kbocek wrote: ↑2018/07/16 15:36:07
I've run rpmdb --rebuilddb several times.
If you had not done this, there would have been a much bigger chance of getting your RPM database back.
Essentially, what that command did was that it went through the RPM database to find any working entries and wrote out the new database. And because rpm thought that none of the entries were valid (or did not find any due to some system errors), it wrote an empty (but working!) RPM database.
There's a chance that rpm could have been convinced to not treat the entries in the database as invalid, but it's too late now.
Next time this happens, don't use
rpmdb --rebuilddb unless you have a backup of your RPM database first.