Debian Package Management Tools
Perhaps the most interesting and well-known part of the Debian package management system is APT, the Advanced Package Tool. APT, through the apt-get utility, maintains a database of packages available in the repositories that it is configured to check and can handle automatically downloading new or upgraded packages. A program named aptitude has been added to simplify package management, and it acts as an interface for the command line operations of apt-get.
When installing or upgrading packages, APT downloads the necessary files to a local cache directory and then instructs the dpkg tool to take the appropriate actions. Among other things, this allows the user to select programs for addition or removal without having to manually instruct the system to handle any package dependencies.
Most basic package management functions are performed by dpkg, although not always at the direct request of the user. This tool handles medium-level package installation and removal, and also manages the package status database. That database contains information about every package known to dpkg, including the package meta information and two other important fields: the package state and selection state.
NOTE
More information about how to determine the state of a package can be found in the
"Querying the Package Database" section of this chapter.
As its name suggests, the package state indicates the present state of the package, which is one of
the following:
not-installed - The package is known but is not installed on the system.
half-installed - An attempt was made to install the package, but an error prevented it
from finishing.
unpacked - The files have been extracted from the package, but any post-extract configuration steps have not yet been performed.
half-configured - The post-extract configuration was started, but an error prevented it
from finishing.
installed - The package is fully installed and configured.
config-files - The package was removed, but the configuration files still exist on the system.