1、安装报错,报错内容如下:
[root@test ~] yum install httpd -y
error: rpmdb: BDB0113 Thread/process 8835/139774366890048 failed:
BDB1507 Thread died in Berkeley DB libraryerror: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RUNRECOVERY:
Fatal error, run database recoveryerror: cannot open Packages index using db5 - (-30973)
error: cannot open Packages database in /var/lib/rpm
CRITICAL:yum.main:
Error: rpmdb open failed
2、解决方法如下:
[root@test ~]cd /var/lib/rpm
[root@test rpm]ll
total 178512
-rw-r–r–. 1 root root 6684672 Oct 12 14:35 Basenames
-rw-r–r–. 1 root root 16384 Oct 12 14:35 Conflictname
-rw-r–r-- 1 root root 311296 Nov 4 17:35 __db.001
-rw-r–r-- 1 root root 90112 Nov 4 17:35 __db.002
-rw-r–r-- 1 root root 1318912 Nov 4 17:35 __db.003
-rw-r–r–. 1 root root 2265088 Oct 12 14:35 Dirnames
-rw-r–r–. 1 root root 40960 Oct 12 14:35 Group
-rw-r–r–. 1 root root 45056 Oct 12 14:35 Installtid
-rw-r–r–. 1 root root 118784 Oct 12 14:35 Name
-rw-r–r–. 1 root root 24576 Oct 12 14:35 Obsoletename
-rw-r–r–. 1 root root 167387136 Oct 12 14:35 Packages
-rw-r–r–. 1 root root 3330048 Oct 12 14:35 Providename
-rw-r–r–. 1 root root 921600 Oct 12 14:35 Requirename
-rw-r–r–. 1 root root 212992 Oct 12 14:35 Sha1header
-rw-r–r–. 1 root root 131072 Oct 12 14:35 Sigmd5
-rw-r–r–. 1 root root 8192 Oct 12 14:35 Triggername
[root@test rpm] rm -f __db.00*
[root@test rpm] rpm --rebuilddb 重建rpm数据库
[root@test rpm] yum install httpd
Loaded plugins: fastestmirror, langpacks Determining fastest mirrors
epel
| 4.7 kB 00:00:00 extras
| 2.9 kB 00:00:00 os
| 3.6 kB 00:00:00 salt-latest-repo
| 2.9 kB 00:00:00 updates
| 2.9 kB 00:00:00 (1/4): epel/7/x86_64/updateinfo
| 1.0 MB 00:00:00 (2/4): salt-latest-repo/primary_db
| 42 kB 00:00:00 (3/4): epel/7/x86_64/primary_db
| 7.0 MB 00:00:01 (4/4): updates/7/x86_64/primary_db
| 12 MB 00:00:01 Resolving Dependencies
–> Running transaction check
—> Package httpd.x86_64 0:2.4.6-97.el7.centos will be updated
—> Package httpd.x86_64 0:2.4.6-97.el7.centos.1 will be an update
–> Processing Dependency: httpd-tools = 2.4.6-97.el7.centos.1 for package: httpd-2.4.6-97.el7.centos.1.x86_64
–> Running transaction check
—> Package httpd-tools.x86_64 0:2.4.6-97.el7.centos will be updated
—> Package httpd-tools.x86_64 0:2.4.6-97.el7.centos.1 will be an update
–> Finished Dependency ResolutionDependencies Resolved
=========================================================================================================================================================================== Package Arch
Version Repository
Size
=========================================================================================================================================================================== Updating: httpd x86_64
2.4.6-97.el7.centos.1 updates 2.7 M Updating for dependencies: httpd-tools x86_64 2.4.6-97.el7.centos.1
updates 93 kTransaction Summary
=========================================================================================================================================================================== Upgrade 1 Package (+1 Dependent package)
Total download size: 2.8 M Is this ok [y/d/N]: y Downloading packages: No Presto metadata available for updates (1/2):
httpd-tools-2.4.6-97.el7.centos.1.x86_64.rpm
| 93 kB 00:00:00 (2/2): httpd-2.4.6-97.el7.centos.1.x86_64.rpm
| 2.7 MB 00:00:01
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Total
2.2 MB/s | 2.8 MB 00:00:01 Running transaction check Running transaction test Transaction test succeeded Running transaction
Updating : httpd-tools-2.4.6-97.el7.centos.1.x86_64 1/4
Updating : httpd-2.4.6-97.el7.centos.1.x86_64 2/4
Cleanup : httpd-2.4.6-97.el7.centos.x86_64 3/4
Cleanup : httpd-tools-2.4.6-97.el7.centos.x86_64 4/4
Verifying : httpd-2.4.6-97.el7.centos.1.x86_64 1/4
Verifying : httpd-tools-2.4.6-97.el7.centos.1.x86_64 2/4
Verifying : httpd-2.4.6-97.el7.centos.x86_64 3/4
Verifying : httpd-tools-2.4.6-97.el7.centos.x86_64 4/4Updated: httpd.x86_64 0:2.4.6-97.el7.centos.1 Dependency Updated: httpd-tools.x86_64 0:2.4.6-97.el7.centos.1 Complete!
遇到上述问题 需要重建rpm数据库。