Stop! I think I see where we are getting confused.
When you said “orphan”, did you mean “orphan”,a person
who has lost his parents, or “often”, frequently?
The Major General,
The Pirates of Penzance [1]

AGRA has managed to collect a fair amount of stranded *choss* during its life as the sniffer box, and it is time to see if I can clean it up. The package manager apt-get is pretty handy but doesn’t cover all of the bases … I need to kill off the orphans.
Deborphan:
deborphan finds packages installed on your Debian/GNU system that have no other packages depending on them. Its primary goal (and default action) is to trace unused libraries. A dialog frontend, orphaner, is included in the package for easy removal of packages. [2]Author: Peter Palfrader (Weasel)
Ok, this is pretty cool, how do we use it?
Removing unnecessary packages with deborphan
Posted by Steve in the Packages section on Thu 5 May 2005 at 17:42 [3]
Over time most Debian installations acquire packages which are no longer required - they’ve just been pulled in to satisfy dependencies of software you’ve since removed. Whilst there are many ways to fix this, the deborphan package is probably the simplest.
deborphan looks for orphaned packages, that is packages which are not required by any other package upon your system.
For example, if you install the game late as follows you’ll see that you’ve pulled in a new package late-data:
root@debian-box:~# apt-get install late
Reading Package Lists... Done
Building Dependency Tree... Done
The following extra packages will be installed:
late-data
The following NEW packages will be installed:
late late-data
If you later decide to remove the late package you could do that easily :
dpkg --purge late
But you’ve left the late-data package upon your system, redundent and orphaned. You could manually remove this, but what about other similar packages you might have lying around, getting needlessly upgraded and wasting disk space?
Enter deborphan. Install it:
root@debian-box:~# apt-get install deborphan
Once installed simply run it to display a list of the packages it thinks you don’t need upon your system:
usr@debian-box:~$ deborphan
libsdl-image1.2
(Note that you don’t need root privileges to use this tool, it merely reads the installed package lists – it won’t remove any packages itself, merely tell you what it thinks you should remove).
As we can see it’s decided that the libsdl-image1.2 package isn’t required, because no currently installed package depends upon its presence.
There are some other options you can give to the command, which increase it’s ability to spot things. These are the “–guess-foo” options. By default it will only list packages which are in the libraries section of the Debian archive, as these are the most likely candidates for removal.
In addition to showing removable library packages it allows you to display potentially orphaned data packages:
usr@debian-box:~$ deborphan --guess-data
late-data
The manpage shows this option as well as other “guessing” options, and you can read it by invoking:
man deborphan
If you wish to see all the packages which aren’t required you could run:
usr@debian-box:~$ deborphan --guess-all
libxpm-dev
libxp-dev
xprt-xprintorg
libxrandr-dev
libxtst-dev
pm-dev
late-data
libjpeg-progs
libxmuu-dev
libxtrap-dev
libhtml-parser-perl
libxmu-dev
Most of the packages it reports are development packages, not required per se, but required if you wish to build things from source and link against package libraries.
As with most common jobs in Debian there are alternative methods of cleaning up your system, such as the cruft package.
Additionally some of the package managers such as aptitude and dselect allow you to handle orphaned packages – but I’ve always thought deborphan was a very underated tool!
There are a few things that will be identified that are not safe to delete eg. shellutils & textutils; you can allow for these exceptions;
apt-get remove $(deborphan |grep -v shellutils |grep -v textutils)
You can also ad them to Deborphan’s “white list”
deborphan -A shellutils
A faster method if you have a white list;
deborphan | xargs apt-get --purge remove -y
It is probably worthwhile fixing any dependancies at the same time;
apt-get install -f
agra:~# apt-get remove $(deborphan |grep -v shellutils |grep -v textutils)
Reading Package Lists... Done
Building Dependency Tree... Done
The following packages will be REMOVED:
lesstif1 libaiksaurusgtk0c102 libcapplet0 libcapplet1 libcroco2 libdb4.0
libdevmapper1.00 libdns11 libexif9 libgal19 libgc1 libgdbmg1 libghttp1
libgimp1.2 libgnome-vfs0 libgnutls10 libgnutls5 libgnutls7 libgssapi1-heimdal
libgtkhtml20 libgtkxmhtml1 libgtop1 libgucharmap3 libgucharmap4 libhowl0
libident libidn9 libkeynote0 libmagick5.5.7 libmimelib1 libmm13 libmpeg1
libmysqlclient10 libnspr4 libnss3 libots0 libpam-cracklib libpanel-applet0
libpcap0 libpisock4 libpsiconv5 libqt2 libraw1394-5 libsasl7 libslp1
libssl0.9.6 libwmf0.2-2 libwpd4 libwraster2 libwv2-1 libxslt1 libzvt2
libzvt2.0-0 xlibmesa3
0 upgraded, 0 newly installed, 54 to remove and 0 not upgraded.
Need to get 0B of archives.
After unpacking 37.8MB disk space will be freed.
Do you want to continue? [Y/n]
agra:~#
...
{several itterations}
...
agra:~# apt-get install -f
Reading Package Lists... Done
Building Dependency Tree... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
agra:~# deborphan
agra:~#
Much better
I ask you, have you ever known what it is to be an orphan?
- The Major General,The Pirates of Penzance [1]
[1] The Pirates of Penzance: Vocal Score by W. S. Gilbert, Arthur Sir Sullivan
[2] http://freshmeat.net/projects/deborphan/ [freshmeat]
[3] http://www.debian-administration.org/articles/134 [debian-administration.org]