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 dependency version checks. Package names are still checked. Normally,
158 pacman will always check a package's dependency fields to ensure that all
159 dependencies are installed and there are no package conflicts in the
160 system. Specify this option twice to skip all dependency checks.
163 Adds/Removes the database entry only, leaves all files in place.
166 Do not show a progress bar when downloading files. This can be useful
167 for scripts that call pacman and capture the output.
170 If an install scriptlet exists, do not execute it. Do not use this
171 unless you know what you are doing.
174 Only print the targets instead of performing the actual operation (sync,
175 remove or upgrade). Use '\--print-format' to specify how targets are
176 displayed. The default format string is "%l", which displays url with
177 '-S', filename with '-U' and pkgname-pkgver with '-R'.
179 *\--print-format* <'format'>::
180 Specify a printf-like format to control the output of the '\--print'
181 operation. The possible are attributes are : %n for pkgname, %v for pkgver,
182 %l for location, %r for repo and %s for size.
184 Upgrade Options (apply to 'S' and 'U')[[UO]]
185 --------------------------------------------
187 Bypass file conflict checks and overwrite conflicting files. If the
188 package that is about to be installed contains files that are already
189 installed, this option will cause all those files to be overwritten.
190 This option should be used with care, ideally not at all.
193 Install packages non-explicitly; in other words, fake their install reason
194 to be installed as a dependency. This is useful for makepkg and other
195 build from source tools that need to install dependencies before building
199 Install packages explicitly; in other words, fake their install reason to
200 be explicitly installed. This is useful if you want to mark a dependency
201 as explicitly installed so it will not be removed by the '\--recursive'
204 *\--ignore* <'package'>::
205 Directs pacman to ignore upgrades of package even if there is one
206 available. Multiple packages can be specified by separating them
209 *\--ignoregroup* <'group'>::
210 Directs pacman to ignore upgrades of all packages in 'group' even if
211 there is one available. Multiple groups can be specified by
212 separating them with a comma.
217 View the ChangeLog of a package. Not every package will provide one but
218 it will be shown if available.
221 Restrict or filter output to packages installed as dependencies. This
222 option can be combined with '-t' for listing real orphans- packages that
223 were installed as dependencies but are no longer required by any
224 installed package. ('-Qdt' is equivalent to the pacman 3.0.X '-Qe'
228 Restrict or filter output to packages explicitly installed. This option
229 can be combined with '-t' to list top-level packages- those packages
230 that were explicitly installed but are not required by any other
231 package. ('-Qet' is equivalent to the pacman 2.9.X '-Qe' option.)
234 Display all packages that are members of a named group. If a name is not
235 specified, list all grouped packages.
238 Display information on a given package. The '-p' option can be used if
239 querying a package file instead of the local database. Passing two
240 '\--info' or '-i' flags will also display the list of backup files and
241 their modification states.
244 Check that all files owned by the given package(s) are present on the
245 system. If packages are not specified or filter flags are not provided,
246 check all installed packages.
249 List all files owned by a given package. Multiple packages can be
250 specified on the command line.
253 Restrict or filter output to packages that were not found in the sync
254 database(s). Typically these are packages that were downloaded manually
255 and installed with '\--upgrade'.
257 *-o, \--owns* <'file'>::
258 Search for the package that owns file. The path can be relative or
262 Signifies that the package supplied on the command line is a file and
263 not an entry in the database. The file will be decompressed and queried.
264 This is useful in combination with '\--info' and '\--list'.
267 Show less information for certain query operations. (This is useful when
268 pacman's output is processed in a script.) Search will only show package
269 names and not version, group, and description information; owns will
270 only show package names instead of "file is owned by pkg" messages; group
271 will only show package names and omit group names; list will only show
272 files and omit package names; check will only show pairs of package names
273 and missing files; a bare query will only show package names
274 rather than names and versions.
276 *-s, \--search* <'regexp'>::
277 This will search each locally-installed package for names or
278 descriptions that match `regexp`. When you include multiple search
279 terms, only packages with descriptions matching ALL of those terms will
282 *-t, \--unrequired*::
283 Restrict or filter output to packages not required by any currently
287 Restrict or filter output to packages that are out of date on the local
288 system. (Only package versions are used to find outdated packages,
289 replacements are not checked here.) This option works best if the sync
290 database is refreshed using '-Sy'.
296 Remove all target packages, as well as all packages that depend on one
297 or more target packages. This operation is recursive, and must be used
298 with care since it can remove many potentially needed packages.
301 Instructs pacman to ignore file backup designations. Normally, when a
302 file is removed from the system the database is checked to see if the
303 file should be renamed with a ``.pacsave'' extension.
306 Remove each target specified including all of their dependencies, provided
307 that (A) they are not required by other packages; and (B) they were not
308 explicitly installed by the user. This operation is recursive and analogous
309 to a backwards '\--sync' operation, and helps keep a clean system without
310 orphans. If you want to omit condition (B), pass this option twice.
313 Removes the targets that are not required by any other packages.
314 This is mostly useful when removing a group without using the '-c' option,
315 to avoid breaking any dependencies.
321 Remove packages that are no longer installed from the cache as well as
322 currently unused sync databases to free up disk space. When pacman
323 downloads packages, it saves them in a cache directory. In addition,
324 databases are saved for every sync DB you download from, and are not
325 deleted even if they are removed from the configuration file
326 linkman:pacman.conf[5]. Use one '\--clean' switch to only remove
327 packages that are no longer installed; use two to remove all packages
328 from the cache. In both cases, you will have a yes or no option to
329 remove packages and/or unused downloaded databases.
331 If you use a network shared cache, see the 'CleanMethod' option in
332 linkman:pacman.conf[5].
335 Display all the members for each package group specified. If no group
336 names are provided, all groups will be listed; pass the flag twice to
337 view all groups and their members.
340 Display information on a given sync database package. Passing two '\--info'
341 or '-i' flags will also display those packages in all repositories that
342 depend on this package.
345 List all packages in the specified repositories. Multiple repositories
346 can be specified on the command line.
349 Show less information for certain sync operations. (This is useful when
350 pacman's output is processed in a script.) Search will only show package
351 names and not repo, version, group, and description information; list
352 will only show package names and omit databases and versions; group will
353 only show package names and omit group names.
355 *-s, \--search* <'regexp'>::
356 This will search each package in the sync databases for names or
357 descriptions that match `regexp`. When you include multiple search
358 terms, only packages with descriptions matching ALL of those terms will
361 *-u, \--sysupgrade*::
362 Upgrades all packages that are out of date. Each currently-installed
363 package will be examined and upgraded if a newer package exists. A
364 report of all packages to upgrade will be presented and the operation
365 will not proceed without user confirmation. Dependencies are
366 automatically resolved at this level and will be installed/upgraded if
367 necessary. Pass this option twice to enable package downgrade; in this
368 case pacman will select sync packages whose version does not match with
369 the local version. This can be useful when the user switches from a testing
370 repo to a stable one. Additional targets can also be specified manually, so
371 that '-Su foo' will do a system upgrade and install/upgrade the foo package in
374 *-w, \--downloadonly*::
375 Retrieve all packages from the server, but do not install/upgrade
379 Download a fresh copy of the master package list from the server(s)
380 defined in linkman:pacman.conf[5]. This should typically be used each time
381 you use '\--sysupgrade' or '-u'. Passing two '\--refresh' or '-y' flags
382 will force a refresh of all package lists even if they are thought to be up
386 Don't reinstall the targets that are already up-to-date.
389 Handling Config Files[[HCF]]
390 ----------------------------
391 Pacman uses the same logic as rpm to determine action against files that are
392 designated to be backed up. During an upgrade, 3 md5 hashes are used for each
393 backup file to determine the required action: one for the original file
394 installed, one for the new file that's about to be installed, and one for the
395 actual file existing on the filesystem. After comparing these 3 hashes, the
396 follow scenarios can result:
398 original=X, current=X, new=X::
399 All three files are the same, so overwrites are not an issue Install the
402 original=X, current=X, new=Y::
403 The current file is the same as the original but the new one differs.
404 Since the user did not ever modify the file, and the new one may contain
405 improvements or bugfixes, install the new file.
407 original=X, current=Y, new=X::
408 Both package versions contain the exact same file, but the one on the
409 filesystem has been modified. Leave the current file in place.
411 original=X, current=Y, new=Y::
412 The new file is identical to the current file. Install the new file.
414 original=X, current=Y, new=Z::
415 All three files are different, so install the new file with a '.pacnew'
416 extension and warn the user. The user must then manually merge any
417 necessary changes into the original file.
424 Search for regexp "ne.hack" in package database.
427 Download and install gpm including dependencies.
429 pacman -U /home/user/ceofhack-0.6-1-x86_64.pkg.tar.gz::
430 Install ceofhack-0.6-1 package from a local file.
433 Update package list and upgrade all packages afterwards.
436 Update package list, upgrade all packages, and then install gpm if it
437 wasn't already installed.
441 See linkman:pacman.conf[5] for more details on configuring pacman using the
447 linkman:pacman.conf[5], linkman:makepkg[8], linkman:libalpm[3]
449 include::footer.txt[]