Clean up your Ubuntu with deborphan

Welcome to Linux Screw! If you're new here, you may want to subscribe our RSS feed.

clean upIf you want to clean up your Ubuntu or Debian machine and delete unnecessary (orphaned) deb packages you can use utility deborphan. It finds packages that have no packages depending on them. The default operation is to search only within the libs and oldlibs sections to hunt down unused libraries.

Install deborphan with command sudo apt-get install deborphan and then let’s proceed with cleaning up. To delete unnecessary libraries just execute:
sudo deborphan | xargs sudo apt-get -y remove --purge

To delete unnecessary data packages use command:
sudo deborphan --guess-data | xargs sudo apt-get -y remove --purge

To see all packages which aren’t required by any others use command
deborphan --guess-all

At my Ubuntu laptop I’ve got the following output:
gstreamer0.10-plugins-bad-doc
libusb-dev
libgstreamer-perl
gstreamer0.10-plugins-bad-dbg
gstreamer0.10-plugins-good-doc
...
libgstreamer-gconf0.8-dev
gstreamer0.10-gnonlin-dev
gstreamer0.10-plugins-ugly-multiverse-dbg
gstreamer0.10-plugins-base-dbg
gstreamer0.10-plugins-ugly-doc
libxcomposite-dev

gtkorphanThere is another tool to delete orphaned packages, it’s GtkOrphan (sudo apt-get install gtkorphan) that does the same as deborphan but is built as graphical application. Once it’s installed go to System –> Administration –> Remove Orphaned Packages, enter your password and proceed with cleaning up.

Another nice tip is to clean partial and orphaned packages by commands:
sudo apt-get autoclean
sudo apt-get autoremove

 
 
» You might also be interested in the following articles:
Linux networking stack understanding
Fun: How To Make Windows look like Ubuntu Linux
Switch to Ubuntu from different Linux distros or other OSes
Free Ubuntu 7.10 Desktop Course is available
Future plans for Ubuntu 9.04 (Jaunty Jackalope)



» Want to stay up to date? Subscribe to our E-MAIL or RSS feed!


3 Responses to “Clean up your Ubuntu with deborphan”


  1. 1 techblog

    Just always use aptitude instead of apt-get, and you won’t have to..

  2. 2 artiomix

    Hi Kevin,

    You’re right, actually I recommend aptitude too, but there are people who use apt-get still. This is primarily for them :)

    Thanks for comment!

  3. 3 Serdar Osman Onur

    Starting with the edgy, aptitude and apt-get has the same functionality when you consider the dependency removal.

Leave a Reply

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word




Friendly Sites:Who is behind Linux Screw?
Aspiring Sysadmin | GeekyBits³ | Bash Cures Cancer | TOTMS
Linux Operating System | Small Linux Deployments | My SysAd Blog
The Danesh Project | ZEPY | Linux config Wiki | Planet Sysadmin
The Sys Admin | {buhay sysad} | a non-geek's linux notes
Linux HOWTOs, Tutorials & Projects with Adam Palmer | LinuxAlt.Com
My name is Artem Nosulchik (artiomix AT gmail DOT com) and I'm Linux/Unix, Cisco systems engineer. The main idea of Linux Screw is to share relevant knowledge, skills and observations over The Web. Here you can find a lot of information related to different Linux distributions, FreeBSD, IOS as well as a other Open Source around staff. Read more ››