Home » Distros » Debian » Clean Up Your Ubuntu With Deborphan

Clean up your Ubuntu with deborphan

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

SHARE:
Photo of author
Author
My name is Stefan, I'm the admin of LinuxScrew. I am a full-time Linux/Unix sysadmin, a hobby Python programmer, and a part-time blogger. I post useful guides, tips, and tutorials on common Linux and Programming issues. Feel free to reach out in the comment section.

3 thoughts on “Clean up your Ubuntu with deborphan”

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

    Reply
  2. sudo apt-get install deborphan; sudo deborphan | xargs sudo apt-get -y remove –purge

    worked and it removed 46 packages and obtained 16.6MB of free disk space on my computer (Xubuntu Lucid.) Thanks 😉

    Reply
  3. I still show a bunch of packages using “–guess-all” that are still hanging around. Any suggestion for getting rid of those?

    Reply

Leave a Comment