When i was using windows, i used to run defrags, ccleaner and revouninstaller once a month to keep the system and the registry clean.

I know ubuntu (and all linux distro) has a different system structure and doesnt need defrags, but i've heard there are some mainenance tasks that help to keep the system clean (for example, sudo apt-get clean or sudo apt-get autoremove)

How many of those commands/software (and please explain what they do and if they can compromise the system stability) do you know and use regularly?


The purpose of the commands you mention is solely to save disk space. Furthermore, on most machines nowadays the savings would only amount to a tiny fraction of your disk space. So they're not very useful.

Most common maintenance tasks are performed automatically by the system. If you're curious about them, the scripts that perform them are in /etc/cron.*. The name or contents of the script might give you a hint of what they do. Don't change anything you don't understand — these commands are there for a reason.

One maintenance task which is not done automatically is installing security and stability updates (major bug fixes). By default, you will get a notification that updates are available. You should follow on the notification at the first opportunity. This is not done automatically in case the updates arrive at an inconvenient time, like when you're on a pay-per-byte Internet access or you have to switch off your computer right now; also because there is a (very small) risk that the updates break something and it's better not to do it unattended.

Updates are the only maintenance task that I trigger manually. If I had to do anything else, I'd consider it a bug. If it has to be done, it should be automated.

  • 5
    It is possible to configure system so important updates get applied automatically in the background. Very nice feature for always connected computers of elderly relatives.
    – vava
    Sep 10 '10 at 1:27
  • @vava you would need to add apt-get update && apt-get upgrade --assume-yes to the crontab for it to run with privileges. Oct 19 '16 at 2:25
  • @NickBedford @vava It's better to setup unattended-upgrades: help.ubuntu.com/lts/serverguide/automatic-updates.html Nov 23 '18 at 23:30

I recomend 2 gui-programs to you:

  • bleach bit
  • ubuntu tweak.

bleach-bit is the "ccleaner"-equivalent for linux, so you can figure what it can do: sudo apt-get install bleachbit from console to install.

ubuntu tweak is kinda a "tweak-ui"/software center/gconf/etc what we are interested here is the "package cleaner" option:

alt text

To install ubuntu-tweak:

  • sudo add-apt-repository ppa:tualatrix/ppa
  • sudo apt-get update
  • sudo apt-get install ubuntu-tweak
  • wow, I already use ubntu tweak but i never used it to clean
    – Strae
    Sep 13 '10 at 11:30

From the offical man page of apt-get (shortversion by me):

       clean clears out the local repository of retrieved package files.
       It removes everything but the lock file from
       /var/cache/apt/archives/ and /var/cache/apt/archives/partial/. 
       This frees up disk space

       autoremove is used to remove packages that were automatically
       installed to satisfy dependencies for some package and that are no
       more needed.

There is also the gui computer-janitor (System => Administration => System Janitor)

  • 3
    In most cases, I'd avoid computer-janitor as much as possible. It's simply not a good program.
    – aperson
    Sep 10 '10 at 21:39
  • @aperson: Please justify why you think it's not a good program. That could mean different things to different people.
    – jvriesem
    Jul 23 '16 at 20:08

I am a software junkie - I keep trying out new software, installing it on my machine and then removing it. So for me apt-get -clean and apt-get -autoremove are used fairly regularly :-)

I also recommend checking the update notifications and updating regularly.

One tool you might look at (I believe it is available in the administration section) is the computer janitor. It's great at identifying redundant packages which you can remove and free up space.

One other thing you might want to look at are redundant services - like Apache, SSH, telnet, etc which may not be relevant or needed for a single desktop installation. If they are configured to run at start-up, you might be wasting performance/memory on unneeded services.

  • 5
    Consider using aptitude install and aptitude purge, it does remove unnecessary packages automatically. More than that, purge also removes any configuration files package has installed.
    – vava
    Sep 10 '10 at 10:42
  • thnx - I will check it out...
    – Nikhil
    Sep 10 '10 at 11:29
  • I love aptitude as much as the next guy, but from what I read, using it has no advantages over apt anymore. I still use it though.
    – aperson
    Sep 10 '10 at 21:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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