Monday, July 18, 2005

Cleaning Up Your Debian Box

If you use Debian GNU/Linux, you know that it has a solid reputation of stability and durability. I just recently upgrade a file/print server here at work from the "Woody" distribution to the newest stable release - "Sarge". The upgrade proceeded without a hitch, and it was all done by editing a single file and then issuing one command from the bash shell. It doesn't get much better than that for the ever-stressed out network administrator! Furthermore, Debian provides extremely timely security updates which are likewise installed in the same painless manner as the distribution.

For those who would prefer to be more on the cutting edge of Debian development, there are also "testing" and "still in development" distributions which provide more recent packages. These meta-distributions are actually the workplaces for the next stable release, but are constantly upgraded as packages are improved, fixed, etc. These testing distributions are also pretty damn stable, but there is more package-churn here than in the stable branch, where packages are updated only for security issues.

The only downside to Debian's stability is that over the long period of time in one of the testing distros, you can get some unused packages left behind. Today, I found a useful package in Debian called deborphan. As you might guess, deborphan scans the list of installed packages, searching for orphaned libraries that are no longer needed. Using the list it prints out, you can then remove these orphaned packages and free up some disk space.

If you don't have deborphan installed yet, install it:

apt-get update
apt-get install deborphan

Of course, you could use aptitude as well - whatever you prefer. Next step, run deborphan and see what packages it thinks you no longer need:

deborphan

Look through the list carefully, and make sure that nothing seems out of the ordinary. If you want to fully remove all of the listed packages, then try:

deborphan | xargs apt-get --purge remove -y

This command will purge all of the packages listed in the previous step from your system. I just did this a few minutes ago on my Debian sid workstation, and it freed up around 106 MB.

1 comment: