• error: cannot open Packages database in /var/lib/rpm

    While trying add some packages on Centos6 ,I got the following error:

    [root@raafat src]# yum install ksh
    rpmdb: Thread/process 22748/140143661344512 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

    To Fix this error and to be able to install the packages from yum ,you have to do one of the following :
    — >Fix the rpm database by run database recovery:
    [root@raafat src]# db_recover -h /var/lib/rpm
    — > Clean yum cache:
    [root@raafat src]# yum clean all

    create or rebuild new rpm database
    Remove old rpm database:
    [root@raafat src]#rm -f /var/lib/rpm/_db*
    Rebuild RPM database :
    [root@raafat src]#rpm –rebuilddb
    Clean yum cache:
    [root@raafat src]#yum clean all

    Categories: Linux

    Comments are currently closed.