I run Arch Linux on my laptop that has a 100GB disk with a 15GB partition for
/, a 15GB partition for
/opt and the remaining 70GB for
/home. Recently I ran out of disk space on
/. First I thought that this was due to a huge browser cache (in opera, my temporary download directory is set to
/tmp/opera/downloads which can get really big). Clearing up the
/tmp did not help, and I went on a wild goose chase of figuring out which directory was hogging disk space. The culprit:
pacman, the arch package manager, keeps a cache of all packages it downloads! Over the last year or so that I have been running Arch, this directory had become huge, taking over 5GB of space. I do not want a cache of all package that I ever downloaded. I bit of hunting through the man pages revealed the right options.
which removes all the uninstalled packages from the cache. After that,
/var/cache/pacman/pkg is at a bearable 2.5GB. I also learnt that if I ever need more disk space, I can run
which will remove all packages from pacman cache.