rpm command won’t work:

I tried to install some xml related rpms on my Fedora, so checked yum list to see what xml rpms are installed. But the system gave me the below error.

[[email protected] home]# yum list | grep -i xmlrpmdb: Thread/process 31902/140347322918656 failed: Thread died in Berkeley DB libraryerror: db3 error(-30974) from dbenv->failchk: DB_RUNRECOVERY: Fatal error, run database recoveryerror: cannot open Packages index using db3 –  (-30974)error: cannot open Packages database in /var/lib/rpmCRITICAL:yum.main:Error: rpmdb open failed[[email protected] home]#

Tried fixing using “yum clean”

I initially thought it was some issue with yum and its cache, so tried yum clean. That did not work!.

[[email protected] home]# yum clean rpmdb: Thread/process 31902/140347322918656 failed: Thread died in Berkeley DB library error: db3 error(-30974) from dbenv->failchk: DB_RUNRECOVERY: Fatal error, run database recovery error: cannot open Packages index using db3 –  (-30974) error: cannot open Packages database in /var/lib/rpm CRITICAL:yum.main: Error: rpmdb open failed[[email protected] home]# rpm -qa rpmdb: Thread/process 31902/140347322918656 failed: Thread died in Berkeley DB library error: db3 error(-30974) from dbenv->failchk: DB_RUNRECOVERY: Fatal error, run database recovery error: cannot open Packages index using db3 –  (-30974) error: cannot open Packages database in /var/lib/rpm rpmdb: Thread/process 31902/140347322918656 failed: Thread died in Berkeley DB library error: db3 error(-30974) from dbenv->failchk: DB_RUNRECOVERY: Fatal error, run database recovery error: cannot open Packages database in /var/lib/rpm

Corrupted rpmdb:

Taking a closer look, it sounded like rpm db is corrupted. This caused issues in rpm command.

[[email protected] home]# ls /var/lib/rpmBasenames  Conflictname  __db.001  __db.002  __db.003  __db.004  Dirnames  Filedigests  Group  Installtid  Name  Obsoletename  Packages  Providename  Provideversion  Pubkeys  Requirename  Requireversion  Sha1header  Sigmd5  Triggername[[email protected] home]#[[email protected] home]# rpm –rebuilddbrpmdb: Thread/process 31902/140347322918656 failed: Thread died in Berkeley DB libraryerror: db3 error(-30974) from dbenv->failchk: DB_RUNRECOVERY: Fatal error, run database recoveryerror: cannot open Packages index using db3 –  (-30974)[[email protected] home]#

Delete and Rebuild rpmdb:

Deleted the __db* files and did a “rpm –rebuilddb”. It worked perfectly and I was able to do rpm and yum commands.

[[email protected] home]#[[email protected] home]# rm -f /var/lib/rpm/__*[[email protected] home]# rpm –rebuilddb[[email protected] home]# rpm -qa | wc -l629[[email protected] home]#

0 Shares:
Leave a Reply

Your email address will not be published. Required fields are marked *

You May Also Like
Read More

Redhat ET

Redhat ET ( emerging technology ) url : http://et.redhat.com/page/Main_Page . This has good information on the developments around…
Read More

Linux hugepages

Hugepages is a mechanism that allows the Linux kernel to utilize the multiple page size capabilities of modern…