Template:Article summary start Template:Article summary text Template:Article summary heading Template:Article summary text Template:Article summary heading Template:Article summary wiki Template:Article summary wiki Template:Article summary wiki Template:Article summary wiki Template:Article summary wiki Template:Article summary heading Template:Article summary link Template:Article summary link Template:Article summary link Template:Article summary link Template:Article summary end
The pacman package manager is one of the main features of Arch Linux. It combines a simple binary package format with an easy-to-use build system (see makepkg and Arch Build System). The goal of pacman is to make it possible to easily manage packages, whether they are from the official Arch repositories or the user's own builds.
pacman keeps the system up to date by synchronizing package lists with the master server. This server/client model also allows you to download/install packages with a simple command, complete with all required dependencies.
pacman is written in the C programming language and uses the Template:Filename package format.
- 1 Configuration
- 2 Usage
- 3 Troubleshooting
- 4 See also
pacman configuration is located in Template:Filename. This is the place where the user configures the program to work in the desired manner. In-depth information about the configuration file can be found in man pacman.conf.
Skip package from being upgraded
To skip upgrading a specific package, specify it as such:
For multiple packages use a space-separated list, or use additional IgnorePkg lines.
Skip package group from being upgraded
As with packages, skipping a whole package group is also possible:
This section defines which repositories to use, as referred to in Template:Filename. They can be stated here directly, or included from another file.
[core] # Add your preferred servers here, they will be used first Include=/etc/pacman.d/mirrorlist [extra] # Add your preferred servers here, they will be used first Include=/etc/pacman.d/mirrorlist [community] # Add your preferred servers here, they will be used first Include=/etc/pacman.d/mirrorlist
To read other examples of what pacman can do, refer to man pacman. The examples below are just a small sample of operations that can be performed.
Installing specific packages
To install a single package or list of packages (including dependencies), issue the following command:
# pacman -S package_name1 package_name2 ...
Sometimes there are multiple versions of a package in different repositories (e.g. extra and testing). Specify which one to install:
# pacman -S extra/package_name # pacman -S testing/package_name
Installing package groups
Some packages belong to a group of packages that can all be installed simultaneously. For example, issuing the command
# pacman -S gnome
will install all the packages that belong to the "gnome" group. You can see what packages belong to the gnome group by running:
# pacman -Sg gnome
You can also visit http://www.archlinux.org/groups/ to see what package groups are available.
To remove a single package, leaving all of its dependencies installed:
# pacman -R package_name
To remove a package and its dependencies which are not required by any other installed package:
# pacman -Rs package_name
To remove a package, its dependencies and all the packages that depend on the target package:
# pacman -Rsc package_name
pacman saves important configuration files when removing certain applications and names them with the extension: Template:Filename. To prevent the creation of these backup files use the Template:Codeline option:
# pacman -Rn package_name
pacman can update all packages on the system with just one command. This could take quite a while depending on how up-to-date the system is. This command can synchronize the repository databases and update the system's packages:
# pacman -Syu
pacman is a powerful package management tool, but it does not attempt to handle all corner cases. Read The Arch Way if this confuses you. Rather, users must be vigilant and take responsibility for maintaining their own system. When performing a system update it is essential that users read all information output by pacman and use common sense. If a configuration file that you have modified needs to be upgraded for a new version of a package, pacman will prompt you to merge a pacnew file.
Before upgrading, it is advisable to visit the Arch Linux home page to check the latest news (or subscribe to the RSS feed): when updates require out-of-the-ordinary user intervention (more than what can be handled simply by following the instructions given by pacman), an appropriate news post will be made.
If you encounter problems that cannot be solved by these instructions, make sure to search the forum. It is likely that others have encountered the same problem and have posted instructions for solving it.
Querying package databases
pacman queries the local package database with the -Q flag; see:
$ pacman -Q --help
and queries the sync databases with the -S flag; see:
$ pacman -S --help
pacman can search for packages in the database, searching both in packages' names and descriptions:
$ pacman -Ss string1 string2 ...
To search for already installed packages:
$ pacman -Qs string1 string2 ...
To display extensive information about a given package:
$ pacman -Si package_name
for locally installed packages:
$ pacman -Qi package_name
Passing two Template:Codeline flags will also display the list of backup files and their modification states:
$ pacman -Qii package_name
To retrieve a list of the files installed by a package:
$ pacman -Ql package_name
One can also query the database to know which package a file in the file system belongs to:
$ pacman -Qo /path/to/a/file
To list all packages no longer required as dependencies (orphans):
$ pacman -Qdt
Upgrade the system and install a list of packages (one-liner):
# pacman -Syu package_name1 package_name2 ...
Download a package without installing it:
# pacman -Sw package_name
Install a 'local' package that is not from a repository:
# pacman -U /path/to/package/package_name-version.pkg.tar.xz
Install a 'remote' package (not from a repository):
# pacman -U http://www.example.com/repo/example.pkg.tar.xz
Clean the package cache of packages that are not currently installed (Template:Filename):
# pacman -Sc
Clean the entire package cache:
# pacman -Scc
Partial upgrades are unsupported
Arch Linux is a rolling release, and new library versions will be pushed to the repositories. The developers and trusted users will rebuild all the packages in the repositories that need to be rebuilt against the libraries. If you have locally installed packages (such as AUR packages), you will need to rebuild them yourself when their dependencies receive a soname bump.
This means that partial upgrades are not supported. Do not use Template:Codeline or any equivalent such as Template:Codeline and then Template:Codeline. Always upgrade before installing a package if you have refreshed the sync repositories. You should also be very careful when using IgnorePkg/IgnoreGroup for the same reason.
If you do a partial upgrade and binaries are broken because they cannot find the libraries they are linked against, do not "fix" the problem simply by symlinking. Libraries receive soname bumps when they are not backwards compatible. A simple Template:Codeline to a properly synced mirror will fix the issue as long as pacman is not broken.