Remove RC Packages in apt-get Based Systems
  Apr 18, 2010

First, see what stray packages are on the system so you know what is about to get deleted.

  1. $ dpkg -l | grep ^rc | cut -d ' ' -f3 | less

What just happened there? We listed the packages that are installed with dpkg -l, filtered out results to only show lines starting with rc, then further trimmed the output to the third column which contains only the package names. less just allows us to easily scroll through the output in the terminal.

Now that you have verified what packages are going to be deleted and taken care of any loose ends, you should then be able to append a simple command to purge the packages in question.

  1. # dpkg -l | grep ^rc | cut -d ' ' -f3 | xargs dpkg -P

You can use sudo on the xargs command if you are a user and need priviledges.

xargs is a handy command that allows you to pipe output delimited by tab, space, etc and do an action on each value. In this case, we have a list of packages that we need to purge, so we run dpkg -P one each package name that we extract.




Post a New Comment

Name

Message

Security
Code

        (case insensitive & space between words)