MakeTechEasier
  • Home
  •  
  • About
  •  
  • Archives
  •  
  • Jobs
  •  
  • Advertise
  •  
  • Contact Us
  • Windows
  • Linux
  • Mac
  • Internet
  • WordPress
  • iPhone
  • Android
  • All Categories
    • Android RSS
    • Firefox RSS
    • Gaming RSS
    • Google RSS
    • google chrome RSS
    • Internet RSS
    • iPhone/iPod Touch RSS
    • Linux RSS
    • Mac RSS
    • Mobile RSS
    • OpenOffice RSS
    • PC Hardware RSS
    • Review RSS
    • Roundup RSS
    • Windows RSS
    • Windows Mobile RSS
    • WordPress RSS
    • WordPress Plugins RSS
  • rss icon
  • email icon
  • facebook icon
  • twitter icon

8 Ways to Maintain a Clean, Lean Ubuntu Machine

Posted by: Damien on October 7th, 2008
  • 73 Comments
  • Share

cleaning-in-progressOnce in a while, you may want to do some maintenance on your Ubuntu machine and clean up unnecessary files that are chunking up large storage space in your hard disk.

Here are 8 ways that you can use to clean up your Ubuntu:

1) Analyze your disk usage

The first thing that you need to do is to find out which files are consuming the large bulk of the storage space in your hard disk. Go to Applications->Accessories->Disk Usage Analyzer and click on the Scan Filesystem at the top to get it to analyze your disk usage pattern. You will be able to see instantly which files/folders are taking up the bulk.

disk-usage-analyzer

Once you have determined the files that are taking up large storage space, you can do the following:

  • decide if you have any use of the files. If not, send them to the trash.
  • If you have no immediate use of the file, but will need to reference to it in the future, either backup to a CD/DVD or to an external hard disk. If the file is too big, you may want to compress and split it to several small files for easier storage.

2) Clear duplicate files and broken symlinks

Over the time, you could have dozen copy of the same file lying in different corners of your system. The best place is to hunt them down and eliminate them before they take control of the hard disk.

FSlint is a utility to find and clean various forms of lint on a filesystem, especially duplicate files and broken symlinks.

Install fslint, or via the terminal:

sudo apt-get install fslint

Go to Applications-> System Tools-> FSlint. Add the file path that you want to search. On the left, click on the Duplicate tab and click Find at the bottom.

FSlint

Other than finding duplicate files, FSlint can also find broken symlinks, empty directories, bad IDs and even redundant temp files, all of which you can delete and recover back your precious disk space.

3) Clean up your package installation

If you have installed and uninstalled a lot of applications, chances are your system is infected with a lot of dependencies files that you have absolutely no use for. Here are some useful commands to get rid of any partial package and remove any unused dependencies:

Cleaning up of partial package:

sudo apt-get autoclean

Cleaning up of the apt cache:

sudo apt-get clean

Cleaning up of any unused dependencies:

sudo apt-get autoremove

A good practice to avoid any left behind is to use the autoremove command whenever you want to uninstall an application.

sudo apt-get autoremove application-name

4) Get rid of old residual config package

When you upgrade a software to a later version, the package of its previous version will still be left behind in the system. You will be able to free up some space by eliminating the old residual config package

Open up your Synaptic Package Manager (System-> Administration-> Synaptic Package Manager). On the left, click on the Status button. You will see a few options appear on the top left pane. If there is a Not Installed (residual config) option, click on it. This will reveal all the residual config package in the system.

synaptic package manager

Check the box beside the package and select “Mark for complete removal”. Click Apply.

synaptic package manager

5) Remove orphaned package

Other than the dependencies files, packages can also become orphaned when you uninstall an application. To get rid of orphan files, we can make use of gtkorphan, a graphical frontend for deborphan.

Install gtkorphan or via the terminal:

sudo apt-get install gtkorphan

Go to System-> Administration-> Removed Orphaned package

gtkorphan

It will analyze the system and show all the orphaned package in the main window. Check those packages that you have no use for and uninstall them.

6) Keep track of what you have installed

Debfoster creates a dependency files to enable you to keep track of what you have installed. When you uninstall an application, it will check for any leave behind dependencies files or orphaned packages and ask you if you want to remove it.

Install debfoster, or via the terminal,

sudo apt-get install debfoster

Creating the initial keeper file:

sudo debfoster -q

Force the system to conform to the keeper file

sudo debfoster -f

If you have some packages that you never want to uninstall and do not want debfoster to handle those packages, you can edit the keeper file and remove those packages from the list.

gksu gedit /var/lib/debfoster/keepers

To see is there is any orphaned package or dependencies files that need to be removed:

sudo debfoster

7) remove locale files

Unless you have a need to switch to various locales all the time, you can uninstall the unused locales and free up some amount of the storage space in your system.

Install localepurge, or via the terminal:

sudo apt-get install localepurge

Once the installation is done, it will remove all locale files from your system that you have no need for.

localepurge

8) Clean up grub menu (only for those who know what they are doing)

Sometime when you perform an update, you will find that the kernel is being upgraded to new one while the old one still remain. If you don’t like to see a long list of entries in your grub menu when you boot up the computer, here is a simple way to clean up the grub menu.

Go to terminal and type

gksu gedit /boot/grub/menu.lst

Search for the following lines:

grub-menu

Remove the entry that you have no need for. Save and exit.

Rather than editing the menu.lst file which can be a scary task for newbies, an easier and better way to cleanup the grub menu is via Startup Manager or SUM in short.

Install SUM or in your terminal:

sudo apt-get install startupmanager

Go to System-> Administration-> Startup-Manager

In the Boot Option tab, under the Default Operating System field, pick the kernel that you want to use.

startup-manager

Click on the Advanced tab, check the box Limit the number of kernel in the boot menu. In the Number of kernels to keep field, enter 1

startup manager screenshot

Close the window.

You should see a cleanup grub menu the next time you boot up.

Is there any ways that I have missed out? How do you clean up your Ubuntu machine?


Damien Oh is the owner and chief editor of Make Tech Easier

Tags: Clean up, Linux, Ubuntu
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Share and Enjoy!

  • Rss feed
  • StumbleUpon It!
  • Del.icio.us
  • reddit

Related Posts

  • Ubuntu: How To Delete Your Files (Or Wipe Your Hard Drive) Beyond Recovery
  • Clean Up And Regain Your Disk Space With Bleachbit
  • How to Reformat an External Hard Drive to NTFS Format In Ubuntu Hardy
  • How to Backup And Install Your Linux Applications With AptOnCD
  • How To Shrink Your Virtualbox VM And Free Up Space For Your Hard Disk

Popular Posts

  • Turn Your Ubuntu Hardy to Mac OSX Leopard 498 comment(s)
  • Turn Your Ubuntu Intrepid Into Mac OSX Leopard 311 comment(s)
  • 28 Coolest Firefox About:Config Tricks 122 comment(s)
  • How To Boot And Install Windows 7 From USB Flash Drive 122 comment(s)
  • Best 101 Free Computer Software For Your Daily Use 101 comment(s)

Enjoyed the article? Subscribe to Make Tech Easier today to get your daily updates of technology tutorials, tips and tricks.

Enter your email:

41 pingbacks/trackbacks (Click to open)

  • 8 Ways to Maintain a Clean, Lean Ubuntu Machine - Make Tech Easier « Wolf’s Geek Blog
  • Links Flickring Into Life | Programmer's Log
  • Chris Rio’s Blogtacularium » Blog Archive » Links of the day
  • 8 maneras de mantener limpio y a tono un sistema Ubuntu [ENG]
  • links for 2008-10-08 « Bloggitation
  • links for 2008-10-08 - ArcIris- Web Design in Spain, Remote Support | Diseño Web y Soporte Remoto · Arc Iris
  • More boring stuff from the Net :|»Boringest :| - Moolah!!!
  • Boycott Novell » Links 08/10/2008: More GNU/Linux Mini-Laptops, Recession Helping FOSS?
  • Ubuntu Linux, 8 modi per mantenere pulito il sistema - Geekissimo
  • Keep Ubutu lean « 0ddn1x: tricks with *nix
  • Ubuntu tip: Use Startup Manager to edit your boot menu | 12 masalay
  • Ubuntu tip: Use Startup Manager to edit your boot menu
  • 4 Ways to Keep Linux Livey - Security, Speed, Cleanliness, Safety | The Penguin Trail
  • Maintaining Ubuntu « TTC Shelbyville - Technical Blog
  • Ubuntu tip: Use Startup Manager to edit your boot menu
  • RickScheibner.net | links for 2008-10-11
  • links for 2008-10-11 « My place
  • 100carretas.es » 8 maneras de mantener Ubuntu limpio. 1 - Analizar el uso de disco
  • 100carretas.es » 8 maneras de mantener Ubuntu limpio. 2 - Borrar archivos duplicados y enlaces rotos
  • 9 sposobów na utrzymanie czysto?ci i odchudzenie naszego Ubuntu. :: Czytelnia
  • Plecebo: blog
  • Business News » Blog Archive » Ubuntu tip: Use Startup Manager to edit your boot menu
  • 100carretas.es » 8 maneras de mantener Ubuntu limpio. 3 - Limpiar los paquetes de instalación
  • Added by a PAL to FAQ PAL
  • Städa din Ubuntu-maskin – Scary Marys blogg
  • 8 maneras de mantener Ubuntu limpio. 4 - Eliminar los paquetes residuales de configuración | 100carretas.es
  • J’s blog » Blog Archive » Much delayed catchup blogging…
  • 8 Ways to Maintain a Clean, Lean Ubuntu Machine « Useful Ubuntu Links
  • 8 maneras de mantener Ubuntu limpio. 5 - Borrar paquetes huérfanos | 100carretas.es
  • 8 maneras de mantener Ubuntu limpio. 6 - Lleva un registro de lo que has instalado | 100carretas.es
  • Haciendo una limpieza a nuestro sistema Debian « Usuarioubuntu
  • Mantener pc limpio « Xonos
  • 8 maneiras de manter o Ubuntu limpo e organizado. « Dautonico
  • Articles Collection of Oct’08 « Dako-Tux
  • Dual Booting on the e6400: Part Three - Setting Up Ubuntu Intrepid Ibex | Bits and Bites
  • Make Tech Easier - How To Shrink Your Virtualbox VM And Free Up Space For Your Hard Disk
  • Big Trev :: More cleaning :: May :: 2009
  • Limpando o Ubuntu « Relógio Velho
  • Purely for my reference — tips for cleaning up Linux « Lstrblg
  • Karmic Koala en una maquina Compaq Presario F700 « De Vista a Ubuntu
  • How To Shrink Your Virtualbox VM | LinuxReaders
[Click to close]

73 Responses

  • hyperX says:
    October 7, 2008 at 5:00 am

    It’s been long time I’ve not use ubuntu for my assignments. It’s about time to switch back. ^^

    Reply
  • Vadim P. says:
    October 7, 2008 at 5:41 pm

    Should make use of apt: links, eh :)

    Reply
  • Jayson says:
    October 7, 2008 at 7:41 pm

    These are some great tips – I’ve never even thought to clean things up but I’m sure the increased productivity would be worth the time investment.

    Reply
  • Anonymous says:
    October 7, 2008 at 7:56 pm

    There is a MUCH better way to cleanup the GRUB list. Find the variable in the menu.lst called “#howmany=all” and change it to #howmany=1 (or however many kernels you want to show in the list). The in the konsole run “update grub” and it will auto-clean it for you.

    Reply
  • ethana2 says:
    October 7, 2008 at 8:15 pm

    I expected to see things like “never install packages directly from source, use checkinstall.”

    Seriously, if there’s one thing that’ll clutter stuff up, it’s that, because you can whip out all your crazy apt tricks, but, surprise! It’s not even /in/ apt.

    Reply
  • suribe says:
    October 7, 2008 at 8:24 pm

    best post about ubuntu in a long time, thanks!

    Reply
  • Kevin says:
    October 7, 2008 at 8:49 pm

    9. Format machine and install Windows Vista on it.

    Reply
  • daxi says:
    October 7, 2008 at 8:52 pm

    You don’t have to edit the grub config file directly. You can just install startupmanager via apt-get.

    Reply
  • . says:
    October 7, 2008 at 8:54 pm

    I’d generally recommend to comment the unnecessary grub entries out, not to delete them. You can never know.

    Reply
    • Rem0te C0ntr01 says:
      October 1, 2009 at 2:29 pm

      Wait, you forgot something. system is running slow. Solution: reformat windows and try again. Next day….system is corrupted, windoze will not boot. Solution: reformat and try again. Better solution: USE LINUX!!!

      Reply
  • torpor says:
    October 7, 2008 at 9:05 pm

    Here’s another great tool, dpigs:

    sudo apt-get install debian-goodies
    dpigs -N 10

    ^^ will show you the top 10 most bloated packages installed on your system. Awesome way to start trimming the fat..

    Reply
  • Clustertim says:
    October 7, 2008 at 10:32 pm

    Wow that was too cool.

    http://www.privacy.es.tc

    Reply
  • Alex Stan says:
    October 7, 2008 at 10:52 pm

    May I suggest Start-Up Manager for the grub section. It’s a gui utility for editing the menu.lst file. Just do an apt-get install startup manager. I also suggest keeping only 2 kernels, using that automatic option.

    Reply
  • Feduntu says:
    October 8, 2008 at 3:12 am

    Why are you using Fedora’s theme for ubuntu?

    Reply
  • vladivostok says:
    October 8, 2008 at 9:50 am

    Or just use Archlinux ;-)

    Reply
  • kevin says:
    October 8, 2008 at 11:56 am

    When you inevitably screw up editing the grub menu and the computer won’t boot properly any more, then get download Super Grub Disk to help sort it out :-)
    http://supergrub.forjamari.linex.org/

    Reply
  • well says:
    October 8, 2008 at 4:17 pm

    well, i don’t get it: whats the difference between orphaned packages and forgotten to remove dependencies?

    and i guess ubuntu documentation recommends using aptitude (all the time, so it can build installed package database) instead of debfoster, gtkorphan and so on.
    # aptitude install somepackage
    # aptitude purge –purge-unused somepackage

    Reply
  • Tanner says:
    October 9, 2008 at 5:35 pm

    As a relatively new ubuntu user, I found this guide very useful. Thanks for the tips!

    Reply
  • Terry Wang says:
    October 14, 2008 at 4:40 am

    Great article. This is actually what I do normally.

    If anyone does not like to use command to clean/autoremove, do it via gjig (I don’t use it.).

    And I prefer to edit GRUB menu manually:)

    Great work! Guys.

    Reply
  • vladimir@bcc.ufla.br says:
    February 18, 2009 at 5:09 pm

    Great article! It was very helpful!

    Thanks! :D vladimir@bcc.ufla.br

    Reply
  • tonym says:
    February 23, 2009 at 6:25 am

    Thanks so much for the article. It surely was of great help to me as am a newbie.

    Reply
  • Michael says:
    February 26, 2009 at 11:36 am

    I’m new to Ubuntu, so this article is of great help.

    Thank You

    Reply
    • Damien says:
      February 26, 2009 at 4:21 pm

      You are welcome

      Reply
  • Vadim P. says:
    February 26, 2009 at 5:21 pm

    http://bleachbit.sourceforge.net/ should be helpful too.

    Reply
  • mister_playboy says:
    March 7, 2009 at 9:06 am

    Thanks for this guide! I did have one odd occurrence… running autoremove flagged and deleted my packages for Skype, so I had to reinstall it. I assume this has something to do with the fact that it uses 32 bit libraries (even though I am using the 64 bit package from medibuntu), and my OS is 64 bit.

    Here’s a question: I have a two entries of “OpenJDK Java 6 Web Start” under my Applications>Internet pull down menu… how do I get rid of one of them? Unlike the panel, right-clicking does bring up a “remove” option.

    Reply
    • Kevin says:
      March 7, 2009 at 11:10 am

      “Here’s a question: I have a two entries of “OpenJDK Java 6 Web Start” under my Applications>Internet pull down menu… how do I get rid of one of them? Unlike the panel, right-clicking does bring up a “remove” option.”

      Go to System > Preferences > Main Menu

      This should bring up a GUI to edit the things that appear in the menus. Find your duplicate item and untick it. Bingo :-) Have fun.

      Reply
  • Tundro Walker says:
    March 14, 2009 at 7:49 am

    Wow, I’ve been using Ubuntu for a long time (since Dapper), and have read a lot of articles on tweaking it. This is the first I’ve seen mention Start-Up Manager. Why the heck isn’t this installed as a default app in Ubuntu? I know “average joe” users could hurt themselves with it, which would be obvious, but power-users would definitely want to see this. They need to make a “dumbed down” and “power user” mode for Ubuntu, so your parents won’t hurt themselves using it, but you’ll have all the tools you’ll need if you have to trouble-shoot their comp later.

    Reply
    • Duy Truong says:
      May 5, 2009 at 8:02 pm

      Well, actually those “power users” won’t need that SUM… I found myself much more comfortable editing configuration text files than having a GUI messing up my configs. I think that’s why they don’t have it by default: People who knows how GrUB works won’t need a GUI to config it.

      Reply
  • Jyrgen Hannus says:
    April 15, 2009 at 4:45 pm

    Thank you a lot, have been looking for this kind of indepth maintenance analysis for a long time!

    Reply
  • Duy Truong says:
    May 5, 2009 at 7:56 pm

    Nice guide! I would add that removing old kernels frees up a couple of hundreds of megabytes, too.

    Reply
  • saaron says:
    September 18, 2009 at 9:33 am

    You should put Computer Janitor there too…

    Reply
  • vasiauvi says:
    December 27, 2009 at 10:27 am

    Hello!
    Good post and thanks for it!

    Reply
Cancel reply

Leave a Comment




Comment

Please Note: Comments maybe under moderation after you submit your comments so there is no need to resubmit your comment again

write for MTE

Latest Posts

  • OfficeMedium – A Social Collaboration Platform For The Small Business + Free Promotions
  • MakeTechEasier Is Now Hosted On KnownHost
  • KTorrent: KDE’s BitTorrent client
  • How to Create a Customized Toolbar for Your Browser
  • 13 Ways To Customize Ubuntu Netbook Remix For Better Usability

Our Writers

  • Damien Oh - Chief Editor
  • Sharninder - Geeky Ninja
  • Joshua Price
  • Tavis J. Hampton - Lantern Torch
  • Shevonne Polastre - FreeAgentWriter
  • Trevor Dobrygoski
  • Soumen Halder - Ampercent
  • Tanmay Ahmed - Tech-Tips-Geek
Make Tech Easier on Facebook
Jobs by SimplyHired
Job Widgets

Copyright

All the articles (including the text, images and tutorials) are properties of MakeTechEasier.

You cannot copy whole tutorials, either in English or translate to another language without our permission.

Write for us

Writing a tutorial or article for MakeTechEasier is a great way to get exposure and give back to the community.

Read More Details

Suggestions

We need your help to help us serve you better! This is YOUR site, so if you have suggestions/feedbacks on how we can improve it for you, please let us know! We do our best to make this place better!

Make a Suggestion

Navigation

  • Home
  • About Us
  • Advertise
  • Archives
  • Contact Us

Copyright © 2007-2010 Make Tech Easier | All Right Reserved.