Cleaning your Apt

My 16 GB Ubuntu partition has ran of out space. Disk usage analyzer claims that /var/cache/apt is using 669 MB. Time to clean it up my apt with apt-get clean! Basically, apt-get clean removes .deb packages that apt caches when you install or update programs.

elton@laptop:/var/cache$ du -hs
 du: cannot read directory `./ldconfig': Permission denied
 du: cannot read directory `./lightdm/dmrc': Permission denied
 743M .
 elton@laptop:/var/cache$ sudo !!
 sudo du -hs
 743M .
 elton@laptop:/var/cache$ sudo apt-get clean
 elton@laptop:/var/cache$ sudo du -hs
 105M

A few other options:

apt-get autoclean
to remove partial packages from the system
apt-get autoremove to remove packages installed as dependencies after the original package is removed

Filed under: Debian, Linux, Ubuntu