1、前提条件:安装软件包的时候,被我手动终止了[root@dhcp yum.repos.d]# yum clean all
rpmdb: Thread/process 4541/140619363587840 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[root@dhcp yum.repos.d]# yum makecacherpmdb: Thread/process 4541/140619363587840 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:
2、根据提示可以知道rpm数据库被损坏,如是按照下面的方法进行重建
[root@dhcp yum.repos.d]# cd /var/lib/rpm/[root@dhcp rpm]# lsBasenames __db.004 Name Pubkeys TriggernameConflictname Dirnames Obsoletename Requirename__db.001 Filedigests Packages Requireversion__db.002 Group Providename Sha1header__db.003 Installtid Provideversion Sigmd5[root@dhcp rpm]# rm __db.* -rf[root@dhcp rpm]# rpm --rebuilddb[root@dhcp rpm]# yum clean all
Loaded plugins: aliases, changelog, downloadonly, kabi, presto, product-id, : refresh-packagekit, security, subscription-manager, tmprepo, : verify, versionlockUpdating certificate-based repositories.Unable to read consumer identityLoading support for Red Hat kernel ABICleaning repos: rhel-sourceCleaning up Everything0 delta-package files removed, by presto[root@dhcp rpm]# yum updateLoaded plugins: aliases, changelog, downloadonly, kabi, presto, product-id, : refresh-packagekit, security, subscription-manager, tmprepo, : verify, versionlockUpdating certificate-based repositories.Unable to read consumer identityLoading support for Red Hat kernel ABIrhel-source | 4.0 kB 00:00 ...rhel-source/primary_db | 3.1 MB 00:00 ...Setting up Update ProcessNo Packages marked for Update