Removed packages keep showing up as “rc” in package list. How to get rid of them.

After removing a package, (i.e. with apt-get remove <packagename>), the packages are still displayed when getting a list of all installed packages (i.e. with dpkg -l). The only difference is that the removed packages display “rc” in the first column, whereas the other packages have “ii”. What’s going on?

Answer: When using apt-get remove <packagename>, the package itself is removed. However, the configuration files are kept on disk. When using dpkg -l, these configuration parts show up as “rc”. For example, after removing compiz:

To get the “rc” records out of the list of installed packages, the configuration files need to be removed too. You can use apt-get purge <packagename> on every item that is showing up. However, it is easier to use some scripting that does all the work:

sudo apt-get autoremove -y && sudo apt-get purge `dpkg -l|grep ^rc|awk '{ print $2 }'|tr '\n' ' '`

Sometimes a reboot is necessary before changes getting effective.

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: