Bug 41095 - rpm database is corrupt
rpm database is corrupt
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Jeff Johnson
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2001-05-17 08:58 EDT by Clifford Felder
Modified: 2007-04-18 12:33 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-05-17 08:58:39 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Clifford Felder 2001-05-17 08:58:35 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.77 [en] (X11; U; Linux 2.4.2-2 i686)

Description of problem:
My Red Hat rpm v.4.0.2 got corrupted, how to fix it?
     1 May 2000: Dear Red Hat Linux community,
While deleting a whole set of kde foreign language rpm's using kpackage
from my Intel Red Hat Linux 7.1 upgrade (running rpm v.4.0.2), the rpm
database became corrupted. I have
identified the particular rpm whose entry is corrupt, 
kde-i18n-German-2.1.1-2.noarch.rpm, but am unable to
clear it by either installing or removing this package. Because the
database is corrupted, any rpm command with the -a option crashes with a
segmentation fault, as does the --rebuilddb option. Further, kpackage,
gnorpm and up2date all crash when trying to open them. Does anyone have any
ideas how to repair the rpm database?  Thank you very much. Sincerely,
Clifford Felder <clifford.felder@weizmann.ac.il> 

How reproducible:

Steps to Reproduce:
If I type any of the following commands:
1.rpm -qa  OR
2.rpm -q kde-i18n-German-2.1.1-2 OR
3.rpm --rebuilddb"S
4.gnorpm   OR

Actual Results:  I get message
"Segmentation fault"

Expected Results:  Expect to get, for each command:
1.Full list of installed rpm's
2.Status of the German rpm
3.A properly rebuilt rpm database
4. and 5.Program should open and display all my installed rpms.

Additional info:
Comment 1 Jeff Johnson 2001-05-20 10:14:43 EDT
You have two problems.

1) The Packages database is corrupt. Verify by doing (you need the db3-utils
package installed):
	cd /var/lib/rpm
	for i in [A-Z]*
	    echo $i -----
	    db_verify $i
    where you will see
   db_verify: Overflow page 3108 of invalid type
   db_verify: Overflow page 3215 of invalid type
   db_verify: DB->verify: Packages: DB_VERIFY_BAD: Database verification failed

   You can fix this by doing (as root)
	cd /var/lib/rpm
	mv Packages Package.old
	db_dump Packages.old | db_load Packages

2) You are using a version of kpackage that is not linked with rpm-4.0.2. You
     both db3 (e.g. Packages) and db1 (e.g. packages.rpm) files in /var/lib/rpm.
     will need to reinstall the handful of packages in db1 format: Here's the
     list that I see:
	bash$ rpm -qa
  You should rename (and eventually remove) all the db1 format files
	cd /var/lib/rpm
	mkdir DB1SAVE
	mv *.rpm DB1SAVE
   Reinstall all the above packages using rpm-4.0.2 from the command line.

   To prevent this from happening again, you will need to get a version of
   that is linked with rpm-4.0.2. Try the Red Hat 7.1 version, or rebuild
whatever src
   rpm you wish against rpm-4.0.2 libraries.

Comment 2 Clifford Felder 2001-05-21 03:53:25 EDT
From Clifford.Felder@weizmann.ac.il: above advice did not help

I tried the two suggestions listed above, namely to rebuild the database via
db_dump | db_load, to move the *.rpm out of /var/lib/rpm, and to replace all the
listed rpm files listed manually, but it still did not help. The database is 
still corrupt. In addition, I was not able either to remove or re-install the
kde-il8n-German rpm, it gave a 'segmentation fault'.
Comment 3 Jeff Johnson 2001-05-21 14:35:34 EDT
I need a reproducible failure if you wish me to look more. What are you
trying to do exactly?

Note You need to log in before you can comment on or make changes to this bug.