Arch Package Management
Managing packages with pacman
What is pacman?
Pacman is the package management tool used by Arch Linux and other Arch based distributions such as ArchBang, Antergos, BBQLinux, Chakra and Manjaro Linux. The job of pacman is to simplify the management of packages, whether they are from an official repository or an users own build. pacman keeps the system up to date by synchronizing package lists with the master server. This server/client model also allows a user to download or install packages with a simple commands whilst maintaining dependencies.
Below is an overview of some of the common pacman commands. For a full list of commands and other options please refer to the official site:
Archlinux Official pacman site
Install one or more packages
The following command is used for installing a single package or a list of packages including all dependencies:
pacman -S package_name1 package_name2
Install a package from a specific repository
The following command will allow you to install a package from a specified repository. The repository is specified in front of the package. In this example, "extra" is the specified repository.
pacman -S extra/package_name
Installing a group of packages
Many packages can be long to a group. These packages can be installed by specifying the name of the group. You will be prompted to specify individual packages from within the group or install all packages.
pacman -S group_name
Remove a single package leaving dependencies installed
The following command will remove a specified package, however, any dependencies will remain installed.
pacman -R package_name
Remove a package along with its dependencies
The following command will remove the specified package along with any dependencies.
pacman -Rs package_name
Remove a package along with dependencies and all packages that depend on the target package
The following command should be used with extreme care as it will remove the specified package along with all packages that are dependant.
pacman -Rsc package_name
Remove a package, which is required by another package, without removing the dependent package
The following command removes the specified package which is required by another package without removing the dependant package.
pacman -Rdd package_name
The following command can be used to upgrade all packages on a system. This command will synchronize the repository databases and update the system's packages.
Search for packages in Database
The following command is used to query the database with the specified string, searching in both package name and description fields.
pacman -Ss keyword
Search for Installed Packages
The following command will display installed packages.
pacman -Qs package_name
Display information about a package
The following command is used to display information about the specified package.
pacman -Si package_name
List files installed by a package
The following command displays files that have been installed by a specified package.
pacman -Ql package_name
List Orphan packages
The following command will list all packages that are no longer required as a dependency.
Display Dependency Tree of a package.
The following command will display a dependency tree of the specified package.
Download a package without installation
The following command will download a specified package without carrying out the installation.
pacman -Sw package_name
Clearing the Package Cache
To remove all the cached packages that are not currently installed on your system.