Debian Tips: Clean your system of orphaned libraries

Even if the Debian package system works extremely well, after running a system and keeping it updated for some longer time, there will remain some orphaned packages. What I am interested is to clean up the remaining orphaned libraries that are no longer in use.

This is exactly what the deborphan package does. From its description: “deborphan finds “orphaned” packages on your system. It determines which packages have no other packages depending on their installation, and shows you a list of these packages. It is most useful when finding libraries, but it can be used on packages in all sections.”

Just install it:

aptitude install deborphan

Normally I use it by simply typing:

deborphan

and this will show a list of the libraries that are obsolete and then I clean them using aptitude with purge. I prefer to use it like this, because it will give me the control on future actions (it will only report the orphaned packages without taking any action). If I choose, I can remove, if not they can stay.

There are many other options that can be used (just check the man page or help for full usage).

This tool has also a nice front-end called orphaner. What is cool about this (and I am using this when I have to clean up many obsolete packages) is that you can simulate its actions and select this way all the dependencies.

I usually call this with the purge option (that will result in purging the actual packages):

orphaner --purge

Here is a screenshot of how orphaner looks:
orphaner screenshot

Note: don’t blame me if this will break your system… You are always in control and you decide what to remove and what to keep installed on your own system ;).

comments powered by Disqus