Stop Dpkg From Keeping Ghost Config Files After You Purge
Package Management (Apt/Dnf/Pacman Internals)
Stop Dpkg From Keeping Ghost Config Files After You Purge
🧩 The Challenge
Ever notice how even after you run a purge on a package, those lingering config files in /etc just won’t die? It’s infuriating when you’re trying to do a clean sweep and keep hitting orphaned remnants that mess up your next install attempt.
💡 The Fix
You need to go after the dpkg selection state directly to tell the system those files are marked for removal. It’s the only way to force the database to actually let go of those configuration paths.
dpkg --purge --pending
⚙️ Why It Works
Running this tells dpkg to iterate through everything in the status file that’s marked as ‘deinstall’ but still has configuration files hanging around, effectively nuking them from orbit.
🚀 Pro-Tip: Use this after a botched dist-upgrade to clear out the junk before you try to fix your broken dependencies.
Linux Tips & Tricks | © ngelinux.com | 11/17/2026
