Difference between revisions of "Pacman"

From ArchWiki
Jump to: navigation, search
(add fr interwiki language link)
(add romanian link)
Line 4: Line 4:
{{i18n|pacman}} {{DISPLAYTITLE:pacman}}
{{i18n|pacman}} {{DISPLAYTITLE:pacman}}

Revision as of 11:21, 3 May 2011

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.

Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어

External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

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.


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.

General options

General options are in the Template:Codeline section. Read the man page or look in the default Template:Filename for information on what can be done here.

Skip package from being upgraded

To skip upgrading a specific package, specify it as such:


For multiple packages use a space.

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.

All official repositories use the same Template:Filename file which contains a variable, 'Template:Codeline', making it a requisite to maintain only one list.

The following is an example for the official repositories that defers mirrors to the mirrorlist.

# Add your preferred servers here, they will be used first

# Add your preferred servers here, they will be used first

# Add your preferred servers here, they will be used first
Note: Care should be taken when using the Template:Codeline repository. It is in active development and updating may cause some packages to stop working. People who use the Template:Codeline repository are encouraged to subscribe to the arch-dev-public mailing list for current information.


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 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
Note: Do not refresh the package list when installing packages (i.e. Template:Codeline); this can lead to dependency issues.[1] Upgrade explicitly first; before installing new packages.

Removing packages

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

# pacman -R package_name

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

# pacman -Rs package_name

pacman saves important configuration files when removing certain applications and names them with the extension: Template:Filename. To delete these backup files use the -n option:

# pacman -Rn package_name
# pacman -Rns package_name
Note: pacman will not remove configurations that the application itself creates (for example Template:Filename files in the home folder).

Upgrading packages

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
Note: As a rolling-release distribution, updating your Arch Linux system is not always as straightforward as with other fixed-release distributions. Furthermore, pacman is not a "fire-and-forget" package manager. As a result, properly maintaining an Arch Linux system with pacman tends to confuse new users (as recurring forum discussions would indicate). Please read the following section thoroughly before continuing.

pacman is a powerful package management tool, but it does not attempt to "do everything", as it were. 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 (Template:Codeline), for example, it is essential that users read all information output by pacman and use common sense.

Instead of immediately updating as soon as updates are available, users must recognize that an update to a critical package may have unforeseen consequences. This means that is not wise to update Template:Codeline if one is about to deliver an important presentation, for example. Rather, update during free time and be prepared to deal with any problems that may arise due to the update.

Next, a visit to the Arch Linux home page is always warranted. Often when updates require user intervention, an appropriate post on http://archlinux.org will be made. Normally there will be forum posts describing the very same issue shortly after the update becomes available across the mirrors, detailing the solutions to any problems.

When the actual update is performed, be sure to read the messages printed out by pacman. Packagers often describe the changes and the expected problems, and direct the users to the appropriate wiki page or resource. Finally, always read all information output by pacman!

Tip: Remember that the pacman's output is logged in Template:Filename.

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 package

To search for already installed packages:

$ pacman -Qs package

To display extensive information about a given package:

$ pacman -Si package

for locally installed packages:

$ pacman -Qi package

To retrieve a list of the files installed by a package:

$ pacman -Ql package

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

Additional commands

Download a package without installing it:

# pacman -Sw package

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:

Warning: Only do this when certain that Downgrading Packages will not be a necessity, as pacman -Scc removes all packages from the cache.
# pacman -Scc