pacman-r
Remove packages from the system
TLDR
View documentation for the original command
SYNOPSIS
pacman-r [options]
PARAMETERS
-h, --help
Display help message and exit.
-V, --version
Display version information and exit.
-d, --directory
Specify the package cache directory (default: /var/cache/pacman/pkg).
-n, --no-act
Do not actually remove packages; only print what would be removed.
-f, --force
Force removal, even if packages are still referenced.
DESCRIPTION
The pacman-r command, part of the pacman package manager for Arch Linux and its derivatives, is used to remove unneeded packages from the pacman cache. This command analyzes the pacman database and identifies packages that are no longer installed on the system. It can then remove these orphaned packages from the local package cache directory to free up disk space. This command helps to keep your system clean and efficient by preventing the accumulation of unnecessary data.
It is especially useful on systems with limited storage space or where regular system maintenance is performed. While pacman itself has options for cleaning the cache, pacman-r provides a specialized tool for removing specifically uninstalled packages.
It is important to note that carelessly removing packages from the cache could impact the ability to downgrade packages in the future if the older package files are removed. Always consider the potential consequences before running any cache cleaning command.
CAVEATS
Removing packages from the cache may prevent downgrading to older versions if those packages are no longer available online. Exercise caution when using the -f option.
CACHE LOCATION
The default package cache directory is /var/cache/pacman/pkg. You can use the -d or --directory option to specify an alternate cache location.