dpkg (1.18.25) stretch; urgency=medium
[dpkg] / man / dpkg.man
1 .\" dpkg manual page - dpkg(1)
2 .\"
3 .\" Copyright © 1996 Juho Vuori <javuori@cc.helsinki.fi>
4 .\" Copyright © 1999 Jim Van Zandt <jrv@vanzandt.mv.com>
5 .\" Copyright © 1999-2003 Wichert Akkerman <wakkerma@debian.org>
6 .\" Copyright © 2000-2003 Adam Heath <doogie@debian.org>
7 .\" Copyright © 2002 Josip Rodin
8 .\" Copyright © 2004-2005 Scott James Remnant <keybuk@debian.org>
9 .\" Copyright © 2006-2016 Guillem Jover <guillem@debian.org>
10 .\" Copyright © 2007-2008 Ian Jackson <ijackson@chiark.greenend.org.uk>
11 .\" Copyright © 2008-2011 Raphaël Hertzog <hertzog@debian.org>
12 .\"
13 .\" This is free software; you can redistribute it and/or modify
14 .\" it under the terms of the GNU General Public License as published by
15 .\" the Free Software Foundation; either version 2 of the License, or
16 .\" (at your option) any later version.
17 .\"
18 .\" This is distributed in the hope that it will be useful,
19 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
20 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 .\" GNU General Public License for more details.
22 .\"
23 .\" You should have received a copy of the GNU General Public License
24 .\" along with this program. If not, see <https://www.gnu.org/licenses/>.
25 .
26 .TH dpkg 1 "%RELEASE_DATE%" "%VERSION%" "dpkg suite"
27 .nh
28 .SH NAME
29 dpkg \- package manager for Debian
30 .
31 .SH SYNOPSIS
32 .B dpkg
33 .RI [ option "...] " action
34 .
35 .SH WARNING
36 This manual is intended for users wishing to understand \fBdpkg\fP's
37 command line options and package states in more detail than that
38 provided by \fBdpkg \-\-help\fP.
39
40 It should \fInot\fP be used by package maintainers wishing to
41 understand how \fBdpkg\fP will install their packages. The
42 descriptions of what \fBdpkg\fP does when installing and removing
43 packages are particularly inadequate.
44 .
45 .SH DESCRIPTION
46 \fBdpkg\fP is a tool to install, build, remove and manage
47 Debian packages. The primary and more user-friendly
48 front-end for \fBdpkg\fP is \fBaptitude\fP(1). \fBdpkg\fP itself is
49 controlled entirely via command line parameters, which consist of exactly
50 one action and zero or more options. The action-parameter tells \fBdpkg\fP
51 what to do and options control the behavior of the action in some way.
52
53 \fBdpkg\fP can also be used as a front-end to \fBdpkg\-deb\fP(1) and
54 \fBdpkg\-query\fP(1). The list of supported actions can be found later on
55 in the \fBACTIONS\fP section. If any such action is encountered \fBdpkg\fP
56 just runs \fBdpkg\-deb\fP or \fBdpkg\-query\fP with the parameters given
57 to it, but no specific options are currently passed to them, to use
58 any such option the back-ends need to be called directly.
59 .
60 .SH INFORMATION ABOUT PACKAGES
61 \fBdpkg\fP maintains some usable information about available
62 packages. The information is divided in three classes: \fBstates\fP,
63 \fBselection states\fP and \fBflags\fP. These values are intended to
64 be changed mainly with \fBdselect\fP.
65 .SS Package states
66 .TP
67 .B not\-installed
68 The package is not installed on your system.
69 .TP
70 .B config\-files
71 Only the configuration files of the package exist on the system.
72 .TP
73 .B half\-installed
74 The installation of the package has been started, but not completed for
75 some reason.
76 .TP
77 .B unpacked
78 The package is unpacked, but not configured.
79 .TP
80 .B half\-configured
81 The package is unpacked and configuration has been started, but not yet
82 completed for some reason.
83 .TP
84 .B triggers\-awaited
85 The package awaits trigger processing by another package.
86 .TP
87 .B triggers\-pending
88 The package has been triggered.
89 .TP
90 .B installed
91 The package is correctly unpacked and configured.
92 .SS Package selection states
93 .TP
94 .B install
95 The package is selected for installation.
96 .TP
97 .B hold
98 A package marked to be on \fBhold\fP is not handled by \fBdpkg\fP,
99 unless forced to do that with option \fB\-\-force\-hold\fP.
100 .TP
101 .B deinstall
102 The package is selected for deinstallation (i.e. we want to remove all
103 files, except configuration files).
104 .TP
105 .B purge
106 The package is selected to be purged (i.e. we want to remove everything
107 from system directories, even configuration files).
108 .SS Package flags
109 .TP
110 .B ok
111 A package marked \fBok\fP is in a known state, but might need further
112 processing.
113 .TP
114 .B reinstreq
115 A package marked \fBreinstreq\fP is broken and requires
116 reinstallation. These packages cannot be removed, unless forced with
117 option \fB\-\-force\-remove\-reinstreq\fP.
118 .
119 .SH ACTIONS
120 .TP
121 \fB\-i\fP, \fB\-\-install\fP \fIpackage-file\fP...
122 Install the package. If \fB\-\-recursive\fP or \fB\-R\fP option is
123 specified, \fIpackage-file\fP must refer to a directory instead.
124
125 Installation consists of the following steps:
126 .br
127
128 \fB1.\fP Extract the control files of the new package.
129 .br
130
131 \fB2.\fP If another version of the same package was installed before
132 the new installation, execute \fIprerm\fP script of the old package.
133 .br
134
135 \fB3.\fP Run \fIpreinst\fP script, if provided by the package.
136 .br
137
138 \fB4.\fP Unpack the new files, and at the same time back up the old
139 files, so that if something goes wrong, they can be restored.
140 .br
141
142 \fB5.\fP If another version of the same package was installed before
143 the new installation, execute the \fIpostrm\fP script of the old
144 package. Note that this script is executed after the \fIpreinst\fP
145 script of the new package, because new files are written at the same
146 time old files are removed.
147 .br
148
149 \fB6.\fP Configure the package. See \fB\-\-configure\fP for detailed
150 information about how this is done.
151 .TP
152 \fB\-\-unpack \fP\fIpackage-file\fP...
153 Unpack the package, but don't configure it. If \fB\-\-recursive\fP or
154 \fB\-R\fP option is specified, \fIpackage-file\fP must refer to a
155 directory instead.
156 .TP
157 \fB\-\-configure \fP\fIpackage\fP...|\fB\-a\fP|\fB\-\-pending\fP
158 Configure a package which has been unpacked but not yet configured.
159 If \fB\-a\fP or \fB\-\-pending\fP is given instead of \fIpackage\fP,
160 all unpacked but unconfigured packages are configured.
161
162 To reconfigure a package which has already been configured, try the
163 .BR dpkg\-reconfigure (8)
164 command instead.
165
166 Configuring consists of the following steps:
167 .br
168
169 \fB1.\fP Unpack the conffiles, and at the same time back up
170 the old conffiles, so that they can be restored if
171 something goes wrong.
172 .br
173
174 \fB2.\fP Run \fIpostinst\fP script, if provided by the package.
175 .TP
176 \fB\-\-triggers\-only\fP \fIpackage\fP...|\fB\-a\fP|\fB\-\-pending\fP
177 Processes only triggers (since dpkg 1.14.17).
178 All pending triggers will be processed.
179 If package
180 names are supplied only those packages' triggers will be processed, exactly
181 once each where necessary. Use of this option may leave packages in the
182 improper \fBtriggers\-awaited\fP and \fBtriggers\-pending\fP states. This
183 can be fixed later by running: \fBdpkg \-\-configure \-\-pending\fP.
184 .TP
185 \fB\-r\fP, \fB\-\-remove\fP \fIpackage\fP...|\fB\-a\fP|\fB\-\-pending\fP
186 Remove an installed package. This removes everything except conffiles,
187 which may avoid having to reconfigure the package if it is reinstalled
188 later (conffiles are configuration files that are listed in the
189 \fIDEBIAN/conffiles\fP control file).
190 If \fB\-a\fP or \fB\-\-pending\fP is given instead of a package name,
191 then all packages unpacked, but marked to be removed in file
192 \fI%ADMINDIR%/status\fP, are removed.
193
194 Removing of a package consists of the following steps:
195 .br
196
197 \fB1.\fP Run \fIprerm\fP script
198 .br
199
200 \fB2.\fP Remove the installed files
201 .br
202
203 \fB3.\fP Run \fIpostrm\fP script
204 .br
205
206 .TP
207 \fB\-P\fP, \fB\-\-purge\fP \fIpackage\fP...|\fB\-a\fP|\fB\-\-pending\fP
208 Purge an installed or already removed package. This removes everything,
209 including conffiles.
210 If \fB\-a\fP or \fB\-\-pending\fP is given instead of a package name,
211 then all packages unpacked or removed, but marked to be purged in file
212 \fI%ADMINDIR%/status\fP, are purged.
213
214 Note: some configuration files might be unknown to \fBdpkg\fP because they
215 are created and handled separately through the configuration scripts. In
216 that case, \fBdpkg\fP won't remove them by itself, but the package's
217 \fIpostrm\fP script (which is called by \fBdpkg\fP), has to take care of
218 their removal during purge. Of course, this only applies to files in
219 system directories, not configuration files written to individual users'
220 home directories.
221
222 Purging of a package consists of the following steps:
223 .br
224
225 \fB1.\fP Remove the package, if not already removed. See \fB\-\-remove\fP
226 for detailed information about how this is done.
227 .br
228
229 \fB2.\fP Run \fIpostrm\fP script.
230 .br
231 .TP
232 .BR \-V ", " \-\-verify " [\fIpackage-name\fP...]
233 Verifies the integrity of \fIpackage-name\fP or all packages if omitted,
234 by comparing information from the files installed by a package with the
235 files metadata information stored in the \fBdpkg\fP database
236 (since dpkg 1.17.2).
237 The origin
238 of the files metadata information in the database is the binary packages
239 themselves. That metadata gets collected at package unpack time during
240 the installation process.
241
242 Currently the only functional check performed is an md5sum verification
243 of the file contents against the stored value in the files database.
244 It will only get checked
245 if the database contains the file md5sum. To check for any missing
246 metadata in the database, the \fB\-\-audit\fP command can be used.
247
248 The output format is selectable with the \fB\-\-verify\-format\fP
249 option, which by default uses the \fBrpm\fP format, but that might
250 change in the future, and as such, programs parsing this command
251 output should be explicit about the format they expect.
252 .TP
253 .BR \-C ", " \-\-audit " [\fIpackage-name\fP...]
254 Performs database sanity and consistency checks for \fIpackage-name\fP
255 or all packages if omitted (per package checks since dpkg 1.17.10).
256 For example, searches for packages that have been installed only partially
257 on your system or that have missing, wrong or obsolete control data or
258 files. \fBdpkg\fP will suggest what to do with them to get them fixed.
259 .TP
260 .BR \-\-update\-avail " [\fIPackages-file\fP]"
261 .TQ
262 .BR \-\-merge\-avail " [\fIPackages-file\fP]"
263 Update \fBdpkg\fP's and \fBdselect\fP's idea of which packages are
264 available. With action \fB\-\-merge\-avail\fP, old information is
265 combined with information from \fIPackages-file\fP. With action
266 \fB\-\-update\-avail\fP, old information is replaced with the information
267 in the \fIPackages-file\fP. The \fIPackages-file\fP distributed with
268 Debian is simply named «\fIPackages\fP». If the \fIPackages-file\fP
269 argument is missing or named «\fB\-\fP» then it will be read from
270 standard input (since dpkg 1.17.7). \fBdpkg\fP keeps its record of
271 available packages in \fI%ADMINDIR%/available\fP.
272
273 A simpler one-shot command to retrieve and update the \fIavailable\fR
274 file is \fBdselect update\fR. Note that this file is mostly useless
275 if you don't use \fBdselect\fR but an APT-based frontend: APT has its
276 own system to keep track of available packages.
277 .TP
278 \fB\-A\fP, \fB\-\-record\-avail\fP \fIpackage-file\fP...
279 Update \fBdpkg\fP and \fBdselect\fP's idea of which packages are
280 available with information from the package \fIpackage-file\fP. If
281 \fB\-\-recursive\fP or \fB\-R\fP option is specified, \fIpackage-file\fP
282 must refer to a directory instead.
283 .TP
284 .B \-\-forget\-old\-unavail
285 Now \fBobsolete\fP and a no-op as \fBdpkg\fP will automatically forget
286 uninstalled unavailable packages (since dpkg 1.15.4), but only those that
287 do not contain user information such as package selections.
288 .TP
289 .B \-\-clear\-avail
290 Erase the existing information about what packages are available.
291 .TP
292 \fB\-\-get\-selections\fP [\fIpackage-name-pattern\fP...]
293 Get list of package selections, and write it to stdout. Without a pattern,
294 non-installed packages (i.e. those which have been previously purged) will
295 not be shown.
296 .TP
297 .B \-\-set\-selections
298 Set package selections using file read from stdin. This file should be
299 in the format “\fIpackage\fP \fIstate\fP”, where state is one of
300 \fBinstall\fP, \fBhold\fP, \fBdeinstall\fP or \fBpurge\fP. Blank lines
301 and comment lines beginning with ‘\fB#\fP’ are also permitted.
302
303 The \fIavailable\fP file needs to be up-to-date for this command to be
304 useful, otherwise unknown packages will be ignored with a warning. See
305 the \fB\-\-update\-avail\fP and \fB\-\-merge\-avail\fP commands for more
306 information.
307 .TP
308 .B \-\-clear\-selections
309 Set the requested state of every non-essential package to deinstall
310 (since dpkg 1.13.18).
311 This is intended to be used immediately before \fB\-\-set\-selections\fP,
312 to deinstall any packages not in list given to \fB\-\-set\-selections\fP.
313 .TP
314 .B \-\-yet\-to\-unpack
315 Searches for packages selected for installation, but which for some
316 reason still haven't been installed.
317 .TP
318 .B \-\-predep\-package
319 Print a single package which is the target of one or more relevant
320 pre-dependencies and has itself no unsatisfied pre-dependencies.
321 .IP
322 If such a package is present, output it as a Packages file entry,
323 which can be massaged as appropriate.
324 .IP
325 Returns 0 when a package is printed, 1 when no suitable package is
326 available and 2 on error.
327 .TP
328 .B \-\-add\-architecture \fIarchitecture\fP
329 Add \fIarchitecture\fP to the list of architectures for which packages can
330 be installed without using \fB\-\-force\-architecture\fP (since dpkg 1.16.2).
331 The architecture
332 \fBdpkg\fP is built for (i.e. the output of \fB\-\-print\-architecture\fP)
333 is always part of that list.
334 .TP
335 .B \-\-remove\-architecture \fIarchitecture\fP
336 Remove \fIarchitecture\fP from the list of architectures for which packages
337 can be installed without using \fB\-\-force\-architecture\fP
338 (since dpkg 1.16.2). If the
339 architecture is currently in use in the database then the operation will
340 be refused, except if \fB\-\-force\-architecture\fP is specified. The
341 architecture \fBdpkg\fP is built for (i.e. the output of
342 \fB\-\-print\-architecture\fP) can never be removed from that list.
343 .TP
344 .B \-\-print\-architecture
345 Print architecture of packages \fBdpkg\fP installs (for example, “i386”).
346 .TP
347 .B \-\-print\-foreign\-architectures
348 Print a newline-separated list of the extra architectures \fBdpkg\fP is
349 configured to allow packages to be installed for (since dpkg 1.16.2).
350 .TP
351 .BI \-\-assert\- feature
352 Asserts that \fBdpkg\fP supports the requested feature.
353 Returns 0 if the feature is fully supported, 1 if the feature is known but
354 \fBdpkg\fP cannot provide support for it yet, and 2 if the feature is unknown.
355 The current list of assertable features is:
356 .RS
357 .TP
358 .B support\-predepends
359 Supports the \fBPre\-Depends\fP field (since dpkg 1.1.0).
360 .TP
361 .B working\-epoch
362 Supports epochs in version strings (since dpkg 1.4.0.7).
363 .TP
364 .B long\-filenames
365 Supports long filenames in \fBdeb\fP(5) archives (since dpkg 1.4.1.17).
366 .TP
367 .B multi\-conrep
368 Supports multiple \fBConflicts\fP and \fBReplaces\fP (since dpkg 1.4.1.19).
369 .TP
370 .B multi\-arch
371 Supports multi-arch fields and semantics (since dpkg 1.16.2).
372 .TP
373 .B versioned\-provides
374 Supports versioned \fBProvides\fP (since dpkg 1.17.11).
375 .RE
376 .TP
377 .BI \-\-validate\- "thing string"
378 Validate that the \fIthing\fP \fIstring\fP has a correct syntax
379 (since dpkg 1.18.16).
380 Returns 0 if the \fIstring\fP is valid, 1 if the \fIstring\fP is invalid but
381 might be accepted in lax contexts, and 2 if the \fIstring\fP is invalid.
382 The current list of validatable \fIthing\fPs is:
383 .RS
384 .TP
385 .B pkgname
386 Validates the given package name (since dpkg 1.18.16).
387 .TP
388 .B trigname
389 Validates the given trigger name (since dpkg 1.18.16).
390 .TP
391 .B archname
392 Validates the given architecture name (since dpkg 1.18.16).
393 .TP
394 .B version
395 Validates the given version (since dpkg 1.18.16).
396 .RE
397 .TP
398 .B \-\-compare\-versions \fIver1 op ver2\fP
399 Compare version numbers, where \fIop\fP is a binary operator. \fBdpkg\fP
400 returns true (\fB0\fP) if the specified condition is satisfied,
401 and false (\fB1\fP) otherwise. There are
402 two groups of operators, which differ in how they treat an empty
403 \fIver1\fP or \fIver2\fP. These treat an empty version as earlier than any
404 version: \fBlt le eq ne ge gt\fP. These treat an empty version as later
405 than any version: \fBlt\-nl le\-nl ge\-nl gt\-nl\fP. These are provided
406 only for compatibility with control file syntax: \fB< << <= = >= >>
407 >\fP. The \fB<\fP and \fB>\fP operators are obsolete and should \fBnot\fP
408 be used, due to confusing semantics. To illustrate: \fB0.1 < 0.1\fP
409 evaluates to true.
410 .\" .TP
411 .\" .B \-\-command\-fd \fIn\fP
412 .\" Accept a series of commands on input file descriptor \fIn\fP. Note:
413 .\" additional options set on the command line, and through this file descriptor,
414 .\" are not reset for subsequent commands executed during the same run.
415 .TP
416 .BR \-? ", " \-\-help
417 Display a brief help message.
418 .TP
419 .B \-\-force\-help
420 Give help about the \fB\-\-force\-\fP\fIthing\fP options.
421 .TP
422 .BR \-Dh ", " \-\-debug=help
423 Give help about debugging options.
424 .TP
425 \fB\-\-version\fP
426 Display \fBdpkg\fP version information.
427 .TP
428 \fBdpkg\-deb actions\fP
429 See \fBdpkg\-deb\fP(1) for more information about the following actions.
430
431 .nf
432 \fB\-b\fP, \fB\-\-build\fP \fIdirectory\fP [\fIarchive\fP|\fIdirectory\fP]
433 Build a deb package.
434 \fB\-c\fP, \fB\-\-contents\fP \fIarchive\fP
435 List contents of a deb package.
436 \fB\-e\fP, \fB\-\-control\fP \fIarchive\fP [\fIdirectory\fP]
437 Extract control-information from a package.
438 \fB\-x\fP, \fB\-\-extract\fP \fIarchive directory\fP
439 Extract the files contained by package.
440 \fB\-X\fP, \fB\-\-vextract\fP \fIarchive directory\fP
441 Extract and display the filenames contained by a
442 package.
443 \fB\-f\fP, \fB\-\-field\fP \fIarchive\fP [\fIcontrol-field\fP...]
444 Display control field(s) of a package.
445 .BR \-\-ctrl\-tarfile " \fIarchive\fP"
446 Output the control tar-file contained in a Debian package.
447 \fB\-\-fsys\-tarfile\fP \fIarchive\fP
448 Output the filesystem tar-file contained by a Debian package.
449 \fB\-I\fP, \fB\-\-info\fP \fIarchive\fP [\fIcontrol-file\fP...]
450 Show information about a package.
451 .fi
452
453 .TP
454 \fBdpkg\-query actions\fP
455 See \fBdpkg\-query\fP(1) for more information about the following actions.
456
457 .nf
458
459 \fB\-l\fP, \fB\-\-list\fP \fIpackage-name-pattern\fP...
460 List packages matching given pattern.
461 \fB\-s\fP, \fB\-\-status\fP \fIpackage-name\fP...
462 Report status of specified package.
463 \fB\-L\fP, \fB\-\-listfiles\fP \fIpackage-name\fP...
464 List files installed to your system from \fIpackage-name\fP.
465 \fB\-S\fP, \fB\-\-search\fP \fIfilename-search-pattern\fP...
466 Search for a filename from installed packages.
467 \fB\-p\fP, \fB\-\-print\-avail\fP \fIpackage-name\fP...
468 Display details about \fIpackage-name\fP, as found in
469 \fI%ADMINDIR%/available\fP. Users of APT-based frontends
470 should use \fBapt\-cache show\fP \fIpackage-name\fP instead.
471 .fi
472 .
473 .SH OPTIONS
474 All options can be specified both on the command line and in the \fBdpkg\fP
475 configuration file \fI%PKGCONFDIR%/dpkg.cfg\fP or fragment files (with names
476 matching this shell pattern '[0-9a-zA-Z_-]*') on the configuration
477 directory \fI%PKGCONFDIR%/dpkg.cfg.d/\fP. Each line in the configuration
478 file is either an option (exactly the same as the command line option but
479 without leading hyphens) or a comment (if it starts with a ‘\fB#\fP’).
480 .br
481 .TP
482 \fB\-\-abort\-after=\fP\fInumber\fP
483 Change after how many errors \fBdpkg\fP will abort. The default is 50.
484 .TP
485 .BR \-B ", " \-\-auto\-deconfigure
486 When a package is removed, there is a possibility that another
487 installed package depended on the removed package. Specifying this
488 option will cause automatic deconfiguration of the package which
489 depended on the removed package.
490 .TP
491 \fB\-D\fIoctal\fP, \fB\-\-debug=\fP\fIoctal\fP
492 Switch debugging on. \fIoctal\fP is formed by bitwise-oring desired
493 values together from the list below (note that these values may change
494 in future releases). \fB\-Dh\fP or \fB\-\-debug=help\fP display these
495 debugging values.
496
497 Number Description
498 1 Generally helpful progress information
499 2 Invocation and status of maintainer scripts
500 10 Output for each file processed
501 100 Lots of output for each file processed
502 20 Output for each configuration file
503 200 Lots of output for each configuration file
504 40 Dependencies and conflicts
505 400 Lots of dependencies/conflicts output
506 10000 Trigger activation and processing
507 20000 Lots of output regarding triggers
508 40000 Silly amounts of output regarding triggers
509 1000 Lots of drivel about e.g. the dpkg/info dir
510 2000 Insane amounts of drivel
511 .TP
512 .B \-\-force\-\fIthings\fP
513 .TQ
514 .BR \-\-no\-force\-\fIthings\fP ", " \-\-refuse\-\fIthings\fP
515 Force or refuse (\fBno\-force\fP and \fBrefuse\fP mean the same thing)
516 to do some things. \fIthings\fP is a comma separated list of things
517 specified below. \fB\-\-force\-help\fP displays a message describing them.
518 Things marked with (*) are forced by default.
519
520 \fIWarning: These options are mostly intended to be used by experts
521 only. Using them without fully understanding their effects may break
522 your whole system.\fP
523
524 \fBall\fP:
525 Turns on (or off) all force options.
526
527 \fBdowngrade\fP(*):
528 Install a package, even if newer version of it is already installed.
529
530 \fIWarning: At present \fP\fBdpkg\fP\fI does not do any dependency
531 checking on downgrades and therefore will not warn you
532 if the downgrade breaks the dependency of some other
533 package. This can have serious side effects, downgrading
534 essential system components can even make your whole
535 system unusable. Use with care.\fP
536
537 \fBconfigure\-any\fP:
538 Configure also any unpacked but unconfigured packages on which the current
539 package depends.
540
541 \fBhold\fP:
542 Process packages even when marked “hold”.
543
544 \fBremove\-reinstreq\fP:
545 Remove a package, even if it's broken and marked to require
546 reinstallation. This may, for example, cause parts of the package to
547 remain on the system, which will then be forgotten by \fBdpkg\fP.
548
549 \fBremove\-essential\fP:
550 Remove, even if the package is considered essential. Essential
551 packages contain mostly very basic Unix commands. Removing them might
552 cause the whole system to stop working, so use with caution.
553
554 \fBdepends\fP:
555 Turn all dependency problems into warnings.
556
557 \fBdepends\-version\fP:
558 Don't care about versions when checking dependencies.
559
560 \fBbreaks\fP:
561 Install, even if this would break another package (since dpkg 1.14.6).
562
563 \fBconflicts\fP:
564 Install, even if it conflicts with another package. This is dangerous,
565 for it will usually cause overwriting of some files.
566
567 \fBconfmiss\fP:
568 Always install the missing conffile without prompting. This is dangerous,
569 since it means not preserving a change (removing) made to the file.
570
571 \fBconfnew\fP:
572 If a conffile has been modified and the version in the package did change,
573 always install the new version without prompting, unless the
574 \fB\-\-force\-confdef\fP is also specified, in which case the default
575 action is preferred.
576
577 \fBconfold\fP:
578 If a conffile has been modified and the version in the package did change,
579 always keep the old version without prompting, unless the
580 \fB\-\-force\-confdef\fP is also specified, in which case the default
581 action is preferred.
582
583 \fBconfdef\fP:
584 If a conffile has been modified and the version in the package did change,
585 always choose the default action without prompting. If there is no default
586 action it will stop to ask the user unless \fB\-\-force\-confnew\fP or
587 \fB\-\-force\-confold\fP is also been given, in which case it will use
588 that to decide the final action.
589
590 \fBconfask\fP:
591 If a conffile has been modified always offer to replace it with the
592 version in the package, even if the version in the package did not
593 change (since dpkg 1.15.8).
594 If any of \fB\-\-force\-confnew\fP,
595 \fB\-\-force\-confold\fP, or \fB\-\-force\-confdef\fP is also given,
596 it will be used to decide the final action.
597
598 \fBoverwrite\fP:
599 Overwrite one package's file with another's file.
600
601 \fBoverwrite\-dir\fP:
602 Overwrite one package's directory with another's file.
603
604 \fBoverwrite\-diverted\fP:
605 Overwrite a diverted file with an undiverted version.
606
607 \fBunsafe\-io\fP:
608 Do not perform safe I/O operations when unpacking (since dpkg 1.15.8.6).
609 Currently this
610 implies not performing file system syncs before file renames, which is
611 known to cause substantial performance degradation on some file systems,
612 unfortunately the ones that require the safe I/O on the first place due
613 to their unreliable behaviour causing zero-length files on abrupt
614 system crashes.
615
616 \fINote\fP: For ext4, the main offender, consider using instead the
617 mount option \fBnodelalloc\fP, which will fix both the performance
618 degradation and the data safety issues, the latter by making the file
619 system not produce zero-length files on abrupt system crashes with
620 any software not doing syncs before atomic renames.
621
622 \fIWarning: Using this option might improve performance at the cost of
623 losing data, use with care.\fP
624
625 \fBscript-chrootless\fP:
626 Run maintainer scrips without \fBchroot\fP(2)ing into \fBinstdir\fP even
627 if the package does not support this mode of operation (since dpkg 1.18.5).
628
629 \fIWarning: This can destroy your host system, use with extreme care.\fP
630
631 \fBarchitecture\fP:
632 Process even packages with wrong or no architecture.
633
634 \fBbad\-version\fP:
635 Process even packages with wrong versions (since dpkg 1.16.1).
636
637 \fBbad\-path\fP:
638 \fBPATH\fP is missing important programs, so problems are likely.
639
640 \fBnot\-root\fP:
641 Try to (de)install things even when not root.
642
643 \fBbad\-verify\fP:
644 Install a package even if it fails authenticity check.
645
646 .TP
647 \fB\-\-ignore\-depends\fP=\fIpackage\fP,...
648 Ignore dependency-checking for specified packages (actually, checking is
649 performed, but only warnings about conflicts are given, nothing else).
650 .TP
651 \fB\-\-no\-act\fP, \fB\-\-dry\-run\fP, \fB\-\-simulate\fP
652 Do everything which is supposed to be done, but don't write any
653 changes. This is used to see what would happen with the specified
654 action, without actually modifying anything.
655
656 Be sure to give \fB\-\-no\-act\fP before the action-parameter, or you might
657 end up with undesirable results. (e.g. \fBdpkg \-\-purge foo
658 \-\-no\-act\fP will first purge package foo and then try to purge package
659 \-\-no\-act, even though you probably expected it to actually do nothing)
660 .TP
661 \fB\-R\fP, \fB\-\-recursive\fP
662 Recursively handle all regular files matching pattern \fB*.deb\fP
663 found at specified directories and all of its subdirectories. This can
664 be used with \fB\-i\fP, \fB\-A\fP, \fB\-\-install\fP, \fB\-\-unpack\fP and
665 \fB\-\-record\-avail\fP actions.
666 .TP
667 \fB\-G\fP
668 Don't install a package if a newer version of the same package is already
669 installed. This is an alias of \fB\-\-refuse\-downgrade\fP.
670 .TP
671 .BI \-\-admindir= dir
672 Change default administrative directory, which contains many files that
673 give information about status of installed or uninstalled packages, etc.
674 (Defaults to «\fI%ADMINDIR%\fP»)
675 .TP
676 .BI \-\-instdir= dir
677 Change default installation directory which refers to the directory where
678 packages are to be installed. \fBinstdir\fP is also the directory passed
679 to \fBchroot\fP(2) before running package's installation scripts, which
680 means that the scripts see \fBinstdir\fP as a root directory.
681 (Defaults to «\fI/\fP»)
682 .TP
683 .BI \-\-root= dir
684 Changing \fBroot\fP changes \fBinstdir\fP to «\fIdir\fP» and
685 \fBadmindir\fP to «\fIdir\fP\fB%ADMINDIR%\fP».
686 .TP
687 \fB\-O\fP, \fB\-\-selected\-only\fP
688 Only process the packages that are selected for installation. The
689 actual marking is done with \fBdselect\fP or by \fBdpkg\fP, when it
690 handles packages. For example, when a package is removed, it will
691 be marked selected for deinstallation.
692 .TP
693 .BR \-E ", " \-\-skip\-same\-version
694 Don't install the package if the same version of the package is already
695 installed.
696 .TP
697 .BI \-\-pre\-invoke= command
698 .TQ
699 .BI \-\-post\-invoke= command
700 Set an invoke hook \fIcommand\fP to be run via \*(lqsh \-c\*(rq before or
701 after the \fBdpkg\fP run for the \fIunpack\fP, \fIconfigure\fP, \fIinstall\fP,
702 \fItriggers\-only\fP, \fIremove\fP, \fIpurge\fP, \fIadd\-architecture\fP and
703 \fIremove\-architecture\fP \fBdpkg\fP actions (since dpkg 1.15.4;
704 \fIadd\-architecture\fP and \fIremove\-architecture\fP actions
705 since dpkg 1.17.19). This
706 option can be specified multiple times. The order the options are specified
707 is preserved, with the ones from the configuration files taking precedence.
708 The environment variable \fBDPKG_HOOK_ACTION\fP is set for the hooks to the
709 current \fBdpkg\fP action. Note: front-ends might call \fBdpkg\fP several
710 times per invocation, which might run the hooks more times than expected.
711 .TP
712 .BI \-\-path\-exclude= glob-pattern
713 .TQ
714 .BI \-\-path\-include= glob-pattern
715 Set \fIglob-pattern\fP as a path filter, either by excluding or re-including
716 previously excluded paths matching the specified patterns during install
717 (since dpkg 1.15.8).
718
719 \fIWarning: take into account that depending on the excluded paths you
720 might completely break your system, use with caution.\fP
721
722 The glob patterns use the same wildcards used in the shell, were
723 ‘*’ matches any sequence of characters, including the empty string
724 and also ‘/’.
725 For example, «\fI/usr/*/READ*\fP» matches
726 «\fI/usr/share/doc/package/README\fP».
727 As usual, ‘?’ matches any single character (again, including ‘/’).
728 And ‘[’
729 starts a character class, which can contain a list of characters, ranges
730 and complementations. See \fBglob\fP(7) for detailed information about
731 globbing. Note: the current implementation might re-include more directories
732 and symlinks than needed, to be on the safe side and avoid possible unpack
733 failures; future work might fix this.
734
735 This can be used to remove all paths except some particular ones; a typical
736 case is:
737
738 .nf
739 .B \-\-path\-exclude=/usr/share/doc/*
740 .B \-\-path\-include=/usr/share/doc/*/copyright
741 .fi
742
743 to remove all documentation files except the copyright files.
744
745 These two options can be specified multiple times, and interleaved with
746 each other. Both are processed in the given order, with the last rule that
747 matches a file name making the decision.
748
749 The filters are applied when unpacking the binary packages, and as such
750 only have knowledge of the type of object currently being filtered
751 (e.g. a normal file or a directory) and have not visibility of what
752 objects will come next.
753 Because these filters have side effects (in contrast to \fBfind\fP(1)
754 filters), excluding an exact pathname that happens to be a directory object
755 like \fI/usr/share/doc\fP will not have the desired result, and only that
756 pathname will be excluded (which could be automatically reincluded if the
757 code sees the need).
758 Any subsequent files contained within that directory will fail to unpack.
759
760 Hint: make sure the globs are not expanded by your shell.
761 .TP
762 .BI \-\-verify\-format " format-name"
763 Sets the output format for the \fB\-\-verify\fP command (since dpkg 1.17.2).
764
765 The only currently supported output format is \fBrpm\fP, which consists
766 of a line for every path that failed any check.
767 The lines start with 9 characters to report each specific check result,
768 a ‘\fB?\fP’ implies the check could not be done (lack of support,
769 file permissions, etc), ‘\fB.\fP’ implies the check passed, and
770 an alphanumeric character implies a specific check failed; the md5sum
771 verification failure (the file contents have changed) is denoted with
772 a ‘\fB5\fP’ on the third character.
773 The line is followed by a space and an attribute character (currently
774 ‘\fBc\fP’ for conffiles), another space and the pathname.
775 .TP
776 \fB\-\-status\-fd \fR\fIn\fR
777 Send machine-readable package status and progress information to file
778 descriptor \fIn\fP. This option can be specified multiple times. The
779 information is generally one record per line, in one of the following
780 forms:
781 .RS
782 .TP
783 .BI "status: " package ": " status
784 Package status changed; \fIstatus\fR is as in the status file.
785 .TP
786 .BI "status: " package " : error : " extended-error-message
787 An error occurred. Any possible newlines in \fIextended-error-message\fR
788 will be converted to spaces before output.
789 .TP
790 .BI "status: " file " : conffile\-prompt : '" real-old "' '" real-new "' " useredited " " distedited
791 User is being asked a conffile question.
792 .TP
793 .BI "processing: " stage ": " package
794 Sent just before a processing stage starts. \fIstage\fR is one of
795 .BR upgrade ", " install " (both sent before unpacking),"
796 .BR configure ", " trigproc ", " disappear ", " remove ", " purge .
797 .RE
798 .TP
799 \fB\-\-status\-logger\fR=\fIcommand\fR
800 Send machine-readable package status and progress information to the
801 shell \fIcommand\fR's standard input, to be run via \*(lqsh \-c\*(rq
802 (since dpkg 1.16.0).
803 This option can be specified multiple times.
804 The output format used is the same as in \fB\-\-status\-fd\fP.
805 .TP
806 \fB\-\-log=\fP\fIfilename\fP
807 Log status change updates and actions to \fIfilename\fP, instead of
808 the default \fI%LOGDIR%/dpkg.log\fP. If this option is given multiple
809 times, the last filename is used. Log messages are of the form:
810 .RS
811 .TP
812 YYYY-MM-DD HH:MM:SS \fBstartup\fP \fItype\fP \fIcommand\fP
813 For each dpkg invocation where \fItype\fP is \fBarchives\fP (with a
814 \fIcommand\fP of \fBunpack\fP or \fBinstall\fP) or \fBpackages\fP
815 (with a \fIcommand\fP of \fBconfigure\fP, \fBtriggers\-only\fP,
816 \fBremove\fP or \fBpurge\fP).
817 .TP
818 YYYY-MM-DD HH:MM:SS \fBstatus\fP \fIstate\fP \fIpkg\fP \fIinstalled-version\fP
819 For status change updates.
820 .TP
821 YYYY-MM-DD HH:MM:SS \fIaction\fP \fIpkg\fP \fIinstalled-version\fP \fIavailable-version\fP
822 For actions where \fIaction\fP is one of \fBinstall\fP, \fBupgrade\fP,
823 \fBconfigure\fP, \fBtrigproc\fP, \fBdisappear\fP, \fBremove\fP or \fBpurge\fP.
824 .TP
825 YYYY-MM-DD HH:MM:SS \fBconffile\fP \fIfilename\fP \fIdecision\fP
826 For conffile changes where \fIdecision\fP is either \fBinstall\fP or
827 \fBkeep\fP.
828 .RE
829 .TP
830 \fB\-\-no\-debsig\fP
831 Do not try to verify package signatures.
832 .TP
833 \fB\-\-no\-triggers\fP
834 Do not run any triggers in this run (since dpkg 1.14.17), but activations
835 will still be recorded.
836 If used with \fB\-\-configure\fP \fIpackage\fP or
837 \fB\-\-triggers\-only\fP \fIpackage\fP then the named package postinst
838 will still be run even if only a triggers run is needed. Use of this option
839 may leave packages in the improper \fBtriggers\-awaited\fP and
840 \fBtriggers\-pending\fP states. This can be fixed later by running:
841 \fBdpkg \-\-configure \-\-pending\fP.
842 .TP
843 \fB\-\-triggers\fP
844 Cancels a previous \fB\-\-no\-triggers\fP (since dpkg 1.14.17).
845 .
846 .SH EXIT STATUS
847 .TP
848 .B 0
849 The requested action was successfully performed.
850 Or a check or assertion command returned true.
851 .TP
852 .B 1
853 A check or assertion command returned false.
854 .TP
855 .B 2
856 Fatal or unrecoverable error due to invalid command-line usage, or
857 interactions with the system, such as accesses to the database,
858 memory allocations, etc.
859 .
860 .SH ENVIRONMENT
861 .SS External environment
862 .TP
863 .B PATH
864 This variable is expected to be defined in the environment and point to
865 the system paths where several required programs are to be found. If it's
866 not set or the programs are not found, \fBdpkg\fP will abort.
867 .TP
868 .B HOME
869 If set, \fBdpkg\fP will use it as the directory from which to read the user
870 specific configuration file.
871 .TP
872 .B TMPDIR
873 If set, \fBdpkg\fP will use it as the directory in which to create
874 temporary files and directories.
875 .TP
876 .B PAGER
877 The program \fBdpkg\fP will execute when displaying the conffiles.
878 .TP
879 .B SHELL
880 The program \fBdpkg\fP will execute when starting a new interactive shell.
881 .TP
882 .B COLUMNS
883 Sets the number of columns \fBdpkg\fP should use when displaying formatted
884 text.
885 Currently only used by \fB\-\-list\fP.
886 .TP
887 .B DPKG_COLORS
888 Sets the color mode (since dpkg 1.18.5).
889 The currently accepted values are: \fBauto\fP (default), \fBalways\fP and
890 \fBnever\fP.
891 .SS Internal environment
892 .TP
893 .B DPKG_ROOT
894 Defined by \fBdpkg\fP on the maintainer script environment to indicate
895 which installation to act on (since dpkg 1.18.5).
896 The value is intended to be prepended to any path maintainer scripts
897 operate on.
898 During normal operation, this variable is empty.
899 When installing packages into a different \fBinstdir\fP, \fBdpkg\fP
900 normally invokes maintainer scripts using \fBchroot\fP(2) and leaves
901 this variable empty, but if \fB\-\-force\-script\-chrootless\fP is
902 specified then the \fBchroot\fP(2) call is skipped and \fBinstdir\fP
903 is non-empty.
904 .TP
905 .B DPKG_ADMINDIR
906 Defined by \fBdpkg\fP on the maintainer script environment to indicate
907 the \fBdpkg\fP administrative directory to use (since dpkg 1.16.0).
908 This variable is always set to the current \fB\-\-admindir\fP value.
909 .TP
910 .B DPKG_SHELL_REASON
911 Defined by \fBdpkg\fP on the shell spawned on the conffile prompt to
912 examine the situation (since dpkg 1.15.6).
913 Current valid value: \fBconffile\-prompt\fP.
914 .TP
915 .B DPKG_CONFFILE_OLD
916 Defined by \fBdpkg\fP on the shell spawned on the conffile prompt to
917 examine the situation (since dpkg 1.15.6).
918 Contains the path to the old conffile.
919 .TP
920 .B DPKG_CONFFILE_NEW
921 Defined by \fBdpkg\fP on the shell spawned on the conffile prompt to
922 examine the situation (since dpkg 1.15.6).
923 Contains the path to the new conffile.
924 .TP
925 .B DPKG_HOOK_ACTION
926 Defined by \fBdpkg\fP on the shell spawned when executing a hook action
927 (since dpkg 1.15.4).
928 Contains the current \fBdpkg\fP action.
929 .TP
930 .B DPKG_RUNNING_VERSION
931 Defined by \fBdpkg\fP on the maintainer script environment to the
932 version of the currently running \fBdpkg\fP instance (since dpkg 1.14.17).
933 .TP
934 .B DPKG_MAINTSCRIPT_PACKAGE
935 Defined by \fBdpkg\fP on the maintainer script environment to the
936 (non-arch-qualified) package name being handled (since dpkg 1.14.17).
937 .TP
938 .B DPKG_MAINTSCRIPT_PACKAGE_REFCOUNT
939 Defined by \fBdpkg\fP on the maintainer script environment to the
940 package reference count, i.e. the number of package instances with
941 a state greater than \fBnot\-installed\fP (since dpkg 1.17.2).
942 .TP
943 .B DPKG_MAINTSCRIPT_ARCH
944 Defined by \fBdpkg\fP on the maintainer script environment to the
945 architecture the package got built for (since dpkg 1.15.4).
946 .TP
947 .B DPKG_MAINTSCRIPT_NAME
948 Defined by \fBdpkg\fP on the maintainer script environment to the
949 name of the script running, one of \fBpreinst\fP, \fBpostinst\fP,
950 \fBprerm\fP or \fBpostrm\fP (since dpkg 1.15.7).
951 .TP
952 .B DPKG_MAINTSCRIPT_DEBUG
953 Defined by \fBdpkg\fP on the maintainer script environment to a value
954 (‘\fB0\fP’ or ‘\fB1\fP’) noting whether debugging has been
955 requested (with the \fB\-\-debug\fP option) for the maintainer scripts
956 (since dpkg 1.18.4).
957 .
958 .SH FILES
959 .TP
960 .I %PKGCONFDIR%/dpkg.cfg.d/[0-9a-zA-Z_-]*
961 Configuration fragment files (since dpkg 1.15.4).
962 .TP
963 .I %PKGCONFDIR%/dpkg.cfg
964 Configuration file with default options.
965 .TP
966 .I %LOGDIR%/dpkg.log
967 Default log file (see \fI%PKGCONFDIR%/dpkg.cfg\fP and option
968 \fB\-\-log\fP).
969 .P
970 The other files listed below are in their default directories, see option
971 \fB\-\-admindir\fP to see how to change locations of these files.
972 .TP
973 .I %ADMINDIR%/available
974 List of available packages.
975 .TP
976 .I %ADMINDIR%/status
977 Statuses of available packages. This file contains information about
978 whether a package is marked for removing or not, whether it is
979 installed or not, etc. See section \fBINFORMATION ABOUT PACKAGES\fP
980 for more info.
981
982 The status file is backed up daily in \fI/var/backups\fP. It can be
983 useful if it's lost or corrupted due to filesystems troubles.
984 .P
985 The format and contents of a binary package are described in \fBdeb\fP(5).
986 .
987 .SH BUGS
988 \fB\-\-no\-act\fP usually gives less information than might be helpful.
989 .
990 .SH EXAMPLES
991 To list installed packages related to the editor \fBvi\fP(1) (note that
992 \fBdpkg\-query\fP does not load the \fIavailable\fP file anymore by
993 default, and the \fBdpkg\-query\fP \fB\-\-load\-avail\fP option should
994 be used instead for that):
995 .br
996 \fB dpkg \-l '*vi*'\fP
997 .br
998
999 To see the entries in \fI%ADMINDIR%/available\fP of two packages:
1000 .br
1001 \fB dpkg \-\-print\-avail elvis vim | less\fP
1002 .br
1003
1004 To search the listing of packages yourself:
1005 .br
1006 \fB less %ADMINDIR%/available\fP
1007 .br
1008
1009 To remove an installed elvis package:
1010 .br
1011 \fB dpkg \-r elvis\fP
1012 .br
1013
1014 To install a package, you first need to find it in an archive or
1015 CDROM. The \fIavailable\fP file shows that the vim package is in section
1016 \fBeditors\fP:
1017 .br
1018 \fB cd /media/cdrom/pool/main/v/vim\fP
1019 \fB dpkg \-i vim_4.5\-3.deb\fP
1020 .br
1021
1022 To make a local copy of the package selection states:
1023 .br
1024 \fB dpkg \-\-get\-selections >myselections\fP
1025 .br
1026
1027 You might transfer this file to another computer, and after having updated
1028 the \fIavailable\fP file there with your package manager frontend of choice
1029 (see https://wiki.debian.org/Teams/Dpkg/FAQ for more details), for example:
1030 .br
1031 \fB apt\-cache dumpavail | dpkg \-\-merge\-avail\fP
1032 .br
1033 or with dpkg 1.17.6 and earlier:
1034 .br
1035 \fB avail=`mktemp`\fP
1036 \fB apt\-cache dumpavail >"$avail"\fP
1037 \fB dpkg \-\-merge\-avail "$avail"\fP
1038 \fB rm "$avail"\fP
1039 .br
1040 you can install it with:
1041 .br
1042 \fB dpkg \-\-clear\-selections\fP
1043 \fB dpkg \-\-set\-selections <myselections\fP
1044 .br
1045
1046 Note that this will not actually install or remove anything, but just
1047 set the selection state on the requested packages. You will need some
1048 other application to actually download and install the requested
1049 packages. For example, run \fBapt\-get dselect\-upgrade\fP.
1050
1051 Ordinarily, you will find that \fBdselect\fP(1) provides a more
1052 convenient way to modify the package selection states.
1053 .br
1054 .
1055 .SH ADDITIONAL FUNCTIONALITY
1056 Additional functionality can be gained by installing any of the
1057 following packages: \fBapt\fR, \fBaptitude\fR and \fBdebsums\fR.
1058 .
1059 .SH SEE ALSO
1060 .ad l
1061 \fBaptitude\fP(1),
1062 \fBapt\fP(1),
1063 \fBdselect\fP(1),
1064 \fBdpkg\-deb\fP(1),
1065 \fBdpkg\-query\fP(1),
1066 \fBdeb\fP(5),
1067 \fBdeb\-control\fP(5),
1068 \fBdpkg.cfg\fP(5),
1069 and
1070 \fBdpkg\-reconfigure\fP(8).
1071 .
1072 .SH AUTHORS
1073 See \fI%PKGDOCDIR%/THANKS\fP for the list of people who have
1074 contributed to \fBdpkg\fP.