Ubuntu – How to remove orphaned files and residues

12.04aptsynapticuninstall

I'm using 12.04 LTS. After uninstalling unwanted packages using purge and autoremove commands I still have orphaned files in system / home directory (configuration and cache files mostly).

Just to make it clear used synaptic to clean the residual configurations, which removed the listed packages but some of the uninstalled package left various directories across system.

Is there a way how to completely get rid of those unwanted files?

I'm not fan of janitor and bleechbit type of software and consider it somehow dangerous, but do not want to bloat my system with files I do not need anymore. Used fslint which looks good for a duplicate files but fails to find residues and similar files.

Any suggestions?

Best Answer

Kinda embarrassing answering to my own question but found a solution how to remove orphaned packages that satisfies my needs.

First I made a new custom filter in Synaptic package Manager.

Settings -> Filters Than Deselected All and checked only Orphaned check box and saved.

Now synaptic is listing all orphaned files. Note that synaptic will list files with no dependencies as orphaned too so don't remove anything you're unsure what it is (and if it is really orphaned).

Than I installed GtkOrphan using CLI sudo apt-get install gtkorphan which is a GUI for deborphan but adds option to remove packages too.

Once started GtkOrphan and has to be run as root, under Orphaned packages tab expand the Options and check the "Show all orphan packages, not only those in the libs section". After that GtkOrphan will report as "orphaned" all packages that have no dependencies too, for example libreoffice, ubuntu-desktop, ubuntu-restricted-extras, myunity and etc. Now you can check the list and using right-click context menu chose to hibernate each package you don't want to be reported as orphaned. List of hibernated packages can be accessed from right click context menu or View menu.

Always under Orphaned packages tab and expanded Options check the "Show uninstalled packages with orphaned configuration files". Before removing anything make sure you know what are the files you want to delete. In my case GtkOrphan found some old nautilus configuration files not shown in Synaptic Package Manager.

In case you delete some of configuration files you need re-installing the package should solve the problem.