Stop DNF from holding onto old transaction history that slows you down

Package Management (Apt/Dnf/Pacman Internals)

Stop DNF from holding onto old transaction history that slows you down

🧩 The Challenge

Dealing with a server where dnf runs like a brick after a few months because the history database has grown into a monster. It’s annoying when a simple query takes longer than the actual package installation.

💡 The Fix

Use the built-in history cleanup tool to prune those ancient transaction records you never look at anyway. It clears out the dead weight without breaking the dependency tracker.

dnf history sync
dnf history undo all
dnf history expire 30d

⚙️ Why It Works

Running the expire command tells the database to dump anything older than your specified threshold, reclaiming the disk space and sanity of your index lookups.

🚀 Pro-Tip: If you really want a clean slate, check the size of /var/lib/dnf/history.sqlite before and after; it’s usually eye-opening.

Linux Tips & Tricks | © ngelinux.com | 8/22/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted