Ubuntu software packaging system can accumulate unused packages or temporary files. These temporary files, also called caches, contain package files from all of the packages that you have ever installed. Eventually, this cache can grow quite large. Removing them allows you to reclaim space on your computer's hard drive for storing your documents, music, photographs, or other files.
To clear the cache you can use either the clean or the auto-clean op for a command-line program called apt-get. The clean command will remove every single cached item, while the auto-clean command only removes cached items that can no longer be downloaded (these items are often unnecessary).

To run clean go to Applications --> Accessories --> Terminal and Type

$ sudo apt-get clean

and it will ask password and give the password

packages can also become unused over time. If a package was installed to assist with running another program- and that program was subsequently removed-you no longer need the supporting package. You can remove it with autoremove

8 thoughts on “How do I cleanup Ubuntu?”

I was a bit disappointed about this post. I expected a bit more information about how to actually clean up your Ubuntu installation. apt-get clean and apt-get autoremove do indeed cleanup a little bit, but most of the time it’s only a little bit of space you free up. And, since the packages aren’t used, they don’t slow down cost anything but disk space.

So I was actually hoping to find some useful tips how to determine what programs are safe to remove and how to find big files and directories that are safe to cleanup. So just a way to really refreshen your Ubuntu installation.

Second, install Ubuntu Tweak and go through all of the cleanup settings.

Third, go to your main folder and hit ctrl-h to show the hidden files. Lots of your programs have a .nameofprogram folder, press shift-delete to remove them if you don’t mind restoring the programs to their default settings. I suggest leaving the Gconf, Fonts, Icons, and Compiz folders alone unless you don’t mind totally resetting all of your custom desktop settings. Use your brain when choosing what to delete.

Fourth, Install “Bleachbit”, go to a terminal and type “sudo bleachbit”, again, be careful what you choose. The wipe free space takes a while but is worth it. Run “Bleachbit as Root” and repeat, this will clear all of the Root settings.

Fifth, type “sudo nautilus” or whatever browser you use, go to the Root directory, and clear all files from the Root directory if you don’t have any reason to retain program settings as a root user.

That cleans the downloaded .deb but if you want to clean your config files you can use bleachbit.

I think it’s in the repositories. It has two modes, user and system (root). I’ve never used it as root for in case… but the user mode cleans the configuration, caches, temporal… etc files from a lot of programs.