packages marked as rc (dpkg -l)

on

After cleaning a bit my raspberry pi 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

u Unknown
i Install
r Remove
p Purge
h Hold

Second column: Status

n Not Installed
i Installed
c Config-files
u Unpacked
f Failed-config
h Half-installed

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

(none)
h Hold
r Reinst-required
x both-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 --list | grep "^rc" | cut -d " " -f 3 | xargs sudo dpkg --purge