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/archives folder 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

  1. Open a terminal.

    • On Ubuntu or many Linux desktops, press Ctrl+Alt+T.
    • You can also search for Terminal from your app menu.
  2. 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.
  3. 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.
  4. 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.
  5. Remove packages that are no longer required.

    • Run:
      sudo apt autoremove
    • This cleans up unused dependencies left behind after uninstalling or upgrading software.
  6. Verify that the cache has been cleared.

    • Run:
      du -sh /var/cache/apt/archives
    • You should see a much smaller size than before.
  7. 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.
  8. 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

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.

Download Kudu Free →

Fix this automatically with Kudu

Run a free system scan to detect and resolve this issue automatically — no manual steps required.

Download Kudu Free →