Is system cleanup/optimization needed

File Cleaning / Space Saving / Privacy

Just to give an idea, taking Windows as base. In windows you need to do a cleanup mostly every week if not every day (I use as an example the fact that I worked in over 30 cyber cafes which are in total more than 500+ PCs. The work the got from users made having to cleanup everyday a typical job.). In Ubuntu, this cleanup is actually not needed so often, but if you actually need to do it you have several command line tools like apt-get or aptitude that do a nice cleaning and GUI tools like ubuntu tweak that also do this. The cleanup for Ubuntu can be done every 6 to 12 months. Yes that is right, every so many months you can do it or in my case every 2 or 3 years.

This really depends on the amount of work you put the PC through. When I say work I mean, downloading files, moving files, creating files, deleting or copying files. All of this on a daily basis. Most Windows users know that the performance of any Windows degrades really fast if no optimizations are done. I have had cases where the user has gone a full year with no need to optimize anything and had other cases where the user had to literally format the PC after a month. It depends on the computer usage. The 1 year guy used the computer for word processing and internet only. The 1 month used it to download a lot of stuff, music, videos, games, deleted some, moved some, etc.. In all of this time, both did not do any optimizations.

In Ubuntu you do get a performance degradation, but from experience you need to:

  1. Install many services that also create many files (LAMP Server, Mail Server, FTP Server, etc..). The performance will go down for about 5%. At least for a full year, that is all that will happen. You might see more performance lose but you need to wait a lot (Like a 3 to 5 year wait). The immediate downside is the booting time and shutting time since you have services running that need to close client connections and such. Apart from that, there won't be a slowness as known in Windows.

  2. Install many programs (Video Editors, Sound Editors, Games, etc..). Similar to the performance drop when installing services but not so much so. You can even install programs up to a point of using 99.99% of the hard drive space and Ubuntu will not create a performance drop. At least I tested this with Wine games and OpenGL games to see if they got hit with a performance drop using an HDD almost full.

If by performance and space wasted you are worry, then you can do the check every year or two since you will not be wasting a lot of space. Performance wise, Ubuntu (or any other distro for that matter) is not influence in performance by the amount of garbage left behind in the system that fills the HDD. That is a Windows problem not a Linux one where, if you get around 25% to 35% of the space left, the system starts slowing down (Shown more in Windows XP than in Vista or 7/8). Anyway, like I said before, having a 99.99% hard drive full of stuff will not slow you down. The only thing is you would need to clean your logs which are found in /var/log. This will increase overtime and the folder will hold many Megabytes or Gigabytes of information depending on the amount of time and the services installed. For a 6 month cycle, I get around 20MB in the log folder.

If you are really paranoid you have this command:

(Only if you have aptitude installed)

sudo aptitude clean - Will erase downloaded packages from cache
sudo aptitude autoclean - Will erase old downloaded packages from cache

(Use apt-get which already comes by default)

sudo apt-get clean - Will erase downloaded packages from cache
sudo apt-get autoclean - Will erase old downloaded packages from cache

For GUI based

Ubuntu Tweak

sudo add-apt-repository ppa:tualatrix/next  
sudo apt-get update  
sudo apt-get install ubuntu-tweak

and then run ubuntu-tweak and there is an option called Janitor which is used for spring cleaning as seen in the picture:

enter image description here

You can also remove old compress log files from the system

sudo rm -v /var/log/*.gz

Lastly there is a GUI Tool (Thank Uri in the comment for this. I forgot):

BleachBit

enter image description here

BleachBit is an advance cleaning utility for Ubuntu (Similar to CCleaner) and other distros that really, REALLY cleans the system. You can find it in the Software Center just by searching for bleach. What makes it different from the Ubuntu Tweak is that it searches for many common folders that many apps use to store cache/temp files. Apart from that improves a little bit the performance of browsers (since it cleans them out too) and libreoffice. There are a lot of more stuff BleachBit does but go to the site for more info. +1 Uri for the reminder.

Note that this is usually done every so many months or years, not everyday or every week like in Windows. Linux and Ubuntu have a unique way of always been optimized for this type of "problems". And before you ask, Fragmentation in Ubuntu is a very hard thing to do. Fragmentation at the level we see in Windows takes many months, even years so a fragmentation of 2 months in Windows (And the slowness that comes with it) is roughly like 2 or 3 years in Linux (and even then is not slowed down like in Windows).

For a general check I have 2 1TB hard drives, one is 0.91% non-contiguous and the other is OMG!! 1.2% non-contiguous... after 2 years of everyday, constant use. So am guessing in 2050 I will eventually have to "defragment" the hard drive, unless I bought a new one or formatted the existing one ;).

For Energy Efficiency

For battery performance, it is known that the following tools do help:

Powertop

It can save several minutes/hours of battery usage, increasing life of battery and performance of it.

To install: sudo apt-get install powertop

To run: sudo powertop

enter image description here

Jupiter

(NOT available/needed since 13.04) Recommended reading Is there a power saving application similar to Jupiter? It manages much better the battery usage and it gives longer battery time.

sudo add-apt-repository ppa:webupd8team/jupiter  
sudo apt-get update  
sudo apt-get install jupiter

To run: Type jupiter in Dash or use the Jupiter Applet icon in the top panel.
enter image description here

TLP

It is a good power management tool to monitor Watt usage:

To install:

sudo add-apt-repository ppa:linrunner/tlp  
sudo apt-get update  
sudo apt-get install tlp

To run: Just reboot, it will start as a service.

The only downside is that you need to tweak the configuration file in order to get the most out of your battery, but using tools like powerstat can let you know easily if you are optimizing it right or wrong.


Cleaning is not necessary, but for the meticulous among us it's highly recommended ;)

  • apt cache can grow quite quickly, especially when a lot of new kernels are being installed
  • buggy applications can leave a file here and there, and make a mess in the filesystem. For example on my 10.10 system I have a few dozen ~/.recently-used.xbel.XXXXX and ~/.org.chromium.XXXX useless files.
  • Uninstalled applications often leave their config files in your home directory.
  • If there is a problem in your system, logs can grow huge - check the size of the /var/log and ~/.xsession-errors.
  • More often than not it is the user who leaves a lot of junk everywhere. Open up the Baobab disk space analyzer or any such to get an idea what has accumulated on your disk over time.
  • all the thumbnails get stored and are never cleared up even though you've deleted those pictures or will never use that photo CD again.
  • if there's a filesystem problem, your lost+found directory can grow too

An Ubuntu system does a good job of cleaning everything unnecessary, but from time to time the administrator has to weigh in...


An apt-get clean to remove old package download archives once in a while doesn't go amiss, I'm not sure there's anything that does that automatically.

Logs will be handled for you by logrotate.

/tmp is cleaned out for you on every reboot.

Tags:

Maintenance