出错情况:
[kmjt@localhost ~]$ sudo yum cleanall
Password:
rpmdb: Lock table is out of available locker entries
rpmdb: Unknown locker ID: a86
error: db4 error(22) from db->close: Invalid argument
error: cannot open Packages index using db3 - Cannot allocate memory (12)
error: cannot open Packages database in /var/lib/rpm
Traceback (most recent call last):
File "/usr/bin/yum", line 29, in ?
yummain.main(sys.argv[1:])
File "/usr/share/yum-cli/yummain.py", line 85, in main
base.getOptionsConfig(args)
File "/usr/share/yum-cli/cli.py", line 163, in getOptionsConfig
disabled_plugins=self.optparser._splitArg(opts.disableplugins))
File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 164, in _getConfig
self._conf = config.readMainConfig(startupconf)
File "/usr/lib/python2.4/site-packages/yum/config.py", line 685, in readMainConfig
yumvars['releasever'] = _getsysver(startupconf.installroot, startupconf.distroverpkg)
File "/usr/lib/python2.4/site-packages/yum/config.py", line 752, in _getsysver
idx = ts.dbMatch('provides', distroverpkg)
TypeError: rpmdb open failed
|
原因与解决:是因为RPM数据库出现损坏导致的,它导致所有的软件的升级、安装甚至是删除都会出现问题,终端出现乱码,YUMEX也用不成,RPM命令也用不成。原因是RPM数据库被破坏,解决方法如下:
$ su 切换到root权限
# rm -f /var/lib/rpm/__db.* 将rpm所用的数据库删除 ;这一步最好把_db.*备份一下
# rpm --rebuilddb 重建该数据库
# yum clean all 这句大家应该知道作什么吧
阅读(4107) | 评论(0) | 转发(1) |