Red Hat Bugzilla – Bug 41095
rpm database is corrupt
Last modified: 2007-04-18 12:33:17 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 <email@example.com>
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
Actual Results: I get message
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.
You have two problems.
1) The Packages database is corrupt. Verify by doing (you need the db3-utils
for i in [A-Z]*
echo $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)
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
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
rpm you wish against rpm-4.0.2 libraries.
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'.
I need a reproducible failure if you wish me to look more. What are you
trying to do exactly?