martedì 24 dicembre 2013

Reducing the size of /var

/var is used in order to store some data which are not essential for the system itself, but which should be kept among sessions. Example of this data are logs (keeped in /var/log), cache (/var/cache) etc.
Using a disk analyzer I noticed my /var folder was huge, like 4.5 GB.
The biggest amount of data was in /var/cache/apt/archives.
Another big folder was /var/tmp/kdecache-your_username

The first one contains a copy of all the packages you have ever downloaded. This is useful if you need to reinstall them or if you want to perform a new clean installation and then reinstall everything you need, but it takes way too much space and it is not useful to me.

In order to remove all the packages in there you can use
apt-get autoclean if you want to remove only the packages which are not needed anymore
apt-get clean to remove all the files

The second huge folder is something related to KDE. I don't really know what it used for, but looking on the internet they state it is safe to remove it as long as you're not running KDE, so move to a different virtual desktop by pressing Ctrl + Alt + F1, log as root and execute
/etc/init.d/kdm stop
rm -fr /var/tmp/kdecache-your_username
/etc/init.d/kdm start 

and log in again.

Nessun commento:

Posta un commento