Move important information up in -Si output
[pacman-ng.git] / doc / pacman.8.txt
blob0ad81882bf3a1140cf1e9cb04f989da9c8c560a7
1 /////
2 vim:set ts=4 sw=4 syntax=asciidoc noet spell spelllang=en_us:
3 /////
4 pacman(8)
5 =========
7 Name
8 ----
9 pacman - package manager utility
12 Synopsis
13 --------
14 'pacman' <operation> [options] [targets]
16 Description
17 -----------
18 Pacman is a package management utility that tracks installed packages on a Linux
19 system. It features dependency support, package groups, install and uninstall
20 hooks, and the ability to sync your local machine with a remote ftp server to
21 automatically upgrade packages. Pacman packages are a zipped tar format.
23 Since version 3.0.0, pacman has been the frontend to linkman:libalpm[3], the
24 ``Arch Linux Package Management'' library. This library allows alternative
25 front ends to be written (for instance, a GUI front end).
27 Invoking pacman involves specifying an operation with any potential options and
28 targets to operate on. A 'target' is usually a package name, filename, URL, or
29 a search string. Targets can be provided as command line arguments.
30 Additionally, if a single dash (-) is passed as an argument, targets will be
31 read from stdin.
34 Operations
35 ----------
36 *-D, \--database*::
37         Modify the package database. This operation allows you to modify certain
38         attributes of the installed packages in pacman's database. At the
39         moment, you can only change the install reason using '\--asdeps' and
40         '\--asexplicit' options.
42 *-Q, \--query*::
43         Query the package database. This operation allows you to view installed
44         packages and their files, as well as meta-information about individual
45         packages (dependencies, conflicts, install date, build date, size). This
46         can be run against the local package database or can be used on
47         individual '.tar.gz' packages. In the first case, if no package names
48         are provided in the command line, all installed packages will be
49         queried. Additionally, various filters can be applied on the package
50         list. See <<QO,Query Options>> below.
52 *-R, \--remove*::
53         Remove package(s) from the system. Groups can also be specified to be
54         removed, in which case every package in that group will be removed.
55         Files belonging to the specified package will be deleted, and the
56         database will be updated. Most configuration files will be saved
57         with a '.pacsave' extension unless the '\--nosave' option is used.
58         See <<RO,Remove Options>> below.
60 *-S, \--sync*::
61         Synchronize packages. Packages are installed directly from the ftp
62         servers, including all dependencies required to run the packages. For
63         example, `pacman -S qt` will download and install qt and all the
64         packages it depends on. If a package name exists in more than one repo, the
65         repo can be explicitly specified to clarify the package to install:
66         `pacman -S testing/qt`. You can also specify version requirements:
67         `pacman -S "bash>=3.2"`. (Quotes are needed, otherwise your shell
68         interprets ">" as redirection to file.)
70 In addition to packages, groups can be specified as well. For example, if
71 gnome is a defined package group, then `pacman -S gnome` will provide a
72 prompt allowing you to select which packages to install from a numbered list.
73 The package selection is specified using a space and/or comma separated list of
74 package numbers. Sequential packages may be selected by specifying the first
75 and last package numbers separated by a hyphen (`-`). Excluding packages is
76 achieved by prefixing a number or range of numbers with a caret (`^`).
78 Packages that provide other packages are also handled. For example, `pacman -S
79 foo` will first look for a foo package. If foo is not found, packages that
80 provide the same functionality as foo will be searched for. If any package is
81 found, it will be installed. A selection prompt is provided if multiple packages
82 providing foo are found.
84 You can also use `pacman -Su` to upgrade all packages that are out of date. See
85 <<SO,Sync Options>> below. When upgrading, pacman performs version comparison
86 to determine which packages need upgrading. This behavior operates as follows:
88   Alphanumeric:
89     1.0a < 1.0b < 1.0beta < 1.0p < 1.0pre < 1.0rc < 1.0 < 1.0.a < 1.0.1
90   Numeric:
91     1 < 1.0 < 1.1 < 1.1.1 < 1.2 < 2.0 < 3.0.0
93 Additionally, version strings can have an 'epoch' value defined that will
94 overrule any version comparison (unless the epoch values are equal). This is
95 specified in an `epoch:version-rel` format. For example, `2:1.0-1` is always
96 greater than `1:3.6-1`.
98 *-T, \--deptest*::
99         Check dependencies; this is useful in scripts such as makepkg to check
100         installed packages. This operation will check each dependency specified and
101         return a list of dependencies that are not currently satisfied on the system.
102         This operation accepts no other options. Example usage: `pacman -T qt
103         "bash>=3.2"`.
105 *-U, \--upgrade*::
106         Upgrade or add package(s) to the system and install the required
107         dependencies from sync repos. Either a URL or file path can be
108         specified. This is a ``remove-then-add'' process. See <<UO,Upgrade
109         Options>> below; also see <<HCF,Handling Config Files>> for an explanation
110         on how pacman takes care of config files.
112 *-V, \--version*::
113         Display version and exit.
115 *-h, \--help*::
116         Display syntax for the given operation. If no operation was supplied
117         then the general syntax is shown.
120 Options
121 -------
122 *-b, \--dbpath* <path>::
123         Specify an alternative database location (a typical default is
124         +{localstatedir}/lib/pacman+). This should not be used unless you know what you are
125         doing. *NOTE*: if specified, this is an absolute path and the root path is
126         not automatically prepended.
128 *-r, \--root* <path>::
129         Specify an alternative installation root (default is `/`). This should
130         not be used as a way to install software into `/usr/local` instead of
131         `/usr`. This option is used if you want to install a package on a
132         temporary mounted partition that is "owned" by another system.
133         *NOTE*: if database path or logfile are not specified on either the
134         command line or in linkman:pacman.conf[5], their default location will
135         be inside this root path.
137 *-v, \--verbose*::
138         Output paths such as as the Root, Conf File, DB Path, Cache Dirs, etc.
140 *\--arch* <arch>::
141         Specify an alternate architecture.
143 *\--cachedir* <dir>::
144         Specify an alternative package cache location (a typical default is
145         +{localstatedir}/cache/pacman/pkg+). Multiple cache directories can be specified,
146         and they are tried in the order they are passed to pacman. *NOTE*: this
147         is an absolute path, the root path is not automatically prepended.
149 *\--config* <file>::
150         Specify an alternate configuration file.
152 *\--debug*::
153         Display debug messages. When reporting bugs, this option is recommended
154         to be used.
156 *\--gpgdir* <dir>::
157         Specify a directory of files used by GnuPG to verify package signatures (a
158         typical default is +{sysconfdir}/pacman.d/gnupg+). This directory should contain
159         two files: `pubring.gpg` and `trustdb.gpg`. `pubring.gpg` holds the public keys
160         of all packagers. `trustdb.gpg` contains a so-called trust database, which
161         specifies that the keys are authentic and trusted. *NOTE*: this is an absolute
162         path, the root path is not automatically prepended.
164 *\--logfile* <file>::
165         Specify an alternate log file. This is an absolute path, regardless of
166         the installation root setting.
168 *\--noconfirm*::
169         Bypass any and all ``Are you sure?'' messages. It's not a good idea to do
170         this unless you want to run pacman from a script.
172 Transaction Options (apply to '-S', '-R' and '-U')
173 --------------------------------------------------
174 *-d, \--nodeps*::
175         Skips dependency version checks. Package names are still checked. Normally,
176         pacman will always check a package's dependency fields to ensure that all
177         dependencies are installed and there are no package conflicts in the
178         system. Specify this option twice to skip all dependency checks.
180 *\--dbonly*::
181         Adds/Removes the database entry only, leaves all files in place.
183 *\--noprogressbar*::
184         Do not show a progress bar when downloading files. This can be useful
185         for scripts that call pacman and capture the output.
187 *\--noscriptlet*::
188         If an install scriptlet exists, do not execute it. Do not use this
189         unless you know what you are doing.
191 *-p, \--print*::
192         Only print the targets instead of performing the actual operation (sync,
193         remove or upgrade). Use '\--print-format' to specify how targets are
194         displayed. The default format string is "%l", which displays URLs with
195         '-S', filenames with '-U' and pkgname-pkgver with '-R'.
197 *\--print-format* <format>::
198         Specify a printf-like format to control the output of the '\--print'
199         operation. The possible attributes are: %n for pkgname, %v for pkgver,
200         %l for location, %r for repo and %s for size.
202 Upgrade Options (apply to '-S' and '-U')[[UO]]
203 --------------------------------------------
204 *\--force*::
205         Bypass file conflict checks and overwrite conflicting files. If the
206         package that is about to be installed contains files that are already
207         installed, this option will cause all those files to be overwritten.
208         This option should be used with care, ideally not at all.
210 *\--asdeps*::
211         Install packages non-explicitly; in other words, fake their install reason
212         to be installed as a dependency. This is useful for makepkg and other
213         build from source tools that need to install dependencies before building
214         the package.
216 *\--asexplicit*::
217         Install packages explicitly; in other words, fake their install reason to
218         be explicitly installed. This is useful if you want to mark a dependency
219         as explicitly installed so it will not be removed by the '\--recursive'
220         remove operation.
222 *\--ignore* <package>::
223         Directs pacman to ignore upgrades of package even if there is one
224         available. Multiple packages can be specified by separating them
225         with a comma.
227 *\--ignoregroup* <group>::
228         Directs pacman to ignore upgrades of all packages in 'group' even if
229         there is one available. Multiple groups can be specified by
230         separating them with a comma.
232 *\--needed*::
233         Do not reinstall the targets that are already up to date.
236 Query Options[[QO]]
237 -------------------
238 *-c, \--changelog*::
239         View the ChangeLog of a package if it exists.
241 *-d, \--deps*::
242         Restrict or filter output to packages installed as dependencies. This
243         option can be combined with '-t' for listing real orphans - packages that
244         were installed as dependencies but are no longer required by any
245         installed package.
247 *-e, \--explicit*::
248         Restrict or filter output to explicitly installed packages. This option
249         can be combined with '-t' to list explicitly installed packages that
250         are not required by any other package.
252 *-g, \--groups*::
253         Display all packages that are members of a named group. If a name is not
254         specified, list all grouped packages.
256 *-i, \--info*::
257         Display information on a given package. The '-p' option can be used if
258         querying a package file instead of the local database. Passing two
259         '\--info' or '-i' flags will also display the list of backup files and
260         their modification states.
262 *-k \--check*::
263         Check that all files owned by the given package(s) are present on the
264         system. If packages are not specified or filter flags are not provided,
265         check all installed packages.
267 *-l, \--list*::
268         List all files owned by a given package. Multiple packages can be
269         specified on the command line.
271 *-m, \--foreign*::
272         Restrict or filter output to packages that were not found in the sync
273         database(s).  Typically these are packages that were downloaded manually
274         and installed with '\--upgrade'.
276 *-o, \--owns* <file>::
277         Search for packages that own the specified file(s). The path can be
278         relative or absolute and one or more files can be specified.
280 *-p, \--file*::
281         Signifies that the package supplied on the command line is a file and
282         not an entry in the database. The file will be decompressed and queried.
283         This is useful in combination with '\--info' and '\--list'.
285 *-q, \--quiet*::
286         Show less information for certain query operations. (This is useful when
287         pacman's output is processed in a script.) Search will only show package
288         names and not version, group, and description information; owns will
289         only show package names instead of "file is owned by pkg" messages; group
290         will only show package names and omit group names; list will only show
291         files and omit package names; check will only show pairs of package names
292         and missing files; a bare query will only show package names
293         rather than names and versions.
295 *-s, \--search* <regexp>::
296         Search each locally-installed package for names or descriptions that
297         match `regexp`. When including multiple search terms, only packages
298         with descriptions matching ALL of those terms are returned.
300 *-t, \--unrequired*::
301         Restrict or filter output to packages not required by any currently
302         installed package.
304 *-u, \--upgrades*::
305         Restrict or filter output to packages that are out of date on the local
306         system. (Only package versions are used to find outdated packages,
307         replacements are not checked here.) This option works best if the sync
308         database is refreshed using '-Sy'.
311 Remove Options[[RO]]
312 --------------------
313 *-c, \--cascade*::
314         Remove all target packages, as well as all packages that depend on one
315         or more target packages. This operation is recursive, and must be used
316         with care since it can remove many potentially needed packages.
318 *-n, \--nosave*::
319         Instructs pacman to ignore file backup designations. Normally, when a
320         file is removed from the system the database is checked to see if the
321         file should be renamed with a '.pacsave' extension.
323 *-s, \--recursive*::
324         Remove each target specified including all of their dependencies, provided
325         that (A) they are not required by other packages; and (B) they were not
326         explicitly installed by the user. This operation is recursive and analogous
327         to a backwards '\--sync' operation, and helps keep a clean system without
328         orphans. If you want to omit condition (B), pass this option twice.
330 *-u, \--unneeded*::
331         Removes targets that are not required by any other packages.
332         This is mostly useful when removing a group without using the '-c' option,
333         to avoid breaking any dependencies.
336 Sync Options[[SO]]
337 ------------------
338 *-c, \--clean*::
339         Remove packages that are no longer installed from the cache as well as
340         currently unused sync databases to free up disk space. When pacman
341         downloads packages, it saves them in a cache directory. In addition,
342         databases are saved for every sync DB you download from, and are not
343         deleted even if they are removed from the configuration file
344         linkman:pacman.conf[5]. Use one '\--clean' switch to only remove
345         packages that are no longer installed; use two to remove all files
346         from the cache. In both cases, you will have a yes or no option to
347         remove packages and/or unused downloaded databases.
349 If you use a network shared cache, see the 'CleanMethod' option in
350 linkman:pacman.conf[5].
352 *-g, \--groups*::
353         Display all the members for each package group specified. If no group
354         names are provided, all groups will be listed; pass the flag twice to
355         view all groups and their members.
357 *-i, \--info*::
358         Display information on a given sync database package. Passing two '\--info'
359         or '-i' flags will also display those packages in all repositories that
360         depend on this package.
362 *-l, \--list*::
363         List all packages in the specified repositories. Multiple repositories
364         can be specified on the command line.
366 *-q, \--quiet*::
367         Show less information for certain sync operations. (This is useful when
368         pacman's output is processed in a script.) Search will only show package
369         names and not repo, version, group, and description information; list
370         will only show package names and omit databases and versions; group will
371         only show package names and omit group names.
373 *-s, \--search* <regexp>::
374         This will search each package in the sync databases for names or
375         descriptions that match `regexp`. When you include multiple search
376         terms, only packages with descriptions matching ALL of those terms will
377         be returned.
379 *-u, \--sysupgrade*::
380         Upgrades all packages that are out of date. Each currently-installed
381         package will be examined and upgraded if a newer package exists. A
382         report of all packages to upgrade will be presented and  the operation
383         will not proceed without user confirmation. Dependencies are
384         automatically resolved at this level and will be installed/upgraded if
385         necessary.
387 Pass this option twice to enable package downgrade; in this case pacman will
388 select sync packages whose version does not match with the local version.  This
389 can be useful when the user switches from a testing repo to a stable one.
391 Additional targets can also be specified manually, so that '-Su foo' will do a
392 system upgrade and install/upgrade the foo package in the same operation.
394 *-w, \--downloadonly*::
395         Retrieve all packages from the server, but do not install/upgrade anything.
397 *-y, \--refresh*::
398         Download a fresh copy of the master package list from the server(s)
399         defined in linkman:pacman.conf[5]. This should typically be used each time
400         you use '\--sysupgrade' or '-u'. Passing two '\--refresh' or '-y' flags
401         will force a refresh of all package lists even if they appear to be up
402         to date.
404 *\--needed*::
405         Do not reinstall the targets that are already up to date.
408 Handling Config Files[[HCF]]
409 ----------------------------
410 Pacman uses the same logic as rpm to determine action against files that are
411 designated to be backed up. During an upgrade, 3 md5 hashes are used for each
412 backup file to determine the required action: one for the original file
413 installed, one for the new file that's about to be installed, and one for the
414 actual file existing on the filesystem. After comparing these 3 hashes, the
415 follow scenarios can result:
417 original=X, current=X, new=X::
418         All three files are the same, so overwrites are not an issue. Install the
419         new file.
421 original=X, current=X, new=Y::
422         The current file is the same as the original but the new one differs.
423         Since the user did not ever modify the file, and the new one may contain
424         improvements or bugfixes, install the new file.
426 original=X, current=Y, new=X::
427         Both package versions contain the exact same file, but the one on the
428         filesystem has  been  modified. Leave the current file in place.
430 original=X, current=Y, new=Y::
431         The new file is identical to the current file. Install the new file.
433 original=X, current=Y, new=Z::
434         All three files are different, so install the new file with a '.pacnew'
435         extension and warn the user. The user must then manually merge any
436         necessary changes into the original file.
439 Examples
440 --------
442 pacman -Ss ne.hack::
443         Search for regexp "ne.hack" in package database.
445 pacman -S gpm::
446         Download and install gpm including dependencies.
448 pacman -U /home/user/ceofhack-0.6-1-x86_64.pkg.tar.gz::
449         Install ceofhack-0.6-1 package from a local file.
451 pacman -Syu::
452         Update package list and upgrade all packages afterwards.
454 pacman -Syu gpm::
455         Update package list, upgrade all packages, and then install gpm if it
456         wasn't already installed.
458 Configuration
459 -------------
460 See linkman:pacman.conf[5] for more details on configuring pacman using the
461 'pacman.conf' file.
464 See Also
465 --------
466 linkman:pacman.conf[5], linkman:makepkg[8], linkman:libalpm[3]
468 include::footer.txt[]