Clear Arch Linux Pacman Cache

Allo c'est moi

Olivier Gareau

May 30, 2022

How to clear the pacman cache in Arch Linux

If you are like me and enjoy keeping your Arch Linux system up-to-date, you will inevitably end up in a situation where the package cache of pacman takes up a lot of disk space. Here is how to prune this cache and only keep one previous version of cached packages.

You will first want to install the pacman-contrib package in order to obtain the paccache utility:

# pacman -S pacman-contrib

You can now run the paccache utility and delete all the cached packages except for the most recent one:

# paccache -rk 1

Here is the console output of running paccache on my machine:

[email protected] ~> sudo paccache -rk 1
[sudo] password for olivier: 

==> finished: 1012 packages removed (disk space saved: 2.96 GiB)
[email protected] ~>