1PACMAN(8)                        Pacman Manual                       PACMAN(8)
2
3
4

NAME

6       pacman - package manager utility
7

SYNOPSIS

9       pacman <operation> [options] [targets]
10

DESCRIPTION

12       Pacman is a package management utility that tracks installed packages
13       on a Linux system. It features dependency support, package groups,
14       install and uninstall scripts, and the ability to sync your local
15       machine with a remote repository to automatically upgrade packages.
16       Pacman packages are a zipped tar format.
17
18       Since version 3.0.0, pacman has been the front-end to libalpm(3), the
19       “Arch Linux Package Management” library. This library allows
20       alternative front-ends to be written (for instance, a GUI front-end).
21
22       Invoking pacman involves specifying an operation with any potential
23       options and targets to operate on. A target is usually a package name,
24       file name, URL, or a search string. Targets can be provided as command
25       line arguments. Additionally, if stdin is not from a terminal and a
26       single hyphen (-) is passed as an argument, targets will be read from
27       stdin.
28

OPERATIONS

30       -D, --database
31           Operate on the package database. This operation allows you to
32           modify certain attributes of the installed packages in pacman’s
33           database. It also allows you to check the databases for internal
34           consistency. See Database Options below.
35
36       -Q, --query
37           Query the package database. This operation allows you to view
38           installed packages and their files, as well as meta-information
39           about individual packages (dependencies, conflicts, install date,
40           build date, size). This can be run against the local package
41           database or can be used on individual package files. In the first
42           case, if no package names are provided in the command line, all
43           installed packages will be queried. Additionally, various filters
44           can be applied on the package list. See Query Options below.
45
46       -R, --remove
47           Remove package(s) from the system. Groups can also be specified to
48           be removed, in which case every package in that group will be
49           removed. Files belonging to the specified package will be deleted,
50           and the database will be updated. Most configuration files will be
51           saved with a .pacsave extension unless the --nosave option is used.
52           See Remove Options below.
53
54       -S, --sync
55           Synchronize packages. Packages are installed directly from the
56           remote repositories, including all dependencies required to run the
57           packages. For example, pacman -S qt will download and install qt
58           and all the packages it depends on. If a package name exists in
59           more than one repository, the repository can be explicitly
60           specified to clarify the package to install: pacman -S testing/qt.
61           You can also specify version requirements: pacman -S "bash>=3.2".
62           Quotes are needed, otherwise the shell interprets ">" as
63           redirection to a file.
64
65           In addition to packages, groups can be specified as well. For
66           example, if gnome is a defined package group, then pacman -S gnome
67           will provide a prompt allowing you to select which packages to
68           install from a numbered list. The package selection is specified
69           using a space- and/or comma-separated list of package numbers.
70           Sequential packages may be selected by specifying the first and
71           last package numbers separated by a hyphen (-). Excluding packages
72           is achieved by prefixing a number or range of numbers with a caret
73           (^).
74
75           Packages that provide other packages are also handled. For example,
76           pacman -S foo will first look for a foo package. If foo is not
77           found, packages that provide the same functionality as foo will be
78           searched for. If any package is found, it will be installed. A
79           selection prompt is provided if multiple packages providing foo are
80           found.
81
82           You can also use pacman -Su to upgrade all packages that are
83           out-of-date. See Sync Options below. When upgrading, pacman
84           performs version comparison to determine which packages need
85           upgrading. This behavior operates as follows:
86
87               Alphanumeric:
88                 1.0a < 1.0b < 1.0beta < 1.0p < 1.0pre < 1.0rc < 1.0 < 1.0.a < 1.0.1
89               Numeric:
90                 1 < 1.0 < 1.1 < 1.1.1 < 1.2 < 2.0 < 3.0.0
91
92           Additionally, version strings can have an epoch value defined that
93           will overrule any version comparison, unless the epoch values are
94           equal. This is specified in an epoch:version-rel format. For
95           example, 2:1.0-1 is always greater than 1:3.6-1.
96
97       -T, --deptest
98           Check dependencies; this is useful in scripts such as makepkg to
99           check installed packages. This operation will check each dependency
100           specified and return a list of dependencies that are not currently
101           satisfied on the system. This operation accepts no other options.
102           Example usage: pacman -T qt "bash>=3.2".
103
104       -U, --upgrade
105           Upgrade or add package(s) to the system and install the required
106           dependencies from sync repositories. Either a URL or file path can
107           be specified. This is a “remove-then-add” process. See Upgrade
108           Options below; also see Handling Config Files for an explanation on
109           how pacman takes care of configuration files.
110
111       -F, --files
112           Query the files database. This operation allows you to look for
113           packages owning certain files or display files owned by certain
114           packages. Only packages that are part of your sync databases are
115           searched. See File Options below.
116
117       -V, --version
118           Display version and exit.
119
120       -h, --help
121           Display syntax for the given operation. If no operation was
122           supplied, then the general syntax is shown.
123

OPTIONS

125       -b, --dbpath <path>
126           Specify an alternative database location (the default is
127           /var/lib/pacman). This should not be used unless you know what you
128           are doing.  NOTE: If specified, this is an absolute path, and the
129           root path is not automatically prepended.
130
131       -r, --root <path>
132           Specify an alternative installation root (default is /). This
133           should not be used as a way to install software into /usr/local
134           instead of /usr.  NOTE: If database path or log file are not
135           specified on either the command line or in pacman.conf(5), their
136           default location will be inside this root path.  NOTE: This option
137           is not suitable for performing operations on a mounted guest
138           system. See --sysroot instead.
139
140       -v, --verbose
141           Output paths such as as the Root, Conf File, DB Path, Cache Dirs,
142           etc.
143
144       --arch <arch>
145           Specify an alternate architecture.
146
147       --cachedir <dir>
148           Specify an alternative package cache location (the default is
149           /var/cache/pacman/pkg). Multiple cache directories can be
150           specified, and they are tried in the order they are passed to
151           pacman.  NOTE: This is an absolute path, and the root path is not
152           automatically prepended.
153
154       --color <when>
155           Specify when to enable coloring. Valid options are always, never,
156           or auto.  always forces colors on; never forces colors off; and
157           auto only automatically enables colors when outputting onto a tty.
158
159       --config <file>
160           Specify an alternate configuration file.
161
162       --debug
163           Display debug messages. When reporting bugs, this option is
164           recommended to be used.
165
166       --gpgdir <dir>
167           Specify a directory of files used by GnuPG to verify package
168           signatures (the default is /etc/pacman.d/gnupg). This directory
169           should contain two files: pubring.gpg and trustdb.gpg.  pubring.gpg
170           holds the public keys of all packagers.  trustdb.gpg contains a
171           so-called trust database, which specifies that the keys are
172           authentic and trusted.  NOTE: This is an absolute path, and the
173           root path is not automatically prepended.
174
175       --hookdir <dir>
176           Specify a alternative directory containing hook files (the default
177           is /etc/pacman.d/hooks). Multiple hook directories can be specified
178           with hooks in later directories taking precedence over hooks in
179           earlier directories.  NOTE: This is an absolute path, and the root
180           path is not automatically prepended.
181
182       --logfile <file>
183           Specify an alternate log file. This is an absolute path, regardless
184           of the installation root setting.
185
186       --noconfirm
187           Bypass any and all “Are you sure?” messages. It’s not a good idea
188           to do this unless you want to run pacman from a script.
189
190       --confirm
191           Cancels the effects of a previous --noconfirm.
192
193       --disable-download-timeout
194           Disable defaults for low speed limit and timeout on downloads. Use
195           this if you have issues downloading files with proxy and/or
196           security gateway.
197
198       --sysroot <dir>
199           Specify an alternative system root. Pacman will chroot and chdir
200           into the system root prior to running. This allows mounted guest
201           systems to be properly operated on. Any other paths given will be
202           interpreted as relative to the system root. Requires root
203           privileges.
204

TRANSACTION OPTIONS (APPLY TO -S, -R AND -U)

206       -d, --nodeps
207           Skips dependency version checks. Package names are still checked.
208           Normally, pacman will always check a package’s dependency fields to
209           ensure that all dependencies are installed and there are no package
210           conflicts in the system. Specify this option twice to skip all
211           dependency checks.
212
213       --assume-installed <package=version>
214           Add a virtual package "package" with version "version" to the
215           transaction to satisfy dependencies. This allows to disable
216           specific dependency checks without affecting all dependency checks.
217           To disable all dependency checking, see the --nodeps option.
218
219       --dbonly
220           Adds/removes the database entry only, leaving all files in place.
221
222       --noprogressbar
223           Do not show a progress bar when downloading files. This can be
224           useful for scripts that call pacman and capture the output.
225
226       --noscriptlet
227           If an install scriptlet exists, do not execute it. Do not use this
228           unless you know what you are doing.
229
230       -p, --print
231           Only print the targets instead of performing the actual operation
232           (sync, remove or upgrade). Use --print-format to specify how
233           targets are displayed. The default format string is "%l", which
234           displays URLs with -S, file names with -U, and pkgname-pkgver with
235           -R.
236
237       --print-format <format>
238           Specify a printf-like format to control the output of the --print
239           operation. The possible attributes are: "%n" for pkgname, "%v" for
240           pkgver, "%l" for location, "%r" for repository, and "%s" for size.
241           Implies --print.
242

UPGRADE OPTIONS (APPLY TO -S AND -U)

244       --asdeps
245           Install packages non-explicitly; in other words, fake their install
246           reason to be installed as a dependency. This is useful for makepkg
247           and other build-from-source tools that need to install dependencies
248           before building the package.
249
250       --asexplicit
251           Install packages explicitly; in other words, fake their install
252           reason to be explicitly installed. This is useful if you want to
253           mark a dependency as explicitly installed so it will not be removed
254           by the --recursive remove operation.
255
256       --ignore <package>
257           Directs pacman to ignore upgrades of package even if there is one
258           available. Multiple packages can be specified by separating them
259           with a comma.
260
261       --ignoregroup <group>
262           Directs pacman to ignore upgrades of all packages in group, even if
263           there is one available. Multiple groups can be specified by
264           separating them with a comma.
265
266       --needed
267           Do not reinstall the targets that are already up-to-date.
268
269       --overwrite <glob>
270           Bypass file conflict checks and overwrite conflicting files. If the
271           package that is about to be installed contains files that are
272           already installed and match glob, this option will cause all those
273           files to be overwritten. Using --overwrite will not allow
274           overwriting a directory with a file or installing packages with
275           conflicting files and directories. Multiple patterns can be
276           specified by separating them with a comma. May be specified
277           multiple times. Patterns can be negated, such that files matching
278           them will not be overwritten, by prefixing them with an exclamation
279           mark. Subsequent matches will override previous ones. A leading
280           literal exclamation mark or backslash needs to be escaped.
281

QUERY OPTIONS (APPLY TO -Q)

283       -c, --changelog
284           View the ChangeLog of a package if it exists.
285
286       -d, --deps
287           Restrict or filter output to packages installed as dependencies.
288           This option can be combined with -t for listing real orphans -
289           packages that were installed as dependencies but are no longer
290           required by any installed package.
291
292       -e, --explicit
293           Restrict or filter output to explicitly installed packages. This
294           option can be combined with -t to list explicitly installed
295           packages that are not required by any other package.
296
297       -g, --groups
298           Display all packages that are members of a named group. If a name
299           is not specified, list all grouped packages.
300
301       -i, --info
302           Display information on a given package. The -p option can be used
303           if querying a package file instead of the local database. Passing
304           two --info or -i flags will also display the list of backup files
305           and their modification states.
306
307       -k, --check
308           Check that all files owned by the given package(s) are present on
309           the system. If packages are not specified or filter flags are not
310           provided, check all installed packages. Specifying this option
311           twice will perform more detailed file checking (including
312           permissions, file sizes, and modification times) for packages that
313           contain the needed mtree file.
314
315       -l, --list
316           List all files owned by a given package. Multiple packages can be
317           specified on the command line.
318
319       -m, --foreign
320           Restrict or filter output to packages that were not found in the
321           sync database(s). Typically these are packages that were downloaded
322           manually and installed with --upgrade.
323
324       -n, --native
325           Restrict or filter output to packages that are found in the sync
326           database(s). This is the inverse filter of --foreign.
327
328       -o, --owns <file>
329           Search for packages that own the specified file(s). The path can be
330           relative or absolute, and one or more files can be specified.
331
332       -p, --file
333           Signifies that the package supplied on the command line is a file
334           and not an entry in the database. The file will be decompressed and
335           queried. This is useful in combination with --info and --list.
336
337       -q, --quiet
338           Show less information for certain query operations. This is useful
339           when pacman’s output is processed in a script. Search will only
340           show package names and not version, group, and description
341           information; owns will only show package names instead of "file is
342           owned by pkg" messages; group will only show package names and omit
343           group names; list will only show files and omit package names;
344           check will only show pairs of package names and missing files; a
345           bare query will only show package names rather than names and
346           versions.
347
348       -s, --search <regexp>
349           Search each locally-installed package for names or descriptions
350           that match regexp. When including multiple search terms, only
351           packages with descriptions matching ALL of those terms are
352           returned.
353
354       -t, --unrequired
355           Restrict or filter output to print only packages neither required
356           nor optionally required by any currently installed package. Specify
357           this option twice to include packages which are optionally, but not
358           directly, required by another package.
359
360       -u, --upgrades
361           Restrict or filter output to packages that are out-of-date on the
362           local system. Only package versions are used to find outdated
363           packages; replacements are not checked here. This option works best
364           if the sync database is refreshed using -Sy.
365

REMOVE OPTIONS (APPLY TO -R)

367       -c, --cascade
368           Remove all target packages, as well as all packages that depend on
369           one or more target packages. This operation is recursive and must
370           be used with care, since it can remove many potentially needed
371           packages.
372
373       -n, --nosave
374           Instructs pacman to ignore file backup designations. Normally, when
375           a file is removed from the system, the database is checked to see
376           if the file should be renamed with a .pacsave extension.
377
378       -s, --recursive
379           Remove each target specified including all of their dependencies,
380           provided that (A) they are not required by other packages; and (B)
381           they were not explicitly installed by the user. This operation is
382           recursive and analogous to a backwards --sync operation, and it
383           helps keep a clean system without orphans. If you want to omit
384           condition (B), pass this option twice.
385
386       -u, --unneeded
387           Removes targets that are not required by any other packages. This
388           is mostly useful when removing a group without using the -c option,
389           to avoid breaking any dependencies.
390

SYNC OPTIONS (APPLY TO -S)

392       -c, --clean
393           Remove packages that are no longer installed from the cache as well
394           as currently unused sync databases to free up disk space. When
395           pacman downloads packages, it saves them in a cache directory. In
396           addition, databases are saved for every sync DB you download from
397           and are not deleted even if they are removed from the configuration
398           file pacman.conf(5). Use one --clean switch to only remove packages
399           that are no longer installed; use two to remove all files from the
400           cache. In both cases, you will have a yes or no option to remove
401           packages and/or unused downloaded databases.
402
403           If you use a network shared cache, see the CleanMethod option in
404           pacman.conf(5).
405
406       -g, --groups
407           Display all the members for each package group specified. If no
408           group names are provided, all groups will be listed; pass the flag
409           twice to view all groups and their members.
410
411       -i, --info
412           Display information on a given sync database package. Passing two
413           --info or -i flags will also display those packages in all
414           repositories that depend on this package.
415
416       -l, --list
417           List all packages in the specified repositories. Multiple
418           repositories can be specified on the command line.
419
420       -q, --quiet
421           Show less information for certain sync operations. This is useful
422           when pacman’s output is processed in a script. Search will only
423           show package names and not repository, version, group, and
424           description information; list will only show package names and omit
425           databases and versions; group will only show package names and omit
426           group names.
427
428       -s, --search <regexp>
429           This will search each package in the sync databases for names or
430           descriptions that match regexp. When you include multiple search
431           terms, only packages with descriptions matching ALL of those terms
432           will be returned.
433
434       -u, --sysupgrade
435           Upgrades all packages that are out-of-date. Each
436           currently-installed package will be examined and upgraded if a
437           newer package exists. A report of all packages to upgrade will be
438           presented, and the operation will not proceed without user
439           confirmation. Dependencies are automatically resolved at this level
440           and will be installed/upgraded if necessary.
441
442           Pass this option twice to enable package downgrades; in this case,
443           pacman will select sync packages whose versions do not match with
444           the local versions. This can be useful when the user switches from
445           a testing repository to a stable one.
446
447           Additional targets can also be specified manually, so that -Su foo
448           will do a system upgrade and install/upgrade the "foo" package in
449           the same operation.
450
451       -w, --downloadonly
452           Retrieve all packages from the server, but do not install/upgrade
453           anything.
454
455       -y, --refresh
456           Download a fresh copy of the master package database from the
457           server(s) defined in pacman.conf(5). This should typically be used
458           each time you use --sysupgrade or -u. Passing two --refresh or -y
459           flags will force a refresh of all package databases, even if they
460           appear to be up-to-date.
461

DATABASE OPTIONS (APPLY TO -D)

463       --asdeps <package>
464           Mark a package as non-explicitly installed; in other words, set
465           their install reason to be installed as a dependency.
466
467       --asexplicit <package>
468           Mark a package as explicitly installed; in other words, set their
469           install reason to be explicitly installed. This is useful it you
470           want to keep a package installed even when it was initially
471           installed as a dependency of another package.
472
473       -k, --check
474           Check the local package database is internally consistent. This
475           will check all required files are present and that installed
476           packages have the required dependencies, do not conflict and that
477           multiple packages do not own the same file. Specifying this option
478           twice will perform a check on the sync databases to ensure all
479           specified dependencies are available.
480
481       -q, --quiet
482           Suppress messages on successful completion of database operations.
483

FILE OPTIONS (APPLY TO -F)

485       -y, --refresh
486           Download fresh package databases from the server. Use twice to
487           force a refresh even if databases are up to date.
488
489       -l, --list
490           List the files owned by the queried package.
491
492       -x, --regex
493           Interpret each query as a regular expression.
494
495       -q, --quiet
496           Show less information for certain file operations. This is useful
497           when pacman’s output is processed in a script, however, you may
498           want to use --machinereadable instead.
499
500       --machinereadable
501           Print each match in a machine readable output format. The format is
502           repository\0pkgname\0pkgver\0path\n with \0 being the NULL
503           character and \n a linefeed.
504

HANDLING CONFIG FILES

506       Pacman uses the same logic as rpm to determine action against files
507       that are designated to be backed up. During an upgrade, three MD5
508       hashes are used for each backup file to determine the required action:
509       one for the original file installed, one for the new file that is about
510       to be installed, and one for the actual file existing on the file
511       system. After comparing these three hashes, the following scenarios can
512       result:
513
514       original=X, current=X, new=X
515           All three files are the same, so overwrites are not an issue.
516           Install the new file.
517
518       original=X, current=X, new=Y
519           The current file is the same as the original, but the new one
520           differs. Since the user did not ever modify the file, and the new
521           one may contain improvements or bug fixes, install the new file.
522
523       original=X, current=Y, new=X
524           Both package versions contain the exact same file, but the one on
525           the file system has been modified. Leave the current file in place.
526
527       original=X, current=Y, new=Y
528           The new file is identical to the current file. Install the new
529           file.
530
531       original=X, current=Y, new=Z
532           All three files are different, so install the new file with a
533           .pacnew extension and warn the user. The user must then manually
534           merge any necessary changes into the original file.
535
536       original=NULL, current=Y, new=Z
537           The package was not previously installed, and the file already
538           exists on the file system. Install the new file with a .pacnew
539           extension and warn the user. The user must then manually merge any
540           necessary changes into the original file.
541

EXAMPLES

543       pacman -Ss ne.hack
544           Search for regexp "ne.hack" in package database.
545
546       pacman -S gpm
547           Download and install gpm including dependencies.
548
549       pacman -U /home/user/ceofhack-0.6-1-x86_64.pkg.tar.gz
550           Install ceofhack-0.6-1 package from a local file.
551
552       pacman -Syu
553           Update package list and upgrade all packages afterwards.
554
555       pacman -Syu gpm
556           Update package list, upgrade all packages, and then install gpm if
557           it wasn’t already installed.
558

CONFIGURATION

560       See pacman.conf(5) for more details on configuring pacman using the
561       pacman.conf file.
562

SEE ALSO

564       alpm-hooks(5), libalpm(3), makepkg(8), pacman.conf(5)
565
566       See the pacman website at https://www.archlinux.org/pacman/ for current
567       information on pacman and its related tools.
568

BUGS

570       Bugs? You must be kidding; there are no bugs in this software. But if
571       we happen to be wrong, submit a bug report with as much detail as
572       possible at the Arch Linux Bug Tracker in the Pacman section.
573

AUTHORS

575       Current maintainers:
576
577       ·   Allan McRae <allan@archlinux.org>
578
579       ·   Andrew Gregory <andrew.gregory.8@gmail.com>
580
581       ·   Dan McGee <dan@archlinux.org>
582
583       ·   Dave Reisner <dreisner@archlinux.org>
584
585       Past major contributors:
586
587       ·   Judd Vinet <jvinet@zeroflux.org>
588
589       ·   Aurelien Foret <aurelien@archlinux.org>
590
591       ·   Aaron Griffin <aaron@archlinux.org>
592
593       ·   Xavier Chantry <shiningxc@gmail.com>
594
595       ·   Nagy Gabor <ngaba@bibl.u-szeged.hu>
596
597       For additional contributors, use git shortlog -s on the pacman.git
598       repository.
599
600
601
602Pacman 5.2.1                      2020-04-01                         PACMAN(8)
Impressum