From Bugzilla Helper: User-Agent: Mozilla/4.79 [en] (X11; U; Linux 2.4.18-4smp i686; Nav) Description of problem: after running up2date -u and it crashing/timeing out, rpmdb is unable to function, it seems anything related to rpm results in a Segmentation Fault. I believe my rpm database from /var/lib/rpm (provided at http://64.40.32.32/rpmdb.tar.gz ) needs rebuilding. Or maybe I need to reinstall :/ Is there a way to reconstruct an rpm database? Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: # up2date -u error: rpmdb: damaged header instance #204 retrieved, skipping. Segmentation fault # rpm --version RPM version 4.0.4 # rm -f /var/lib/rpm/__db.00* # rpm --rebuilddb error: rpmdb: damaged header instance #204 retrieved, skipping. *** dbiUpdateRecord: uh is NULL Segmentation fault Additional info:
Changing component to rpm.
3 headers were damaged. I've removed by doing rpm --rebuilddb with rpm-4.1. Your fixed rpm/Packages is at ftp://people.redhat.com/jbj/rpmdb-77503-FIX.tar.gz Download and install by doing cd /var/lib mv rpm/Packages rpm/Packages-ORIG tar xzvf rpmdb-77503-FIX.tar.gz rpm --rebuilddb -vv
I only had RPM version 4.0.4, so I tried rpm --rebuilddb -vv (after overwriting /var/lib/rpm/Packages with the fixed version) and got the following error: # rpm --rebuilddb -vv D: rebuilding database /var/lib/rpm into /var/lib/rpmrebuilddb.9466 D: creating directory /var/lib/rpmrebuilddb.9466 D: opening old database with dbapi 3 D: opening db environment /var/lib/rpm/Packages create:mpool D: opening db index /var/lib/rpm/Packages rdonly mode=0x0 rpmdb: /var/lib/rpm/Packages: unsupported hash version: 8 D: closed db index /var/lib/rpm/Packages D: closed db environment /var/lib/rpm/Packages D: removed db environment /var/lib/rpm/Packages D: opening db file /var/lib/rpm/packages.rpm mode 0x0 D: closed db file /var/lib/rpm/packages.rpm error: cannot open Packages index D: removing directory /var/lib/rpmrebuilddb.9466 Should I try to upgrade rpm to rpm 4.1? If so, what is the best way to do that while my rpm database is corrupt?
Sorry, I forgot that I was running db-4.1.24. All that's needed is a rpm --rebuilddb with rpm-4.1, latest packages at ftp://people.redhat.com/jbj/test-4.1. You can install manually by downloading into /var/tmp, and doing mkdir -p /var/tmp/xxx cd /var/tmp/xxx for i in ../*.rpm; do rpm2cpio $i | cpio -dim done find . -type d -exec chmod 0755 {} \; tar cf - . | (cd /; tar xvf -) rpm --rebuilddb -vv Reinstall rpm-4.0.4 using --force after you're done
Presumably you've done a --rebuilddb with rpm-4.1. Otherwise reopen, and I'll get you sorted out.