The following conventions are used:
- <pkg.deb>: a package file, like xfwp_4.0-10_i386.deb, sitting on
your hard drive.
- <pkg-name>: the name of a package which is already installed on your system,
like xfwp.
- <dir>: a directory name
- <file>: some file on your hard drive.
| Installation and Removal |
| dpkg -i <pkg.deb> |
dpkg --install <pkg.deb> |
Install the package <pkg>, and back up its previous version. |
| dpkg -r <pkg-name> |
dpkg --remove <pkg-name> |
Remove package <pkg> but leave the configuration files in place. |
| dpkg -P <pkg-name> |
dpkg --purge <pkg-name> |
Purge package <pkg>, including the configuration files. |
| Informational |
| dpkg -S <file> |
dpkg --search <file> |
Lists what package the file <file> belongs to. |
| dpkg -l <string> |
dpkg --list <string> |
List all packages matching the regular expression <string>. |
| dpkg -L <pkg-name> |
dpkg --listfiles <pkg-name> |
List all the files provided by the installed package <pkg-name>. |
| dpkg -c <pkg.deb> |
dpkg --contents <pkg.deb> |
List the files provided by the package file <pkg.deb>. |
| dpkg -p <pkg-name> |
dpkg --print-avail <pkg-name> |
List detailed information about the package <pkg-name>. |
| dpkg -I <pkg.deb> |
dpkg --info <pkg.deb> |
List detailed information about the package file <pkg.deb>. |
| Configuration And Status |
| dpkg -s <pkg-name> |
Report status on the packkage <pkg-name>. |
| dpkg -C |
Report all half installed packages. |
| dpkg --configure <pkg-name> |
Configure the package <pkg-name>. |
| dpkg --configure --pending |
Configure all package which need configuring. |
| Miscellaneous |
| dpkg -x <pkg.deb> <dir> |
Extract a package file into directory <dir>. |
| dpkg -X <pkg.deb> <dir> |
Lists files as it extracts them, like tar's v option. |
Sometimes dpkg won't install or delete a package. There could be a whole host of reasons,
including package dependencies or the package was compiled for a different architecture. You can
always force the issue. See dpkg --force-help for details.
dpkg understands shell globbing type metacharacters (such as the wildcard *). For example,
to list all Tcl packages, use dpkg -l "tcl*". You need to use quotes to protect the
asterisk from being interpreted by the shell (which happens before the shell passes -l
"tcl*" to dpkg). I suppose you could do something like dpkg -r "*", but frankly,
I'm too scared to even try.