Stop apt from keeping ghost versions of your config files

Package Management (Apt/Dnf/Pacman Internals)

Stop apt from keeping ghost versions of your config files

🧩 The Challenge

You ever update a system and find a graveyard of old configuration files ending in .dpkg-dist or .dpkg-old, cluttering your /etc directory? It’s infuriating to realize you’ve been running on stale config logic because the package manager just dumped the new files instead of merging them.

💡 The Fix

Use the hidden interactive interface built into apt to force a sanity check on all these leftovers before they cause a production outage. It saves you from manual diffing and ensures you actually see what changed between versions.

apt-get install apt-show-versions && apt-show-versions | grep "newer than version in archive"

⚙️ Why It Works

By querying the package manager’s internal state against the local repository metadata, you can identify exactly which packages have pending configuration drift that hasn’t been reconciled. This approach ignores the noise and points you straight at the packages that think they are smarter than your current configuration.

🚀 Pro-Tip: Keep a close eye on /var/lib/dpkg/info for the actual installation logs if you’re really stuck in the weeds.

Linux Tips & Tricks | © ngelinux.com | 7/13/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted