pkgcacheclean(8)

NAME
pkgcacheclean - a simple utility to clean pacman cache

SYNOPSIS
pkgcacheclean [option...] [preserve_number]

DESCRIPTION
For installed packages, preserve_number of versions are reserved. This includes the current version and the newest (preserve_number - 1) of the remaining. For uninstalled packages all versions are deleted. The default number is 2.

OPTIONS

-n, --dry-run
    Perform a trial run with no changes made

-d, --cachedir=PATH
    Set alternative (absolute) cache directory PATH. Default is /var/cache/pacman/pkg/

-k, --all-as-installed
    Treat not-installed packages as installed

-v, --verbose
    Verbose output

-q, --quiet
    Suppress output, default

-?, --help
    Give a help list

--usage
    Give a short usage message

-V, --version
    Print program version

EXAMPLES

Do a verbose dry-run for cleaning up all but the latest 3 versions:
    pkgcacheclean -nv 3