当前位置: 代码迷 >> 综合 >> 解决rpmdb:Lock table is out of available locker entries问题
  详细解决方案

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

热度:42   发布时间:2023-12-16 19:52:08.0
解决rpmdb:Lock table is out of available locker entries问题
 
如果运行一些程序后,远行yum命令出现
 
“rpmdb: Lock table is out of available locker entries...”的问题时, 你可以按照如下操作来修复它:
  www.2cto.com  
错误表现如下:
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就很可能会出错误。因为这个临时锁还没有被释放呢。找到原因,相信您还可以找到其它的解决方法。
   www.2cto.com  
----------------------------------------------------------------------------------------------------------------------
英文原文:
rpmdb: Lock table is out of available locker entries
05.27.2007 | Author: major | Posted in Posts
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:
[html] 
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  
Make a backup of /var/lib/rpm in case you break something:
 
[html] 
tar cvzf rpmdb-backup.tar.gz /var/lib/rpm  
Remove the Berkeley databases that rpm uses:
  www.2cto.com  
[html] 
rm /var/lib/rpm/__db.00*  
Make rpm rebuild the databases from scratch (may take a short while):
 
[html] 
rpm --rebuilddb  
Now, check rpm to make sure everything is okay:
 
[html] 
rpm -qa | sort  
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!
  相关解决方案