Rebuilding your RPM package database: fixing RPM/yum problems

If you’re finding yourself stuck with yum updates and failing dependencies, you can try to rebuild your RPM database.

# cd /var/lib/rpm

# rm -f __db.*

# rpm –rebuilddb -vv

This will clear the old RPM database lock files (/var/lib/rpm/__db*) and rebuild it. Note: the __db* files only exist on the older Berkeley DB backend (RHEL 8 and older, Fedora 32 and older). On RHEL 9 / Fedora 33 and newer the backend is SQLite and there are no __db* files to remove; just running rpm --rebuilddb is enough.

For some interesting extra documentation, see the “RPM Database Recovery ” page.