I had rpm-3.0.4-0.48 and rpm-build-3.0.4-0.48 installed. I "upgraded" to
rpm-3.1-0.9 and rpm-build-3.1-0.9. When I attempted to view the database,
rpm claimed that it couldn't see several files that are in fact present in
/var/lib/rpm and then it segfaulted.
I had the same exact problem, and so have other people. That version of rpm
appears to use a different rpmdb (db x.x) version than previous version and
lacks support for the older db formats including db 2.x version 5. I have been
unable in trying to get it to work properly and the only workaround I can see is
to reinstall an older version of RPM. If you are unable to use rpm completely
and have no backup of the rpm binary you can do the following:
1) download or obtain a copy of rpm (version 3.1-0.3 or 3.04-7) and save it to /
2) convert the rpm to a cpio archive by doing this: rpm2cpio rpm-3.1-
0.3.i386.rpm > rpm-3.1-0.3.i386.rpm.cpio
3) extract the the files from the archive by doing this: cpio -i --make-
directories --preserve-modification-time --file=rpm-3.1-0.3.i386.rpm.cpio
that will create the directories where the package's file are created.
4) By hand move the file from the /tmp/usr directories to the /usr directory
equivilants and do the same with /tmp/bin/rpm which should be moved to /bin/rpm.
5) After those steps are complete and you moved all the files to the proper place
your rpm should be working again.
As of right now I'm not aware of any way to convert the rpmdb's prior to 2.1-0.x
to the new format used in rpm-3.1-0.9 so reinstalling that package in to see if
it does it again will be a fruitless attempt as it will fail again. Just thought
I'd warn you.
Hope that helped,
*** This bug has been marked as a duplicate of 10775 ***