RPM - Verify the integrity of RPM Database Packages using rpmdb_verify
by
Jeremy Canfield |
Updated: October 06 2023
| RPM articles
On some Red Hat distributions (CentOS, Fedora, Red Hat), the /usr/lib/rpm/rpmdb_verify command line tool can be used to determine there are any issues with the RPM database Packages file.
~]$ /usr/lib/rpm/rpmdb_verify /var/lib/rpm/Packages
BDB5105 Verification of /var/lib/rpm/Packages succeeded.
If the rpmdb_verify command detects an issue, you can rename the /var/lib/rpm/Packages file.
mv /var/lib/rpm/Packages /var/lib/rpm/Packages.old
And then use the rpmdb_dump and rpmdb_load commands to create a new RPM database Packages file.
/usr/lib/rpm/rpmdb_dump /var/lib/rpm/Packages.old | /usr/lib/rpm/rpmdb_load /var/lib/rpm/Packages
And then use the rpm command with the -vv and --rebuilddb flags to rebuild the RPM database.
rpm -vv --rebuilddb
Did you find this article helpful?
If so, consider buying me a coffee over at