paccache
cache cleaning utility for pacman, the Arch Linux package manager
TLDR
Remove all but the 3 most recent package versions from the pacman cache
SYNOPSIS
paccache [options] [targets...]
DESCRIPTION
paccache is a cache cleaning utility for pacman, the Arch Linux package manager. It removes old package versions from the pacman cache directory (/var/cache/pacman/pkg/) while preserving recent versions for potential rollbacks.
By default, it keeps the 3 most recent versions of each package. This helps reclaim disk space while maintaining the ability to downgrade packages if needed. The tool can target all cached packages or only those no longer installed on the system.
PARAMETERS
-r, --remove
Remove candidate packages from the cache-d, --dryrun
Perform a dry run, only listing candidates-k, --keep num
Keep num versions of each package (default: 3)-m, --move dir
Move candidates to dir instead of removing-u, --uninstalled
Target uninstalled packages only-c, --cachedir dir
Specify alternate cache directory-a, --arch arch
Filter packages by architecture-v, --verbose
Show removed or moved packages-q, --quiet
Minimize output-z, --null
Use null delimiters for output-h, --help
Display help message
CAVEATS
Requires appropriate permissions to modify the pacman cache (typically root). After aggressive cleaning, downgrading packages may require re-downloading older versions. Consider keeping at least 1-2 versions for critical packages.
HISTORY
Part of pacman-contrib, a collection of scripts for pacman previously included in the main pacman package. Split into a separate package to keep the core pacman lean. Essential for Arch Linux system maintenance where the cache can grow substantially over time.
