Last updated: Apr 13, 2007
If you happen to *remove* packages with apt-get or aptitude, there are still fragments of these packages on your system (configuration files etc.). If you want to *purge* a package (ie. remove all the files), you should use:
apt-get --purge remove <package>
or
aptitude purge <package>
I wrote the following script to purge the packages that were removed, but not purged:
#!/bin/sh # # This script purges all the packages that have a status different from ii # 2005 - Julien Valroff <julien@kirya.net> # # Changelog: # 0.01 (16/06/2005) # * Initial release # 0.02 (16/10/2005) # * Fixed possible symlink attacks (uses mktemp) # * Updated regexp # 0.03 (27/11/2005) # * Simplified usage (no question asked) TMPFILE=`mktemp` || exit 1 dpkg -l | grep -v '^ii ' | awk '{print $2}' > $TMPFILE count=$(cat $TMPFILE|wc -l) count=$(expr $count - 5) if [ $count -eq 0 ]; then echo "No package to purge." else var=$(dpkg -l | grep -v '^ii ' | awk '{print $2}' | tail -n $count) sudo aptitude purge $var fi rm -f $TMPFILE
As usual, take care when using this kind of scripts!
UPDATE: aptitude just deals with this automatically with aptitude purge ~c…
You will find here some information about me and my different projects. I am involved in several open source projects, and try to promote Free software. This site is thus mainly dedicated to Free Software use on GNU/Linux systems. Please do not hesitate to contact me for any comments on this site.