What's the good way to clean up the system (and is Bleachbit safe) on Ubuntu 14.04?

326,043

Solution 1

To remove any packages that aren't needed by the system:

sudo apt-get autoremove

The other answer for this question:

sudo apt-get clean

This just clears the package cache for downloading new packages, it will not uninstall any packages.

See: https://help.ubuntu.com/community/AptGet/Howto

Solution 2

Ubuntu tweak will be to your liking.

It has a "janitor" option where you can clear caches files, delete old kernels, delete orphaned .debs and more like that. But what gets removed tends to be a few MBs of software that is not longer used on your system but will not have interfered with what you normally do.

A crash of kate should be treated as such: search the crash online and see of there is a fix, otherwise you can opt to file a bug report against kate.

Solution 3

On Linux there usually is no need to clean your system, even after multiple updates. APT keeps tracks of which package installed which file and removes them when uninstalling a package.

Your system doesn't get slower if there are many packages installed (as long as you still have a reasonable amount of free disk space).

There is also no system wide registry as in Windows, but a lot of programs have configuration files in /etc. Usually it is better to not touch these files unless you know what you are doing. These configuration files are the only thing not deleted by APT when uninstalling a package (because you might want to use then again in the future). If you want to remove configurations files from uninstalled packages you can either call

dpkg --purge PACKAGENAME

for each package you want to remove or use

dpkg -l | awk '/^rc/ {print $2}' | xargs --no-run-if-empty sudo dpkg --purge

to remove configuration files of all uninstalled packages. However you should expect no speed up of your system.

Solution 4

To get rid of partial packages - sudo apt-get autoclean

Get rid of unnecessary locale data - localepurge

Get rid of "orphaned" packages - sudo deborphan | xargs sudo apt-get -y remove --purge

You can refer this article for more detailed information

http://www.ubuntugeek.com/cleaning-up-a-ubuntu-gnulinux-system-updated-with-ubuntu-14-10-and-more-tools-added.html.

Solution 5

Below are cleanup system tools

  1. BleachBit

  2. Ubuntu Tweak

  3. GCleaner

  4. Sweeper

  5. Stacer: Linux Optimizer & monitoring open source

I got a vote list for above from here

enter image description here

And for removing unnecessary files follow below tools

  1. baobab - GUI
  2. ncdu - OUTPUT in CLI and also works remote servers via SSH.
  3. cruft

Hope this helps you.

Share:
326,043

Related videos on Youtube

artm
Author by

artm

Perfection is the enemy of the good..

Updated on September 18, 2022

Comments

  • artm
    artm over 1 year

    I used Ubuntu 14.04 (Trusty Tahr) for about a year (actually upgraded it from Ubuntu 12.04 (Precise Pangolin)), and during the time I installed some packages, and removed some other packages.

    Now I think it's probably time to clean up the system as it's likely several unused stuff is lying out there (both from the old 12.04 and the new 14.04), and I hope to have a cleaner system that works faster.

    I found these two links:

    Both links seem good, but when I came across to what they said about Bleachbit then one says yes, and one says no - a bit contradicting.

    What should be done for this common task?

    • xangua
      xangua over 8 years
      Clean what exactly? Unused packages for example, try apt-get autoremove
    • artm
      artm over 8 years
      clean up the system - if that's possible..
    • Raphael
      Raphael over 8 years
      That's probably not the answer you want, but still: have the OS, /home and your data on separate partitions. Then, just install a completely new system (keeping home/ and data); if you don't make too larger jumps, most configurations will still work as before. Of course you'd have to reinstall everything, but that's a part of cleaning up: install only what you need when you need it.
    • Rinzwind
      Rinzwind over 8 years
      @artm in this respect Linux is a lot better than Windows. We do not have a registry with bogus keys that slow down your system. If you delete a lot on Ubuntu you might have libraries that are no longer used BUT we are talking about files that are the size of a few -bytes- here. Not worth the time to me. Cleaning up your system in Ubuntu is generally removing software you installed and never used ;)
    • artm
      artm over 8 years
      @Rinzwind: Yeah you're right. I actually forgot about those windows-style system clean-up for a while. As I mentioned in the Q, it just happened to me that kate suddenly stopped working properly, so I started to have some doubt about the way I usually handle Ubuntu install/uninstall, and how to clean the system up as a whole.
    • Rinzwind
      Rinzwind over 8 years
      You will want this ubuntu-tweak.com @artm See the "janitor" option.
    • redchief
      redchief over 8 years
      @artm use ubuntu tweak it contains a system janitor will help you exactly as you want
  • artm
    artm over 8 years
    I just tried sudo apt-get clean - nothing seems to be done though..
  • Daniel
    Daniel over 8 years
    sudo apt-get clean is what cleans out unused package stuff, so if that hasn't done anything, then you're already clean package wise.
  • Daniel
    Daniel over 8 years
    If you wanted to clear out stuff like old downloads, you'll have to do that manually, or find something like Ubuntu tweak or Bleachbit to clear out cache and history etc.
  • Admin
    Admin almost 8 years
    Please fix the broken link.
  • Thomas Ward
    Thomas Ward almost 8 years
    Note that Ubuntu Tweak is no longer maintained as of May 2016, according to the Project Page on Launchpad.
  • PeterM
    PeterM over 7 years
    localepurge might be configured to automatically run when using dpkg, so might be unnecessary to use it. To check this use localepurge --help
  • artm
    artm over 7 years
    that looks good thanks (didn't expect that there are so many, and Bleachbit is leading tool..)
  • Xiaodong Qi
    Xiaodong Qi about 7 years
    Any alternatives to Ubuntu Tweak?
  • Undefined Behavior
    Undefined Behavior over 6 years
    Beware that there is a bug bugs.launchpad.net/ubuntu/+source/apt/+bug/1615381 for autoremove and probably it will remove all kernels, include the current running kernel.
  • labyrinth
    labyrinth over 6 years
    +1 for ncdu. I ran into an issue where my entire drive filled up. I'd used baobab in the past, and bleachbit helped a bit, but ncdu really drilled down fast to what files were taking up space, and it scans faster than any other tool. This was on 17.10, so still a very relevant tool.
  • HattinGokbori87
    HattinGokbori87 about 6 years
    Using Ubuntu Cleaner with occasional autoclean, autoremove, clean commands. Works very well
  • Matthew
    Matthew about 4 years
    Tried ncdu, and it said I had 2.3 GiB used space, but glances says I'm using 18G, and I'm fairly certain 18 is much more accurate. And yes I ran from root directory. Actually, I ran ncdu as root as well and it showed even less space being used so honestly don't know what the hell is up with that program.
  • Christophe Roussy
    Christophe Roussy about 3 years
    @UndefinedBehavior note that this bug was fixed in the package apt - 2.1.18
  • Christophe Roussy
    Christophe Roussy about 3 years
    You can also do sudo apt-get autoclean