Running Linux, 5th Edition - Matthias Kalle Dalheimer [222]
Selecting previously deselected package superfrob.
(Reading database ... 159540 files and directories currently installed.)
Unpacking superfrob (from superfrob_4-1_i386.deb) ...
dpkg: dependency problems prevent configuration of superfrob:
superfrob depends on frobnik (>> 2); however:
Package frobnik is not installed.
dpkg: error processing superfrob (--install):
dependency problems - leaving unconfigured
Errors were encountered while processing:
superfrob
The output indicates that you would need frobnik Version 2 or later for the package to install completely. (The files in the package are installed, but they may not work until frobnik is installed too.)
Unlike RPM, dpkg doesn't make a distinction between installing a new package and upgrading an existing one; the -i (or --install) option is used in both cases. For example, if we want to upgrade superfrob using a newly downloaded package superfrob_5-1_i386.deb, we'd simply type:
tigger # dpkg -i superfrob_5-1_i386.deb
(Reading database ... 159546 files and directories currently installed.)
Preparing to replace superfrob 4-1 (using superfrob_5-1_i386.deb) ...
Unpacking replacement superfrob ...
Setting up superfrob (5-1) ...
To uninstall a package, you can use either the -r (--remove) or -P (--purge) options. The --remove option will remove most of the package, but will retain any configuration files, while --purge will remove the system-wide configuration files as well. For example, to completely remove superfrob:
tigger # dpkg -P superfrob
(Reading database ... 159547 files and directories currently installed.)
Removing superfrob ...
dpkg can also be used to find out what packages are installed on a system, using the -l (--list) option:
tigger $ dpkg -l
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-= == == == == == == =-= == == == == == == =-= == == == == == ==
== == == == == == == == == == == == == == == =
ii a2ps 4.13b-15 GNU a2ps 'Anything to PostScript' converter
ii aalib1 1.4p5-10 ascii art library
ii abcde 2.0.3-1 A Better CD Encoder
...
ii zlib1g-dev 1.1.3-19 compression library - development
The first three lines of the output are designed to tell you what the first three columns before each package's name mean. Most of the time, they should read ii, which means the package is correctly installed. If they don't, you should type dpkg --audit for an explanation of what is wrong with your system and how to fix it.
You can also use the -l option with a package name or glob-style pattern; for example, you could find out what version of superfrob is installed using the following:
tigger $ dpkg -l superfrob
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-= == == == == == == =-= == == == == == == =-= == == == == == ==
== == == == == == == == == == == == == == == =
ii superfrob 4-1 The superfrobulator
dpkg can also be used to find out the package to which a particular file belongs:
tigger $ dpkg --search /bin/false
shellutils: /bin/false
tigger $ dpkg --search /home/kalle/.xinitrc
dpkg: /home/kalle/.xinitrc not found.
You can also display information about an installed package or .deb archive:
tigger $ dpkg --statusdpkg
Package: dpkg
Essential: yes
Status: install ok installed
Priority: required
Section: base
Installed-Size: 3156
Origin: debian
Maintainer: Dpkg Development Bugs: debbugs://bugs.debian.org Version: 1.9.19 Replaces: dpkg-doc-ja Pre-Depends: libc6 (>= 2.2.4-4), libncurses5 (>= 5.2.20020112a-1), libstdc++2.10- glibc2.2 (>= 1:2.95.4-0.010810) Conflicts: sysvinit (<< 2.80) Conffiles: /etc/alternatives/README 69c4ba7f08363e998e0f2e244a04f881 /etc/dpkg/dpkg.cfg 1db461ac9a1d4f4c8b47f5061078f5ee