How do I cleanup Ubuntu?

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

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

$ sudo apt-get autoremove

it will remove the unnecessary packages.

Allu John Sudhakar
System/Network Administrator
to see my Blogger (for Ubuntu)
any help mail to me [email protected]

Sponsored Link

You may also like...

8 Responses

  1. Gnoise says:

    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.

  2. MUD says:

    ## Use this if you know what it does ##

    sudo aptitude clean

    sudo aptitude install localepurge # removes unneeded locale files and localized man page

    sudo apt-get install deborphan # removes orphaned packages
    sudo deborphan | xargs sudo apt-get -y remove –purge

    # Remove the Trash – –
    rm -rf /home/*/.local/share/Trash/*/**
    rm -rf /root/.local/share/Trash/*/**

  3. dutchy says:

    The last commands “Remove the Trash” (from MUD) the first one is fine as is, but the second one needs root privledges, so sudo must precede it if not logged in as root.

  4. Gnoise says:

    Woky says:
    March 23, 2011 at 6:22 pm

    The only method how to clean Ubuntu is rm -rf /*

    No, that’s is (a way) to _remove_ Ubuntu. Not ‘clean it up’. Not really a smart advise, imho.

    @MUD: I would advise not to use the -f (force) parameter if not really needed. If you can’t delete a file, there is probably a reason. It’s better to read that reason first before force deleting it.

  5. Crada says:

    First, remove all unnecessary programs using Synaptic Package Manager.

    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.

  6. darent says:

    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.

  7. Robi says:

    sudo apt-get install deborph

    deborphan | xargs sudo apt-get -y remove –purge

  8. darent says:


    Some people must prefer the gui version for deborphan:

    sudo aptitude install gtkorphan

    Basicaly, it does the same than your command, but with an gtk interface 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *