dpkg (Debian Package) is the software at the base of the package management system in the free operating system Debian and its numerous derivatives.
dpkg is used to install, remove, and provide information about .deb packages.
dpkg itself is a low-level tool.
APT (Advanced Package Tool), a higher-level tool, is more commonly used than
dpkg as it can fetch packages from remote locations and deal with complex package relations, such as dependency resolution. Frontends for
APT, like aptitude (ncurses) and synaptic (GTK), are used for their friendlier interfaces.
The Debian package “dpkg” provides the
dpkg program, as well as several other programs necessary for run-time functioning of the packaging system, including:
dpkg-trigger. It also includes the programs such as
To install a
dpkg -i filename.deb
filename.deb is the name of the Debian package (such as
The list of installed packages can be obtained with:
dpkg -l [optional pattern]
To remove an installed package:
dpkg -r packagename
If you run into conflits installing a package and running the
apt command keeps producing errors, then the following steps may help repair your system.
sudo dpkg --configure -a to try reconfiguring the
dpkg database. This should produce a list of the software packages causing errors.
Now remove the packages causing issues by running,
sudo dpkg --force-all -P <software packages> (listing all the software packages from the previous step).
sudo apt install -f and
sudo apt autoremove to get back to a working state.
You should now be able to run
sudo apt update && sudo apt upgrade without errors.