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

解决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!
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值