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