Clear the APT cache to reclaim disk space used by the downloaded packages.
Inspect APT cache configuration
Check out the current APT cache configuration using the following command.
$ apt-config dump | grep "^Dir\( \|::Ca\)"Dir "/";
Dir::Cache "var/cache/apt";
Dir::Cache::archives "archives/";
Dir::Cache::srcpkgcache "srcpkgcache.bin";
Dir::Cache::pkgcache "pkgcache.bin";
Dir::Cache::Backup "backup/";Remove every package from the cache
Perform a simulation of the whole process.
$ sudo apt-get clean --dry-runDel /var/cache/apt/archives/* /var/cache/apt/archives/partial/*
Del /var/lib/apt/lists/partial/*
Del /var/cache/apt/pkgcache.bin /var/cache/apt/srcpkgcache.binRemove retrieved package files.
$ sudo apt-get cleanRemove outdated packages from the cache
$ sudo apt-get autoclean --dry-runRemove retrieved package files that can no longer be downloaded.
$ sudo apt-get autoclean