summaryrefslogtreecommitdiff
path: root/main/dpkg.8
blob: fabf8028a1b00cd08e0d31afa67faebf6f28bac9 (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
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
.TH DPKG 8 "February 2000" "Debian Project" "dpkg suite"
.SH NAME
dpkg \- medium-level package manager for Debian
..
.SH SYNOPSIS
.B dpkg
[\fIoptions\fP] \fIaction\fP
..
.SH WARNING
This manual is intended for users wishing to understand \fBdpkg\fP's
command line options and package states in more detail than that
provided by \fBdpkg --help\fP.
.PP
It should \fInot\fP be used by package maintainers wishing to
understand how \fBdpkg\fP will install their packages.  The
descriptions of what \fBdpkg\fP does when installing and removing
packages are particularly inadequate.
.PP
For information about this, please refer to sections regarding the
Debian packaging system in the Debian FAQ or the Debian Reference.
..
.SH DESCRIPTION
\fBdpkg\fP is a medium-level tool to install, build, remove and manage
Debian packages. \fBdpkg\fP is
controlled entirely via command line parameters, which consist of exactly
one action and zero or more options. The action-parameter tells dpkg
what to do and options control the behavior of the action in some way.
.PP
\fBdpkg\fP can be also be used as a front-end to \fBdpkg-deb\fP.
The following
are \fBdpkg-deb\fP actions, and if they are encountered, \fBdpkg\fP
just runs \fBdpkg-deb\fP with the parameters given to it:
.nf
    \fB-b\fP, \fB--build\fP,
    \fB-c\fP, \fB--contents\fP,
    \fB-I\fP, \fB--info\fP,
    \fB-f\fP, \fB--field\fP,
    \fB-e\fP, \fB--control\fP,
    \fB-x\fP, \fB--extract\fP,
    \fB-X\fP, \fB--vextract\fP, and
    \fB--fsys-tarfile\fP.
.fi
Please refer to \fBdpkg-deb\fP(1) for information about these actions.
.PP
Note: the primary and more user-friendly front-end for \fBdpkg\fP is
\fBdselect\fP(8). There are other front-ends such as those based on
\fBapt\fP(8).
..
.SH INFORMATION ABOUT PACKAGES
\fBdpkg\fP maintains some usable information about available
packages. The information is divided in three classes: \fBstates\fP,
\fBselection states\fP and \fBflags\fP.  These values are intended to
be changed mainly with \fBdselect\fP.
.SS PACKAGE STATES
.TP
.B installed
The package is unpacked and configured OK.
.TP
.B half-installed
The installation of the package has been started, but not completed for
some reason.
.TP
.B not-installed
The package is not installed on your system.
.TP
.B unpacked
The package is unpacked, but not configured.
.TP
.B half-configured
The package is unpacked and configuration has been started, but not yet
completed for some reason.
.TP
.B config-files
Only the configuration files of the package exist on the system.
.SS PACKAGE SELECTION STATES
.TP
.B install
The package is selected for installation.
.TP
.B deinstall
The package is selected for deinstallation (i.e. we want to remove all
files, except configuration files).
.TP
.B purge
The package is selected to be purged (i.e. we want to remove everything,
even configuration files).
.SS PACKAGE FLAGS
.TP
.B hold
A package marked to be on \fBhold\fP is not handled by \fBdpkg\fP,
unless forced to do that with option \fB--force-hold\fP.
.TP
.B reinst-required
A package marked \fBreinst-required\fP is broken and requires
reinstallation. These packages cannot be removed, unless forced with
option \fB--force-reinstreq\fP.
..
.SH ACTIONS
.TP
\fBdpkg -i\fP | \fB--install\fP \fIpackage_file\fP...
Install the package. If \fB--recursive\fP or \fB-R\fP option is
specified, \fIpackage_file\fP must refer to a directory instead.
.PP
Installation consists of the following steps:
.br
\fB1.\fP Extract the control files of the new package.
.br
\fB2.\fP If another version of the same package was installed before
the new installation, execute \fIprerm\fP script of the old package.
.br
\fB3.\fP Run \fIpreinst\fP script, if provided by the package.
.br
\fB4.\fP Unpack the new files, and at the same time back up the old
files, so that if something goes wrong, they can be restored.
.br
\fB5.\fP If another version of the same package was installed before
the new installation, execute the \fIpostrm\fP script of the old
package. Note that this script is executed after the \fIpreinst\fP
script of the new package, because new files are written at the same
time old files are removed.
.br
\fB6.\fP Configure the package. See \fB--configure\fP for detailed
information about how this is done.
.TP
\fBdpkg --unpack \fP\fIpackage_file\fP ...
Unpack the package, but don't configure it. If \fB--recursive\fP or
\fB-R\fP option is specified, \fIpackage_file\fP must refer to a
directory instead.
.TP
\fBdpkg --configure \fP\fIpackage\fP ... | \fB-a\fP | \fB--pending\fP
Reconfigure an unpacked package.  If \fB-a\fP or \fB--pending\fP is
given instead of \fIpackage\fP, all unpacked but unconfigured
packages are configured.
.PP
Configuring consists of the following steps:
.br
\fB1.\fP Unpack the configuration files, and at the same time back up
the old configuration files, so that they can be restored if
something goes wrong.
.br
\fB2.\fP Run \fIpostinst\fP script, if provided by the package.
.TP
\fBdpkg -r\fP | \fB--remove\fP | \fB-P\fP | \fB--purge \fP\fIpackage\fP ... | \fB-a\fP | \fB--pending\fP
Remove an installed package.  \fB-r\fP or \fB--remove\fP remove
everything except configuration files.  This may avoid having to
reconfigure the package if it is reinstalled later.  (Configuration
files are the files listed in the \fIdebian/conffiles\fP control
file).  \fB-P\fP or \fB--purge\fP removes everything, including configuration
files.  If \fB-a\fP or \fB--pending\fP is given instead of a package
name, then all packages unpacked, but marked to be removed or purged
in file \fI/var/lib/dpkg/status\fP, are removed or purged,
respectively.
.PP
Removing of a package consists of the following steps:
.br
\fB1.\fP Run \fIprerm\fP script
.br
\fB2.\fP Remove the installed files
.br
\fB3.\fP Run \fIpostrm\fP script
.br
.TP
.BI "dpkg  -p|--print-avail " package
Display details about \fIpackage\fP, as found in
\fI/var/lib/dpkg/available\fP.
.TP
\fBdpkg --update-avail\fP | \fB--merge-avail\fP \fIPackages-file\fP
Update \fBdpkg\fP's and \fBdselect\fP's idea of which packages are
available.  With action \fB--merge-avail\fP, old information is
combined with information from \fIPackages-file\fP.  With action
\fB--update-avail\fP, old information is replaced with the information
in the \fIPackages-file\fP.  The \fIPackages-file\fP distributed with
Debian is simply named \fIPackages\fP.  \fBdpkg\fP keeps its
record of available packages in \fI/var/lib/dpkg/available\fP.
.TP
\fBdpkg -A\fP | \fB--record-avail\fP \fIpackage_file\fP ...
Update \fBdpkg\fP and \fBdselect\fP's idea of which packages are
available with information from the package \fIpackage_file\fP.  If
\fB--recursive\fP or \fB-R\fP option is specified, \fIpackage_file\fP
must refer to a directory instead.
.TP
.B dpkg --forget-old-unavail
Forget about uninstalled unavailable packages.
.TP
.B dpkg --clear-avail
Erase the existing information about what packages are available.
.TP
\fBdpkg -l\fP | \fB--list\fP \fIpackage-name-pattern\fP ...
List packages matching given pattern. If no \fIpackage-name-pattern\fP
is given, list all packages in \fI/var/lib/dpkg/available\fP.  Normal
shell wildchars are allowed in \fIpackage-name-pattern\fP.  (You will
probably have to quote \fIpackage-name-pattern\fP to prevent the shell
from performing filename expansion.  For example, \fBdpkg -l 'libc5*'\fP will list all the package names starting with "libc5".)
.TP
\fBdpkg -s\fP | \fB--status\fP \fIpackage-name\fP ...
Report status of specified package. This just displays the entry in
the installed package status database.
.TP
\fBdpkg -C\fP | \fB--audit\fP
Searches for packages that have been installed only partially on your
system.  \fBdpkg\fP will suggest what to do with them to get them
working.
.TP
\fBdpkg --get-selections\fP [\fIpattern\fP...]
Get list of package selections, and write it to stdout.
.TP
.B dpkg --set-selections
Set package selections using file read from stdin.
.TP
.B dpkg --yet-to-unpack
Searches for packages selected for installation, but which for some
reason still haven't been installed.
.TP
\fBdpkg -L\fP | \fB--listfiles\fP \fIpackage\fP ...
List files installed to your system from \fBpackage\fP.
However, note that files created by package-specific
installation-scripts are not listed.
.TP
\fBdpkg -S\fP | \fB--search\fP \fIfilename-search-pattern\fP ...
Search for a filename from installed packages. All standard shell
wildchars can be used in the pattern.
.TP
.B dpkg --print-architecture
Print target architecture (for example, "i386").  This option uses
\fBgcc\fP.
.TP
.B dpkg --print-gnu-build-architecture
Print GNU version of target architecture (for example, "i486").
.TP
.B dpkg --print-installation-architecture
Print host architecture for installation.
.TP
.B dpkg --compare-versions \fIver1 op ver2\fP
Compare version numbers, where \fIop\fP is a binary operator.  \fBdpkg\fP
returns success (zero result) if the specified condition is satisfied,
and failure (nonzero result) otherwise.  There are
two groups of operators, which differ in how they treat a missing
\fIver1\fP or \fIver2\fP.  These treat no version as earlier than any
version: \fBlt le eq ne ge gt\fP.  These treat no version as later
than any version: \fBlt-nl le-nl ge-nl gt-nl\fP.  These are provided
only for compatibility with control file syntax: \fB< << <= = >= >>
>\fP.
.TP
.B dpkg --command-fd <n>
Accept a series of commands on input file descriptor \fB<n>\fP.  Note:
additional options set on the command line, and thru this file descriptor,
are not reset for subsequent commands executed during the same run.
.TP
.B dpkg --help
Display the usage instructions.
.TP
.B dpkg --force-help
Give help about the \fB--force-\fP\fIthing\fP options.
.TP
.BR "dpkg -Dh " | " --debug=help"
Give help about debugging options.
.TP
\fBdpkg --licence\fP | \fBdpkg --license\fP
Display \fBdpkg\fP copyright and licence information.
.TP
\fBdpkg --version\fP
Display \fBdpkg\fP version information.
.TP
\fBdpkg-deb-actions\fP
See \fBdpkg-deb\fP(1) for more information about the following actions.
.PP
.nf
\fBdpkg -b\fP | \fB--build\fP \fIdirectory\fP [\fIfilename\fP]
    Build a deb package.
\fBdpkg -c\fP | \fB--contents\fP \fIfilename\fP
    List contents of a deb package.
\fBdpkg -e\fP | \fB--control\fP \fIfilename\fP [\fIdirectory\fP]
    Extract control-information from a package.
\fBdpkg -x\fP | \fB--extract\fP \fIfilename directory\fP
    Extract the files contained by package.
\fBdpkg -f\fP | \fB--field\fP  \fIfilename\fP [\fIcontrol-field\fP] ...
    Display control field(s) of a package.
\fBdpkg --fsys-tarfile\fP \fIfilename\fP
    Display the filesystem tar-file contained by a
    Debian package.
\fBdpkg -I\fP | \fB--info\fP \fIfilename\fP [\fIcontrol-file\fP]
    Show information about a package.
\fBdpkg -X\fP | \fB--vextract\fP \fIfilename\fP \fIdirectory\fP
    Extract and display the filenames contained by a
    package.
.fi
..
.SH OPTIONS
All options can be specified both on the commandline and in the \fBdpkg\fP
configuration file \fI/etc/dpkg/dpkg.cfg\fP. Each line in the configuration
file is either an option (exactly the same as the commandline option but
without leading dashes) or a comment (if it starts with a \fB#\fR).
.br
.TP
\fB--abort-after=\fP\fInumber\fP
Change after how many errors dpkg will abort. The default is 50.
.TP
.BR -B | --auto-deconfigure
When a package is removed, there is a possibility that another
installed package depended on the removed package. Specifying this
option will cause automatic deconfiguration of the package which
depended on the removed package.
.TP
\fB-D\fIoctal\fP | \fB--debug=\fP\fIoctal\fP
Set debugging on.  \fIoctal\fP is formed by bitwise-orring desired
values together from the list below (note that these values may change
in future releases).  \fB-Dh\fP or \fB--debug=help\fP display these
debugging values.

 number  description
    1   Generally helpful progress information
    2   Invocation and status of maintainer scripts
   10   Output for each file processed
  100   Lots of output for each file processed
   20   Output for each configuration file
  200   Lots of output for each configuration file
   40   Dependencies and conflicts
  400   Lots of dependencies/conflicts output
 1000   Lots of drivel about e.g. the dpkg/info dir
 2000   Insane amounts of drivel
.TP
\fB--force-\fP\fIthings\fP | \fB--no-force-\fP\fIthings\fP | \fB--refuse-\fP\fIthings\fP
Force or refuse (\fBno-force\fP and \fBrefuse\fP mean the same thing)
to do some things.  \fIthings\fP is a comma separated list of things
specified below.  \fB--force-help\fP displays a message describing them.
Things marked with (*) are forced by default.
.PP
\fIWarning: These options are mostly intended to be used by experts
only. Using them without fully understanding their effects may break
your whole system.\fP
.br
\fBall\fP:
Turns on(or off) all force options.
.br
\fBauto-select\fP(*):
Select packages to install them, and deselect packages to remove them.
.br
\fBdowngrade\fP(*):
Install a package, even if newer version of it is already installed.
.br
\fBconfigure-any\fP:
Configure also any unpacked but unconfigured packages on which the current
package depends.
.br
\fBhold\fP:
Process packages even when marked "hold".
.br
\fBremove-reinstreq\fP:
Remove a package, even if it's broken and marked to require
reinstallation.  This may, for example, cause parts of the package to
remain on the system, which will then be forgotten by \fBdpkg\fP.
.br
\fBremove-essential\fP:
Remove, even if the package is considered essential. Essential
packages contain mostly very basic Unix commands. Removing them might
cause the whole system to stop working, so use with caution.
.br
\fBdepends\fP:
Turn all dependency problems into warnings.
.br
\fBdepends-version\fP:
Don't care about versions when checking dependencies.
.br
\fBconflicts\fP:
Install, even if it conflicts with another package. This is dangerous,
for it will usually cause overwriting of some files.
.br
\fBconfmiss\fP:
Always install a missing configuration file. This is dangerous,
since it means not preserving a change (removing) made to the
file.
.br
\fBconfnew\fP:
If a conffile has been modified always install the new version without
prompting, unless the \fB--force-confdef\fP is also specified, in
which case the default action is preferred.
.br
\fBconfold\fP:
If a conffile has been modified always keep the old version without
prompting, unless the \fB--force-confdef\fP is also specified, in
which case the default action is preferred.
.br
\fBconfdef\fP:
If a conffile has been modified always choose the default action. If
there is no default action it will stop to ask the user unless 
\fB--force-confnew\fP or \fB--force-confold\fP is also been given, in
which case it will use that to decide the final action.
.br
\fBoverwrite\fP:
Overwrite one package's file with another's file.
.br
\fBoverwrite-dir\fP:
Overwrite one package's directory with another's file.
.br
\fBoverwrite-diverted\fP:
Overwrite a diverted file with an undiverted version.
.br
\fBarchitecture\fP:
Process even packages with the wrong architecture.
.br
\fBbad-path\fP:
\fBPATH\fP is missing important programs, so problems are likely.
.br
\fBnot-root\fP:
Try to (de)install things even when not root.
.br
.TP
\fB--ignore-depends\fP=\fIpackage\fP,...
Ignore dependency-checking for specified packages (actually, checking is
performed, but only warnings about conflicts are given, nothing else).
.TP
\fB--new\fP | \fB--old\fP
Select new or old binary package format. This is a \fBdpkg-deb\fP(1)
option.
.TP
.B --nocheck
Don't read or check contents of control file while building a package.
This is a \fBdpkg-deb\fP(1) option.
.TP
.B --no-act
Do everything which is supposed to be done, but don't write any
changes. This is used to see what would happen with the specified
action, without actually modifying anything.
.PP
Be sure to give \fB--no-act\fP before the action-parameter, or you might
end up with undesirable results.  (e.g.  \fBdpkg --purge foo
--no-act\fP will first purge package foo and then try to purge package
--no-act, even though you probably expected it to actually do nothing!)
.TP
\fB-R\fP | \fB--recursive\fP
Recursively handle all regular files matching pattern \fB*.deb\fP
found at specified directories and all of its subdirectories. This can
be used with \fB-i\fP, \fB-A\fP, \fB--install\fP, \fB--unpack\fP and
\fB--avail\fP actions.
.TP
\fB-G\fP
Don't install a package if a newer version of the same package is already
installed. This is an alias of \fB--refuse-downgrade.\fP
.TP
\fB--root=\fP\fIdir\fP | \fB--admindir=\fP\fIdir\fP | \fB--instdir=\fP\fIdir\fP
Change default directories.  \fBadmindir\fP defaults to
\fI/var/lib/dpkg\fP and contains many files that give information
about status of installed or uninstalled packages, etc.  \fBinstdir\fP
defaults to \fI/\fP and refers to the directory where packages are to
be installed.  \fBinstdir\fP is also the directory passed to
\fBchroot\fP(2) before running \fIpackage\fP's installation scripts, which
means that the scripts see \fBinstdir\fP as a root directory.
Changing \fBroot\fP changes \fBinstdir\fP to \fIdir\fP and
\fBadmindir\fP to \fIdir\fP\fB/var/lib/dpkg\fP.
.TP
\fB-O\fP | \fB--selected-only\fP
Only process the packages that are selected for installation. The
actual marking is done with \fBdselect\fP or by \fBdpkg\fP, when it
handles packages.  For example, when a package is removed, it will
be marked selected for installation.
.TP
.BR -E " | " --skip-same-version
Don't install the package if the same version of the package is already
installed.
.TP
\fB--status-fd \fP\fI<n>\fP
Send package status info to file descriptor \fI<n>\fP.  This can be given
multiple times.  Status updates are of the form `status: <pkg>: <pkg qstate>'.
..
.SH FILES
.TP
.I /etc/dpkg/dpkg.cfg
Configuration file with default options.
.P
The other files listed below are in their default directories, see option
\fB--admindir\fP to see how to change locations of these files.
.TP
.I /var/lib/dpkg/available
List of available packages.
.TP
.I /var/lib/dpkg/status
Statuses of available packages. This file contains information about
whether a package is marked for removing or not, whether it is
installed or not, etc. See section \fBINFORMATION ABOUT PACKAGES\fP
for more info.
.P
The following files are components of a binary package.  See \fBdeb\fP(5)
for more information about them:
.TP
.I control
.TP
.I conffiles
.TP
.I preinst
.TP
.I postinst
.TP
.I prerm
.TP
.I postrm
..
.SH ENVIRONMENT VARIABLES
.TP
.B DPKG_NO_TSTP
Define this to something if you prefer \fBdpkg\fP starting a new
shell rather than suspending itself, while doing a shell escape.
.TP
.B SHELL
The program \fBdpkg\fP will execute while starting a new shell.
.TP
.B COLUMNS
Sets the number of columns \fBdpkg\fP should use when displaying formatted
text.  Currently only used by -l.
.TP
.B DPKG_OLD_CONFFILE
Set by \fBdpkg\fP to the filename of the old configuration file 
when you start a shell to examine a changed configuration.
file.
.TP
.B DPKG_NEW_CONFFILE
Set by \fBdpkg\fP to the filename of the newversion of a configuration file
when you start a shell to examine a changed configuration.
file.
..
.SH EXAMPLES
To list packages containing the string `vi' in their name:
.br
\fB     dpkg -l '*vi*'\fP
.PP
To see the entries in \fI/var/lib/dpkg/available\fP on several packages:
.br
\fB     dpkg -p base-files login xfree86-common | pager\fP
.PP
To remove an installed package named "elvis":
.br
\fB     dpkg -r elvis\fP
.PP
To install a package, you first need to find it in an archive or
CDROM.  The "available" file shows that the vim package is in section
"editors":
.br
\fB     cd /cdrom/hamm/hamm/binary/editors\fP
\fB     dpkg -i vim_4.5-3.deb\fP
.br
(Note: \fBapt-get\fP(8) is commonly used for this.)
.PP
To make a local copy of the package selection states:
.br
\fB     dpkg --get-selections >myselections\fP
.PP
You might transfer this file to another computer, and install it there
with:
.br
\fB     dpkg --set-selections <myselections\fP
.br
Note that this will not actually install or remove anything, but just
set the selection state on the requested packages.  You will need some
other application to actually download and install the requested
packages.
.PP
Ordinarily, you will find that \fBdselect\fP(8) provides a more
convenient way to modify the package selection states.
..
.SH SEE ALSO
.BR dpkg-deb (1),
.BR deb (5),
.BR deb-control (5),
.BR dselect (8),
.BR apt (8).
..
.SH BUGS/RESTRICTIONS
dpkg doesn't do any intelligent package ordering on installation.
.br
There is no automatic logging ability in dpkg.
.br
Depending package relations may sometimes get out of sync on upgrades
(e.g. exact dependencies of a library -dev package on the library package).
.PP
The --no-act option usually gives less information than might be helpful.
.br
There is no --status information for virtual packages.
..
.SH AUTHORS
.nf
\fBdpkg\fP was originally written by Ian Jackson, and later updated by
many other people, full list of which you may find in the
\fB/usr/share/doc/dpkg/THANKS\fP file.
.fi