packages marked as rc (dpkg -l)

After cleaning one of my Ubuntu VPS’es I found some packages marked with rc after executing dpkg -l

$dpkg -l
[..]
ii  leafpad
ii  less
rc  liba52-0.7.4
rc  libaa1:armhf
ii  libacl1:armhf
[..]

What’s that ii and rc mean.
Actually it has not 1 but 3 meaning’s:
First column: Desired

uUnknown
iInstall
rRemove
pPurge
hHold

Second column: Status

nNot Installed
iInstalled
cConfig-files
uUnpacked
fFailed-config
hHalf-installed

And there is also a third column: Err? (error?) – If in uppercase, bad errors.

 (none)
hHold
rReinst-required
xboth-problems

So in my case let’s count them:

$dpkg -l | cut -d" " -f1 | sort | uniq -c
[..]
662 ii
46  rc

So I have 662 Correctly installed packages (ii) and 46 packages that are remove, but where still config-files for exist(rc).

Now let’s clean the system of this config files (purge): pipe the packagenames into sudo dpkg –purge (with use of xargs).

$dpkg -l | grep "^rc" | cut -d " " -f 3 | xargs sudo dpkg --purge

This post was copied from my other (deprecated) blog: knilluz.buurnet.nl blog