I am having rpm problem in RH9 after running up2date, either user or root can not query rpm packages error message: #rpm -qa rpmdb: /var/lib/rpm/Packages: unsupported hash version: 8 error: cannot open Packages index using db3 - Invalid argument (22) error: cannot open Packages database in /var/lib/rpm no packages after follow the instructions descripted in http://www.rpm.org/hintskinks/repairdb/ I have done as root: #cd /var/lib/rpm rm -f /var/lib/rpm/__db* rpm -vv --rebuilddb I got message: # rpm -vv --rebuilddb D: rebuilding database /var/lib/rpm into /var/lib/rpmrebuilddb.15334 D: creating directory /var/lib/rpmrebuilddb.15334 D: opening old database with dbapi 3 D: opening db environment /var/lib/rpm/Packages create:cdb: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 error: cannot open Packages index D: removing directory /var/lib/rpmrebuilddb.15334 so I did #cd /var/lib/rpm # rm -f __db.00* # /usr/lib/rpm/rpmdb_verify Packages no error message at this time then I did #rpm -qa I got: rpmdb: /var/lib/rpm/Packages: unsupported hash version: 8 error: cannot open Packages index using db3 - Invalid argument (22) error: cannot open Packages database in /var/lib/rpm no packages what shall I do to fix it now? Thanks a lot!! Helen
Hmm, you've somehow managed to mix db-4.0.14 tools with db-4.1.25 on disk format. You can convert Packages from db-4.1.25 to db-4.0.14 by using db_dump (from db4-utils-4.1.25) piped into db_load (from db4-utils-4.0.14). Here's how (adding explict versions for clarify). cd /var/lib/rpm mv Packages Packages-ORIG db_dump-4.1.25 Packages-ORIG | db_dump-4.0.14 Packages You'll have to figure which db_dump and db_load to use. The file /usr/lib/rpm/rpmdb_load appears to be from db-4.0.14, and /usr/bin/db_dump may very well be the version from 4.1.25, verify by doing rpm -rf /usr/bin/db_dump to see which version of db4-utils is installed. Once Packages is converted, rpm --rebuilddb -vv will convert the other indices.
*** Bug 113712 has been marked as a duplicate of this bug. ***
while using rpm-rf /usr/bin/db_dump, it gave message: rpm: arguments to --root (-r) must begin with a / also in /usr/lib/rpm, no "db_dump" instead it has rpmdb_dump compare these two files, the result is: light# ls -al /usr/bin/db_dump -r-xr-xr-x 1 root root 10008 Feb 5 2003 /usr/bin/db_dump* light# ls -al /usr/lib/rpm/rpmdb_dump -rwxr-xr-x 1 rpm rpm 11156 Feb 27 2003 /usr/lib/rpm/rpmdb_dump* shall I use rpmdb_dump for version 4.1 and db_dump for version 4.0?
By the way, the command you give me "db_dump-4.1.25 Packages-ORIG | db_dump-4.0.14 Packages" should it be " db_dump Packages-ORIG |rpmdb_load Packages"?? if the version is used correctly. Thanks
Thanks Jeff, I fixed it!! Here si the command I am using: /usr/lib/rpm/rpmdb_dump Packages-ORIG | /usr/bin/db_load Packages and then rpm --rebuilddb -vv now it is working fine. Thank you again!!
Yes, db_load. There's script /usr/lib/rpm/rrpmdb_loadcvt that does what you have done if you need reference in future.