Moderators, translator
119
edits
m (prepare translation) |
(Marked this version for translation) |
||
Line 3: | Line 3: | ||
<translate> | <translate> | ||
=Overview= | =Overview= <!--T:1--> | ||
<!--T:2--> | |||
Manjaro's package manager, [[Special:MyLanguage/Pamac|Pamac]] ships with most Manjaro editions. All Manjaro editions include [https://www.archlinux.org/pacman/ pacman], the package manager from upstream Arch Linux. Pacman includes some advanced features not found in Pamac. | Manjaro's package manager, [[Special:MyLanguage/Pamac|Pamac]] ships with most Manjaro editions. All Manjaro editions include [https://www.archlinux.org/pacman/ pacman], the package manager from upstream Arch Linux. Pacman includes some advanced features not found in Pamac. | ||
<!--T:3--> | |||
Key points to know: | Key points to know: | ||
<!--T:4--> | |||
* Pacman is already installed in Manjaro Linux by default | * Pacman is already installed in Manjaro Linux by default | ||
* Pacman is mainly developed/maintained by Arch Linux developers | * Pacman is mainly developed/maintained by Arch Linux developers | ||
Line 15: | Line 18: | ||
=Installing Updates= | =Installing Updates= <!--T:5--> | ||
<!--T:6--> | |||
To update the package database and update all packages on the system | To update the package database and update all packages on the system | ||
sudo pacman -Syu | sudo pacman -Syu | ||
<!--T:7--> | |||
To force a full refresh of the package database and update all packages on the system. You must do this when [[Special:MyLanguage/Switching_Branches|switching branches]] or [[Special:MyLanguage/Pacman-mirrors|switching mirrors]]. | To force a full refresh of the package database and update all packages on the system. You must do this when [[Special:MyLanguage/Switching_Branches|switching branches]] or [[Special:MyLanguage/Pacman-mirrors|switching mirrors]]. | ||
</translate> | </translate> | ||
Line 26: | Line 31: | ||
<translate> | <translate> | ||
<!--T:8--> | |||
To force a full refresh of the package database, update all packages on the system and allow packages to be downgraded. Downgrading should be only be needed when switching to an older branch. For example, switching from Testing to Stable.</translate> | To force a full refresh of the package database, update all packages on the system and allow packages to be downgraded. Downgrading should be only be needed when switching to an older branch. For example, switching from Testing to Stable.</translate> | ||
sudo pacman -Syyuu | sudo pacman -Syyuu | ||
Line 31: | Line 37: | ||
<translate> | <translate> | ||
=Searching for Packages= | =Searching for Packages= <!--T:9--> | ||
<!--T:10--> | |||
To search the Manjaro repositories for available packages you can use the command {{ic|pacman -Ss keyword}}. It will search both the package name and the description for the keyword. For example, to search for packages containing the keyword smplayer you could use:</translate> | To search the Manjaro repositories for available packages you can use the command {{ic|pacman -Ss keyword}}. It will search both the package name and the description for the keyword. For example, to search for packages containing the keyword smplayer you could use:</translate> | ||
pacman -Ss smplayer | pacman -Ss smplayer | ||
<translate>You can search your installed packages in the same manner using {{ic|-Qs}} instead of {{ic|-Ss}}. To search your installed packages for smplayer:</translate> | <translate><!--T:11--> You can search your installed packages in the same manner using {{ic|-Qs}} instead of {{ic|-Ss}}. To search your installed packages for smplayer:</translate> | ||
pacman -Qs smplayer | pacman -Qs smplayer | ||
<translate>Once you have found a package you can use {{ic|pacman -Qi}} to get more information about an installed packages or {{ic|pacman -Si}} for packages in the repos. Following the example above you could use</translate> | <translate><!--T:12--> Once you have found a package you can use {{ic|pacman -Qi}} to get more information about an installed packages or {{ic|pacman -Si}} for packages in the repos. Following the example above you could use</translate> | ||
pacman -Si smplayer | pacman -Si smplayer | ||
<translate>Finally, for a list of all installed packages on your system, enter the following command:</translate> | <translate><!--T:13--> Finally, for a list of all installed packages on your system, enter the following command:</translate> | ||
pacman -Ql | pacman -Ql | ||
<translate> | <translate> | ||
=Installing Packages= | =Installing Packages= <!--T:14--> | ||
<!--T:15--> | |||
{{warning|Never install a package without updating the system first. On a rolling release this can lead to an unbootable system}} | {{warning|Never install a package without updating the system first. On a rolling release this can lead to an unbootable system}} | ||
<!--T:16--> | |||
To install a software package, the basic syntax is {{ic|pacman -S packagename}}. However, installing a package without updating the system will lead to a partial upgrade situation so all the examples here will use {{ic|pacman -Syu packagename which will install the package and ensure the system is up to date}}. For example, to install smplayer the command is:</translate> | To install a software package, the basic syntax is {{ic|pacman -S packagename}}. However, installing a package without updating the system will lead to a partial upgrade situation so all the examples here will use {{ic|pacman -Syu packagename which will install the package and ensure the system is up to date}}. For example, to install smplayer the command is:</translate> | ||
sudo pacman -Syu smplayer | sudo pacman -Syu smplayer | ||
<translate> | <translate> | ||
<!--T:17--> | |||
You will then be presented a list of software to install. You may notice this list has more packages than you requested. This is because many packages also have dependencies which are packages that must be installed in order for the software you selected to function properly. | You will then be presented a list of software to install. You may notice this list has more packages than you requested. This is because many packages also have dependencies which are packages that must be installed in order for the software you selected to function properly. | ||
<!--T:18--> | |||
Pacman can also directly install packages from the local system or a location on the internet. The format of that command is {{ic|pacman -U packagelocation}}. For example, to install a copy of your package cache you could do something like:</translate> | Pacman can also directly install packages from the local system or a location on the internet. The format of that command is {{ic|pacman -U packagelocation}}. For example, to install a copy of your package cache you could do something like:</translate> | ||
sudo pacman -U /var/cache/pacman/pkg/smplayer-19.5.0-1-x86_64.pkg.tar.xz | sudo pacman -U /var/cache/pacman/pkg/smplayer-19.5.0-1-x86_64.pkg.tar.xz | ||
<translate>Alternatively, you could get it directly from one of Manjaro's mirrors:</translate> | <translate><!--T:19--> Alternatively, you could get it directly from one of Manjaro's mirrors:</translate> | ||
sudo pacman -U https://mirror.alpix.eu/manjaro/stable/community/x86_64/smplayer-19.5.0-1-x86_64.pkg.tar.xz | sudo pacman -U https://mirror.alpix.eu/manjaro/stable/community/x86_64/smplayer-19.5.0-1-x86_64.pkg.tar.xz | ||
<translate> | <translate> | ||
<!--T:20--> | |||
{{warning|When using pacman -U it is up to you to ensure that the package you are installing is fully compatible with your system.}} | {{warning|When using pacman -U it is up to you to ensure that the package you are installing is fully compatible with your system.}} | ||
=Removing Packages= | =Removing Packages= <!--T:21--> | ||
<!--T:22--> | |||
{{warning|Always review the package list before confirming when removing packages. If you are not careful you can easily remove your entire desktop due to dependencies.}} | {{warning|Always review the package list before confirming when removing packages. If you are not careful you can easily remove your entire desktop due to dependencies.}} | ||
<!--T:23--> | |||
To remove a software package, the basic syntax is {{ic|sudo pacman -R packagename}}. We could remove the smplayer package we installed above with:</translate> | To remove a software package, the basic syntax is {{ic|sudo pacman -R packagename}}. We could remove the smplayer package we installed above with:</translate> | ||
sudo pacman -R smplayer | sudo pacman -R smplayer | ||
<translate>This will remove the package, but will leave all the dependencies behind. If you also want to remove the unneeded dependencies you could use {{ic|pacman -Rsu packagename}} as seen in this example:</translate> | <translate><!--T:24--> This will remove the package, but will leave all the dependencies behind. If you also want to remove the unneeded dependencies you could use {{ic|pacman -Rsu packagename}} as seen in this example:</translate> | ||
sudo pacman -Rsu smplayer | sudo pacman -Rsu smplayer | ||
<translate>Sometimes when you try to remove a package you will not be able to because there are other packages which depend on it. You can use {{ic|pacman -Rc packagename}} to remove a package and everything that depends on it. Be careful to heed the above warning when using this option.</translate> | <translate><!--T:25--> Sometimes when you try to remove a package you will not be able to because there are other packages which depend on it. You can use {{ic|pacman -Rc packagename}} to remove a package and everything that depends on it. Be careful to heed the above warning when using this option.</translate> | ||
sudo pacman -Rc smplayer | sudo pacman -Rc smplayer | ||
<translate>The most nuclear option is {{ic|pacman -Rcs packagename}}. This will remove everything that depends on packagename and continue to do so on its dependencies. This should really only be used in exceptional circumstances such as when removing an entire desktop environment and trying not to leave anything behind. | <translate><!--T:26--> | ||
The most nuclear option is {{ic|pacman -Rcs packagename}}. This will remove everything that depends on packagename and continue to do so on its dependencies. This should really only be used in exceptional circumstances such as when removing an entire desktop environment and trying not to leave anything behind. | |||
<!--T:27--> | |||
Pacman usually also creates backup configuration files when deleting packages. To remove those, you can add {{ic|n}} to any of the examples above. For example:</translate> | Pacman usually also creates backup configuration files when deleting packages. To remove those, you can add {{ic|n}} to any of the examples above. For example:</translate> | ||
sudo pacman -Rn smplayer | sudo pacman -Rn smplayer | ||
Line 99: | Line 115: | ||
<translate> | <translate> | ||
=Viewing and Removing Orphans= | =Viewing and Removing Orphans= <!--T:28--> | ||
<!--T:29--> | |||
To list all ''orphans'', installed packages that are not used by anything else and should no longer be needed: | To list all ''orphans'', installed packages that are not used by anything else and should no longer be needed: | ||
pacman -Qdt | pacman -Qdt | ||
<!--T:30--> | |||
To remove all the orphans:</translate> | To remove all the orphans:</translate> | ||
sudo pacman -Rs $(pacman -Qdtq) | sudo pacman -Rs $(pacman -Qdtq) | ||
Line 110: | Line 128: | ||
<translate> | <translate> | ||
=Downloading Packages without Installing= | =Downloading Packages without Installing= <!--T:31--> | ||
<!--T:32--> | |||
In some cases it may be useful to download a package without installing. For example, to install on a different system that is not connected to the internet. This can be done with {{ic|pacman -Sw packagename}}. For example:</translate> | In some cases it may be useful to download a package without installing. For example, to install on a different system that is not connected to the internet. This can be done with {{ic|pacman -Sw packagename}}. For example:</translate> | ||
sudo pacman -Sw smplayer | sudo pacman -Sw smplayer | ||
Line 117: | Line 136: | ||
<translate> | <translate> | ||
<!--T:33--> | |||
The package and any rerquired dependencies will be downloaded to your pacman cache at {{ic|/var/cache/pacman/pkg}} | The package and any rerquired dependencies will be downloaded to your pacman cache at {{ic|/var/cache/pacman/pkg}} | ||
=Determining which Package Owns a File= | =Determining which Package Owns a File= <!--T:34--> | ||
<!--T:35--> | |||
It is often useful to understand which package installed a file on your system. This is easy to do with pacman using {{ic|pacman -Qo /path/to/filename}}. For example:</translate> | It is often useful to understand which package installed a file on your system. This is easy to do with pacman using {{ic|pacman -Qo /path/to/filename}}. For example:</translate> | ||
pacman -Qo /usr/bin/smplayer | pacman -Qo /usr/bin/smplayer | ||
Line 127: | Line 148: | ||
<translate> | <translate> | ||
=Cleaning the Cache= | =Cleaning the Cache= <!--T:36--> | ||
<!--T:37--> | |||
When pacman installs packages, it keeps a copy of all the old packages you have downloaded. This cache can be very useful if you have to install older packages in an emergency. However, left unchecked, this cache will grow very large over time. Systems running [[Special:MyLanguage/Pamac|Pamac]] will already have access to its automated pacman cache cleaning functions. It is also possible to clean them manually using pacman. | When pacman installs packages, it keeps a copy of all the old packages you have downloaded. This cache can be very useful if you have to install older packages in an emergency. However, left unchecked, this cache will grow very large over time. Systems running [[Special:MyLanguage/Pamac|Pamac]] will already have access to its automated pacman cache cleaning functions. It is also possible to clean them manually using pacman. | ||
<!--T:38--> | |||
To clear the cache of packages that are no longer installed, enter the following command:</translate> | To clear the cache of packages that are no longer installed, enter the following command:</translate> | ||
sudo pacman -Sc | sudo pacman -Sc | ||
<translate>Otherwise, to clear the cache completely, enter the following command (and use with care):</translate> | <translate><!--T:39--> Otherwise, to clear the cache completely, enter the following command (and use with care):</translate> | ||
sudo pacman -Scc | sudo pacman -Scc | ||
<translate>A safer way to remove old package cache files is to remove all packages except for the latest three package versions using {{ic|paccache}}:</translate> | <translate><!--T:40--> A safer way to remove old package cache files is to remove all packages except for the latest three package versions using {{ic|paccache}}:</translate> | ||
paccache -rvk3 | paccache -rvk3 | ||
<translate> | <translate> | ||
=The Configuration File, pacman.conf= | =The Configuration File, pacman.conf= <!--T:41--> | ||
<!--T:42--> | |||
Pacman's settings are located in {{ic|/etc/pacman.conf}}. This file is owned by root, please see [[Special:MyLanguage/Viewing_and_editing_configuration_files|this guide]] if you need more information on how to edit this file. A full reference to these options can be found in the Arch Wiki linked below. This sections features some settings that may be of particular interest to Manjaro users. | Pacman's settings are located in {{ic|/etc/pacman.conf}}. This file is owned by root, please see [[Special:MyLanguage/Viewing_and_editing_configuration_files|this guide]] if you need more information on how to edit this file. A full reference to these options can be found in the Arch Wiki linked below. This sections features some settings that may be of particular interest to Manjaro users. | ||
<!--T:43--> | |||
{{note|pacman.conf settings are case sensitive}} | {{note|pacman.conf settings are case sensitive}} | ||
==Enabling Color Output== | ==Enabling Color Output== <!--T:44--> | ||
<!--T:45--> | |||
By default, pacman's output is monochrome but enabling colored output can make the output easier to read if your terminal supports colors. This can be enabled by uncommenting or adding the following line to the file</translate> | By default, pacman's output is monochrome but enabling colored output can make the output easier to read if your terminal supports colors. This can be enabled by uncommenting or adding the following line to the file</translate> | ||
Color | Color | ||
<translate> | <translate> | ||
==Showing PacMan Eating Power Pills== | ==Showing PacMan Eating Power Pills== <!--T:46--> | ||
<!--T:47--> | |||
If you are bored of simply watching lines of hashes while downloading software packages in the terminal, why not change the progress bar to Pacman eating power pills instead? To enable this, simply add the line:</translate> | If you are bored of simply watching lines of hashes while downloading software packages in the terminal, why not change the progress bar to Pacman eating power pills instead? To enable this, simply add the line:</translate> | ||
ILoveCandy | ILoveCandy | ||
<translate> | <translate> | ||
=Troubleshooting= | =Troubleshooting= <!--T:48--> | ||
A separate page for pacman troubleshooting is available '''[[Special:MyLanguage/pacman troubleshooting|here]]'''. | A separate page for pacman troubleshooting is available '''[[Special:MyLanguage/pacman troubleshooting|here]]'''. | ||
=See Also= | =See Also= <!--T:49--> | ||
* [[Special:MyLanguage/System Maintenance|System Maintenance]] | * [[Special:MyLanguage/System Maintenance|System Maintenance]] | ||
* [[Special:MyLanguage/Pacman-mirrors|Pacman-mirrors]] | * [[Special:MyLanguage/Pacman-mirrors|Pacman-mirrors]] |