Free Up Some Ubuntu Space!

cleaning up ubuntuHaving trouble cleaning up space for your Ubuntu installation?
I only have a 4GB SSD drive on my Lenovo S10e netbook, so I have the problem myself. Here are some handy tips for you!

Remove files not needed

sudo apt-get autoremove

Remove all stored archives in the cache

Basically it clears up the ‘/var/cache/apt/archives/’ and ‘/var/cache/apt/archives/partial’ folders

sudo apt-get clean

Remove package files that can no longer be downloaded

sudo apt-get autoclean

Remove locale data

This will remove unneeded locale files and localized man pages.

sudo apt-get install localepurge

Run it:

localepurge

A window will pop up. There choose your language. I use English, therefor I chose “en”.
Ignore the capitalized ones.

Remove orphaned packages

It shows you which packages that have no other packages depending on them.

sudo apt-get install deborphan

Run it:

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

Cleaning up log files

sudo find /var/log -type f -exec rm {} \;

Cleaning up doc files (use only when desperate use of space)

sudo rm -rf /usr/share/doc/*

Remove Linux kernels not in use

Check what kernel you are using:

uname -r

Goto System->Administration->Synaptic Package Manager

Search for “Linux” and mark all Linux header/kernel files which you are not currently using for complete removal. Then hit ‘apply’.

Tags:

Leave a Reply