The Debian package management utility that performs lower level tasks in software installation and removal.

dpkg is a tool to install, build, remove and manage Debian packages. Unlike apt-get, dpkg can be used to install Debian packages off-line.

While the high level APT resolves dependencies and fetches and authenticates packages, dpkg performs low-level tasks involved in package management. For example, when installing a package, dpkg will:

  • unpack the .deb package
  • run the pre-installation script
  • move the files from the package to the correct locations
  • run the post installation script

When asking questions to debug problems with dpkg, please make sure you include the exact command used and the entire output with all error messages. Most of the error messages are generic and non-informative, so the complete output is needed in any attempt to accurately diagnose and solve the problem.

Fr example, the most common error is

E: Sub-process /usr/bin/dpkg returned an error code (1)

This is very generic and the solution will be different in each case.

Further reading:

The Debian Reference Chapter 2: Package Management