Stop apt from holding onto ghost package versions
Package Management (Apt/Dnf/Pacman Internals)
Stop apt from holding onto ghost package versions
🧩 The Challenge
You ever run an update only to find your machine is still holding onto an old, buggy library version that should have been kicked to the curb weeks ago? It happens when dependencies get messy and apt just refuses to prune what it thinks you might still need.
💡 The Fix
Use the autoremove command combined with specific flags to force apt to clean up those orphaned packages that don’t have any reason to be on your disk anymore.
sudo apt-get autoremove --purge
⚙️ Why It Works
This tells the package manager to look for every package that was installed automatically to satisfy a dependency but is no longer required by anything currently on the system, and the purge flag ensures the config files go with it.
🚀 Pro-Tip: Run this after every major dist-upgrade to keep your filesystem from turning into a graveyard of unused config files.
Linux Tips & Tricks | © ngelinux.com | 10/6/2026
