Manual Reference Pages - PACMAN (8)
pacman - package manager utility
pacman <operation> [options] [targets]
Pacman is a package management utility that tracks installed packages on a Linux system. It features dependency support, package groups, install and uninstall scripts, and the ability to sync your local machine with a remote repository to automatically upgrade packages. Pacman packages are a zipped tar format.
Since version 3.0.0, pacman has been the front-end to libalpm(3), the Arch Linux Package Management library. This library allows alternative front-ends to be written (for instance, a GUI front-end).
Invoking pacman involves specifying an operation with any potential options and targets to operate on. A target is usually a package name, file name, URL, or a search string. Targets can be provided as command line arguments. Additionally, if stdin is not from a terminal and a single hyphen (-) is passed as an argument, targets will be read from stdin.
Modify the package database. This operation allows you to modify certain attributes of the installed packages in pacmans database. At the moment, you can only change the install reason using
Query the package database. This operation allows you to view installed packages and their files, as well as meta-information about individual packages (dependencies, conflicts, install date, build date, size). This can be run against the local package database or can be used on individual package files. In the first case, if no package names are provided in the command line, all installed packages will be queried. Additionally, various filters can be applied on the package list. See
Remove package(s) from the system. Groups can also be specified to be removed, in which case every package in that group will be removed. Files belonging to the specified package will be deleted, and the database will be updated. Most configuration files will be saved with a
extension unless the
option is used. See
Synchronize packages. Packages are installed directly from the remote repositories, including all dependencies required to run the packages. For example,
pacman -S qt
will download and install qt and all the packages it depends on. If a package name exists in more than one repository, the repository can be explicitly specified to clarify the package to install:
pacman -S testing/qt. You can also specify version requirements:
pacman -S "bash>=3.2". Quotes are needed, otherwise the shell interprets ">" as redirection to a file.
In addition to packages, groups can be specified as well. For example, if gnome is a defined package group, then
pacman -S gnome
will provide a prompt allowing you to select which packages to install from a numbered list. The package selection is specified using a space- and/or comma-separated list of package numbers. Sequential packages may be selected by specifying the first and last package numbers separated by a hyphen (-). Excluding packages is achieved by prefixing a number or range of numbers with a caret (^).
Packages that provide other packages are also handled. For example,
pacman -S foo
will first look for a foo package. If foo is not found, packages that provide the same functionality as foo will be searched for. If any package is found, it will be installed. A selection prompt is provided if multiple packages providing foo are found.
You can also use
to upgrade all packages that are out-of-date. See
below. When upgrading, pacman performs version comparison to determine which packages need upgrading. This behavior operates as follows:
1.0a < 1.0b < 1.0beta < 1.0p < 1.0pre < 1.0rc < 1.0 < 1.0.a < 1.0.1
1 < 1.0 < 1.1 < 1.1.1 < 1.2 < 2.0 < 3.0.0
Additionally, version strings can have an
value defined that will overrule any version comparison, unless the epoch values are equal. This is specified in an
format. For example,
is always greater than
Check dependencies; this is useful in scripts such as makepkg to check installed packages. This operation will check each dependency specified and return a list of dependencies that are not currently satisfied on the system. This operation accepts no other options. Example usage:
pacman -T qt "bash>=3.2".
Upgrade or add package(s) to the system and install the required dependencies from sync repositories. Either a URL or file path can be specified. This is a remove-then-add process. See
below; also see
Handling Config Files
for an explanation on how pacman takes care of configuration files.
Display version and exit.
Display syntax for the given operation. If no operation was supplied, then the general syntax is shown.
-b, --dbpath <path>
Specify an alternative database location (a typical default is
/var/lib/pacman). This should not be used unless you know what you are doing.
NOTE: If specified, this is an absolute path, and the root path is not automatically prepended.
-r, --root <path>
Specify an alternative installation root (default is
/). This should not be used as a way to install software into
/usr. This option is used if you want to install a package on a temporarily mounted partition that is "owned" by another system.
NOTE: If database path or log file are not specified on either the command line or in
pacman.conf(5), their default location will be inside this root path.
Output paths such as as the Root, Conf File, DB Path, Cache Dirs, etc.
Specify an alternate architecture.
Specify an alternative package cache location (a typical default is
/var/cache/pacman/pkg). Multiple cache directories can be specified, and they are tried in the order they are passed to pacman.
NOTE: This is an absolute path, and the root path is not automatically prepended.
Specify when to enable coloring. Valid options are
forces colors on;
forces colors off; and
only automatically enables colors when outputting onto a tty.
Specify an alternate configuration file.
Display debug messages. When reporting bugs, this option is recommended to be used.
Specify a directory of files used by GnuPG to verify package signatures (a typical default is
/etc/pacman.d/gnupg). This directory should contain two files:
holds the public keys of all packagers.
contains a so-called trust database, which specifies that the keys are authentic and trusted.
NOTE: This is an absolute path, and the root path is not automatically prepended.
Specify an alternate log file. This is an absolute path, regardless of the installation root setting.
Bypass any and all Are you sure? messages. Its not a good idea to do this unless you want to run pacman from a script.
Cancels the effects of a previous
TRANSACTION OPTIONS (APPLY TO I-SR, I-RR AND I-UR)
Skips dependency version checks. Package names are still checked. Normally, pacman will always check a packages dependency fields to ensure that all dependencies are installed and there are no package conflicts in the system. Specify this option twice to skip all dependency checks.
Add a virtual package "package" with version "version" to the transaction to satisfy dependencies. This allows to disable specific dependency checks without affecting all dependency checks. To disable all dependency checking, see the
Adds/removes the database entry only, leaving all files in place.
Do not show a progress bar when downloading files. This can be useful for scripts that call pacman and capture the output.
If an install scriptlet exists, do not execute it. Do not use this unless you know what you are doing.
Only print the targets instead of performing the actual operation (sync, remove or upgrade). Use
to specify how targets are displayed. The default format string is "%l", which displays URLs with
-S, file names with
-U, and pkgname-pkgver with
Specify a printf-like format to control the output of the
operation. The possible attributes are: "%n" for pkgname, "%v" for pkgver, "%l" for location, "%r" for repository, and "%s" for size. Implies
UPGRADE OPTIONS (APPLY TO I-SR AND I-UR)
Bypass file conflict checks and overwrite conflicting files. If the package that is about to be installed contains files that are already installed, this option will cause all those files to be overwritten. Using
will not allow overwriting a directory with a file or installing packages with conflicting files and directories. This option should be used with care, ideally not at all.
Install packages non-explicitly; in other words, fake their install reason to be installed as a dependency. This is useful for makepkg and other build-from-source tools that need to install dependencies before building the package.
Install packages explicitly; in other words, fake their install reason to be explicitly installed. This is useful if you want to mark a dependency as explicitly installed so it will not be removed by the
Directs pacman to ignore upgrades of package even if there is one available. Multiple packages can be specified by separating them with a comma.
Directs pacman to ignore upgrades of all packages in
group, even if there is one available. Multiple groups can be specified by separating them with a comma.
Do not reinstall the targets that are already up-to-date.
View the ChangeLog of a package if it exists.
Restrict or filter output to packages installed as dependencies. This option can be combined with
for listing real orphans - packages that were installed as dependencies but are no longer required by any installed package.
Restrict or filter output to explicitly installed packages. This option can be combined with
to list explicitly installed packages that are not required by any other package.
Display all packages that are members of a named group. If a name is not specified, list all grouped packages.
Display information on a given package. The
option can be used if querying a package file instead of the local database. Passing two
flags will also display the list of backup files and their modification states.
Check that all files owned by the given package(s) are present on the system. If packages are not specified or filter flags are not provided, check all installed packages. Specifying this option twice will perform more detailed file checking (including permissions, file sizes, and modification times) for packages that contain the needed mtree file.
List all files owned by a given package. Multiple packages can be specified on the command line.
Restrict or filter output to packages that were not found in the sync database(s). Typically these are packages that were downloaded manually and installed with
Restrict or filter output to packages that are found in the sync database(s). This is the inverse filter of
-o, --owns <file>
Search for packages that own the specified file(s). The path can be relative or absolute, and one or more files can be specified.
Signifies that the package supplied on the command line is a file and not an entry in the database. The file will be decompressed and queried. This is useful in combination with
Show less information for certain query operations. This is useful when pacmans output is processed in a script. Search will only show package names and not version, group, and description information; owns will only show package names instead of "file is owned by pkg" messages; group will only show package names and omit group names; list will only show files and omit package names; check will only show pairs of package names and missing files; a bare query will only show package names rather than names and versions.
-s, --search <regexp>
Search each locally-installed package for names or descriptions that match
regexp. When including multiple search terms, only packages with descriptions matching ALL of those terms are returned.
Restrict or filter output to packages not required or optionally required by any currently installed package. Specify this option twice to only filter packages that are direct dependencies (i.e. do not filter optional dependencies).
Restrict or filter output to packages that are out-of-date on the local system. Only package versions are used to find outdated packages; replacements are not checked here. This option works best if the sync database is refreshed using
Remove all target packages, as well as all packages that depend on one or more target packages. This operation is recursive and must be used with care, since it can remove many potentially needed packages.
Instructs pacman to ignore file backup designations. Normally, when a file is removed from the system, the database is checked to see if the file should be renamed with a
Remove each target specified including all of their dependencies, provided that (A) they are not required by other packages; and (B) they were not explicitly installed by the user. This operation is recursive and analogous to a backwards
operation, and it helps keep a clean system without orphans. If you want to omit condition (B), pass this option twice.
Removes targets that are not required by any other packages. This is mostly useful when removing a group without using the
option, to avoid breaking any dependencies.
Remove packages that are no longer installed from the cache as well as currently unused sync databases to free up disk space. When pacman downloads packages, it saves them in a cache directory. In addition, databases are saved for every sync DB you download from and are not deleted even if they are removed from the configuration file
pacman.conf(5). Use one
switch to only remove packages that are no longer installed; use two to remove all files from the cache. In both cases, you will have a yes or no option to remove packages and/or unused downloaded databases.
If you use a network shared cache, see the
Display all the members for each package group specified. If no group names are provided, all groups will be listed; pass the flag twice to view all groups and their members.
Display information on a given sync database package. Passing two
flags will also display those packages in all repositories that depend on this package.
List all packages in the specified repositories. Multiple repositories can be specified on the command line.
Show less information for certain sync operations. This is useful when pacmans output is processed in a script. Search will only show package names and not repository, version, group, and description information; list will only show package names and omit databases and versions; group will only show package names and omit group names.
-s, --search <regexp>
This will search each package in the sync databases for names or descriptions that match
regexp. When you include multiple search terms, only packages with descriptions matching ALL of those terms will be returned.
Upgrades all packages that are out-of-date. Each currently-installed package will be examined and upgraded if a newer package exists. A report of all packages to upgrade will be presented, and the operation will not proceed without user confirmation. Dependencies are automatically resolved at this level and will be installed/upgraded if necessary.
Pass this option twice to enable package downgrades; in this case, pacman will select sync packages whose versions do not match with the local versions. This can be useful when the user switches from a testing repository to a stable one.
Additional targets can also be specified manually, so that
will do a system upgrade and install/upgrade the "foo" package in the same operation.
Retrieve all packages from the server, but do not install/upgrade anything.
Download a fresh copy of the master package list from the server(s) defined in
pacman.conf(5). This should typically be used each time you use
-u. Passing two
flags will force a refresh of all package lists, even if they appear to be up- to-date.
HANDLING CONFIG FILES
Pacman uses the same logic as rpm to determine action against files that are designated to be backed up. During an upgrade, three MD5 hashes are used for each backup file to determine the required action: one for the original file installed, one for the new file that is about to be installed, and one for the actual file existing on the file system. After comparing these three hashes, the follow scenarios can result:
original=X, current=X, new=X
All three files are the same, so overwrites are not an issue. Install the new file.
original=X, current=X, new=Y
The current file is the same as the original, but the new one differs. Since the user did not ever modify the file, and the new one may contain improvements or bug fixes, install the new file.
original=X, current=Y, new=X
Both package versions contain the exact same file, but the one on the file system has been modified. Leave the current file in place.
original=X, current=Y, new=Y
The new file is identical to the current file. Install the new file.
original=X, current=Y, new=Z
All three files are different, so install the new file with a
extension and warn the user. The user must then manually merge any necessary changes into the original file.
original=NULL, current=Y, new=Z
The package was not previously installed, and the file already exists on the file system. Save the current file with a
extension, install the new file, and warn the user.
pacman -Ss ne.hack
Search for regexp "ne.hack" in package database.
pacman -S gpm
Download and install gpm including dependencies.
pacman -U /home/user/ceofhack-0.6-1-x86_64.pkg.tar.gz
Install ceofhack-0.6-1 package from a local file.
Update package list and upgrade all packages afterwards.
pacman -Syu gpm
Update package list, upgrade all packages, and then install gpm if it wasnt already installed.
See pacman.conf(5) for more details on configuring pacman using the pacman.conf file.
pacman.conf(5), makepkg(8), libalpm(3)
See the pacman website at https://www.archlinux.org/pacman/ for current information on pacman and its related tools.
Bugs? You must be kidding; there are no bugs in this software. But if we happen to be wrong, send us an email with as much detail as possible to email@example.com.
Allan McRae <firstname.lastname@example.org>
Andrew Gregory <email@example.com>
Dan McGee <firstname.lastname@example.org>
Dave Reisner <email@example.com>
Past major contributors:
Judd Vinet <firstname.lastname@example.org>
Aurelien Foret <email@example.com>
Aaron Griffin <firstname.lastname@example.org>
Xavier Chantry <email@example.com>
Nagy Gabor <firstname.lastname@example.org>
For additional contributors, use git shortlog -s on the pacman.git repository.
|Pacman 4&.2&.0 ||PACMAN (8) ||2014-12-19 |
Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.