About DPKG

ref http://www.cyberciti.biz/howto/question/linux/dpkg-cheat-sheet.php
ref http://linuxprograms.wordpress.com/2010/05/14/dpkg-tutorial/

Very thank for Owners of 2 links above.


The first column corresponds to the status of a package. How to interpret this status.
Status of every package is represented by three characters xxx
Let’s explore each of the character signify.
First character: The possible value for the first character. The first character signifies the desired state, like we (or some user) is marking the package for installation
  1. u: Unknown (an unknown state)
  2. i: Install (marked for installation)
  3. r: Remove (marked for removal)
  4. p: Purge (marked for purging)
  5. h: Hold
Second Character: The second character signifies the current state, whether it is installed or not. The possible values are
  1. n: Not- The package is not installed
  2. i: Inst – The package is successfully installed
  3. c: Cfg-files – Configuration files are present
  4. u: Unpacked- The package is stilled unpacked
  5. f: Failed-cfg- Failed to remove configuration files
  6. h: Half-inst- The package is only partially installed
  7. W: trig-aWait
  8. t: Trig-pend
Let’s move to the third character
Third Character: This corresponds to the error state. The possible value include
  1. R: Reinst-required The package must be installed.


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

Comments

Popular posts from this blog

Return Code 127