Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have the following problem, I've installed a bunch of Ubuntu packages ever since I used Ubuntu, now I've removed these packages using the Synaptic Package Manager but somehow it still left hidden folders in my home directory for the specific applications I uninstalled, taking up unnessesary diskspace. eg. .Netbeans and .amarok etc

Is there a way to detect these folders that are no longer in use automatically and delete them?

share|improve this question
add comment

4 Answers

up vote 10 down vote accepted

Take a look into the folders that bother you, to see if there is anything of value in there, and - if you're happy with losing the data - just delete them (just in case, you might choose to leave them in the trash for a few weeks).

In the future, you can instruct your package manager to remove the application as well as associated system-wide configuration files by doing a purge.

  • In synaptic, right click the package and select Mark for complete removal.
  • On the command line, if you prefer, type sudo apt-get purge packagename.

This will delete any configuration and application data that the application has created system-wide, it will - of course - leave intact all the data that you have saved from within the application (i.e. NetBeans' project directory), this includes all the user-specific configuration that is saved in your home directory. Manual deletion is the only way to get rid of those.

If you want to find out what folders take up much space, there's the Disk Usage Analyser (Applications → Accessories → Disk Usage Analyser), select the "scan home" option to get a listing of everything in home, including hidden files.

Also, use the Computer Janitor (System → Administration → Computer Janitor) to clean up any rubbish that has been left behind by the package manager. In terms of the command line, this would be equivalent to doing sudo apt-get autoremove && sudo apt-get autoclean.

Some applications, like NetBeans and AmaroK, may leave behind quite a bit of data. But there is no way for the system to automatically delete them without the risk of deleting something somebody actually wanted to keep. For the users' sake, there's no such feature; a good job considering you might have used netbeans for a few years before removing it - i'd be really annoying if apt deleted all your work to free 500 kilobytes. :-)

share|improve this answer
3  
The purge command and related Synaptic feature does not remove config files from the user /home. It removes configs from /etc and probably other system folders. They only way I know to remove hidden config folders from /home is manual deletion. –  lovinglinux Nov 23 '10 at 11:22
    
Edited the answer accordingly, thank you! –  Stefano Palazzo Nov 23 '10 at 11:25
add comment

The Mundus project is building some software designed to make it easier to clean up unused files in a home directory. See: http://blog.mundusproject.org/

share|improve this answer
add comment

There's no way how to detect these unused folders reliable. A program can choose any folder name to save the user information. There's not necessarily a relation between folder name and program name.

In most cases it's not worthwhile delete this folders because most of them occupy very little space. And if you ever reinstall the program all your data is still there.

You can however manually delete folders which occupy very much space. You have to guess if the folders aren't used anymore. You may want to backup these folders first.

The space occupied by each folder can be listed with a graphical file manager or on a console with a command like this:

cd "$HOME"
du -h --max-depth 1
share|improve this answer
add comment

Well, I had the same problem once, and I just opened nautilus, pressed Ctrl+h to view hidden files, and sorted them by date. I found lots of folders that werent modified beyond a certain date. Take note though, I had installed a new fresh version of Ubuntu, and hence some applications had newer modified dates, which helped me to sort.

I am not sure about this: Some applications might change files inside the folder, but the folder date wont be modified. You have to check for that too.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.