解决rpmdb: Lock table is out of available locker entries问题。

来源:互联网 发布:淘宝秋装新款女装 编辑:程序博客网 时间:2024/06/06 19:42

解决rpmdb: Lock table is out of available locker entries问题

 
  如果运行一些程序后,远行yum命令出现

“rpmdb: Lock table is out of available locker entries...”的问题时, 你可以按照如下操作来修复它:

错误表现如下:
rpmdb: Lock table is out of available locker entries
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

操作之前请先备份 /var/lib/rpm :
tar cvzf rpmdb-backup.tar.gz /var/lib/rpm

去除rpm使用的BDB数据库:
rm /var/lib/rpm/__db.00*

重建立 rpm 使用的数据库,注意:此处可能需要一点时间:
rpm --rebuilddb

现在检查,看看 rpm 包是否一切正常:
rpm -qa | sort

为什么为发生这个问题呢?
其实当您用rpm命令后,rpm访问BDB数据库,首先会设置一个临时锁。如果在它运行时您用 control-c 中断它,或者是给它发了中断信号。那么rpm就很可能会出错误。因为这个临时锁还没有被释放呢。找到原因,相信您还可以找到其它的解决方法。
 
----------------------------------------------------------------------------------------------------------------------
 
英文原文:

rpmdb: Lock table is out of available locker entries

If up2date throws some horrible Python errors and rpm says “rpmdb: Lock table is out of available locker entries”, you can restore your system to normality with the following:

The errors:

Make a backup of /var/lib/rpm in case you break something:

Remove the Berkeley databases that rpm uses:

Make rpm rebuild the databases from scratch (may take a short while):

Now, check rpm to make sure everything is okay:

Why does this happen?
When rpm accesses the Berkeley database files, it makes temporary locker entries within the tables while it searches for data. If you control-c your rpm processes often, this issue will occur much sooner because the locks are never cleared.

Update: As of February 2009, this post received five times the visits of my next most popular post. This situation must happen very often!

 

 
原创粉丝点击