Jumping between Debian and RedHat based Linux distros can be confusing sometimes for me. This is why I decided to create this short Debian Package Management guide. But, first I need to brew a good cup of Catimor coffee variety at home.
Brief terms:
dpkg – Low-level tool to manage .deb packages.
apt, apt-get, apt-cache – High-level front ends for package management (use online repositories).
Install, Upgrade, and Uninstall Debian Packages
Install a .deb package (local file):
sudo dpkg -i package-name.debFix missing dependencies (after installing a .deb manually):
sudo apt -f installUpgrade an installed package:
sudo apt upgrade package-nameOr all upgrade ALL packages:
sudo apt update && sudo apt upgradeUninstall a package (local):
sudo dpkg -r package-nameRemove completely with configuration files:
sudo dpkg -P package-nameInstall from the repository:
sudo apt install package-nameFind Packages Containing Specific Files or Libraries
Search for a file in installed packages:
dpkg -S /path/to/fileFor example:
dpkg -S /bin/lnObtain Package Info: Version, Content, Dependencies, etc.
Check if a package is installed:
dpkg -l | grep package-nameShow details about a package:
dpkg -s package-nameList files installed by a package:
dpkg -L package-nameShow dependencies of a package:
apt depends package-nameShow reverse dependencies (who depends on it):
apt rdepends package-nameCommon apt commands:
| Task | Command |
|---|
| Update repo list | sudo apt update |
| Install a package | sudo apt install htop |
| Upgrade installed packages | sudo apt upgrade |
| Remove a package | sudo apt remove package-name |
| Full removal (with config) | sudo apt purge package-name |
| Clean downloaded files | sudo apt clean |
| Autoremove unused packages | sudo apt autoremove |
If you like this article and want to support me consider buying a T-Shirt or coffee mug from my shop. Thanks.

