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:
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:
tar cvzf rpmdb-backup.tar.gz /var/lib/rpm
Remove the Berkeley databases that rpm uses:
rm /var/lib/rpm/__db.00*
Make rpm rebuild the databases from scratch (may take a short while):
rpm --rebuilddb
Now, check rpm to make sure everything is okay:
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!
49 Comments on “rpmdb: Lock table is out of available locker entries”
You can track this conversation through its atom feed.
RPM Database Rebuild at S C ^ 2 says:
[...] did some research, and I found this guy’s website. Very helpful indeed, and a fellow RHCE. His tips did the trick. I’m going to spell [...]
Posted on August 25, 2007 at 1:17 pm.
Glad I was able to help!
Posted on August 25, 2007 at 3:13 pm.
It’s really helpful.
Posted on August 6, 2008 at 9:59 pm.
Thanks! That helped me too! Great description and solve of the problem!
Posted on August 8, 2008 at 4:26 am.
6log » Blog Archive says:
[...] source: Racker Hacker [...]
Posted on September 9, 2008 at 4:39 am.
This tip is very helpful
Posted on October 20, 2008 at 8:35 am.
hi,
worked very good with me
thanks alot
Posted on November 4, 2008 at 12:20 am.
Worked fine!!
Thanks
Posted on November 27, 2008 at 10:12 am.
Another thanks from me!
Posted on December 1, 2008 at 7:40 pm.
Thanks from me as well
Posted on December 2, 2008 at 11:53 am.
Did the job for me as well, thanks!
Posted on December 4, 2008 at 12:30 pm.
evilrouters.net » Blog Archive » rpmdb: Lock table is out of available locker entries says:
[...] So, what to do? Google, of course! Fortunately, major over at Racker Hacker encountered this same issue about a year and a half ago and has already provided the fix for us: [...]
Posted on December 8, 2008 at 1:04 am.
I’m really glad to hear that this fix has helped so many people!
Posted on December 8, 2008 at 6:34 pm.
Great stuff, thank you very much. Saved my day
Posted on December 12, 2008 at 9:42 am.
You the man. Many thanks.
Posted on December 12, 2008 at 4:54 pm.
Great!! Now it works!
Posted on January 8, 2009 at 2:54 pm.
Thanks Major, great stuff!! Now back to the original problem I was trying to solve….
Posted on January 14, 2009 at 1:25 pm.
Precious major
Posted on February 2, 2009 at 7:37 am.
Did the trick, thanks!
Posted on February 18, 2009 at 8:20 am.
Thanks a lot for this, saved me a lot of time !
Posted on February 23, 2009 at 4:29 am.
Thank you!
Posted on February 24, 2009 at 10:27 am.
Thanks for all of the feedback! I’m glad I was able to help everyone out of this annoying situation!
Posted on February 27, 2009 at 9:17 am.
u rock!! fixing my stressful yum server
Posted on March 4, 2009 at 9:01 am.
Thanks.. Solved the problem.. unlike the gits over at CPanel.net….
Posted on March 19, 2009 at 8:39 am.
Thanks for this article, help fixed the problem for me
Posted on April 2, 2009 at 10:34 am.
Thanks a lot ! You saved another guy !
Posted on April 2, 2009 at 11:13 am.
and herein lies why i hate rpm distros, oh well, at least its an easy fix!
Posted on April 9, 2009 at 7:44 am.
@Trophaeum:
Because other package management tools don’t use DBs that could have locking issues?
Posted on April 23, 2009 at 10:45 am.
“tar cvzf rpmdb-backup.tar.gz /var/lib/rpm”
Now which file(s) do I delete that I backed up? Is it…
__db.001
__db.002
__db.003
Thanks.
Posted on May 10, 2009 at 7:35 am.
Thanks a lot it helps me a lot
Posted on May 15, 2009 at 4:27 am.
muchas gracias desde chile. thanks
Posted on June 3, 2009 at 10:50 pm.
Thx! this really helps
Posted on June 9, 2009 at 1:06 am.
Thanks for the fix, I’m not sure if this was the case with other people, and the reason why it started showing up more frequently recently, but my server uptime is nearing 3 years and this problem just showed up. Could be totally unrelated!
Posted on June 9, 2009 at 10:46 pm.
Many thanks, you saved my night
Daniel
Posted on June 22, 2009 at 3:42 pm.
rpmdb: Lock table is out of available locker entries says:
[...] 參考來源 : rpmdb: Lock table is out of available locker entries [...]
Posted on June 24, 2009 at 2:18 am.
Thanks for this, fixed one of our servers that was failing to run a cPanel EasyApache update. Tips like these are invaluable to desperate Googlers!
Posted on June 26, 2009 at 8:07 am.
A long time ago on a much older version of RedHat (7.x or 8.x series I think), this would happen quite often and you’d have to rebuild the database all the time. For a while, its been fine, now suddenly I’m running into this problem again on RHEL 5 systems. Maybe its a bug regression or something.
Posted on June 26, 2009 at 12:46 pm.
If you have to implement a published change in time and you suddenly face
this problem you are very happy, indeed, to find this working solution.
Thanks a lot
Posted on July 27, 2009 at 1:48 am.
RHEL Sucks but Rackerhacker r0x it. Thanks for the tip.
Posted on August 17, 2009 at 4:03 am.
thanks for the tip!
Posted on August 17, 2009 at 2:54 pm.
Wow, I’m really glad I wrote this post.
Posted on August 17, 2009 at 2:56 pm.
Brilliant! Thank you!
Posted on September 30, 2009 at 12:20 am.
Brilliant! Helped in avoiding a complete reinstall!…
Posted on October 8, 2009 at 8:57 am.
Thank you for posting this helpful workaround, but this seems an unacceptable flaw in the RPM/YUM stack.
Why YUM and/or RPM can’t simply remove the stale entries in this Lock table before the RPM DB becomes unusable is beyond me…
Posted on November 2, 2009 at 1:47 pm.
working for me too ! thanks a lot !
Posted on December 1, 2009 at 1:15 pm.
Recuperando base de dados RPM « Net Solution – Soluções Tecnológicas says:
[...] Fonte: Racker Hacker [...]
Posted on January 1, 2010 at 3:32 pm.
Yay! Thank you very much! Yum sucks really hard.
Posted on January 2, 2010 at 12:09 pm.
picca – Glad I could help.
The actual culprit is rpm, but it manifests itself in yum since yum relies on rpm to operate.
Posted on January 3, 2010 at 8:56 pm.
Thanks saved me alot of head scratching.
Posted on February 4, 2010 at 2:50 pm.