Calculate disk space consumed by the APT package cache and downloaded .deb archives.
APT keeps every downloaded .deb package file in /var/cache/apt/archives/ after installation, in case a reinstall is needed without re-downloading. Over time, as packages are upgraded, older versions' .deb files accumulate uselessly since only the latest installed version can ever be reinstalled from cache. `apt autoclean` removes only those obsolete, superseded package files, while `apt clean` (or `apt-get clean`) removes the entire cache indiscriminately, trading the ability to reinstall the currently-installed versions offline for maximum space recovery.
Cache size
cache_size = cached_deb_count × avg_deb_size; autoclean_savings = obsolete_deb_count × avg_deb_size
`apt autoclean` removes only .deb files for package versions that are no longer installable (superseded by a newer version already applied), keeping the cache for currently-installed versions. `apt clean` deletes the entire archive cache regardless of whether packages are still installed, maximizing space recovery at the cost of needing to re-download for any future reinstall.
`du -sh /var/cache/apt/archives` shows total size directly; `apt-get clean -s` (simulate/dry-run) or `du -sh /var/cache/apt/archives/*.deb | tail -1` in some shells can approximate what would be freed without actually deleting anything.
Generally yes — it only removes cached downloaded package files, not installed packages or their configuration, so system functionality is unaffected. The only downside is that reinstalling or downgrading a package afterward requires re-downloading it rather than pulling from local cache.