LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

apt-clean

Clear the local cache of retrieved package files.

TLDR

Remove downloaded package files from the cache
$ sudo apt clean
copy
Simulate the cleanup
$ apt clean -s
copy
Run quietly
$ sudo apt clean -q
copy
Use a specific configuration file
$ sudo apt clean -c [path/to/apt.conf]
copy
Clean a different archive directory
$ sudo apt clean -o Dir::Cache::Archives=[path/to/directory]
copy

SYNOPSIS

apt clean [options]

DESCRIPTION

apt clean deletes retrieved package files from the local APT archive cache, normally `/var/cache/apt/archives/` and `/var/cache/apt/archives/partial/`. The lock file in that directory is left in place. Package index lists under `/var/lib/apt/lists/` are left alone; refresh those with apt update.The command is a subcommand of apt. apt-get clean does the same work. autoclean is the narrower variant: it removes only package files that can no longer be downloaded.

PARAMETERS

-s, --simulate

Print what would be removed. --dry-run and --no-act are equivalent.
-q, --quiet
Produce less output. Repeat for quieter logs.
-c, --config-file file
Read the named APT configuration file.
-o, --option key=value
Set a configuration option for this run. `Dir::Cache::Archives` selects the directory that is cleaned.
-h, --help
Show help and exit.

CAVEATS

Deleting the cache requires root. A later install downloads those package files again. clean does not uninstall software and does not free space used by installed packages.

SEE ALSO

apt(8), apt-get(8), apt-update(8)

RESOURCES

Copied to clipboard
Kai