Product SiteDocumentation Site

10.5. Database backup and rebuild

It may happen that the RPM database is corrupted for various reasons. If so, you can rebuild the entire database just having /var/lib/rpm/Packages in a good condition, the other files are generated from it, and please, backup your database often.
Later, to restore the RPM database from the file Packages:
$ su -
# cd /var/lib/rpm
# rm __db.00*
# cp /root/Pacakges.bu Packages
# rpm --rebuilddb