rpmdb woes

Place to discuss Fedora and/or Red Hat
Post Reply
Ice9
guru
guru
Posts: 577
Joined: Thu Jan 09, 2003 12:40 am
Location: Belgium
Contact:

rpmdb woes

Post by Ice9 » Mon Oct 13, 2003 3:03 am

It seems like I have some problems with my rpm database.
Every now and then the database locks up and I can't do anything else but
"rpm --rebuilddb".
It occurs periodically when using Synaptic or installing a package.

Just now I updated mozilla and got this

Code: Select all

[root@dhcp-2354-337 Mozilla]# rpm -Uvh *.rpm
error: cannot get shared lock on /var/lib/rpm/Packages
error: cannot open Packages index using db3 - Operation not permitted (1)
error: cannot open Packages database in /var/lib/rpm
error: Failed dependencies:
        mozilla-nspr = 1.0.2-2.8.0 is needed by (installed) mozilla-1.0.2-2.8.0
(On a sidenote, I had all the necessary packages in the dir.)
I did a "rpm --rebuilddb" and then everything ran ok.

Has anyone else ever experienced this on a regular basis and perhaps know about a fix?

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Mon Oct 13, 2003 7:52 am

I have a tip on the RPM lockup issue that sounds like the same issue you are having:

http://voidmain.is-a-geek.net/redhat/re ... round.html

The first error message displayed is usually either because you are not root (which you are so that ain't it) or because there is another "rpm" process running that has a lock on the database, which I assume is the case. You can check if you have an "rpm" process running by:

$ ps auxwww | grep rpm

My tip is for the time when you try and install a package and "rpm" just seems to hang up. It won't let you break out of it or anything. If you try and install the RPM again from another window it will fail because the first "rpm" command has a lock on the database. You just have to kill the "rpm" command that is hung and remove the lock files. I seems to happen very rarely for me but still happens on occassion. It's all in the tip though...

Ice9
guru
guru
Posts: 577
Joined: Thu Jan 09, 2003 12:40 am
Location: Belgium
Contact:

Post by Ice9 » Mon Oct 13, 2003 8:11 am

Thanks void but I don't think the tip solves the problem, if I do a
# killall -9 rpm
# rm /var/lib/rpm/__*

I get something like "no procees to kill", I can't remember from the top of my head.
The only thing that seems to work is to rebuild the rpm database.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Mon Oct 13, 2003 9:56 am

Weird. Have you searched bugzilla? Is your system up to date with all the latest updates ("apt-get dist-upgrade" would do the trick if you have it installed). I'll do some digging as soon as I can get a few free minutes strung together..

Ice9
guru
guru
Posts: 577
Joined: Thu Jan 09, 2003 12:40 am
Location: Belgium
Contact:

Post by Ice9 » Mon Oct 13, 2003 1:26 pm

I haven't searched Bugzilla yet, but yes my system is up to date with all the latest patches, I do an update every day with Synaptic.
It's no big deal anyway since I can fix it by rebuilding the database, and it doesn't happen that often.

On the other side I'm waiting for my system to screw up badly, I bought a Libranet copy but since my pewter never ran this smooth since I first started years ago I'm somewhat reluctant to make radical changes.
On the other hand if the system screws up by itself I have an excuse :D

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Mon Oct 13, 2003 10:12 pm

Try and see if there is a process that has a hold on /var/lib/rpm/Packages by:

# fuser -u /var/lib/rpm/Packages

Ice9
guru
guru
Posts: 577
Joined: Thu Jan 09, 2003 12:40 am
Location: Belgium
Contact:

Post by Ice9 » Tue Oct 14, 2003 1:42 pm

I'll try that next time it locks up.
Thanks.

Post Reply