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

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

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

UPGRADE OPTIONS (APPLY TO -S AND -U)

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

QUERY OPTIONS (APPLY TO -Q)

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

REMOVE OPTIONS (APPLY TO -R)

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

SYNC OPTIONS (APPLY TO -S)

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

DATABASE OPTIONS (APPLY TO -D)

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

FILE OPTIONS (APPLY TO -F)

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

HANDLING CONFIG FILES

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

EXAMPLES

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

CONFIGURATION

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

SEE ALSO

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

BUGS

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

AUTHORS

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