dpkg

DPKG Cheatsheet #

dpkg is a low-level package management tool for Debian-based systems. It is used to install, remove, and manage Debian packages.

Basic Commands #

Command/OptionExampleDescription
dpkg -i <package.deb>dpkg -i nginx_1.14.0-0ubuntu1_amd64.debInstall a Debian package
dpkg -r <package>dpkg -r nginxRemove a package, but keep configuration files
dpkg -P <package>dpkg -P nginxPurge a package, removing configuration files
dpkg -ldpkg -lList all installed packages
dpkg -L <package>dpkg -L nginxList all files installed by a package
dpkg -S <file>dpkg -S /usr/sbin/nginxFind the package that owns a specific file
dpkg -c <package.deb>dpkg -c nginx_1.14.0-0ubuntu1_amd64.debList the contents of a Debian package file

Package Information #

Command/OptionExampleDescription
dpkg -s <package>dpkg -s nginxDisplay detailed information about an installed package
dpkg -p <package>dpkg -p nginxDisplay detailed information about a package that is not installed

Configuration and Status #

Command/OptionExampleDescription
dpkg --configure -adpkg --configure -aReconfigure unpacked packages that have not yet been configured
dpkg --auditdpkg --auditReport packages with problems (e.g., broken dependencies)

Miscellaneous #

Command/OptionExampleDescription
dpkg-deb -b <directory> <package.deb>dpkg-deb -b mypackage mypackage_1.0-1_all.debBuild a Debian package from a directory
dpkg-deb -x <package.deb> <directory>dpkg-deb -x nginx_1.14.0-0ubuntu1_amd64.deb /tmp/nginxExtract the contents of a Debian package file

This cheatsheet covers essential dpkg commands and options for managing Debian packages on Debian-based systems.

dpkg

Explore our comprehensive cheatsheets to enhance your knowledge and efficiency. Each cheatsheet provides detailed command options, examples, and descriptions to help you master various tools and technologies.