You are on page 1of 2

dpkg command cheat sheet for Debian Linux dpkg is package manager for Debian Linux which is use

to install/manage individual packages. Here is quick cheat sheet you will find handy while using dpkg at shell prompt:
Syntax dpkg -i {.deb package} dpkg -i {.deb package} Description Install the package Example dpkg -i zip_2.313_i386.deb

Upgrade package if it is dpkg -i zip_2.31installed else install a fresh 3_i386.deb copy of package Install all packages dpkg -R {Directory-name} dpkg -R /tmp/downloads recursively from directory Remove/Delete an dpkg -r {package} installed package except dpkg -r zip configuration files Remove/Delete everything dpkg -P {package} including configuration dpkg -P apache-perl files List all installed packages, dpkg -l along with package dokg -l | less dpkg -l version and short dpkg -l '*apache*' description dpkg -l | grep -i 'sudo' List individual installed packages, along with dpkg -l {package} dpkg -l apache-perl package version and short description Find out files are provided by the installed package dpkg -L apache-perl dpkg -L {package} i.e. list where files were dpkg -L perl installed List files provided (or owned) by the package i.e. List all files inside debian dpkg -c dc_1.06dpkg -c {.Deb package} .deb package file, very 19_i386.deb useful to find where files would be installed Find what package owns dpkg -S /bin/netstat dpkg -S {/path/to/file} the file i.e. find out what dpkg -S /sbin/ippool package does file belong Display details about package package group, version, maintainer, dpkg -p {package} dpkg -p lsof Architecture, display depends packages, description etc dpkg -s {package} | grep Find out if Debian package dpkg -s lsof | grep Status Status is installed or not (status)

apt-get command cheat sheet for Debian Linux apt-get is the command-line tool for handling packages for Debian Linux which is use to: Install/manage individual packages Upgrade packages Apply security patch(s) Keep Debian system up to date Download source .deb files Has many GUI and other utilities as front-ends Here is quick cheat sheet you will find handy while using apt-get at shell prompt:
Description Example(s) Install the new package. If apt-get install zip package is installed then apt-get install {package} apt-get install lsof samba try to upgrade to latest mysql-client version Remove/Delete an apt-get remove {package} installed package except apt-get remove zip configuration files apt-get --purge remove Remove/Delete everything apt-get --purge remove {package} including configuration files mysql-server Resynchronize the package index files and apt-get update Upgrade the Debian Linux apt-get update apt-get upgrade system including security apt-get upgrade update (Internet access required) Usually use to upgrade to Debian distribution. For example Woody to Sarge upgrade. 'dist-upgrade' in addition to performing the function of upgrade, also intelligently handles apt-get update changing dependencies apt-get update apt-get dist-upgrade with new versions of apt-get dist-upgrade packages; apt-get has a "smart" conflict resolution system, and it will attempt to upgrade the most important packages at the expense of less important ones if necessary. Syntax