1 # dpkg manual page - dpkg(1)
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>
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.
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.
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/>.
30 dpkg - package manager for Debian
35 [I<option>...] I<action>
39 This manual is intended for users wishing to understand B<dpkg>'s
40 command line options and package states in more detail than that
41 provided by B<dpkg --help>.
43 It should I<not> be used by package maintainers wishing to
44 understand how B<dpkg> will install their packages. The
45 descriptions of what B<dpkg> does when installing and removing
46 packages are particularly inadequate.
50 B<dpkg> is a medium-level tool to install, build, remove and manage
52 The primary and more user-friendly front-end for B<dpkg>
53 as a CLI (command-line interface) is B<apt>(8) and
54 as a TUI (terminal user interface) is B<aptitude>(8).
56 controlled entirely via command line parameters, which consist of exactly
57 one action and zero or more options. The action-parameter tells B<dpkg>
58 what to do and options control the behavior of the action in some way.
60 B<dpkg> can also be used as a front-end to B<dpkg-deb>(1) and
61 B<dpkg-query>(1). The list of supported actions can be found later on
62 in the B<ACTIONS> section. If any such action is encountered B<dpkg>
63 just runs B<dpkg-deb> or B<dpkg-query> with the parameters given
64 to it, but no specific options are currently passed to them, to use
65 any such option the back-ends need to be called directly.
67 =head1 INFORMATION ABOUT PACKAGES
69 B<dpkg> maintains some usable information about available
70 packages. The information is divided in three classes: B<states>,
71 B<selection states> and B<flags>. These values are intended to
72 be changed mainly with B<dselect>.
78 =item B<not-installed>
80 The package is not installed on your system.
84 Only the configuration files or the B<postrm> script and the data it needs
85 to remove of the package exist on the system.
87 =item B<half-installed>
89 The installation of the package has been started, but not completed for
94 The package is unpacked, but not configured.
96 =item B<half-configured>
98 The package is unpacked and configuration has been started, but not yet
99 completed for some reason.
101 =item B<triggers-awaited>
103 The package awaits trigger processing by another package.
105 =item B<triggers-pending>
107 The package has been triggered.
111 The package is correctly unpacked and configured.
115 =head2 Package selection states
121 The package is selected for installation.
125 A package marked to be on B<hold> is kept on the same version, that is,
126 no automatic new installs, upgrades or removals will be performed on them,
127 unless these actions are requested explicitly, or are permitted to be done
128 automatically with the B<--force-hold> option.
132 The package is selected for deinstallation (i.e. we want to remove all
133 files, except configuration files).
137 The package is selected to be purged (i.e. we want to remove everything
138 from system directories, even configuration files).
142 The package selection is unknown.
143 A package that is also in a B<not-installed> state, and with an
144 B<ok> flag will be forgotten in the next database store.
154 A package marked B<ok> is in a known state, but might need further
159 A package marked B<reinstreq> is broken and requires
160 reinstallation. These packages cannot be removed, unless forced with
161 option B<--force-remove-reinstreq>.
169 =item B<-i>, B<--install> I<package-file>...
171 Install the package. If B<--recursive> or B<-R> option is
172 specified, I<package-file> must refer to a directory instead.
174 Installation consists of the following steps:
180 Extract the control files of the new package.
184 If another version of the same package was installed before
185 the new installation, execute I<prerm> script of the old package.
189 Run I<preinst> script, if provided by the package.
193 Unpack the new files, and at the same time back up the old
194 files, so that if something goes wrong, they can be restored.
198 If another version of the same package was installed before
199 the new installation, execute the I<postrm> script of the old
200 package. Note that this script is executed after the I<preinst>
201 script of the new package, because new files are written at the same
202 time old files are removed.
206 Configure the package. See B<--configure> for detailed
207 information about how this is done.
211 =item B<--unpack> I<package-file>...
213 Unpack the package, but don't configure it. If B<--recursive> or
214 B<-R> option is specified, I<package-file> must refer to a
217 Will process triggers for B<Pre-Depends> unless B<--no-triggers> has
220 =item B<--configure> I<package>...|B<-a>|B<--pending>
222 Configure a package which has been unpacked but not yet configured.
223 If B<-a> or B<--pending> is given instead of I<package>,
224 all unpacked but unconfigured packages are configured.
226 To reconfigure a package which has already been configured, try the
227 B<dpkg-reconfigure>(8) command instead (which is part of the B<debconf>
230 Configuring consists of the following steps:
236 Unpack the conffiles, and at the same time back up
237 the old conffiles, so that they can be restored if
238 something goes wrong.
242 Run I<postinst> script, if provided by the package.
246 Will process triggers unless B<--no-triggers> has been specified.
248 =item B<--triggers-only> I<package>...|B<-a>|B<--pending>
250 Processes only triggers (since dpkg 1.14.17).
251 All pending triggers will be processed.
253 names are supplied only those packages' triggers will be processed, exactly
254 once each where necessary. Use of this option may leave packages in the
255 improper B<triggers-awaited> and B<triggers-pending> states. This
256 can be fixed later by running: B<dpkg --configure --pending>.
258 =item B<-r>, B<--remove> I<package>...|B<-a>|B<--pending>
260 Remove an installed package.
261 This removes everything except conffiles and other data cleaned up by
262 the I<postrm> script,
263 which may avoid having to reconfigure the package if it is reinstalled
264 later (conffiles are configuration files that are listed in the
265 I<DEBIAN/conffiles> control file).
266 If there is no I<DEBIAN/conffiles> control file nor I<DEBIAN/postrm>
267 script, this command is equivalent to calling B<--purge>.
268 If B<-a> or B<--pending> is given instead of a package name,
269 then all packages unpacked, but marked to be removed in file
270 I<%ADMINDIR%/status>, are removed.
272 Removing of a package consists of the following steps:
282 Remove the installed files.
286 Run I<postrm> script.
290 Will process triggers unless B<--no-triggers> has been specified.
292 =item B<-P>, B<--purge> I<package>...|B<-a>|B<--pending>
294 Purge an installed or already removed package. This removes everything,
295 including conffiles, and anything else cleaned up from I<postrm>.
296 If B<-a> or B<--pending> is given instead of a package name,
297 then all packages unpacked or removed, but marked to be purged in file
298 I<%ADMINDIR%/status>, are purged.
300 B<Note>: Some configuration files might be unknown to B<dpkg> because they
301 are created and handled separately through the configuration scripts. In
302 that case, B<dpkg> won't remove them by itself, but the package's
303 I<postrm> script (which is called by B<dpkg>), has to take care of
304 their removal during purge. Of course, this only applies to files in
305 system directories, not configuration files written to individual users'
308 Purging of a package consists of the following steps:
314 Remove the package, if not already removed. See B<--remove>
315 for detailed information about how this is done.
319 Run I<postrm> script.
323 Will process triggers unless B<--no-triggers> has been specified.
325 =item B<-V>, B<--verify> [I<package-name>...]
327 Verifies the integrity of I<package-name> or all packages if omitted,
328 by comparing information from the files installed by a package with the
329 files metadata information stored in the B<dpkg> database
332 of the files metadata information in the database is the binary packages
333 themselves. That metadata gets collected at package unpack time during
334 the installation process.
336 Currently the only functional check performed is an md5sum verification
337 of the file contents against the stored value in the files database.
338 It will only get checked
339 if the database contains the file md5sum. To check for any missing
340 metadata in the database, the B<--audit> command can be used.
341 This is only an integrity check and should not be considered as any
342 kind of security verification.
344 The output format is selectable with the B<--verify-format>
345 option, which by default uses the B<rpm> format, but that might
346 change in the future, and as such, programs parsing this command
347 output should be explicit about the format they expect.
349 =item B<-C>, B<--audit> [I<package-name>...]
351 Performs database sanity and consistency checks for I<package-name>
352 or all packages if omitted (per package checks since dpkg 1.17.10).
353 For example, searches for packages that have been installed only partially
354 on your system or that have missing, wrong or obsolete control data or
355 files. B<dpkg> will suggest what to do with them to get them fixed.
357 =item B<--update-avail> [I<Packages-file>]
359 =item B<--merge-avail> [I<Packages-file>]
361 Update B<dpkg>'s and B<dselect>'s idea of which packages are
362 available. With action B<--merge-avail>, old information is
363 combined with information from I<Packages-file>. With action
364 B<--update-avail>, old information is replaced with the information
365 in the I<Packages-file>. The I<Packages-file> distributed with
366 Debian is simply named «I<Packages>». If the I<Packages-file>
367 argument is missing or named «B<->» then it will be read from
368 standard input (since dpkg 1.17.7). B<dpkg> keeps its record of
369 available packages in I<%ADMINDIR%/available>.
371 A simpler one-shot command to retrieve and update the I<available>
372 file is B<dselect update>. Note that this file is mostly useless
373 if you don't use B<dselect> but an APT-based frontend: APT has its
374 own system to keep track of available packages.
376 =item B<-A>, B<--record-avail> I<package-file>...
378 Update B<dpkg> and B<dselect>'s idea of which packages are
379 available with information from the package I<package-file>. If
380 B<--recursive> or B<-R> option is specified, I<package-file>
381 must refer to a directory instead.
383 =item B<--forget-old-unavail>
385 Now B<obsolete> and a no-op as B<dpkg> will automatically forget
386 uninstalled unavailable packages (since dpkg 1.15.4), but only those that
387 do not contain user information such as package selections.
389 =item B<--clear-avail>
391 Erase the existing information about what packages are available.
393 =item B<--get-selections> [I<package-name-pattern>...]
395 Get list of package selections, and write it to stdout. Without a pattern,
396 non-installed packages (i.e. those which have been previously purged) will
399 =item B<--set-selections>
401 Set package selections using file read from stdin. This file should be
402 in the format “I<package> I<state>”, where state is one of
403 B<install>, B<hold>, B<deinstall> or B<purge>. Blank lines
404 and comment lines beginning with ‘B<#>’ are also permitted.
406 The I<available> file needs to be up-to-date for this command to be
407 useful, otherwise unknown packages will be ignored with a warning. See
408 the B<--update-avail> and B<--merge-avail> commands for more
411 =item B<--clear-selections>
413 Set the requested state of every non-essential package to deinstall
414 (since dpkg 1.13.18).
415 This is intended to be used immediately before B<--set-selections>,
416 to deinstall any packages not in list given to B<--set-selections>.
418 =item B<--yet-to-unpack>
420 Searches for packages selected for installation, but which for some
421 reason still haven't been installed.
423 B<Note>: This command makes use of both the available file and the package
426 =item B<--predep-package>
428 Print a single package which is the target of one or more relevant
429 pre-dependencies and has itself no unsatisfied pre-dependencies.
431 If such a package is present, output it as a Packages file entry,
432 which can be massaged as appropriate.
434 B<Note>: This command makes use of both the available file and the package
437 Returns 0 when a package is printed, 1 when no suitable package is
438 available and 2 on error.
440 =item B<--add-architecture> I<architecture>
442 Add I<architecture> to the list of architectures for which packages can
443 be installed without using B<--force-architecture> (since dpkg 1.16.2).
445 B<dpkg> is built for (i.e. the output of B<--print-architecture>)
446 is always part of that list.
448 =item B<--remove-architecture> I<architecture>
450 Remove I<architecture> from the list of architectures for which packages
451 can be installed without using B<--force-architecture>
452 (since dpkg 1.16.2). If the
453 architecture is currently in use in the database then the operation will
454 be refused, except if B<--force-architecture> is specified. The
455 architecture B<dpkg> is built for (i.e. the output of
456 B<--print-architecture>) can never be removed from that list.
458 =item B<--print-architecture>
460 Print architecture of packages B<dpkg> installs (for example, “i386”).
462 =item B<--print-foreign-architectures>
464 Print a newline-separated list of the extra architectures B<dpkg> is
465 configured to allow packages to be installed for (since dpkg 1.16.2).
467 =item B<--assert-help>
469 Give help about the B<--assert->I<feature> options (since dpkg 1.21.0).
471 =item B<--assert->I<feature>
473 Asserts that B<dpkg> supports the requested feature.
474 Returns 0 if the feature is fully supported, 1 if the feature is known but
475 B<dpkg> cannot provide support for it yet, and 2 if the feature is unknown.
476 The current list of assertable features is:
480 =item B<support-predepends>
482 Supports the B<Pre-Depends> field (since dpkg 1.1.0).
484 =item B<working-epoch>
486 Supports epochs in version strings (since dpkg 1.4.0.7).
488 =item B<long-filenames>
490 Supports long filenames in B<deb>(5) archives (since dpkg 1.4.1.17).
492 =item B<multi-conrep>
494 Supports multiple B<Conflicts> and B<Replaces> (since dpkg 1.4.1.19).
498 Supports multi-arch fields and semantics (since dpkg 1.16.2).
500 =item B<versioned-provides>
502 Supports versioned B<Provides> (since dpkg 1.17.11).
504 =item B<protected-field>
506 Supports the B<Protected> field (since dpkg 1.20.1).
510 =item B<--validate->I<thing> I<string>
512 Validate that the I<thing> I<string> has a correct syntax
513 (since dpkg 1.18.16).
514 Returns 0 if the I<string> is valid, 1 if the I<string> is invalid but
515 might be accepted in lax contexts, and 2 if the I<string> is invalid.
516 The current list of validatable I<thing>s is:
522 Validates the given package name (since dpkg 1.18.16).
526 Validates the given trigger name (since dpkg 1.18.16).
530 Validates the given architecture name (since dpkg 1.18.16).
534 Validates the given version (since dpkg 1.18.16).
538 =item B<--compare-versions> I<ver1> I<op> I<ver2>
540 Compare version numbers, where I<op> is a binary operator. B<dpkg>
541 returns true (B<0>) if the specified condition is satisfied,
542 and false (B<1>) otherwise. There are
543 two groups of operators, which differ in how they treat an empty
544 I<ver1> or I<ver2>. These treat an empty version as earlier than any
545 version: B<lt le eq ne ge gt>. These treat an empty version as later
546 than any version: B<lt-nl le-nl ge-nl gt-nl>. These are provided
547 only for compatibility with control file syntax: B<E<lt> E<lt>E<lt> E<lt>= = E<gt>= E<gt>E<gt>
548 E<gt>>. The B<E<lt>> and B<E<gt>> operators are obsolete and should B<not>
549 be used, due to confusing semantics. To illustrate: B<0.1 E<lt> 0.1>
554 =item B<--command-fd> I<n>
556 Accept a series of commands on input file descriptor I<n>.
558 B<Note>: Additional options set on the command line, and through this
559 file descriptor, are not reset for subsequent commands executed during the
564 =item B<-?>, B<--help>
566 Display a brief help message.
568 =item B<--force-help>
570 Give help about the B<--force->I<thing> options.
572 =item B<-Dh>, B<--debug=help>
574 Give help about debugging options.
578 Display B<dpkg> version information.
580 When used with B<--robot>, the output will be the program version number
581 in a dotted numerical format, with no newline.
583 =item B<dpkg-deb actions>
585 See B<dpkg-deb>(1) for more information about the following actions,
586 and other actions and options not exposed by the B<dpkg> front-end.
590 =item B<-b>, B<--build> I<directory> [I<archive>|I<directory>]
594 =item B<-c>, B<--contents> I<archive>
596 List contents of a deb package.
598 =item B<-e>, B<--control> I<archive> [I<directory>]
600 Extract control-information from a package.
602 =item B<-x>, B<--extract> I<archive> I<directory>
604 Extract the files contained by package.
606 =item B<-X>, B<--vextract> I<archive> I<directory>
608 Extract and display the filenames contained by a package.
610 =item B<-f>, B<--field> I<archive> [I<control-field>...]
612 Display control field(s) of a package.
614 =item B<--ctrl-tarfile> I<archive>
616 Output the control tar-file contained in a Debian package.
618 =item B<--fsys-tarfile> I<archive>
620 Output the filesystem tar-file contained by a Debian package.
622 =item B<-I>, B<--info> I<archive> [I<control-file>...]
624 Show information about a package.
628 =item B<dpkg-query actions>
630 See B<dpkg-query>(1) for more information about the following actions,
631 and other actions and options not exposed by the B<dpkg> front-end.
635 =item B<-l>, B<--list> I<package-name-pattern>...
637 List packages matching given pattern.
639 =item B<-s>, B<--status> I<package-name>...
641 Report status of specified package.
643 =item B<-L>, B<--listfiles> I<package-name>...
645 List files installed to your system from I<package-name>.
647 =item B<-S>, B<--search> I<filename-search-pattern>...
649 Search for a filename from installed packages.
651 =item B<-p>, B<--print-avail> I<package-name>...
653 Display details about I<package-name>, as found in
654 I<%ADMINDIR%/available>. Users of APT-based frontends
655 should use B<apt show> I<package-name> instead.
663 All options can be specified both on the command line and in the B<dpkg>
664 configuration file I<%PKGCONFDIR%/dpkg.cfg> or fragment files (with names
665 matching this shell pattern '[0-9a-zA-Z_-]*') on the configuration
666 directory I<%PKGCONFDIR%/dpkg.cfg.d/>. Each line in the configuration
667 file is either an option (exactly the same as the command line option but
668 without leading hyphens) or a comment (if it starts with a ‘B<#>’).
672 =item B<--abort-after=>I<number>
674 Change after how many errors B<dpkg> will abort. The default is 50.
676 =item B<-B>, B<--auto-deconfigure>
678 When a package is removed, there is a possibility that another
679 installed package depended on the removed package. Specifying this
680 option will cause automatic deconfiguration of the package which
681 depended on the removed package.
683 =item B<-D>I<octal>, B<--debug=>I<octal>
685 Switch debugging on. I<octal> is formed by bitwise-ORing desired
686 values together from the list below (note that these values may change
687 in future releases). B<-Dh> or B<--debug=help> display these
691 1 Generally helpful progress information
692 2 Invocation and status of maintainer scripts
693 10 Output for each file processed
694 100 Lots of output for each file processed
695 20 Output for each configuration file
696 200 Lots of output for each configuration file
697 40 Dependencies and conflicts
698 400 Lots of dependencies/conflicts output
699 10000 Trigger activation and processing
700 20000 Lots of output regarding triggers
701 40000 Silly amounts of output regarding triggers
702 1000 Lots of drivel about for example the dpkg/info dir
703 2000 Insane amounts of drivel
705 =item B<--force->I<things>
707 =item B<--no-force->I<things>, B<--refuse->I<things>
709 Force or refuse (B<no-force> and B<refuse> mean the same thing)
710 to do some things. I<things> is a comma separated list of things
711 specified below. B<--force-help> displays a message describing them.
712 Things marked with (*) are forced by default.
714 B<Warning>: These options are mostly intended to be used by experts
715 only. Using them without fully understanding their effects may break
722 Turns on (or off) all force options.
724 =item B<downgrade>(*):
726 Install a package, even if newer version of it is already installed.
728 B<Warning>: At present B<dpkg> does not do any dependency
729 checking on downgrades and therefore will not warn you
730 if the downgrade breaks the dependency of some other
731 package. This can have serious side effects, downgrading
732 essential system components can even make your whole
733 system unusable. Use with care.
735 =item B<configure-any>:
737 Configure also any unpacked but unconfigured packages on which the current
742 Allow automatic installs, upgrades or removals of packages even when marked
744 B<Note>: When these actions are requested explicitly, the “hold” package
745 selection state always gets ignored.
747 =item B<remove-reinstreq>:
749 Remove a package, even if it's broken and marked to require
750 reinstallation. This may, for example, cause parts of the package to
751 remain on the system, which will then be forgotten by B<dpkg>.
753 =item B<remove-protected>:
755 Remove, even if the package is considered protected (since dpkg 1.20.1).
756 Protected packages contain mostly important system boot infrastructure or
757 are used for custom system-local meta-packages.
758 Removing them might cause the whole system to be unable to boot or lose
759 required functionality to operate, so use with caution.
761 =item B<remove-essential>:
763 Remove, even if the package is considered essential.
764 Essential packages contain mostly very basic Unix commands, required for
765 the packaging system, for the operation of the system in general or during
766 boot (although the latter should be converted to protected packages instead).
767 Removing them might cause the whole system to stop working,
772 Turn all dependency problems into warnings.
773 This affects the B<Pre-Depends> and B<Depends> fields.
775 =item B<depends-version>:
777 Don't care about versions when checking dependencies.
778 This affects the B<Pre-Depends> and B<Depends> fields.
782 Install, even if this would break another package (since dpkg 1.14.6).
783 This affects the B<Breaks> field.
787 Install, even if it conflicts with another package. This is dangerous,
788 for it will usually cause overwriting of some files.
789 This affects the B<Conflicts> field.
793 Always install the missing conffile without prompting. This is dangerous,
794 since it means not preserving a change (removing) made to the file.
798 If a conffile has been modified and the version in the package did change,
799 always install the new version without prompting, unless the
800 B<--force-confdef> is also specified, in which case the default
805 If a conffile has been modified and the version in the package did change,
806 always keep the old version without prompting, unless the
807 B<--force-confdef> is also specified, in which case the default
812 If a conffile has been modified and the version in the package did change,
813 always choose the default action without prompting. If there is no default
814 action it will stop to ask the user unless B<--force-confnew> or
815 B<--force-confold> is also been given, in which case it will use
816 that to decide the final action.
820 If a conffile has been modified always offer to replace it with the
821 version in the package, even if the version in the package did not
822 change (since dpkg 1.15.8).
823 If any of B<--force-confnew>,
824 B<--force-confold>, or B<--force-confdef> is also given,
825 it will be used to decide the final action.
829 Overwrite one package's file with another's file.
831 =item B<overwrite-dir>:
833 Overwrite one package's directory with another's file.
835 =item B<overwrite-diverted>:
837 Overwrite a diverted file with an undiverted version.
839 =item B<statoverride-add>:
841 Overwrite an existing stat override when adding it (since dpkg 1.19.5).
843 =item B<statoverride-remove>:
845 Ignore a missing stat override when removing it (since dpkg 1.19.5).
847 =item B<security-mac>(*):
849 Use platform-specific Mandatory Access Controls (MAC) based security when
850 installing files into the filesystem (since dpkg 1.19.5).
851 On Linux systems the implementation uses SELinux.
855 Do not perform safe I/O operations when unpacking (since dpkg 1.15.8.6).
857 implies not performing file system syncs before file renames, which is
858 known to cause substantial performance degradation on some file systems,
859 unfortunately the ones that require the safe I/O on the first place due
860 to their unreliable behaviour causing zero-length files on abrupt
863 I<Note>: For ext4, the main offender, consider using instead the
864 mount option B<nodelalloc>, which will fix both the performance
865 degradation and the data safety issues, the latter by making the file
866 system not produce zero-length files on abrupt system crashes with
867 any software not doing syncs before atomic renames.
869 B<Warning>: Using this option might improve performance at the cost of
870 losing data, use with care.
872 =item B<script-chrootless>:
874 Run maintainer scripts without B<chroot>(2)ing into B<instdir> even
875 if the package does not support this mode of operation (since dpkg 1.18.5).
877 B<Warning>: This can destroy your host system, use with extreme care.
879 =item B<architecture>:
881 Process even packages with wrong or no architecture.
883 =item B<bad-version>:
885 Process even packages with wrong versions (since dpkg 1.16.1).
889 B<PATH> is missing important programs, so problems are likely.
893 Try to (de)install things even when not root.
897 Install a package even if it fails authenticity check.
901 =item B<--ignore-depends>=I<package>,...
903 Ignore dependency-checking for specified packages (actually, checking is
904 performed, but only warnings about conflicts are given, nothing else).
905 This affects the B<Pre-Depends>, B<Depends> and B<Breaks> fields.
907 =item B<--no-act>, B<--dry-run>, B<--simulate>
909 Do everything which is supposed to be done, but don't write any
910 changes. This is used to see what would happen with the specified
911 action, without actually modifying anything.
913 Be sure to give B<--no-act> before the action-parameter, or you might
914 end up with undesirable results. (e.g. B<dpkg --purge foo --no-act> will
915 first purge package “foo” and then try to purge package ”--no-act”, even
916 though you probably expected it to actually do nothing).
918 =item B<-R>, B<--recursive>
920 Recursively handle all regular files matching pattern B<*.deb>
921 found at specified directories and all of its subdirectories. This can
922 be used with B<-i>, B<-A>, B<--install>, B<--unpack> and
923 B<--record-avail> actions.
927 Don't install a package if a newer version of the same package is already
928 installed. This is an alias of B<--refuse-downgrade>.
930 =item B<--admindir=>I<dir>
932 Set the administrative directory to I<directory>.
933 This directory contains many files that give information about status of
934 installed or uninstalled packages, etc.
935 Defaults to «I<%ADMINDIR%>» if B<DPKG_ADMINDIR> has not been set.
937 =item B<--instdir=>I<dir>
939 Set the installation directory, which refers to the directory where
940 packages are to be installed. B<instdir> is also the directory passed
941 to B<chroot>(2) before running package's installation scripts, which
942 means that the scripts see B<instdir> as a root directory.
945 =item B<--root=>I<dir>
947 Set the root directory to B<directory>, which sets the installation
948 directory to «I<dir>» and the administrative
949 directory to «I<dir>B<%ADMINDIR%>».
951 =item B<-O>, B<--selected-only>
953 Only process the packages that are selected for installation. The
954 actual marking is done with B<dselect> or by B<dpkg>, when it
955 handles packages. For example, when a package is removed, it will
956 be marked selected for deinstallation.
958 =item B<-E>, B<--skip-same-version>
960 Don't install the package if the same version and architecture
961 of the package is already installed.
963 Since dpkg 1.21.10, the architecture is also taken into account,
964 which makes it possible to cross-grade packages or install additional
965 co-installable instances with the same version, but different architecture.
967 =item B<--pre-invoke=>I<command>
969 =item B<--post-invoke=>I<command>
971 Set an invoke hook I<command> to be run via “sh -c” before or
972 after the B<dpkg> run for the I<unpack>, I<configure>, I<install>,
973 I<triggers-only>, I<remove>, I<purge>, I<add-architecture> and
974 I<remove-architecture> B<dpkg> actions (since dpkg 1.15.4;
975 I<add-architecture> and I<remove-architecture> actions
976 since dpkg 1.17.19). This
977 option can be specified multiple times. The order the options are specified
978 is preserved, with the ones from the configuration files taking precedence.
979 The environment variable B<DPKG_HOOK_ACTION> is set for the hooks to the
980 current B<dpkg> action.
982 B<Note>: Front-ends might call B<dpkg> several
983 times per invocation, which might run the hooks more times than expected.
985 =item B<--path-exclude=>I<glob-pattern>
987 =item B<--path-include=>I<glob-pattern>
989 Set I<glob-pattern> as a path filter, either by excluding or re-including
990 previously excluded paths matching the specified patterns during install
993 B<Warning>: Take into account that depending on the excluded paths you
994 might completely break your system, use with caution.
996 The glob patterns use the same wildcards used in the shell, were
997 ‘*’ matches any sequence of characters, including the empty string
999 For example, «I</usr/*/READ*>» matches
1000 «I</usr/share/doc/package/README>».
1001 As usual, ‘?’ matches any single character (again, including ‘/’).
1003 starts a character class, which can contain a list of characters, ranges
1004 and complementations. See B<glob>(7) for detailed information about
1006 B<Note>: The current implementation might re-include more directories
1007 and symlinks than needed, in particular when there is a more specific
1008 re-inclusion, to be on the safe side and avoid possible unpack failures;
1009 future work might fix this.
1011 This can be used to remove all paths except some particular ones; a typical
1014 --path-exclude=/usr/share/doc/*
1015 --path-include=/usr/share/doc/*/copyright
1017 to remove all documentation files except the copyright files.
1019 These two options can be specified multiple times, and interleaved with
1020 each other. Both are processed in the given order, with the last rule that
1021 matches a file name making the decision.
1023 The filters are applied when unpacking the binary packages, and as such
1024 only have knowledge of the type of object currently being filtered
1025 (e.g. a normal file or a directory) and have not visibility of what
1026 objects will come next.
1027 Because these filters have side effects (in contrast to B<find>(1)
1028 filters), excluding an exact pathname that happens to be a directory object
1029 like I</usr/share/doc> will not have the desired result, and only that
1030 pathname will be excluded (which could be automatically reincluded if the
1031 code sees the need).
1032 Any subsequent files contained within that directory will fail to unpack.
1034 B<Hint>: make sure the globs are not expanded by your shell.
1036 =item B<--verify-format> I<format-name>
1038 Sets the output format for the B<--verify> command (since dpkg 1.17.2).
1040 The only currently supported output format is B<rpm>, which consists
1041 of a line for every path that failed any check.
1042 These lines have the following format:
1045 B<missing > [B<c>] I<pathname> [B<(>I<error-message>B<)>]
1046 B<??5??????> [B<c>] I<pathname>
1048 The first 9 characters are used to report the checks result,
1049 either a literal B<missing> when the file is not present or its metadata
1051 or one of the following special characters that report the result for each
1058 Implies the check could not be done (lack of support, file permissions, etc).
1062 Implies the check passed.
1064 =item ‘I<A-Za-z0-9>’
1066 Implies a specific check failed.
1067 The following positions and alphanumeric characters are currently supported:
1073 These checks are currently not supported, will always be ‘B<?>’.
1077 The file mode check failed (since dpkg 1.21.0).
1078 Because pathname metadata is currently not tracked, this check can only be
1079 partially emulated via a very simple heuristic for pathnames that have a
1080 known digest, which implies they should be regular files, where the check
1081 will fail if the pathname is not a regular file on the filesystem.
1082 This check will currently never succeed as it does not have enough
1083 information available.
1087 The digest check failed, which means the file contents have changed.
1088 This is only an integrity check and should not be considered as any
1089 kind of security verification.
1093 These checks are currently not supported, will always be ‘B<?>’.
1099 The line is followed by a space and an attribute character.
1100 The following attribute character is supported:
1106 The pathname is a conffile.
1110 Finally followed by another space and the pathname.
1112 In case the entry was of the B<missing> type, and the file was not actually
1113 present on the filesystem, then the line is followed by a space and the
1114 error message enclosed within parenthesis.
1116 =item B<--status-fd> I<n>
1118 Send machine-readable package status and progress information to file
1119 descriptor I<n>. This option can be specified multiple times. The
1120 information is generally one record per line, in one of the following
1125 =item B<status:> I<package>B<:> I<status>
1127 Package status changed; I<status> is as in the status file.
1129 =item B<status:> I<package> B<: error :> I<extended-error-message>
1131 An error occurred. Any possible newlines in I<extended-error-message>
1132 will be converted to spaces before output.
1134 =item B<status:> I<file> B<: conffile-prompt : '>I<real-old>B<' '>I<real-new>B<'> I<useredited> I<distedited>
1136 User is being asked a conffile question.
1138 =item B<processing:> I<stage>B<:> I<package>
1140 Sent just before a processing stage starts. I<stage> is one of
1141 B<upgrade>, B<install> (both sent before unpacking),
1142 B<configure>, B<trigproc>, B<disappear>, B<remove>, B<purge>.
1146 =item B<--status-logger>=I<command>
1148 Send machine-readable package status and progress information to the
1149 shell I<command>'s standard input, to be run via “sh -c”
1150 (since dpkg 1.16.0).
1151 This option can be specified multiple times.
1152 The output format used is the same as in B<--status-fd>.
1154 =item B<--log=>I<filename>
1156 Log status change updates and actions to I<filename>, instead of
1157 the default I<%LOGDIR%/dpkg.log>. If this option is given multiple
1158 times, the last filename is used. Log messages are of the form:
1162 =item YYYY-MM-DD HH:MM:SS B<startup> I<type> I<command>
1164 For each dpkg invocation where I<type> is B<archives> (with a
1165 I<command> of B<unpack> or B<install>) or B<packages>
1166 (with a I<command> of B<configure>, B<triggers-only>,
1167 B<remove> or B<purge>).
1169 =item YYYY-MM-DD HH:MM:SS B<status> I<state> I<pkg> I<installed-version>
1171 For status change updates.
1173 =item YYYY-MM-DD HH:MM:SS I<action> I<pkg> I<installed-version> I<available-version>
1175 For actions where I<action> is one of B<install>, B<upgrade>,
1176 B<configure>, B<trigproc>, B<disappear>, B<remove> or B<purge>.
1178 =item YYYY-MM-DD HH:MM:SS B<conffile> I<filename> I<decision>
1180 For conffile changes where I<decision> is either B<install> or
1187 Use a machine-readable output format. This provides an interface for programs
1188 that need to parse the output of some of the commands that do not otherwise
1189 emit a machine-readable output format. No localization will be used, and the
1190 output will be modified to make it easier to parse.
1192 The only currently supported command is B<--version>.
1196 Disables the use of any pager when showing information (since dpkg 1.19.2).
1198 =item B<--no-debsig>
1200 Do not try to verify package signatures.
1202 =item B<--no-triggers>
1204 Do not run any triggers in this run (since dpkg 1.14.17), but activations
1205 will still be recorded.
1206 If used with B<--configure> I<package> or
1207 B<--triggers-only> I<package> then the named package postinst
1208 will still be run even if only a triggers run is needed. Use of this option
1209 may leave packages in the improper B<triggers-awaited> and
1210 B<triggers-pending> states. This can be fixed later by running:
1211 B<dpkg --configure --pending>.
1215 Cancels a previous B<--no-triggers> (since dpkg 1.14.17).
1225 The requested action was successfully performed.
1226 Or a check or assertion command returned true.
1230 A check or assertion command returned false.
1234 Fatal or unrecoverable error due to invalid command-line usage, or
1235 interactions with the system, such as accesses to the database,
1236 memory allocations, etc.
1242 =head2 External environment
1248 This variable is expected to be defined in the environment and point to
1249 the system paths where several required programs are to be found. If it's
1250 not set or the programs are not found, B<dpkg> will abort.
1254 If set, B<dpkg> will use it as the directory from which to read the user
1255 specific configuration file.
1259 If set, B<dpkg> will use it as the directory in which to create
1260 temporary files and directories.
1264 The program B<dpkg> will execute when starting a new interactive shell,
1265 or when spawning a command via a shell.
1271 The program B<dpkg> will execute when running a pager,
1272 which will be executed with «B<$SHELL -c>»,
1273 for example when displaying the conffile differences.
1274 If B<SHELL> is not set, «B<sh>» will be used instead.
1275 The B<DPKG_PAGER> overrides the B<PAGER> environment variable
1276 (since dpkg 1.19.2).
1278 =item B<DPKG_COLORS>
1280 Sets the color mode (since dpkg 1.18.5).
1281 The currently accepted values are: B<auto> (default), B<always> and
1286 Sets the debug mask (since dpkg 1.21.10) from an octal value.
1287 The currently accepted flags are described in the B<--debug> option.
1291 Sets the force flags (since dpkg 1.19.5).
1292 When this variable is present, no built-in force defaults will be applied.
1293 If the variable is present but empty, all force flags will be disabled.
1295 =item B<DPKG_ADMINDIR>
1297 If set and the B<--admindir> or B<--root> options have not been
1298 specified, it will be used as the B<dpkg> administrative directory
1299 (since dpkg 1.20.0).
1301 =item B<DPKG_FRONTEND_LOCKED>
1303 Set by a package manager frontend to notify dpkg that it should not acquire
1304 the frontend lock (since dpkg 1.19.1).
1308 =head2 Internal environment
1314 Defined by B<dpkg> to “B<-FRSXMQ>”, if not already set, when
1315 spawning a pager (since dpkg 1.19.2).
1316 To change the default behavior, this variable can be preset to some other
1317 value including an empty string, or the B<PAGER> or B<DPKG_PAGER>
1318 variables can be set to disable specific options with «B<-+>», for
1319 example B<DPKG_PAGER="less -+F">.
1323 Defined by B<dpkg> on the maintainer script environment to indicate
1324 which installation to act on (since dpkg 1.18.5).
1325 The value is intended to be prepended to any path maintainer scripts
1327 During normal operation, this variable is empty.
1328 When installing packages into a different B<instdir>, B<dpkg>
1329 normally invokes maintainer scripts using B<chroot>(2) and leaves
1330 this variable empty, but if B<--force-script-chrootless> is
1331 specified then the B<chroot>(2) call is skipped and B<instdir>
1334 =item B<DPKG_ADMINDIR>
1336 Defined by B<dpkg> on the maintainer script environment to indicate
1337 the B<dpkg> administrative directory to use (since dpkg 1.16.0).
1338 This variable is always set to the current B<--admindir> value.
1342 Defined by B<dpkg> on the subprocesses environment to all the currently
1343 enabled force option names separated by commas (since dpkg 1.19.5).
1345 =item B<DPKG_SHELL_REASON>
1347 Defined by B<dpkg> on the shell spawned on the conffile prompt to
1348 examine the situation (since dpkg 1.15.6).
1349 Current valid value: B<conffile-prompt>.
1351 =item B<DPKG_CONFFILE_OLD>
1353 Defined by B<dpkg> on the shell spawned on the conffile prompt to
1354 examine the situation (since dpkg 1.15.6).
1355 Contains the path to the old conffile.
1357 =item B<DPKG_CONFFILE_NEW>
1359 Defined by B<dpkg> on the shell spawned on the conffile prompt to
1360 examine the situation (since dpkg 1.15.6).
1361 Contains the path to the new conffile.
1363 =item B<DPKG_HOOK_ACTION>
1365 Defined by B<dpkg> on the shell spawned when executing a hook action
1366 (since dpkg 1.15.4).
1367 Contains the current B<dpkg> action.
1369 =item B<DPKG_RUNNING_VERSION>
1371 Defined by B<dpkg> on the maintainer script environment to the
1372 version of the currently running B<dpkg> instance (since dpkg 1.14.17).
1374 =item B<DPKG_MAINTSCRIPT_PACKAGE>
1376 Defined by B<dpkg> on the maintainer script environment to the
1377 (non-arch-qualified) package name being handled (since dpkg 1.14.17).
1379 =item B<DPKG_MAINTSCRIPT_PACKAGE_REFCOUNT>
1381 Defined by B<dpkg> on the maintainer script environment to the
1382 package reference count, i.e. the number of package instances with
1383 a state greater than B<not-installed> (since dpkg 1.17.2).
1385 =item B<DPKG_MAINTSCRIPT_ARCH>
1387 Defined by B<dpkg> on the maintainer script environment to the
1388 architecture the package got built for (since dpkg 1.15.4).
1390 =item B<DPKG_MAINTSCRIPT_NAME>
1392 Defined by B<dpkg> on the maintainer script environment to the
1393 name of the script running, one of B<preinst>, B<postinst>,
1394 B<prerm> or B<postrm> (since dpkg 1.15.7).
1396 =item B<DPKG_MAINTSCRIPT_DEBUG>
1398 Defined by B<dpkg> on the maintainer script environment to a value
1399 (‘B<0>’ or ‘B<1>’) noting whether debugging has been
1400 requested (with the B<--debug> option) for the maintainer scripts
1401 (since dpkg 1.18.4).
1409 =item I<%PKGCONFDIR%/dpkg.cfg.d/[0-9a-zA-Z_-]*>
1411 Configuration fragment files (since dpkg 1.15.4).
1413 =item I<%PKGCONFDIR%/dpkg.cfg>
1415 Configuration file with default options.
1417 =item I<%LOGDIR%/dpkg.log>
1419 Default log file (see I<%PKGCONFDIR%/dpkg.cfg> and option
1424 The other files listed below are in their default directories, see option
1425 B<--admindir> to see how to change locations of these files.
1429 =item I<%ADMINDIR%/available>
1431 List of available packages.
1433 =item I<%ADMINDIR%/status>
1435 Statuses of available packages. This file contains information about
1436 whether a package is marked for removing or not, whether it is
1437 installed or not, etc. See section B<INFORMATION ABOUT PACKAGES>
1440 The status file is backed up daily in I<%BACKUPSDIR%>. It can be
1441 useful if it's lost or corrupted due to filesystems troubles.
1445 The format and contents of a binary package are described in B<deb>(5).
1449 Any operation that needs write access to the database or the filesystem
1450 is considered a privileged operation that might allow root escalation.
1451 These operations must never be delegated to an untrusted user or be done
1452 on untrusted packages, as that might allow root access to the system.
1454 Some operations (such as package verification) might need root privileges
1455 to be able to access files on the filesystem that would otherwise be
1456 inaccessible due to restricted permissions, but should otherwise work
1457 normally and produce appropriate messages in those cases.
1459 Query operations should never require root, and delegating their execution
1460 to unprivileged users via some gain-root command can have security
1461 implications (such as privilege escalation), for example when a pager is
1462 automatically invoked by the tool.
1464 See also the B<SECURITY> section of the L<dpkg-deb(1)> and L<dpkg-split(1)>
1469 B<--no-act> usually gives less information than might be helpful.
1473 To list installed packages related to the editor B<vi>(1) (note that
1474 B<dpkg-query> does not load the I<available> file anymore by
1475 default, and the B<dpkg-query> B<--load-avail> option should
1476 be used instead for that):
1484 To see the entries in I<%ADMINDIR%/available> of two packages:
1488 dpkg --print-avail elvis vim | less
1492 To search the listing of packages yourself:
1496 less %ADMINDIR%/available
1500 To remove an installed elvis package:
1508 To install a package, you first need to find it in an archive or
1509 CDROM. The I<available> file shows that the vim package is in section
1514 cd /media/cdrom/pool/main/v/vim
1515 dpkg -i vim_4.5-3.deb
1519 To make a local copy of the package selection states:
1523 dpkg --get-selections >myselections
1527 You might transfer this file to another computer, and after having updated
1528 the I<available> file there with your package manager frontend of choice
1529 (see L<https://wiki.debian.org/Teams/Dpkg/FAQ#set-selections> for more
1530 details), for example:
1534 apt-cache dumpavail | dpkg --merge-avail
1538 or with dpkg 1.17.6 and earlier:
1543 apt-cache dumpavail >"$avail"
1544 dpkg --merge-avail "$avail"
1549 you can install it with:
1553 dpkg --clear-selections
1554 dpkg --set-selections <myselections
1558 Note that this will not actually install or remove anything, but just
1559 set the selection state on the requested packages. You will need some
1560 other application to actually download and install the requested
1561 packages. For example, run B<apt-get dselect-upgrade>.
1563 Ordinarily, you will find that B<dselect>(1) provides a more
1564 convenient way to modify the package selection states.
1566 =head1 ADDITIONAL FUNCTIONALITY
1568 Additional functionality can be gained by installing any of the
1569 following packages: B<apt>, B<aptitude> and B<debsums>.
1582 B<dpkg-reconfigure>(8).
1586 See I<%PKGDOCDIR%/THANKS> for the list of people who have
1587 contributed to B<dpkg>.