Skip to content

Latest commit

 

History

History
141 lines (93 loc) · 2.3 KB

deb-cheat.org

File metadata and controls

141 lines (93 loc) · 2.3 KB

deb Cheat

Tools

dpkg

dpkg operates on individual packages. It does not handle dependencies.

apt-get

apt-get is a low level package management system that installs and removes packages along with dependencies. It is a stable, low level tool that has a dependeble ui.

apt-cache

Performs various operations on the package cache.

apt

apt is a more user friendly tool. It’s ui may change and improve.

Common Actions

List all available packages

Package name and one line description

apt-cache search .

Not a pleasing format

apt list --all-versions

List installed packages

dpkg --get-selections | grep -v deinstall

Shows a one line description as well

dpkg -l
apt list --installed

Install a package

apt-get install <package-name> [<package-name> ...]
apt install <package-name> [<package-name> ...]

Install from a deb file.

sudo apt install ./<deb-filename>

Remove a package

apt-get remove <package-name>
apt remove <package-name>

Purge removes all configuration files as well

apt-get purge <package-name>
apt purge <package-name>

Autoremove removes packages that were auto installed an no longer needed.

apt-get autoremove <package-name>
apt autoremove <package-name>

Display information about a package

Information is not that useful but it has a multi-line description.

dpkg show <package-name>
apt show <package-name>

Display information about a .deb file.

dpkg-deb -I <deb-filename>

Display files for installed package

dpkg -L <package-name>

Update installed packages

First update the cached list of available packages and then upgrade installed packages. You should normally run these consecutively.

apt-get update <package-name>
apt-get upgrade <package-name>
apt update <package-name>
apt upgrade <package-name>