-i, --install package-file...
Install the package. If --recursive or -R option is specified, package-file must refer to a
Installation consists of the following steps:
1. Extract the control files of the new package.
2. If another version of the same package was installed before the new installation, execute prerm
script of the old package.
3. Run preinst script, if provided by the package.
4. Unpack the new files, and at the same time back up the old files, so that if something goes
wrong, they can be restored.
5. If another version of the same package was installed before the new installation, execute the
postrm script of the old package. Note that this script is executed after the preinst script of
the new package, because new files are written at the same time old files are removed.
6. Configure the package. See --configure for detailed information about how this is done.
Unpack the package, but don't configure it. If --recursive or -R option is specified, package-file
must refer to a directory instead.
Configure a package which has been unpacked but not yet configured. If -a or --pending is given
instead of package, all unpacked but unconfigured packages are configured.
To reconfigure a package which has already been configured, try the dpkg-reconfigure(8) command
Configuring consists of the following steps:
1. Unpack the conffiles, and at the same time back up the old conffiles, so that they can be
restored if something goes wrong.
2. Run postinst script, if provided by the package.
Processes only triggers. All pending triggers will be processed. If package names are supplied
only those packages' triggers will be processed, exactly once each where necessary. Use of this
option may leave packages in the improper triggers-awaited and triggers-pending states. This can
be fixed later by running: dpkg --configure --pending.
-r, --remove, -P, --purge package...|-a|--pending
Remove an installed package. -r or --remove remove everything except conffiles. This may avoid
having to reconfigure the package if it is reinstalled later. (Conffiles are configuration files
that are listed in the DEBIAN/conffiles control file). -P or --purge removes everything, including
conffiles. If -a or --pending is given instead of a package name, then all packages unpacked, but
marked to be removed or purged in file /var/lib/dpkg/status, are removed or purged, respectively.
Note: some configuration files might be unknown to dpkg because they are created and handled
separately through the configuration scripts. In that case, dpkg won't remove them by itself, but
the package's postrm script (which is called by dpkg), has to take care of their removal during
purge. Of course, this only applies to files in system directories, not configuration files
written to individual users' home directories.
Removing of a package consists of the following steps:
1. Run prerm script
2. Remove the installed files
3. Run postrm script
--update-avail, --merge-avail Packages-file
Update dpkg's and dselect's idea of which packages are available. With action --merge-avail, old
information is combined with information from Packages-file. With action --update-avail, old
information is replaced with the information in the Packages-file. The Packages-file distributed
with Debian is simply named Packages. dpkg keeps its record of available packages in
A simpler one-shot command to retrieve and update the available file is dselect update. Note that
this file is mostly useless if you don't use dselect but an APT-based frontend: APT has its own
system to keep track of available packages.
-A, --record-avail package-file...
Update dpkg and dselect's idea of which packages are available with information from the package
package-file. If --recursive or -R option is specified, package-file must refer to a directory
Now obsolete and a no-op as dpkg will automatically forget uninstalled unavailable packages.
Erase the existing information about what packages are available.
Searches for packages that have been installed only partially on your system. dpkg will suggest
what to do with them to get them working.
Get list of package selections, and write it to stdout. Without a pattern, non-installed packages
(i.e. those which have been previously purged) will not be shown.
Set package selections using file read from stdin. This file should be in the format 'package
state', where state is one of install, hold, deinstall or purge. Blank lines and comment lines
beginning with '#' are also permitted.
Set the requested state of every non-essential package to deinstall. This is intended to be used
immediately before --set-selections, to deinstall any packages not in list given to
Searches for packages selected for installation, but which for some reason still haven't been
Print architecture of packages dpkg installs (for example, "i386").
Add architecture to the list of architectures for which packages can be installed without
using --force-architecture, in addition to the architecture dpkg is built for (i.e.: the
output of --print-architecture).
Print a space-separated list of the extra architectures dpkg is configured to allow
packages to be installed for.
--compare-versions ver1 op ver2
Compare version numbers, where op is a binary operator. dpkg returns success (zero result)
if the specified condition is satisfied, and failure (nonzero result) otherwise. There are
two groups of operators, which differ in how they treat an empty ver1 or ver2. These treat
an empty version as earlier than any version: lt le eq ne ge gt. These treat an empty
version as later than any version: lt-nl le-nl ge-nl gt-nl. These are provided only for
compatibility with control file syntax: < << <= = >= >> >.
Accept a series of commands on input file descriptor n. Note: additional options set on the
command line, and through this file descriptor, are not reset for subsequent commands
executed during the same run.
--help Display a brief help message.
Give help about the --force-thing options.
Give help about debugging options.
Display dpkg version information.
-b, --build directory [archive|directory]
Build a deb package.
-c, --contents archive
List contents of a deb package.
-e, --control filename [directory]
Extract control-information from a package.
-x, --extract archive directory
Extract the files contained by package.
-X, --vextract archive directory
Extract and display the filenames contained by a
-f, --field archive [control-field...]
Display control field(s) of a package.
Display the filesystem tar-file contained by a
-I, --info archive [control-file...]
Show information about a package.
See dpkg-query(1) for more information about the following actions.
-l, --list package-name-pattern...
List packages matching given pattern.
-s, --status package-name...
Report status of specified package.
-L, --listfiles package-name...
List files installed to your system from package-name.
-S, --search filename-search-pattern...
Search for a filename from installed packages.
-p, --print-avail package-name...
Display details about package-name, as found in
/var/lib/dpkg/available. Users of APT-based frontends
should use apt-cache show package-name instead.
Change after how many errors dpkg will abort. The default is 50.
When a package is removed, there is a possibility that another installed package depended
on the removed package. Specifying this option will cause automatic deconfiguration of the
package which depended on the removed package.
Switch debugging on. octal is formed by bitwise-orring desired values together from the
list below (note that these values may change in future releases). -Dh or --debug=help
display these debugging values.
1 Generally helpful progress information
2 Invocation and status of maintainer scripts
10 Output for each file processed
100 Lots of output for each file processed
20 Output for each configuration file
200 Lots of output for each configuration file
40 Dependencies and conflicts
400 Lots of dependencies/conflicts output
10000 Trigger activation and processing
20000 Lots of output regarding triggers
40000 Silly amounts of output regarding triggers
1000 Lots of drivel about e.g. the dpkg/info dir
2000 Insane amounts of drivel
--force-things, --no-force-things, --refuse-things
Ignore dependency-checking for specified packages (actually, checking is performed, but
only warnings about conflicts are given, nothing else).
--no-act, --dry-run, --simulate
Do everything which is supposed to be done, but don't write any changes. This is used to
see what would happen with the specified action, without actually modifying anything.
Be sure to give --no-act before the action-parameter, or you might end up with undesirable
results. (e.g. dpkg --purge foo --no-act will first purge package foo and then try to purge
package --no-act, even though you probably expected it to actually do nothing)
Recursively handle all regular files matching pattern *.deb found at specified directories
and all of its subdirectories. This can be used with -i, -A, --install, --unpack and
-G Don't install a package if a newer version of the same package is already installed. This
is an alias of --refuse-downgrade.
Change default administrative directory, which contains many files that give information
about status of installed or uninstalled packages, etc. (Defaults to /var/lib/dpkg)
Change default installation directory which refers to the directory where packages are to
be installed. instdir is also the directory passed to chroot(2) before running package's
installation scripts, which means that the scripts see instdir as a root directory.
(Defaults to /)
Changing root changes instdir to dir and admindir to dir/var/lib/dpkg.
Only process the packages that are selected for installation. The actual marking is done
with dselect or by dpkg, when it handles packages. For example, when a package is removed,
it will be marked selected for deinstallation.
Don't install the package if the same version of the package is already installed.
Set an invoke hook command to be run via “sh -c” before or after the dpkg run for the
unpack, configure, install, triggers-only, remove and purge dpkg actions. This option can
be specified multiple times. The order the options are specified is preserved, with the
ones from the configuration files taking precedence. The environment variable
DPKG_HOOK_ACTION is set for the hooks to the current dpkg action. Note: front-ends might
call dpkg several times per invocation, which might run the hooks more times than expected.
Set glob-pattern as a path filter, either by excluding or re-including previously excluded
paths matching the specified patterns during install.
Warning: take into account that depending on the excluded paths you might completely break
your system, use with caution.
The glob patterns use the same wildcards used in the shell, were '*' matches any sequence
of characters, including the empty string and also '/'. For example, '/usr/*/READ*' matches
'/usr/share/doc/package/README'. As usual, '?' matches any single character (again,
including '/'). And '[' starts a character class, which can contain a list of characters,
ranges and complementations. See glob(7) for detailed information about globbing. Note: the
current implementation might re-include more directories and symlinks than needed, to be on
the safe side and avoid possible unpack failures, future work might fix this.
This can be used to remove all paths except some particular ones; a typical case is:
to remove all documentation files except the copyright files.
These two options can be specified multiple times, and interleaved with each other. Both
are processed in the given order, with the last rule that matches a file name making the
Send machine-readable package status and progress information to file descriptor n. This
option can be specified multiple times. The information is generally one record per line,
in one of the following forms:
status: package: status
Package status changed; status is as in the status file.
status: package : error : extended-error-message
An error occurred. Any possible newlines in extended-error-message will be converted
to spaces before output.
status: file : conffile-prompt : 'real-old' 'real-new' useredited distedited
User is being asked a conffile question.
processing: stage: package
Sent just before a processing stage starts. stage is one of upgrade, install (both
sent before unpacking), configure, trigproc, disappear, remove, purge.
Send machine-readable package status and progress information to the shell command's
standard input. This option can be specified multiple times. The output format used is the
same as in --status-fd.
Log status change updates and actions to filename, instead of the default
/var/log/dpkg.log. If this option is given multiple times, the last filename is used. Log
messages are of the form `YYYY-MM-DD HH:MM:SS status state pkg installed-version' for
status change updates; `YYYY-MM-DD HH:MM:SS action pkg installed-version available-version'
for actions where action is one of install, upgrade, remove, purge; and `YYYY-MM-DD
HH:MM:SS conffile filename decision' for conffile changes where decision is either install
Do not try to verify package signatures.
Do not run any triggers in this run (activations will still be recorded). If used with
--configure package or --triggers-only package then the named package postinst will still
be run even if only a triggers run is needed. Use of this option may leave packages in the
improper triggers-awaited and triggers-pending states. This can be fixed later by running:
dpkg --configure --pending.
Cancels a previous --no-triggers.