Cleaning up a Debian GNU/Linux (or Ubuntu), reprise

My little article Cleaning up a Debian GNU/Linux was published at Debian Administration where lot’s of people replied with other ways to achieve the same goals. It was very nice to see all the different approaches with all the different pros and cons.

In the end I ended up changing my own approach for one that is faster and cleaner so I wanted to share it with you. Still, go to the Debian Administration version of the article and read the comments, they are very cool (thanks to all those who posted!).

Here’s the approach: I mark all the packages as automatically installed:

aptitude --schedule-only markauto ~i

This doesn’t really mark them; if it did, it would also remove them (try dropping the “–schedule-only” and you’ll see what I am talking about).

Then I run aptitude in graphical mode, that is, by:


there I press “g” to perform the actions… what actions ? the previously scheduled ones. It’ll mark every single package as automatically installed so it’ll show you a long list of packages to remove (all of them ? it’d be interested to let it run and see where it dies). I read the list, one by one, pressing “+” on each one I want to mantain installed. Automatically the dependencies will be marked as not-to-delete (although they’ll remain in auto mode). Once you finish you press “g” again and that’s it, it’ll remove all the un-needed packages.

To remove the configurations of those packages no longer needed (you have made backups first… no, it’s not a question) I run:

aptitude purge ~c

Thank you to the anonymous poster of this last tip and Kevin Locke for the previous one and let me repeat again: if you are interested in this, go see the comments, they are very interesting.

I also mentioned Ubuntu because this works for Ubuntu as well (actually, the last times I’ve used it was on Ubuntu installations). It will also work in other members of the Ubuntu family, like Kubuntu, Edubuntu and Xubuntu as well as other Debian derivate like Mepis.

You may also like:

Leave a Reply

Hi, I'm Pablo, this is my web site. You can follow me or connect with me:

Or get new content delivered directly to your inbox.

Join 4,025 other subscribers

I'm writing a book

Stack of copies of How to Hire and Manage Remote Teams

How to Hire and Manage Remote Teams, where I distill all the techniques I've been using to build and manage distributed teams for the past 10 years.

I write about:

announcement blogging book book review book reviews books building Sano Business C# Clojure ClojureScript Common Lisp database Debian Esperanto Git history idea Java Kubuntu Lisp music Non-Fiction OpenID programming Python Rails rant re-frame release Ruby Ruby on Rails Sano science science fiction security self-help Star Trek startups technology Ubuntu video web Windows WordPress

I've been writing for a while:

%d bloggers like this: