执行rpm -ivh 时报错:error rpmdb BDB0113 Threadprocess 11690140458095421504 failed

1.报错具体信息如下:

[root@heyong tools]# rpm -ivh jenkins-2.197-1.1.noarch.rpm
error: rpmdb: BDB0113 Thread/process 11690/140458095421504 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 warning: jenkins-2.197-1.1.noarch.rpm: Header V4 DSA/SHA1 Signature, key ID d50582e6: NOKEY error: rpmdb: BDB0113 Thread/process 11690/140458095421504 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 database in /var/lib/rpm

  

2.解决办法:

重新构建rpm数据库

[root@heyong tools]# cd /var/lib/rpm
[root@heyong rpm]# ls Basenames Conflictname __db.001 __db.002 __db.003 Dirnames Group Installtid Name Obsoletename Packages Providename Requirename Sha1header Sigmd5 Triggername
[root@heyong rpm]# rm -rf _db*
[root@heyong rpm]# rpm --rebuilddb

  

3.再次验证:

[root@heyong tools]# rpm -ivh jenkins-2.197-1.1.noarch.rpm 
warning: jenkins-2.197-1.1.noarch.rpm: Header V4 DSA/SHA1 Signature, key ID d50582e6: NOKEY Preparing... ################################# [100%] Updating / installing... 1:jenkins-2.197-1.1 ################################# [100%]

 验证成功

02-11 12:10