Forrest logo
back to the paccache tool

paccache:tldr:8eb22

paccache: Remove all but the 3 most recent package versions from the pacman cache.
$ paccache -r
try on your machine

The command "paccache -r" is used in Arch Linux to remove old versions of installed packages from the package cache directory.

When you install or upgrade packages in Arch Linux, the package manager (Pacman) stores the downloaded packages in a cache directory (/var/cache/pacman/pkg) to allow for future reinstallation or downgrading. However, over time, the cache directory can accumulate a large number of old versions of packages, taking up unnecessary disk space.

By using the "paccache -r" command, you can clean up this package cache directory by removing all but the three most recent versions of each package. This helps you to free up disk space while still retaining the ability to revert to slightly older package versions if needed.

The "paccache -r" command is typically run with root privileges. Once executed, it will scan the package cache directory, identify the old versions of packages, and remove them, leaving only the three most recent versions intact.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the paccache tool