Clearing the cache on Debian/Ubuntu (or their derivatives, such as PopOS)
- Cleaning up orphaned packages
sudo apt autoremove
- Preview of the cache and of what clearing/deleting the cache will delete
sudo apt clean --dry-run
Example:
debby@linodebox:~$ sudo apt clean --dry-run
Del /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.bin
debby@linodebox:~$
- Clear the cache
sudo apt clean
If clearing the cache is successful, this command will have no output.