[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Broken Database



Hi Jeff,

Thanks for the help so far.

Redhat Linux 6.2 i386
Nearly all Errata is Installed including rpm-4.0.2-6x. I had been putting the kernel upgrade off untill about a week ago.
Kernel 2.2.19-6.2.7


Since the update of rpm itself, everything was fine. The first rpm that we attempted to install since the kernel upgrade failed with the following message:

[root@octo <mailto:root@octo> updates]# rpm -i fetchmail-5.5.0-2.6.i386.rpm
error: cannot open Depends index using db1 - Invalid argument (22)
Segmentation fault


The Depends.idx is not directly the problem, as that's a temporaray database index used to speed up dependency checking. Nuke the file left over from the segfaulting install.

I'm not sure what file you were refering too ?

I first tried to reboot the machine with the original kernel but that didnt help. After searching around a bit for a solution to this, I found that the rpm update to version 4 used a new database format and all advice pointed to a "rpm --rebuilddb". I did this and there was another segmentation fault. I had a look at /var/lib/rpm and the Depends.idx file had a 0 file size. I presume this is the problem.

rpm often segfaults when bad data is found in a header for any reason. Try
rpm-4.0.3-0.57 or later from Raw hide or
	ftp://ftp.rpm.org
Most (all I've personally seen) of the segfaults with bad data are
fixed there.

I couldnt find the source for rpm 4.0.3-0.57 on the ftp.rpm.org server in tar.gz. Only rpms :) . I downloaded the source to rpm 4.0.2 and it compiled cleanly. I then replaced /var/lib/rpm with the backed up rpm database directory and tried again. It still gives me the dependency issues. It's as if it wants to use the rpm database created with --initdb.

I also tried installing rpm-4.0.3-0.57.i386.rpm with the --nodeps option. Even with the old rpm database in place (no db3 files in /var/lib/rpm) it creates them and spits the following error at me.

[root@octo lib]# rpm --nodeps -Uvh rpm-4.0.3-0.57.i386.rpm
Preparing... ########################################### [100%]


You have both
      /var/lib/rpm/packages.rpm       db1 format installed package headers
      /var/lib/rpm/Packages           db3 format installed package headers
Please remove (or at least rename) one of those files, and re-install.

error: execution of %pre scriptlet from rpm-4.0.3-0.57 failed, exit status 1
error: skipping rpm-4.0.3-0.57 install, %pre scriptlet failed rc 2

I have removed the db3 file countless times and tried again, but it keeps recreating them. Do you know where I could go from here ? I've got a bad feeling that everything I do is just making it worse.. :)

I then looked for any reference to the database in the rpm man page and came across "rpm --initdb". I first backed up my old database in /var/lib/rpm and ran this (probably a stupid move). I presumed it would allow me to start from scratch. Now whenever I try and install an rpm, I get a list of dependencies as long as your arm.

What I am basically asking is if there is a way to rebuild the database with my old dependencies? Or if I can still do anything with the old backed up rpmdb ? Any surgery that I can perform on it ? I hope there is enough info in this for someone to help steer me in the right direction.


The --initdb command created an empty database. Use your original database, and do a rpm --rebuilddb with rpm-4.0.3-0.57 or later.

73 de Jeff








[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []