HOWTO Clean packages on a Debian system

This article was first written in July 2005 for the BeezNest technical
website (
A Debian system can take more and more disk space as you install new packages. Let's see how we can detect which packages are no longer used (unsused/obsolete/transitional) and clean them if we are sure we don't need them anymore. First, it is good to know that when you use apt (apt-get, aptitude, dselect, synaptic, ...) the files downloaded are stored in /var/cache/apt/archives, and never cleaned.