Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I recover a corrupted dnf database?

I just killed a dnf process as it was not responding to ^Z

Now I have a corrupted Berkley database and no idea of how to rebuild it - colour me stoopid.

Any help would be gratefully received.

The output of any dnf search now is:

error: rpmdb: BDB0113 Thread/process 21154/140457937990976 failed: BDB1507 Thread died in Berkeley DB library
error: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db5 -  (-30973)
error: cannot open Packages database in /var/lib/rpm
Error: Error: rpmdb open failed

Thanks very much for your help.

like image 433
Doug Avatar asked Dec 07 '22 13:12

Doug


1 Answers

So simple I found the solution.

rpm --rebuilddb
like image 161
Doug Avatar answered Dec 11 '22 11:12

Doug