2 vim:set ts=4 sw=4 syntax=asciidoc noet:
9 pacman - package manager utility
14 'pacman' <operation> [options] [packages]
19 Pacman is a package management utility that tracks installed packages on a Linux
20 system. It features dependency support, package groups, install and uninstall
21 hooks, and the ability to sync your local machine with a remote ftp server to
22 automatically upgrade packages. Pacman packages are a zipped tar format.
24 Since version 3.0.0, pacman has been the frontend to linkman:libalpm[3], the
25 ``Arch Linux Package Management'' library. This library allows alternative
26 front ends to be written (for instance, a GUI front end).
32 Modify the package database. This options allows you to modify certain
33 attributes of the installed packages in pacman's database. At the
34 moment, you can only change the install reason using '\--asdeps' and
35 '\--asexplicit' options.
38 Query the package database. This operation allows you to view installed
39 packages and their files, as well as meta-information about individual
40 packages (dependencies, conflicts, install date, build date, size). This
41 can be run against the local package database or can be used on
42 individual '.tar.gz' packages. In the first case, if no package names
43 are provided in the command line, all installed packages will be
44 queried. Additionally, various filters can be applied on the package
45 list. See <<QO,Query Options>> below.
48 Remove package(s) from the system. Groups can also be specified to be
49 removed, in which case every package in that group will be removed.
50 Files belonging to the specified package will be deleted, and the
51 database will be updated. Most configuration files will be saved
52 with a `.pacsave` extension unless the '\--nosave' option is used.
53 See <<RO,Remove Options>> below.
56 Synchronize packages. Packages are installed directly from the ftp
57 servers, including all dependencies required to run the packages. For
58 example, `pacman -S qt` will download and install qt and all the
59 packages it depends on. If a package name exists in more than one repo, the
60 repo can be explicitly specified to clarify the package to install:
61 `pacman -S testing/qt`. You can also specify version requirements:
62 `pacman -S "bash>=3.2"`. (Quotes are needed, otherwise your shell
63 interprets ">" as redirection to file.)
65 In addition to packages, groups can be specified as well. For example, if
66 gnome is a defined package group, then `pacman -S gnome` will install every
67 package in the gnome group, as well as the dependencies of those packages.
69 Packages which provide other packages are also handled. For example, `pacman -S
70 foo` will first look for a foo package. If foo is not found, packages which
71 provide the same functionality as foo will be searched for. If any package is
72 found, it will be installed.
74 You can also use `pacman -Su` to upgrade all packages that are out of date. See
75 <<SO,Sync Options>> below. When upgrading, pacman performs version comparison
76 to determine which packages need upgrading. This behavior operates as follows:
79 1.0a < 1.0alpha < 1.0b < 1.0beta < 1.0p < 1.0pre < 1.0rc < 1.0
81 1 < 1.0 < 1.1 < 1.1.1 < 1.2 < 2.0 < 3.0.0
83 Additionally, version strings can have an 'epoch' value defined that will
84 overrule any version comparison (unless the epoch values are equal). This is
85 specified in an `epoch:version-rel` format. For example, `2:1.0-1` is always
86 greater than `1:3.6-1`.
89 Check dependencies; this is useful in scripts such as makepkg to check
90 installed packages. This operation will check each dependency specified and
91 return a list of those which are not currently satisfied on the system.
92 This operation accepts no other options. Example usage: `pacman -T qt
96 Upgrade or add package(s) to the system and install the required
97 dependencies from sync repos. Either a URL or file path can be
98 specified. This is a ``remove-then-add'' process. See <<UO,Upgrade
99 Options>> below; also see <<HCF,Handling Config Files>> for an explanation
100 on how pacman takes care of config files.
103 Display version and exit.
106 Display syntax for the given operation. If no operation was supplied
107 then the general syntax is shown.
112 *-b, \--dbpath* <'path'>::
113 Specify an alternative database location (a typical default is
114 ``{localstatedir}/lib/pacman''). This should not be used unless you know what you are
115 doing. *NOTE*: if specified, this is an absolute path and the root path is
116 not automatically prepended.
118 *-r, \--root* <'path'>::
119 Specify an alternative installation root (default is ``/''). This should
120 not be used as a way to install software into ``/usr/local'' instead of
121 ``/usr''. This option is used if you want to install a package on a
122 temporary mounted partition which is "owned" by another system.
123 *NOTE*: if database path or logfile are not specified on either the
124 command line or in linkman:pacman.conf[5], their default location will
125 be inside this root path.
128 Output paths such as as the Root, Conf File, DB Path, Cache Dirs, etc.
131 Specify an alternate architecture.
133 *\--cachedir* <'dir'>::
134 Specify an alternative package cache location (a typical default is
135 ``{localstatedir}/cache/pacman/pkg''). Multiple cache directories can be specified,
136 and they are tried in the order they are passed to pacman. *NOTE*: this
137 is an absolute path, the root path is not automatically prepended.
139 *\--config* <'file'>::
140 Specify an alternate configuration file.
143 Display debug messages. When reporting bugs, this option is recommended
146 *\--logfile* <'file'>::
147 Specify an alternate log file. This is an absolute path, regardless of
148 the installation root setting.
151 Bypass any and all ``Are you sure?'' messages. It's not a good idea to do
152 this unless you want to run pacman from a script.
154 Transaction Options (apply to '-S', '-R' and '-U')
155 --------------------------------------------------
157 Skips all dependency checks. Normally, pacman will always check a
158 package's dependency fields to ensure that all dependencies are
159 installed and there are no package conflicts in the system.
162 Adds/Removes the database entry only, leaves all files in place.
165 Do not show a progress bar when downloading files. This can be useful
166 for scripts that call pacman and capture the output.
169 If an install scriptlet exists, do not execute it. Do not use this
170 unless you know what you are doing.
173 Only print the targets instead of performing the actual operation (sync,
174 remove or upgrade). Use '\--print-format' to specify how targets are
175 displayed. The default format string is "%l", which displays url with
176 '-S', filename with '-U' and pkgname-pkgver with '-R'.
178 *\--print-format* <'format'>::
179 Specify a printf-like format to control the output of the '\--print'
180 operation. The possible are attributes are : %n for pkgname, %v for pkgver,
181 %l for location, %r for repo and %s for size.
183 Upgrade Options (apply to 'S' and 'U')[[UO]]
184 --------------------------------------------
186 Bypass file conflict checks and overwrite conflicting files. If the
187 package that is about to be installed contains files that are already
188 installed, this option will cause all those files to be overwritten.
189 This option should be used with care, ideally not at all.
192 Install packages non-explicitly; in other words, fake their install reason
193 to be installed as a dependency. This is useful for makepkg and other
194 build from source tools that need to install dependencies before building
198 Install packages explicitly; in other words, fake their install reason to
199 be explicitly installed. This is useful if you want to mark a dependency
200 as explicitly installed so it will not be removed by the '\--recursive'
203 *\--ignore* <'package'>::
204 Directs pacman to ignore upgrades of package even if there is one
205 available. Multiple packages can be specified by separating them
208 *\--ignoregroup* <'group'>::
209 Directs pacman to ignore upgrades of all packages in 'group' even if
210 there is one available. Multiple groups can be specified by
211 separating them with a comma.
216 View the ChangeLog of a package. Not every package will provide one but
217 it will be shown if available.
220 Restrict or filter output to packages installed as dependencies. This
221 option can be combined with '-t' for listing real orphans- packages that
222 were installed as dependencies but are no longer required by any
223 installed package. ('-Qdt' is equivalent to the pacman 3.0.X '-Qe'
227 Restrict or filter output to packages explicitly installed. This option
228 can be combined with '-t' to list top-level packages- those packages
229 that were explicitly installed but are not required by any other
230 package. ('-Qet' is equivalent to the pacman 2.9.X '-Qe' option.)
233 Display all packages that are members of a named group. If a name is not
234 specified, list all grouped packages.
237 Display information on a given package. The '-p' option can be used if
238 querying a package file instead of the local database. Passing two
239 '\--info' or '-i' flags will also display the list of backup files and
240 their modification states.
243 Check that all files owned by the given package(s) are present on the
244 system. If packages are not specified or filter flags are not provided,
245 check all installed packages.
248 List all files owned by a given package. Multiple packages can be
249 specified on the command line.
252 Restrict or filter output to packages that were not found in the sync
253 database(s). Typically these are packages that were downloaded manually
254 and installed with '\--upgrade'.
256 *-o, \--owns* <'file'>::
257 Search for the package that owns file. The path can be relative or
261 Signifies that the package supplied on the command line is a file and
262 not an entry in the database. The file will be decompressed and queried.
263 This is useful in combination with '\--info' and '\--list'.
266 Show less information for certain query operations. (This is useful when
267 pacman's output is processed in a script.) Search will only show package
268 names and not version, group, and description information; owns will
269 only show package names instead of "file is owned by pkg" messages; group
270 will only show package names and omit group names; list will only show
271 files and omit package names; check will only show pairs of package names
272 and missing files; a bare query will only show package names
273 rather than names and versions.
275 *-s, \--search* <'regexp'>::
276 This will search each locally-installed package for names or
277 descriptions that match `regexp`. When you include multiple search
278 terms, only packages with descriptions matching ALL of those terms will
281 *-t, \--unrequired*::
282 Restrict or filter output to packages not required by any currently
286 Restrict or filter output to packages that are out of date on the local
287 system. (Only package versions are used to find outdated packages,
288 replacements are not checked here.) This option works best if the sync
289 database is refreshed using '-Sy'.
295 Remove all target packages, as well as all packages that depend on one
296 or more target packages. This operation is recursive, and must be used
297 with care since it can remove many potentially needed packages.
300 Instructs pacman to ignore file backup designations. Normally, when a
301 file is removed from the system the database is checked to see if the
302 file should be renamed with a ``.pacsave'' extension.
305 Remove each target specified including all of their dependencies, provided
306 that (A) they are not required by other packages; and (B) they were not
307 explicitly installed by the user. This operation is recursive and analogous
308 to a backwards '\--sync' operation, and helps keep a clean system without
309 orphans. If you want to omit condition (B), pass this option twice.
312 Removes the targets that are not required by any other packages.
313 This is mostly useful when removing a group without using the '-c' option,
314 to avoid breaking any dependencies.
320 Remove packages that are no longer installed from the cache as well as
321 currently unused sync databases to free up disk space. When pacman
322 downloads packages, it saves them in a cache directory. In addition,
323 databases are saved for every sync DB you download from, and are not
324 deleted even if they are removed from the configuration file
325 linkman:pacman.conf[5]. Use one '\--clean' switch to only remove
326 packages that are no longer installed; use two to remove all packages
327 from the cache. In both cases, you will have a yes or no option to
328 remove packages and/or unused downloaded databases.
330 If you use a network shared cache, see the 'CleanMethod' option in
331 linkman:pacman.conf[5].
334 Display all the members for each package group specified. If no group
335 names are provided, all groups will be listed; pass the flag twice to
336 view all groups and their members.
339 Display information on a given sync database package. Passing two '\--info'
340 or '-i' flags will also display those packages in all repositories that
341 depend on this package.
344 List all packages in the specified repositories. Multiple repositories
345 can be specified on the command line.
348 Show less information for certain sync operations. (This is useful when
349 pacman's output is processed in a script.) Search will only show package
350 names and not repo, version, group, and description information; list
351 will only show package names and omit databases and versions; group will
352 only show package names and omit group names.
354 *-s, \--search* <'regexp'>::
355 This will search each package in the sync databases for names or
356 descriptions that match `regexp`. When you include multiple search
357 terms, only packages with descriptions matching ALL of those terms will
360 *-u, \--sysupgrade*::
361 Upgrades all packages that are out of date. Each currently-installed
362 package will be examined and upgraded if a newer package exists. A
363 report of all packages to upgrade will be presented and the operation
364 will not proceed without user confirmation. Dependencies are
365 automatically resolved at this level and will be installed/upgraded if
366 necessary. Pass this option twice to enable package downgrade; in this
367 case pacman will select sync packages whose version does not match with
368 the local version. This can be useful when the user switches from a testing
369 repo to a stable one. Additional targets can also be specified manually, so
370 that '-Su foo' will do a system upgrade and install/upgrade the foo package in
373 *-w, \--downloadonly*::
374 Retrieve all packages from the server, but do not install/upgrade
378 Download a fresh copy of the master package list from the server(s)
379 defined in linkman:pacman.conf[5]. This should typically be used each time
380 you use '\--sysupgrade' or '-u'. Passing two '\--refresh' or '-y' flags
381 will force a refresh of all package lists even if they are thought to be up
385 Don't reinstall the targets that are already up-to-date.
388 Handling Config Files[[HCF]]
389 ----------------------------
390 Pacman uses the same logic as rpm to determine action against files that are
391 designated to be backed up. During an upgrade, 3 md5 hashes are used for each
392 backup file to determine the required action: one for the original file
393 installed, one for the new file that's about to be installed, and one for the
394 actual file existing on the filesystem. After comparing these 3 hashes, the
395 follow scenarios can result:
397 original=X, current=X, new=X::
398 All three files are the same, so overwrites are not an issue Install the
401 original=X, current=X, new=Y::
402 The current file is the same as the original but the new one differs.
403 Since the user did not ever modify the file, and the new one may contain
404 improvements or bugfixes, install the new file.
406 original=X, current=Y, new=X::
407 Both package versions contain the exact same file, but the one on the
408 filesystem has been modified. Leave the current file in place.
410 original=X, current=Y, new=Y::
411 The new file is identical to the current file. Install the new file.
413 original=X, current=Y, new=Z::
414 All three files are different, so install the new file with a '.pacnew'
415 extension and warn the user. The user must then manually merge any
416 necessary changes into the original file.
423 Search for regexp "ne.hack" in package database.
426 Download and install gpm including dependencies.
428 pacman -U /home/user/ceofhack-0.6-1-x86_64.pkg.tar.gz::
429 Install ceofhack-0.6-1 package from a local file.
432 Update package list and upgrade all packages afterwards.
435 Update package list, upgrade all packages, and then install gpm if it
436 wasn't already installed.
440 See linkman:pacman.conf[5] for more details on configuring pacman using the
446 linkman:pacman.conf[5], linkman:makepkg[8], linkman:libalpm[3]
448 include::footer.txt[]