Pacman

Installing packages

To install a package or a list of packages (including dependencies), use this command:


 * 1) pacman -S package1 package2

There may be multiple versions of a package in different repositories (e.g. extra and testing). To specify which one to install use:


 * 1) pacman -S extra/package_name
 * 2) pacman -S testing/package_name

Removing packages

To remove a package, leaving all of its dependencies installed:


 * 1) pacman -R package_name

To remove a package's dependencies which are not required by any other installed package:


 * 1) pacman -Rs package_name

pacman saves important configuration files when removing applications and gives them the .pacsave extention. To delete these files use the -n option:


 * 1) pacman -Rn package_name
 * 2) pacman -Rns package_name

Upgrading packages

pacman can update all packages and synchronize the repository databases on the system with just one command:
 * 1) pacman -Syu

Querying package databases

To query the local package database, use the -Q flag:

$ pacman -Q

and queries the sync databases with the -S flag:

$ pacman -S

pacman can search for packages in the database, searching for both package names and descriptions:

$ pacman -Ss package

To search already installed packages:

$ pacman -Qs package

To show extensive information about a given package:

$ pacman -Si package

for locally installed packages:

$ pacman -Qi package

To show a list of files installed by a package:

$ pacman -Ql package

You can also query the database to show which package a file on the file system belongs to.

$ pacman -Qo /path/to/a/file

To show all packages that are no longer required as dependencies aka orphans:

$ pacman -Qdt