paccache
A pacman cache cleaning utility. tldr-pages
On Linux
Linux
Remove all but the 3 most recent package versions from the pacman cache
paccache --removeIdentifySet the number of package versions to keep
paccache --remove --keep num_versionsIdentifySimulate the cleaning and show the number of candidate packages for deletion
paccache --dryrunIdentifyMove candidate packages to a directory instead of deleting them
paccache --move path/to/directoryIdentify