Bug 115484
Summary: | rpmdb corrupted after run up2date in RHEL3 | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 3 | Reporter: | helen wang <huwang> |
Component: | rpm | Assignee: | Jeff Johnson <jbj> |
Status: | CLOSED WORKSFORME | QA Contact: | Mike McLean <mikem> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 3.0 | CC: | huwang, msw |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | i386 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2004-02-17 16:10:38 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
helen wang
2004-02-12 21:55:38 UTC
What version of rpm? Your steps are basically sound, db-4.1.25 is backward compatible with db-4.0.14, but db-4.0.14 is not forward compatible with db-4.1.25. You might look at /usr/lib/rpm/rpmdb_loadcvt, that's a script that does essentially what you have done manually. There are also copies (or should be) of all db4 utilities that are linked against the same version of Berkeley DB that rpm is. For example, there's rpmdb_dump, rpmdb_load, etc. Running file(1) against the database files in /var/lib/rpm will display version information. Packages is the most important. If you get that converted to a version that rpm can read, the other indices will be recreated with --rebuilddb -vv. change from NEEDINFO -> ASSIGNED if you need help sorting out. Jeff, Thanks for he quick response. I tried /usr/lib/rpm/rpmdb_loadcvt, as you recommended, no error at this step, it showed "converting to db-4.1.25 compatible format" .... "Done" then I did "rpm --rebuilddb" it still gave me the same error message as I mentioned as above. what could it be the trouble? Helen What version of rpm please? rpm version is 4.1 by running rpm --version by running rpmdb --version, it shows rpm version 4.2.1 ?? Hmmm, 4.1 != 4.2.1, something is odd. Digging ... Could you try rpmdb --rebuilddb -vv please? That should have db-4.1.25 inside which is backwards compat. Ha!! very smart! it works this time. appreciate it very much. just confusing in different version of RH... have a wonderful night. Helen Oops, rpmdb --rebuilddb -vv worked fine, but when I use rpm -qa, it gave error message again like "cannot open Package index using db3, cannot open packages database in /var/lib/rpm" Jeff, I noticed that in RHEL the command for query is /usr/bin/rpmquery ( pointing to /usr/lib/rpm/rpmq) with options similar to rpm -qa, this command is working fine, so I am wondering that in RHEL3 something about rpm changed so the general rpm command under /bin is no longer being used for the same purpose? Helen Hmmm, /bin/rpm is from wrong version. For all modes but install/upgrade/erase, /bin/rpm is just a front-end, invoking (after a little digging) helpers located in /usr/lib/rpm that look like, say, rpmv for verify mode, rpmk for signature checking, etc, etc. /bin/rpm seems damaged somehow, I don't think from RHEL3. Try /usr/lib/rpm/rpmv -V rpm to see what is broken or missing. I suspect that /bin/rpm will show up as modified. Is that the case? Jeff, I agree with you, but when I check /bin/rpm and all the rpm commands under /usr/lib/rpm/, they are all showing the same modification time as Jan 8 at 21:47 group# ls -al /bin/rpm -rwxr-xr-x 1 rpm rpm 79388 Jan 8 21:47 /bin/rpm* group# group# ls -al /usr/lib/rpm/rpm* -rwxr-xr-x 1 rpm rpm 713 Jan 8 21:47 /usr/lib/rpm/rpm2cpio.sh* -rwxr-xr-x 1 rpm rpm 19656 Jan 8 21:47 /usr/lib/rpm/rpmb* -rwxr-xr-x 1 rpm rpm 12264 Jan 8 21:47 /usr/lib/rpm/rpmcache* -rwxr-xr-x 1 rpm rpm 10432 Jan 8 21:47 /usr/lib/rpm/rpmd* -rwxr-xr-x 1 rpm rpm 104 Jan 8 21:47 /usr/lib/rpm/rpm.daily* -rwxr-xr-x 1 rpm rpm 7052 Jan 8 21:47 /usr/lib/rpm/rpmdb_deadlock* -rwxr-xr-x 1 rpm rpm 11100 Jan 8 21:47 /usr/lib/rpm/rpmdb_dump* -rwxr-xr-x 1 rpm rpm 18040 Jan 8 21:47 /usr/lib/rpm/rpmdb_load* -rwxr-xr-x 1 rpm rpm 1467 Jan 8 21:47 /usr/lib/rpm/rpmdb_loadcvt* -rwxr-xr-x 1 rpm rpm 24852 Jan 8 21:47 /usr/lib/rpm/rpmdb_stat* -rwxr-xr-x 1 rpm rpm 39788 Jan 8 21:47 /usr/lib/rpm/rpmdb_svc* -rwxr-xr-x 1 rpm rpm 7320 Jan 8 21:47 /usr/lib/rpm/rpmdb_verify* -rwxr-xr-x 1 rpm rpm 5912 Jan 8 21:47 /usr/lib/rpm/rpmdeps* lrwxr-xr-x 1 rpm rpm 4 Jan 30 19:39 /usr/lib/rpm/rpme -> rpmi* -rwxr-xr-x 1 rpm rpm 8848 Jan 8 21:47 /usr/lib/rpm/rpmfile* -rwxr-xr-x 1 rpm rpm 1951224 Jan 8 21:47 /usr/lib/rpm/rpmi* -rwxr-xr-x 1 rpm rpm 11792 Jan 8 21:47 /usr/lib/rpm/rpmk* -rwxr-xr-x 1 rpm rpm 61 Jan 8 21:47 /usr/lib/rpm/rpm.log* -rw-r--r-- 1 rpm rpm 20872 Jan 8 21:47 /usr/lib/rpm/rpmpopt-4.2.1 -rwxr-xr-x 1 rpm rpm 11136 Jan 8 21:47 /usr/lib/rpm/rpmq* -rw-r--r-- 1 rpm rpm 10596 Jan 8 21:47 /usr/lib/rpm/rpmrc lrwxr-xr-x 1 rpm rpm 4 Jan 30 19:49 /usr/lib/rpm/rpmt -> rpmb* lrwxr-xr-x 1 rpm rpm 4 Jan 30 19:39 /usr/lib/rpm/rpmu -> rpmi* lrwxr-xr-x 1 rpm rpm 4 Jan 30 19:39 /usr/lib/rpm/rpmv -> rpmq* -rwxr-xr-x 1 rpm rpm 319 Jan 8 21:47 /usr/lib/rpm/rpm.xinetd* running the command rpmv -V rpm did not show anything. group# /usr/lib/rpm/rpmv -V rpm group# shall I reinstall rpm package at this point or simply get a good version of rpm executable and copy it under /bin? Hele reinstall with --force should fix. if /bin/rpm fails to install, then try /usr/lib/rpm/rpmi with same args. if /usr/lib/rpm/rpmi fails to install, then you will need to install manually using rpm2cpio. There's rpm2cpio man page, but the commands will be something like mkdir -p /var/tmp/xxx rpm2cpio /path/to/rpm-4*.rpm | cpio -dim find . -type d -exec chmod 755 {} \; tar cf - . | (cd /; tar xvf -) Jeff, the problem is fixed finally by your instructions. thank you very much for all of the help. with all of these solutions, I hope I won;t have any rpm problem anymore :)) have a good day. Helen |