summaryrefslogtreecommitdiff
path: root/doc/pacman.8.txt
blob: 37680be82994ed26286cb66deec046600cd80c66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
/////
vim:set ts=4 sw=4 syntax=asciidoc noet:
/////
pacman(8)
=========

Name
----
pacman - package manager utility


Synopsis
--------
'pacman' <operation> [options] [packages]


Description
-----------
Pacman is a package management utility that tracks installed packages on a Linux
system. It features dependency support, package groups, install and uninstall
hooks, and the ability to sync your local machine with a remote ftp server to
automatically upgrade packages. Pacman packages are a zipped tar format.

Since version 3.0.0, pacman has been the frontend to linkman:libalpm[3], the
``Arch Linux Package Management'' library. This library allows alternative
front ends to be written (for instance, a GUI front end).


Operations
----------
*-Q, \--query*::
    Query the package database. This operation allows you to view installed
    packages and their files, as well as meta-information about individual
    packages (dependencies, conflicts, install date, build date, size). This
    can be run against the local package database or can be used on
    individual '.tar.gz' packages. See <<QO,Query Options>> below.

*-R, \--remove*::
    Remove a package from the system. Groups can also be specified to be
    removed, in which case every package in that group will be removed.
    Files belonging to the specified package will be deleted, and the
    database will be updated. Most configuration files will be saved
    with a `.pacsave` extension unless the '\--nosave' option is used.
    See <<RO,Remove Options>> below.

*-S, \--sync*::
    Synchronize packages. Packages are installed directly from the ftp
    servers, including all dependencies required to run the packages. For
    example, `pacman -S qt` will download and install qt and all the
    packages it depends on. If a package name exists in more than one repo, the
    repo can be explicitly specified to clarify the package to install:
    `pacman -S testing/qt`. You can also specify version requirements:
    `pacman -S "bash>=3.2"`. (Quotes are needed, otherwise your shell
    interprets ">" as redirection to file.)
+
In addition to packages, groups can be specified as well. For example, if
gnome is a defined package group, then `pacman -S gnome` will install every
package in the gnome group, as well as the dependencies of those packages.
+
Packages which provide other packages are also handled. For example, `pacman -S
foo` will first look for a foo package. If foo is not found, packages which
provide the same functionality as foo will be searched for. If any package is
found, it will be installed.
+
You can also use `pacman -Su` to upgrade all packages that are out of date. See
<<SO,Sync Options>> below. When upgrading, pacman performs version comparison
to determine which packages need upgrading. This behavior operates as follows:

  Alphanumeric:
    1.0a < 1.0alpha < 1.0b < 1.0beta < 1.0p < 1.0pre < 1.0rc < 1.0
  Numeric:
    1 < 1.0 < 1.1 < 1.1.1 < 1.2 < 2.0 < 3.0.0

*-U, \--upgrade*::
    Upgrade or add a package to the system. Either a URL or file path can be
    specified. This is a ``remove-then-add'' process. See <<HCF,Handling Config
    Files>> for an explanation on how pacman takes care of config files.

*-V, \--version*::
    Display version and exit.

*-h, \--help*::
    Display syntax for the given operation. If no operation was supplied
    then the general syntax is shown.


Options
-------
*\--asdeps*::
    Install packages non-explicitly; in other words, fake their install reason
    to be installed as a dependency. This is useful for makepkg and other
    build from source tools that need to install dependencies before building
    the package.

*\--asexplicit*::
    Install packages explicitly; in other words, fake their install reason to
    be explicitly installed. This is useful if you want to mark a dependency
    as explicitly installed so it will not be removed by the '\--recursive'
    remove operation.

*-b, \--dbpath* <'path'>::
    Specify an alternative database location (a typical default is
    ``/var/lib/pacman'').  This should not be used unless you know what you are
    doing. *NOTE*: if specified, this is an absolute path and the root path is
    not automatically prepended.

*-d, \--nodeps*::
    Skips all dependency checks. Normally, pacman will always check a
    package's dependency fields to ensure that all dependencies are
    installed and there are no package conflicts in the system.

*-f, \--force*::
    Bypass file conflict checks and overwrite conflicting files. If the
    package that is about to be installed contains files that are already
    installed, this option will cause all those files to be overwritten.
    This option should be used with care, ideally not at all.

*-r, \--root* <'path'>::
    Specify an alternative installation root (default is ``/''). This should
    not be used as a way to install software into ``/usr/local'' instead of
    ``/usr''. This option is used if you want to install a package on a
    temporary mounted partition which is "owned" by another system.
    *NOTE*: if database path or logfile are not specified on either the
    command line or in linkman:pacman.conf[5], their default location will
    be inside this root path.

*-v, \--verbose*::
    Output paths such as as the Root, Conf File, DB Path, Cache Dirs, etc.

*\--debug*::
    Display debug messages. When reporting bugs, this option is recommended
    to be used.

*\--cachedir* <'dir'>::
    Specify an alternative package cache location (a typical default is
    ``/var/cache/pacman/pkg''). Multiple cache directories can be specified,
    and they are tried in the order they are passed to pacman. *NOTE*: this
    is an absolute path, the root path is not automatically prepended.

*\--config* <'file'>::
    Specify an alternate configuration file.

*\--logfile* <'file'>::
    Specify an alternate log file. This is an absolute path, regardless of
    the installation root setting.

*\--noconfirm*::
    Bypass any and all ``Are you sure?'' messages. It's not a good idea to do
    this unless you want to run pacman from a script.

*\--noprogressbar*::
    Do not show a progress bar when downloading files. This can be useful
    for scripts that call pacman and capture the output.

*\--noscriptlet*::
    If an install scriptlet exists, do not execute it. Do not use this
    unless you know what you are doing.


Query Options[[QO]]
-------------------
*-c, \--changelog*::
    View the ChangeLog of a package. Not every package will provide one but
    it will be shown if available.

*-d, \--deps*::
    List all packages installed as dependencies. This option can be combined
    with '-t' for listing real orphans- packages that were installed as
    dependencies but are no longer required by any installed package. ('-Qdt'
    is equivalent to the pacman 3.0.X '-Qe' option.)

*-e, \--explicit*::
    List all packages explicitly installed. This option can be combined with
    '-t' to list top-level packages- those packages that were explicitly
    installed but are not required by any other package. ('-Qet' is equivalent
    to the pacman 2.9.X '-Qe' option.)

*-g, \--groups*::
    Display all packages that are members of a named group. If a name is not
    specified, list all grouped packages.

*-i, \--info*::
    Display information on a given package. The '-p' option can be used if
    querying a package file instead of the local database. Passing two
    '\--info' or '-i' flags will also display the list of backup files and
    their modification states.

*-l, \--list*::
    List all files owned by a given package. Multiple packages can be
    specified on the command line.

*-m, \--foreign*::
    Restrict or filter output to packages that were not found in the sync
    database(s).  Typically these are packages that were downloaded manually
    and installed with '\--upgrade'.

*-o, \--owns* <'file'>::
    Search for the package that owns file. The path can be relative or
    absolute.

*-p, \--file*::
    Signifies that the package supplied on the command line is a file and
    not an entry in the database. The file will be decompressed and queried.
    This is useful in combination with '\--info' and '\--list'.

*-q, \--quiet*::
    Show less information for certain query operations. (This is useful when
    pacman's output is processed in a script.) Search will only show package
    names and not version, group, and description information; owns will
    only show package names instead of "file is owned by pkg" messages; group
    will only show package names and omit group names; list will only show
    files and omit package names; a bare query will only show package names
    rather than names and versions.

*-s, \--search* <'regexp'>::
    This will search each locally-installed package for names or
    descriptions that match `regexp`.

*-t, \--unrequired*::
    Restrict or filter output to packages not required by any currently
    installed package.

*-u, \--upgrades*::
    Lists all packages that are out of date on the local system. This option
    works best if the sync database is refreshed using '-Sy'.


Remove Options[[RO]]
--------------------
*-c, \--cascade*::
    Remove all target packages, as well as all packages that depend on one
    or more target packages. This operation is recursive, and must be used
    with care since it can remove many potentially needed packages.

*-k, \--keep*::
    Removes the database entry only. Leaves all files in place.

*-n, \--nosave*::
    Instructs pacman to ignore file backup designations. Normally, when a
    file is removed from the system the database is checked to see if the
    file should be renamed with a ``.pacsave'' extension.

*-s, \--recursive*::
    Remove each target specified including all of their dependencies, provided
    that (A) they are not required by other packages; and (B) they were not
    explicitly installed by the user. This operation is recursive and analogous
    to a backwards '\--sync' operation, and helps keep a clean system without
    orphans. If you want to omit condition (B), pass this option twice.

*-u, \--unneeded*::
    Removes the targets that are not required by any other packages.
    This is mostly useful when removing a group without using the '-c' option,
    to avoid breaking any dependencies.


Sync Options[[SO]]
------------------
*-c, \--clean*::
    Remove packages that are no longer installed from the cache as well as
    currently unused sync databases to free up disk space. When pacman
    downloads packages, it saves them in a cache directory. In addition,
    databases are saved for every sync DB you download from, and are not
    deleted even if they are removed from the configuration file
    linkman:pacman.conf[5]. Use one '\--clean' switch to only remove
    packages that are no longer installed; use two to remove all packages
    from the cache. In both cases, you will have a yes or no option to
    remove packages and/or unused downloaded databases.
+
If you use a network shared cache, see the 'CleanMethod' option in
linkman:pacman.conf[5].

*-g, \--groups*::
    Display all the members for each package group specified. If no group
    names are provided, all groups will be listed; pass the flag twice to
    view all groups and their members.

*-i, \--info*::
    Display dependency and other information for a given package. This will
    search through all repositories for a matching package.

*-l, \--list*::
    List all packages in the specified repositories. Multiple repositories
    can be specified on the command line.

*-p, \--print-uris*::
    Print out URIs for each package that will be installed, including any
    dependencies yet to be installed. These can be piped to a file and
    downloaded at a later time, using a program like wget.

*-q, \--quiet*::
    Show less information for certain sync operations. (This is useful when
    pacman's output is processed in a script.) Search will only show package
    names and not repo, version, group, and description information; list
    will only show package names and omit databases and versions; group will
    only show package names and omit group names.

*-s, \--search* <'regexp'>::
    This will search each package in the sync databases for names or
    descriptions that match `regexp`.

*-u, \--sysupgrade*::
    Upgrades all packages that are out of date. Each currently-installed
    package will be examined and upgraded if a newer package exists. A
    report of all packages to upgrade will be presented and  the operation
    will not proceed without user confirmation. Dependencies are
    automatically resolved at this level and will be installed/upgraded if
    necessary.

*-w, \--downloadonly*::
    Retrieve all packages from the server, but do not install/upgrade
    anything.

*-y, \--refresh*::
    Download a fresh copy of the master package list from the server(s)
    defined in linkman:pacman.conf[5]. This should typically be used each time
    you use '\--sysupgrade' or '-u'. Passing two '\--refresh' or '-y' flags
    will force a refresh of all package lists even if they are thought to be up
    to date.

*\--needed*::
    Don't reinstall the targets that are already up-to-date.

*\--ignore* <'package'>::
    Directs pacman to ignore upgrades of package even if there is one
    available. Multiple packages can be specified by separating them
    with a comma.

*\--ignoregroup* <'group'>::
    Directs pacman to ignore upgrades of all packages in 'group' even if
    there is one available. Multiple groups can be specified by
    separating them with a comma.


Handling Config Files[[HCF]]
----------------------------
Pacman uses the same logic as rpm to determine action against files that are
designated to be backed up. During an upgrade, 3 md5 hashes are used for each
backup file to determine the required action: one for the original file
installed, one for the new file that's about to be installed, and one for the
actual file existing on the filesystem. After comparing these 3 hashes, the
follow scenarios can result:

original=X, current=X, new=X::
    All three files are the same, so overwrites are not an issue Install the
    new file.

original=X, current=X, new=Y::
    The current file is the same as the original but the new one differs.
    Since the user did not ever modify the file, and the new one may contain
    improvements or bugfixes, install the new file.

original=X, current=Y, new=X::
    Both package versions contain the exact same file, but the one on the
    filesystem has  been  modified. Leave the current file in place.

original=X, current=Y, new=Y::
    The new file is identical to the current file. Install the new file.

original=X, current=Y, new=Z::
    All three files are different, so install the new file with a '.pacnew'
    extension and warn the user. The user must then manually merge any
    necessary changes into the original file.


Configuration
-------------
See linkman:pacman.conf[5] for more details on configuring pacman using the
'pacman.conf' file.


See Also
--------
linkman:pacman.conf[5], linkman:makepkg[8], linkman:libalpm[3]

include::footer.txt[]