dpkg(8)

NAME
dpkg - a low-level package manager for Debian GNU/Linux

SYNOPSIS
dpkg [options] action

WARNING WARNING WARNING
This manual was inaccurate when it was written and is now also out of date. It should not be used by package maintainers wishing to understand how dpkg will install their packages. It may be useful to users wishing to understand dpkg's command line options and package states in more detail than that provided by dpkg --help. The descriptions of what dpkg does when installing and removing packages are particularly inadequate. For detailed information about this please refer to the Debian Packaging Guidelines, available under guidelines in the GNU Info system.

DESCRIPTION
dpkg is a medium-level tool to install, build, remove and manage Debian GNU/Linux packages. The primary and more user-friendly front-end for dpkg is dselect(8). dpkg itself is totally controlled via command line parameters, whose include one or more options and exactly one action. The action-parameter tells dpkg what to do and options control the behaviour of the action in some way. dpkg can be also be used as a front-end to dpkg-deb. Actions -b , --build , -c , --contents , -I , --info , -f , --field , -e , --control , -x , --extract , -X , --vextract and --fsys-tarfile are dpkg-deb actions and if they are encountered, dpkg just runs dpkg-deb with the parameters given to it. Please refer to dpkg-deb(8) for information about these actions.

  ACTIONS

dpkg -i | --install <package file name> ...
    Install specified packages. If --recursive or -R option is specified, <package file name> must refer to a directory instead. Installation consists of the following steps:
    1. Extract the controlfiles 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 files and at the same time, backup the old files so that if something goes wrong, we can restore them.
    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. eonfigure the package. See --configure for detailed information about how this is done.

dpkg --unpack <package file name> ...
    Unpack package, but don't configure it. If --recursive or -R option is specified, <package file name> must refer to a directory instead.

dpkg --configure <package name> ... | -a|--pending
    Reconfigure an unpacked package. If -a or --pending is given instead of package name, all unpacked, but unconfigured packages are configured. Configuring consists of the following steps:
    1. Unpack the configuration files and at the same time, backup the old configuration files, so that we can restore them, if something goes wrong.
    2. Run postinst script, if provided by the package.

dpkg -r|--remove | --purge <package name> ... | -a|--pending
    Remove an installed package. --purge removes everything, including configuration files, --remove removes everything, but not configuration files. (configuration files are the files listed in conffiles -control file). If -a or --pending is given instead of package name all packages unpacked, but marked to be removed or purged are removed or purged (in file /var/lib/dpkg/status ). Removing of a package consists of the following steps:
    1. Run prerm script
    2. Remove the installed files
    3. Run postrm script

dpkg -A | --avail <package file name> ...
    Update dpkg and dselect's idea of which packages are available with information about the package <package file name>. If --recursive or -R option is specified, <package file name> must refer to a directory instead.

dpkg --update-avail | --merge-avail <Packages-file>
    Update dpkg's and dselect's idea of which packages are available. With action --merge-avail, information is combined from the old information and from the <Packages-file>. With action --update-avail, old information is replaced with the information in the <Packages-file>. The <Packages-file> distributed with Debian GNU/Linux is simply named Packages.

dpkg --yet-to-unpack
    Searches for packages selected for installation, but which for some reason still haven't been installed.

dpkg -l|--list [<package-name-pattern> ...]
    List packages matching given pattern. If no <package-name-pattern> is given, list all packages in /var/lib/dpkg/available. Normal shell wildchars are allowed in <package-name-pattern>.

dpkg -L|--listfiles <package-name> ...
    List files installed to your system from a package <package-name>. However, note that files created by package-specific installation-scripts are not listed.

dpkg -C|--audit
    Searches for packages that have been installed only partially on your system. dpkg will suggest what to do with them to get them working.

dpkg -S|--search <filename-search-pattern> ...
    Search for a filename from installed packages. All standard shell wildchars can be used in the pattern.

dpkg -s|--status <package-name> ...
    Report status of specified package. This just displays the entry in from the installed package status database.

dpkg --help
    Display a brief help.

dpkg --licence
    Display licence of dpkg.

dpkg --version
    Display version information.

dpkg-deb-actions
    See dpkg-deb(8) for more information about these actions. dpkg -b|--build <directory> [<filename>] - Build a Debian GNU/Linux package.
    dpkg -c|--contents <filename> - List contents of Debian GNU/Linux package.
    dpkg -e|--control <filename> [<directory>] - Extract control-information from a package.
    dpkg -x|--extract <filename> <directory> - Extract the files contained by package.
    dpkg -f|--field <filename> [<control-field>...] - Display control field(s) of a package.
    dpkg --fsys-tarfile <filename> - Display the filesystem tar-file contained by a Debian package.
    dpkg -I|--info <filename> [<control-file>] - Show information about a package.
    dpkg -X|--vextract <filename> <directory> - Extract and display the filenames contained by a package.

  OPTIONS

-B | --auto-deconfigure
    While a package is removed, there is a possibility that another installed package depended on the removed package. Specifying this option will cause automatical deconfiguration of the package which depended on the removed package.

-Dh | --debug=help
    Give help about debugging options.

-D<octal> | --debug=<octal>
    Set debugging on. <octal> is a octal number formed by bitwise-orring desired values together from the list below (note that these values may change in future releases).
     number description
        1 Generally helpful progress information
        2 Invocation and status of maintainer scripts
       10 Output for each file processed
      100 Lots of output for each file processed
       20 Output for each configuration file
      200 Lots of output for each configuration file
       40 Dependencies and conflicts
      400 Lots of dependencies/conflicts output
     1000 Lots of drivel about eg the dpkg/info dir
     2000 Insane amounts of drivel

--force-<things> | --no-force-<things> | --refuse-<things>
    Force or refuse (no-force and refuse stands for the same thing) to do some things. <things> is a comma separated list of things specified below: downgrade(*): Install a package, even if newer version of it is already installed. configure-any: Configure also unpacked, but unconfigured packages on whose current package depends on. remove-reinstreq: Remove a package, even if it's broken and marked to require reinstallation. This may, for example, cause parts of the package to remain on the system, which will then be forgotten by dpkg. hold: Don't care, wheter a package is on hold or not. remove-essential: Remove, even if the package is considered essential. Essential packages contains mostly very basic unix commands and such. Removing them might cause the whole system to stop working, so use with caution. conflicts: Install, even if it conflicts with another package. This is dangerous, for it will usually cause overwriting of some files. depends: Remove, even if another package depends on this one. This will usually break the other package. depends-version: Don't care about versions when checking depencies. This will usually break the other package. Things marked with (*) are forced by default. Warning: These options are mostly intended to be used by experts only. Using them without fully understanding their effects may break your whole system.

--ignore-depends=<package>,...
    Ignore depency-checking for specified packages (actually, checking is performed, but only warnings about conflicts are given, nothing else).

--largemem | --smallmem
    Tells dpkg wheter to preserve memory or consume it as much as needed.

--new | --old
    Select new or old package format. This is a dpkg-deb(8) option.

--nocheck
    Don't read or check contents of control file while building a package. This is a dpkg-deb(8) option.

--no-act
    Do everything, which is supposed to be done, but don't write any changes. This is used to see, what would happen with specified action, without actually modifying anything. Be sure to give --no-act before 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 propably expected it to actually do nothing)

-R | --recursive
    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 --avail actions.

-G  Don't install package, if newer version of the same package is already installed. This is an alias to

-R|--root=<dir> | --admindir=<dir> | --instdir=<dir>
    Change default directories. admindir defaults to /var/lib/dpkg and contains many files that give information about status of installed or uninstalled packages, etc. instdir defaults to / and 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. Changing root changes instdir to <dir> and admindir to <dir>/var/lib/dpkg.

-O | --selected-only
    Only process the packages that are selected for installation. The actual marking is done with dselect or by dpkg, when it handles packages. i.e. When, for example a package is removed, it will be marked selected for installation, etc.

-E | --skip-same-version
    Don't install the package, if the same version of the package is already installed.

INFORMATION ABOUT PACKAGES
dpkg maintains some usable information about available packages. The information is divided in three classes: states , selection states and flags. These values are intended to be changed mainly with dselect.

  PACKAGE STATES

installed
    The package is unpacked and configured ok.

half-installed
    The installation of the package has been started, but not completed for some reason.

not-installed
    The package is not installed on your system.

unpacked
    The package is unpacked, but not configured.

half-configured
    The package is unpacked and configuration has been started, but not yet completed for some reason.

config-files
    Only the configuration files of the package exist on the system.

  PACKAGE SELECTION STATES

install
    The package is selected for installation.

deinstall
    The package is selected for deinstallation (i.e. we want to remove all files, except configuration files).

purge
    The package is selected to be purged (i.e. we want to remove everything, even configuration files).

  PACKAGE FLAGS

hold
    A package marked to be on hold is not handled by dpkg, unless forced to do that with option --force-hold.

reinst-required
    A package marked reinst-required is broken and requires reinstallation. These packages cannot be removed, unless forced with option --force-reinstreq.

FILES
The files listed here are in their default directories, see option --admindir to see how to change locations of these files.

/var/lib/dpkg/available
    List of available packages.

/var/lib/dpkg/status
    Statuses of available packages. This file contains information about wheter a package is marked for removing or not, wheter it is installed or not, etc. See section INFORMATION ABOUT PACKAGES for more info.

control
    See deb(5) for more information about this file.

conffiles
    dpkg. See deb(5) for more information about this file.

preinst
    See deb(5) for more information about this file.

postinst
    See deb(5) for more information about this file.

prerm
    See deb(5) for more information about this file.

postrm
    See deb(5) for more information about this file.

ENVIRONMENT VARIABLES

DPKG_NO_TSTP
    Define this to something, if you prefer dpkg starting a new shell rather than suspending dpkg, while doing a shell escape.

SHELL
    The program dpkg will execute while starting a new shell.

SEE ALSO
deb(5) , dpkg-deb(8) , dselect(8) and deb-control(5)

BUGS
--no-act usually gives less information that might be helpful.

AUTHOR
dpkg is written by Ian Jackson (ian@chiark.chu.cam.ac.uk). Manual page added by Juho Vuori (javuori@cc.helsinki.fi).