Add new alpm_list_remove_item() function
[pacman-ng.git] / doc / pacman.8.txt
blob8a94ebc67893996b3e025040f408d07bbe70b6e0
1 /////
2 vim:set ts=4 sw=4 syntax=asciidoc noet:
3 /////
4 pacman(8)
5 =========
7 Name
8 ----
9 pacman - package manager utility
12 Synopsis
13 --------
14 'pacman' <operation> [options] [packages]
17 Description
18 -----------
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).
29 Operations
30 ----------
31 *-D, \--database*::
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.
37 *-Q, \--query*::
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.
47 *-R, \--remove*::
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.
55 *-S, \--sync*::
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:
78   Alphanumeric:
79     1.0a < 1.0alpha < 1.0b < 1.0beta < 1.0p < 1.0pre < 1.0rc < 1.0
80   Numeric:
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`.
88 *-T, \--deptest*::
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
93         "bash>=3.2"`.
95 *-U, \--upgrade*::
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.
102 *-V, \--version*::
103         Display version and exit.
105 *-h, \--help*::
106         Display syntax for the given operation. If no operation was supplied
107         then the general syntax is shown.
110 Options
111 -------
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.
127 *-v, \--verbose*::
128         Output paths such as as the Root, Conf File, DB Path, Cache Dirs, etc.
130 *\--arch* <'arch'>::
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.
142 *\--debug*::
143         Display debug messages. When reporting bugs, this option is recommended
144         to be used.
146 *\--logfile* <'file'>::
147         Specify an alternate log file. This is an absolute path, regardless of
148         the installation root setting.
150 *\--noconfirm*::
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 --------------------------------------------------
156 *-d, \--nodeps*::
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.
162 *-k, \--dbonly*::
163         Adds/Removes the database entry only, leaves all files in place.
165 *\--noprogressbar*::
166         Do not show a progress bar when downloading files. This can be useful
167         for scripts that call pacman and capture the output.
169 *\--noscriptlet*::
170         If an install scriptlet exists, do not execute it. Do not use this
171         unless you know what you are doing.
173 *-p, \--print*::
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 --------------------------------------------
186 *-f, \--force*::
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.
192 *\--asdeps*::
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
196         the package.
198 *\--asexplicit*::
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'
202         remove operation.
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
207         with a comma.
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.
214 Query Options[[QO]]
215 -------------------
216 *-c, \--changelog*::
217         View the ChangeLog of a package. Not every package will provide one but
218         it will be shown if available.
220 *-d, \--deps*::
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'
225         option.)
227 *-e, \--explicit*::
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.)
233 *-g, \--groups*::
234         Display all packages that are members of a named group. If a name is not
235         specified, list all grouped packages.
237 *-i, \--info*::
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.
243 *-k \--check*::
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.
248 *-l, \--list*::
249         List all files owned by a given package. Multiple packages can be
250         specified on the command line.
252 *-m, \--foreign*::
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
259         absolute.
261 *-p, \--file*::
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'.
266 *-q, \--quiet*::
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
280         be returned.
282 *-t, \--unrequired*::
283         Restrict or filter output to packages not required by any currently
284         installed package.
286 *-u, \--upgrades*::
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'.
293 Remove Options[[RO]]
294 --------------------
295 *-c, \--cascade*::
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.
300 *-n, \--nosave*::
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.
305 *-s, \--recursive*::
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.
312 *-u, \--unneeded*::
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.
318 Sync Options[[SO]]
319 ------------------
320 *-c, \--clean*::
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].
334 *-g, \--groups*::
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.
339 *-i, \--info*::
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.
344 *-l, \--list*::
345         List all packages in the specified repositories. Multiple repositories
346         can be specified on the command line.
348 *-q, \--quiet*::
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
359         be returned.
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
372         the same operation.
374 *-w, \--downloadonly*::
375         Retrieve all packages from the server, but do not install/upgrade
376         anything.
378 *-y, \--refresh*::
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
383         to date.
385 *\--needed*::
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
400         new file.
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.
420 Examples
421 --------
423 pacman -Ss ne.hack::
424         Search for regexp "ne.hack" in package database.
426 pacman -S gpm::
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.
432 pacman -Syu::
433         Update package list and upgrade all packages afterwards.
435 pacman -Syu gpm::
436         Update package list, upgrade all packages, and then install gpm if it
437         wasn't already installed.
439 Configuration
440 -------------
441 See linkman:pacman.conf[5] for more details on configuring pacman using the
442 'pacman.conf' file.
445 See Also
446 --------
447 linkman:pacman.conf[5], linkman:makepkg[8], linkman:libalpm[3]
449 include::footer.txt[]