From Bugzilla Helper: User-Agent: Mozilla/4.61 [en] (OS/2; U) Description of problem: My rpmdb has become corrupted. (I don't know how.) When I try to run any rpm commands it errors out and core dumps. The following is an example command: # rpmdb --rebuilddb error: rpmdb: damaged header instance #427 retrieved, skipping. Segmentation fault A tar of my /var/lib/rpm directory is in the URL above. Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1.run any rpm command against my rpmdb 2. 3. Additional info:
Created attachment 39649 [details] /var/lib/rpm directory
rpm removed from URL as it is now attached as an attachment to the bug.
I need the URL, please, as rpm databases are too big for bugzilla attachments.
It is now back at the previous URL.
Install rpm-4.0.3, using rpm2cpio if necessary, from ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.0.x Assuming all 6 packages (don't forget popt) are downloaded into /var/tmp/, do as root mkdir /var/tmp/xx cd /var/tmp/xxx for i in ../{rpm,popt}-*i386.rpm do rpm2cpio $i | cpio -dim done find . -type d -exec chmod 755 {} \; tar cf - * | (cd /; tar xvf -) Then a rp[m --rebuilddb should fix your problem.
I am not positive I got the correct rpms. I had no problems with the directions. The following are the rpms I used: 69457 Dec 3 11:39 ../popt-1.6.3-7x.i386.rpm 2119120 Dec 5 12:05 ../rpm-4_0_3-7x_i386.rpm 77134 Dec 5 12:05 ../rpm-build-4_0_3-7x_i386.rpm 4875855 Dec 5 12:05 ../rpm-devel-4_0_3-7x_i386.rpm 99311 Dec 5 12:05 ../rpm-perl-4_0_3-7x_i386.rpm 46651 Dec 5 12:05 ../rpm-python-4_0_3-7x_i386.rpm The rpm --rebuilddb still segs. rpm --rebuilddb error: rpmdb: damaged header instance #427 retrieved, skipping. Segmentation fault The following is the version: rpm --version RPM version 4.0.3 The following is the sum: sum /bin/rpm 41880 1545 cksum /bin/rpm 2992084340 1582024 /bin/rpm
OK, here's the next steps (you need db3-utils) cd /var/lib/rpm db_verify Packages mv Packages Packages-ORIG db_dump Packages-ORIG | db_load Packages Compile and run the attached program cc -o t57112 t57112.c -ldb-3.2 Try the rpm --rebuilddb again.
Created attachment 39748 [details] program to delete header instance #610
(Damn, my comments were lost. Presumably you have them in e-mail, otherwise reopen and I'll type Yet Again.)
I was unable to run the db_util commands because of a version mismatch between my dbutils and the ones required by the Package (unexpected...) I figured that since I had the rpms directory tarred up I might as well give your executable a shot. I built it and ran it. Following that I ran the rpm --rebuild and the problem seems to be corrected. Thanks for the help!