jump to navigation

Better Management of Packages while Uninstalling September 30, 2005

Posted by Carthik in administration, applications, commands, ubuntu.

Have you ever noticed how, when you install a required package using apt-get or synaptic, and lot of associated “required” packages such as library packages and documentation packages are also installed due to the dependencies between packages? There are some “meta-packages” like kubuntu-desktop, for example, which in and of themselves do not install any files on your system, but have a long list of dependencies, which, together assume a cetain function. I installed kubuntu-desktop to try KDE, and later removed it, and was surprised to see that all the dependencies that were installed we not removed! That is where this story began.

What I don’t like is that when I later remove the package I installed earlier, the packages that were installed because they were dpendencies don’t get removed. So, when I installed the package, 30 MB was used, say. Now after unistalling the package, only 5 MB is freed, since the other 25 MB was used up by the dependencies. Over a period of time, this leads to a number of “orphaned” packages remaining on your system. The package or application that used this package has long-since been removed, but apt “ignored” removing these dependency packages.

Now I like my system lean, and more importantly, clean. I use debfoster to keep my system clean over a longish period of time.

Debian uses the main programs apt and dpkg to manage packages. These programs do not make a distinction between packages that got installed because some other program happened to need it and packages you really asked for. Debfoster will help you get rid of packages (libraries for example) get left behind on your system when the program that required it was removed or upgraded to a version that doesn’t have the dependency.

In the above, what is said of Debian is also true of Ubuntu.

Install debfoster, read it’s man page, and take it out on a ride by running it. The first time, it will ask you a few questions. Later, periodically running it will keep your system clean of aliened packages that are no longer needed. If you make a mistake with the answers, you can always edit the file /var/lib/debfosterkeepers which defines the packages you want to remain on your system.

An alternative to debfoster is aptitude (instead of apt-get) but the catch is that one has to always use aptitude instead of apt-get from the very beginning, and if you like me, realized the orphaned packages problem late, then aptitude won’t work.

Of course, I should add that besides occupying some space on your hard drive, and a few extra installed applications, the extra orphaned packages cause no harm.


1. robotgeek - September 30, 2005

On it now! Also a great way to remove those libraries which were needed to compile stuff, but you forgot about!

2. David Pizon - September 30, 2005

deborphan | xargs apt-get –purge remove -y

3. Kuswanto - September 30, 2005

Ah…now i have a clean system too.

Just removed a bunch of GTK+ lib :).

4. Pascal - October 1, 2005

This is quite handy I must say. I like to install a whole load of new stuff, and then get rid of it later. However, I must say I found a whole new alternative to apt-get, dpkg or any rpm/deb/ebuild. Moving slightly off topic, but nonetheless, check this out:


However, I must say, debfoster is still a very trendy tool. I wonder whether it will work on my Suse system with APT (I have apt4rpm installed)…

5. ubuntonista - October 1, 2005

David, that is cool 🙂

Pascal, klik is great, but I figure synaptic, and apt-get with all the associated tools enable me to do things quite well right now – but yes, klik is really cool – I just don’t want to mix and match stuff (apt-get and klik stuff) right now, so will give it a shot later 🙂

As far as I know, debfoster needs to have apt-get with the cache files, logs etc to function. However, I would suggest you give it a shot on your Suse system and see what gives.

6. Deusiah - October 2, 2005

I too tried KDE for as long as I could stand it 😛

It does leave a load of mess all over your system, KDE progs in the Gnome Menu and an “open with” list full of KDE progs which I can’t seem to remove. The remove option is greyed out for these. Why is it that some progs can prevent themselves being removed from the list?

Lucklily I knew what I mess KDE makes and so I decided to only try it when I was nearing a wipe of my machine will will happen as soon as Breezy comes out (the last upgrade had disastorous effects, I think a clean install is easier :P).

My advice is if you want to try KDE get a Kubuntu live CD. Needless to say I have not swiched to the KDE camp, KDE has more features and better support in some areas but it’s not a patch of Gnome in my opinion :).

7. Pascal - October 4, 2005

Deusiah, if you aren’t a fan of KDE, you can still get klik. klik has GNOME support now as well. See:

Also, there are plans for including klik in Ubuntu. There should/may be already a package for Breezy in the universe repositories, and klik might also be included in Dapper (on the CD). See:

You can get klik now on Ubuntu. Run this – wget klik.atekon.de/client/install -O -|sh – in run application and voila. Download the CMG files and you can run apps without installing them. 🙂

There is an Ubuntu forums thread on this, with a fair bit of info regarding klik on Ubuntu, including screenshots:

I’ve written an entry on this subject with multiple other links. See:

Sorry for getting somewhat off topic. 😛
Happy kliking and using Ubuntu!

Pascal Klein

8. UbuWu - October 4, 2005

Support for this kind of functionality is planned to be added to apt in dapper drake, the next ubuntu release after breezy.

9. Basil Crow - October 4, 2005

I may be wrong, but can’t you just use aptitude install packagename and then aptitude will keep track of those funky dependencies and then remove them when you remove the package with aptitude remove packagename?

10. UbuWu - October 4, 2005

Basil Crow, yes, aptitude does that, but apt-get and more importantly synaptic don’t at the moment.

11. UbuWu - October 4, 2005

Also when you have deborphan installed, it is possible to setup a filter in synaptic for orphaned packages.

12. ubuntu_demon - October 6, 2005

I wrote a howto about debfoster here :


13. Nat - October 6, 2005

shiny stuff rocks. you know whats even better than shiny stuff? clean linux systems. thanks for helping my fetish :p

14. Fabio - November 3, 2005

You can also use gtkorphan from debian repositories.


15. pvh - February 28, 2006

GTKorphan is excellent. I hope Adept grows that kind of functionality soon.

16. Chris G. - July 11, 2006

This site (and this post / comment thread) is awesome – a very valuable resource for the community.

17. marc - November 20, 2006

thanx… esp about the debfoster thingy. God bless you

18. seks izle - September 29, 2010

deborphan | xargs apt-get –purge remove -y

19. porno - November 28, 2010

deborphan | xargs apt-get –purge remove -y asdad…

20. Laeylagul Leylagul - January 9, 2012

Wonderful work! That is the kind of info that are meant to be shared around the net. Disgrace on the seek engines for now not positioning this publish upper! Come on over and consult with my website . Thanks =) http://www.chatde.net

21. seo - January 31, 2012

Thank you, I have recently been searching for facts about this subject for ages and yours is the best I have discovered so far.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: