Keeping Ubuntu Tidy Like Your Whities

8072007

Installing and removing programs can clutter up your system. Sometimes certain dependency packages aren’t needed after a program has been uninstalled – so trash it. I have a few handy tricks up my sleeve so you can reclaim some of your disk space back:

Autoremove

apt-get isn’t like your two your old cousin – it can clean up after itself. If you want to get rid of packages that are no longer referenced by your system, its as simple as “sudo apt-get autoremove”in the terminal

Clean

Retrieved or downloaded packages can still remain locally on your system like bad residue. “sudo apt-get clean”will clear the repository completely, leaving only the lock that is used to connect to your repo’s.

deborphan

Sometimes apt-get’s built in cleanup functionality doesn’t cut it. 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. deborphan is in the universe so grab it by typing “sudo apt-get install deborphan.”It should show up under System > Administration > Remove orphaned packages after the install.

Advertisements

Like this:

LikeLoading...

Related

Actions

Information

11 responses

9072007

anandanbu(06:39:04) :

Thanks Sheehan for this wonderful post and i would like to know from where you get these informations that you provide. Anyway all these are really good. Try to leave a comment and anand dot ubuntu at gmail dot com .

anandandbu – thanks for the kind comments! I browse the web and read lots of forum threads and RSS feeds and sometimes I get ideas to write about in my blog, always keep reading thats my advice! All of the tips posted on my blog are the practices I use, so in a sense this blog is also helpful for me to document what I am doing in Ubuntu.

I’m more of a FreeBSD guy, so I haven’t used much Linux other than some mild flirtation with ubuntu. This seems similar to the FreeBSD ports system. From what I understand, Debian uses this as well. However the ports system builds stuff right from the source while recursively going down the dependency tree and building those as well. Does apt-get do something similar? Or does it use pre-compiled binaries (FreeBSD has this as well through pkg_tools)?

The most annoying thing is dependencies; conflicting libraries and such, especially when you upgrade. program-a will use lib-2.2.1 while program-b needs lib-2.2.3 or something. I get that sometimes and because I am really not in a mood to fix it, I’ll force install it :). Symlinking seems to work sometimes. So if you can do:

ln -s /usr/lib/lib-2.2.3.so /usr/lib/lib-2.2.1.so

In fact, I think that’s how I got Quake to run on my FreeBSD machine a few years back. It wanted to use some other libraries. I also had the same problem when I tried to upgrade vim (libiconv was the culprit, I think) I think in most cases the system takes care of the symlinking for you, but if it doesn’t this is something I use to fix it.

Vivin – Ubuntu has its own backports repository which is similar to the BSD ports tree. Most packages in the repos also have references to the src so you could get your hands a little dirty and make them fresh. Dependencies are always a big headache, the way I’ve seen Ubuntu handle things is that you’ll have a bunch of different versions of libs so you don’t break anything. This is where deborphan comes in, once a library has no dependant packages it becomes orphaned and therefore is deleted. Linux by default symlinks things for you, I’ve never had to mess with it though it would be a good learning experience.

Gotcha. That sounds like a good way to do it. The issue with dependencies, I think, is the hurdle with all forms of *nixes (Linux, FreeBSD, whatever). That might be one thing that hinders its adoption by the average user. As soon as you say “well, just open up a terminal window and type…” you’re going way over their head. Which is ironic because back in the days of DOS, people were used to that. In fact, I think computer users were more intelligent back in those days.

I know that PC-BSD solves this by installing pbi (PC-BSD Install packages) files to a /Programs directory and keeping it separate from the system. So each program is essentially in its bubble. If it requires anything crazy, then the installer makes sure to symlink it to the appropriate stuff.