Investigate Disk Usage and Clean Pacman Cache

Examine what's taking up space

So, according to my conky display, my root partition is almost full. df confirms:

sh df -h

``` Filesystem Size Used Avail Use% Mounted on /dev/sdd2 15G 14G 566M 97% / ... /dev/sdd3 102G 3.8G 93G 4% /home /dev/sdd1 1022M 36M 987M 4% /boot /dev/sdc1 1.9T 859G 1005G 47% /mnt/storage /dev/sde1 1.8T 859G 883G 50% /mnt/backup_hv620 ... /dev/sdf1 459G 16G 420G 4% /mnt/backup_ch91


I'm sure I don't have that much installed. Drive usage can be tracked down with du.

  • -P: skips symlinks
  • -h: human readable
  • -x: only uses filesystem specified, i use this to narrow to my root filesystem
  • --max-depth: controls directory recursion depth

Following the strategy below, I track it down to the pacman cache.

``` sh sudo du -Phx / --max-depth=1 sudo du -Phx /var --max-depth=1 sudo du -Phx /var/cache --max-depth=1

# 5.8G  /var/cache/pacman
# 3.6M  /var/cache/man
# 57M   /var/cache/minidlna
# 260K  /var/cache/fontconfig
# 52K   /var/cache/ldconfig
# 5.8G  /var/cache

sudo du -Phx /var/cache/pacman/pkg
# 5.8G  /var/cache/pacman/pkg
# 5.8G  /var/cache/pacman


Figure out a solution

Alright, what's the solution. A switch to btrfs would be convenient :P. But, from the archwiki, pacman caches downloaded packages for backup purposes. It can be cleaned up as follows

  • -r removes candidate packages
  • -k keeps most recent number, below, 2

sh sudo paccache -rk2 ==> finished: 733 packages removed (diskspace saved: 3.4 GiB)

  • -u is to remove uninstalled packages, which are kept unless the option given
  • -k here keeps the most recent 0 versions

sh sudo paccache -ruk0 ==> finished: 78 packages removed (diskspace saved: 142.17 MiB)

Go Top
comments powered by Disqus