Where Does APT Cache Downloaded Packages?
Where APT caches downloaded .deb files on Debian and Ubuntu, and the two commands that reclaim the space.
Last updated
APT keeps every downloaded package in /var/cache/apt/archives as .deb files, so reinstalls skip the download. The cache only grows: nothing prunes it automatically, and long lived servers accumulate gigabytes of stale versions.
Package lists are the sibling to know about. They live in /var/lib/apt/lists and record what is available, while the archives folder holds what was fetched. A corrupt lists entry breaks apt update; a full archives folder just wastes space. Different problems, different folders.
Where APT stores this, by platform
/var/cache/apt/archives
Needs sudo to read and clean. Partial downloads sit in the partial subfolder during fetches. Run du -sh on the folder first so you know what cleaning will actually reclaim.
Frequently asked questions
How do I free disk space used by cached packages?
Run sudo apt-get clean to empty the cache completely, or sudo apt-get autoclean to drop only packages too old to reinstall. Both are safe: installed software never depends on the cached .deb. Clean first when a disk full error appears out of nowhere.
Can I reuse cached .deb files on an offline machine?
Yes. Each .deb installs with sudo dpkg -i <file>, no network needed. Copy the ones you need to the offline machine (a USB stick works). Dependency chains may need several files, so prefer apt --download-only on the connected side to gather the full set.
Notice an outdated path? Let us know.