Stop apt from leaving your disk cluttered with old downloaded packages
Package Management (Apt/Dnf/Pacman Internals)
Stop apt from leaving your disk cluttered with old downloaded packages
🧩 The Challenge
You ever run a quick update on a server and realize you’ve burned through all your free disk space? Turns out apt keeps every single .deb file it ever pulled down sitting in a cache directory, just waiting for the day your partition fills up.
💡 The Fix
Use the built-in clean or autoclean functions to dump the trash. You don’t need to keep installers for versions you replaced months ago.
apt-get clean
⚙️ Why It Works
Running this command scrubs the local repository of retrieved package files, essentially purging the cache that apt treats like a hoarding project. It’s a clean sweep of the /var/cache/apt/archives directory without touching the actual installed software.
🚀 Pro-Tip: Stick this in a simple weekly cron job if you’re managing systems with tiny root partitions.
Linux Tips & Tricks | © ngelinux.com | 8/14/2026
