How to Remove APT Cache on Linux
Free up storage by cleaning APT cache files on Linux with Kudu’s cleanup tools.
By Kudu Team
Fix this automatically with Kudu
Run a free system scan to detect and resolve this issue automatically — no manual steps required.
Download Kudu Free →What Causes This?
APT stores downloaded .deb package files in its local cache so it can reuse them during installs, upgrades, or reinstalls. Over time, that cache can grow large, especially on systems that are updated often or have many packages installed. Old package files may no longer be needed, but they stay in the cache until you remove them manually or use a cleanup tool.
Common Symptoms
- Your Linux system is running low on disk space
- The
/var/cache/apt/archivesfolder has grown unexpectedly large - Package updates complete, but storage usage keeps increasing
- You see “No space left on device” during installs or upgrades
- Disk cleanup tools report package cache files taking up space
How to Fix It Manually
-
Open a terminal.
- On Ubuntu or many Linux desktops, press
Ctrl+Alt+T. - You can also search for Terminal from your app menu.
- On Ubuntu or many Linux desktops, press
-
Check how much space the APT cache is using.
- Run:
du -sh /var/cache/apt/archives - This shows the total size of cached package files.
- Run:
-
Remove old cached packages that can no longer be downloaded.
- Run:
sudo apt autoclean - Enter your password if prompted.
- This is the safer cleanup option because it only removes outdated package files.
- Run:
-
Remove all cached package files if you want to free up the most space.
- Run:
sudo apt clean - This deletes everything in the APT package cache, not just outdated files.
- It will not uninstall your apps, but APT will need to re-download packages later if needed.
- Run:
-
Remove packages that are no longer required.
- Run:
sudo apt autoremove - This cleans up unused dependencies left behind after uninstalling or upgrading software.
- Run:
-
Verify that the cache has been cleared.
- Run:
du -sh /var/cache/apt/archives - You should see a much smaller size than before.
- Run:
-
If you want to inspect the cache folder manually, list its contents.
- Run:
ls -lh /var/cache/apt/archives - Most systems should show very few remaining files after cleanup.
- Run:
-
Restart package operations if needed.
- If you were troubleshooting update or install errors caused by low disk space, try your command again:
sudo apt update sudo apt upgrade
- If you were troubleshooting update or install errors caused by low disk space, try your command again:
Fix It Automatically with Kudu
If you do not want to dig through cache folders and cleanup commands yourself, Kudu can help automate the cleanup process and identify storage-hogging files quickly. It makes it easier to find leftover package caches and other junk files so you can recover disk space without hunting through the system manually.
Fix this automatically with Kudu
Run a free system scan to detect and resolve this issue automatically — no manual steps required.
Download Kudu Free →Related guides
How to Remove App Cache on Linux
Clean application cache on Linux to recover space and reduce clutter using Kudu.
How to Remove Browser Cache on Linux
Delete browser cache on Linux to free up storage and improve browsing performance with Kudu.
How to Remove DNF Cache on Linux
Delete DNF cache on Linux and reclaim storage space safely using Kudu’s cleanup tools.
How to Remove Pacman Cache on Linux
Free up space by cleaning Pacman cache on Linux with help from Kudu.