错误信息
yum 执行安装时,出现There are unfinished transactions remaining.
然后执行被Killed,导致Error: rpmdb open failed
错误。
并且执行yum- complete-transaction --cleanup-only
导致同样的错误。
[root@master rpm]# yum install php-pear
BDB2053 Freeing read locks for locker 0x34:
28550/139945697376064
Loaded plugins: fastestmirror, langpacks
Repository epel is listed more than once in the
configuration
Loading mirror speeds from cached hostfile
* remi-php74: mirrors.tuna.tsinghua.edu.cn
* remi-safe: mirrors.tuna.tsinghua.edu.cn
Resolving Dependencies
There are unfinished transactions remaining. You might
consider running yum-complete-transaction, or "yum-
complete-transaction --cleanup-only" and "yum history redo
last", first to finish them. If those don't work you'll
have to try removing/installing packages by hand (maybe
package-cleanup can help).
--> Running transaction check
---> Package php-pear.noarch 1:1.10.10-4.el7.remi will be updated
---> Package php-pear.noarch 1:1.10.12-1.el7.remi will be an update
--> Finished Dependency Resolution
Killed
error: rpmdb: BDB0113 Thread/process 2816/140577839810368 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
CRITICAL:yum.main:
Error: rpmdb open failed
解决方法
解决Error: rpmdb open failed
cd /var/lib/rpm
rm -f __db.*
rpm --rebuilddb
yum clean all
解决There are unfinished transactions remaining.
先删除之前安装出错的pakeage
yum remove php-pear
安装yum-utils
yum install yum-utils
清理未完成事务
yum-complete-transaction --cleanup-only
这时重新安装php-pear不会出错。