cheat.sheets:dpkg
# dpkg
# Package manager for Debian
# Display the package(s) in which the given file would be found. This is very
# useful, because it lets you know to which package a file belongs.
dpkg -S /usr/bin/awk
# Where FILE is the provided Debian package to install, so instructed by `-i`.
dpkg -i [FILE]
# List Debian packages currently installed.
dpkg --get-selections
# List Debian packages installed and in other states, such as not-yet-purged.
dpkg -l
cheat:dpkg
---
tags: [ packaging ]
---
# To install or upgrade a package:
dpkg -i <deb-file>
# To remove a package (including configuration files):
dpkg -P <deb-file>
# To list all installed packages with versions and details:
dpkg -l
# To determine whether a Debian package is installed:
dpkg -s <deb-file> | grep Status
tldr:dpkg
# dpkg
# Debian package manager.
# Some subcommands such as `dpkg deb` have their own usage documentation.
# For equivalent commands in other package managers, see <https://wiki.archlinux.org/title/Pacman/Rosetta>.
# More information: <https://manpages.debian.org/latest/dpkg/dpkg.html>.
# Install a package:
dpkg -i path/to/file.deb
# Remove a package:
dpkg -r package_name
# List installed packages:
dpkg -l pattern
# List a package's contents:
dpkg -L package_name
# List contents of a local package file:
dpkg -c path/to/file.deb
# Find out which package owns a file:
dpkg -S filename
$
cheat.sh