# rpm —rebuilddb
or completely re-create it:
# rpm —initdb
It is uncommon for the RPM database to need rebuilding, but it doesn't hurt anything to try. Any time you make major changes to your system is a good time to rebuild the RPM database. If you compare the size of /var/lib/rpm/packages before and after running
rpm —rebuilddb, you may notice some shrinkage, because it has removed unused portions of the database.