LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora - Installation (https://www.linuxquestions.org/questions/fedora-installation-39/)
-   -   RPM dead after upgrade of Fedora 8 to Fedora 10 (https://www.linuxquestions.org/questions/fedora-installation-39/rpm-dead-after-upgrade-of-fedora-8-to-fedora-10-a-715053/)

bjcatlin 03-28-2009 05:31 AM

RPM dead after upgrade of Fedora 8 to Fedora 10
 
Hello,

I just upgraded my machine from Fedora 8 to Fedora 10, and now rpm isn't working at all. If I do the "rpm -qa" command, it just returns with nothing. I looked in the /var/lib/rpm directory, and there were no __db.* files. I tried doing "rpm --rebuilddb", but that just immediately returned without any errors or messages, and didn't seem to fix anything. In fact, the only command I've found that returned some text, was the "rpm -?" command, which returned the standard help text.

I've done so many google searches now that my head is spinning. Anyone have any ideas of how to fix this or what to check? I know the basics of rpm, but this seems to be way beyond that.

Files in /var/lib/rpm:
Basenames
Conflictname
Dirnames
Filedigests
Filemd5s
Group
Installtid
Name
Packages
Providename
Provideversion
Pubkeys
Requirename
Requireversion
Sha1header
Sigmd5
Triggername

Thanks for any help or ideas,
B. J.

unSpawn 03-28-2009 06:19 AM

Quote:

Originally Posted by bjcatlin (Post 3490442)
I just upgraded my machine from Fedora 8 to Fedora 10, and now rpm isn't working at all.

I know it doesn't help now (or anymore) but I think the preferred way to upgrade Fedora is to follow releases and not skip one.


Quote:

Originally Posted by bjcatlin (Post 3490442)
If I do the "rpm -qa" command, it just returns with nothing. I looked in the /var/lib/rpm directory, and there were no __db.* files.

Is there anything in your upgrade or install log (in /root) that points to problems?
Is there anything in /var/log/messages (and /var/log/audit/* if you have it) that points to problems?
What does 'ls -alZh /var/lib/rpm' show?
If the RPM database files in /var/lib/rpm have a size greater than zero, what does '/usr/lib/rpm/rpmdb_dump /var/lib/rpm/Name | wc -l' show?

bjcatlin 03-28-2009 12:24 PM

Quote:

Originally Posted by unSpawn (Post 3490463)
I know it doesn't help now (or anymore) but I think the preferred way to upgrade Fedora is to follow releases and not skip one.

Yeah, I'm learning that one the hard way!
Quote:

Originally Posted by unSpawn (Post 3490463)
Is there anything in your upgrade or install log (in /root) that points to problems?
Is there anything in /var/log/messages (and /var/log/audit/* if you have it) that points to problems?

Nothing in the upgrade log file or the messages files of any concern. Looked through the audit log as best as I could and didn't see any problems.
Quote:

Originally Posted by unSpawn (Post 3490463)
What does 'ls -alZh /var/lib/rpm' show?

drwxr-xr-x root root system_u:object_r:rpm_var_lib_t:s0 .
drwxr-xr-x root root system_u:object_r:var_lib_t:s0 ..
-rw-r--r-- rpm rpm ? Basenames
-rw-r--r-- rpm rpm ? Conflictname
-rw-r--r-- rpm rpm ? Dirnames
-rw-r--r-- root root ? Filedigests
-rw-r--r-- rpm rpm ? Filemd5s
-rw-r--r-- rpm rpm ? Group
-rw-r--r-- rpm rpm ? Installtid
-rw-r--r-- rpm rpm ? Name
-rw-r--r-- rpm rpm ? Packages
-rw-r--r-- rpm rpm ? Providename
-rw-r--r-- rpm rpm ? Provideversion
-rw-r--r-- rpm rpm ? Pubkeys
-rw-r--r-- rpm rpm ? Requirename
-rw-r--r-- rpm rpm ? Requireversion
-rw-r--r-- rpm rpm ? Sha1header
-rw-r--r-- rpm rpm ? Sigmd5
-rw-r--r-- rpm rpm ? Triggername

I also tried to chown rpm:rpm for Filedigests, but I don't see any changes in getting rpm to work. I'm not sure what I did to get that ownership to root:root.

Quote:

Originally Posted by unSpawn (Post 3490463)
If the RPM database files in /var/lib/rpm have a size greater than zero, what does '/usr/lib/rpm/rpmdb_dump /var/lib/rpm/Name | wc -l' show?

Well, I don't have an rpmdb_dump file. There is an htdb_dump and a slapd_db_dump. htdb_dump fails with an "unsupported hash version: 8" error, and if I substitute slapd_db_dump, the result of 'wc -l' on that is "3625". I then copied db_dump from a fc9 machine and ran it, and it also came back with 3625 from the 'wc -l'.

unSpawn 03-28-2009 07:05 PM

Your 'wc -l' shows its got legible entries which is good. Files in /var/lib/rpm should have TE (system_u object_r) rpm_var_lib_t. Try 'chcon -R rpm_var_lib_t /var/lib/rpm/*', then try any rpm ops again?

bjcatlin 03-28-2009 07:24 PM

Quote:

Originally Posted by unSpawn (Post 3491048)
Your 'wc -l' shows its got legible entries which is good. Files in /var/lib/rpm should have TE (system_u object_r) rpm_var_lib_t. Try 'chcon -R rpm_var_lib_t /var/lib/rpm/*', then try any rpm ops again?

Well, it looks like the chcon isn't working. I get this when I try that command:

chcon: invalid context: rpm_var_lib_t

UPDATE:
I noticed that the '.' directory entry has the rpm_var_lib_t, so I tried a 'chcon --reference=. *' from inside the /usr/lib/rpm directory, and now I have this:

drwxr-xr-x root root system_u:object_r:rpm_var_lib_t:s0 .
drwxr-xr-x root root system_u:object_r:var_lib_t:s0 ..
-rw-r--r-- rpm rpm system_u:object_r:rpm_var_lib_t:s0 Basenames
-rw-r--r-- rpm rpm system_u:object_r:rpm_var_lib_t:s0 Conflictname
-rw-r--r-- rpm rpm system_u:object_r:rpm_var_lib_t:s0 Dirnames
-rw-r--r-- rpm rpm system_u:object_r:rpm_var_lib_t:s0 Filedigests
-rw-r--r-- rpm rpm system_u:object_r:rpm_var_lib_t:s0 Filemd5s
-rw-r--r-- rpm rpm system_u:object_r:rpm_var_lib_t:s0 Group
-rw-r--r-- rpm rpm system_u:object_r:rpm_var_lib_t:s0 Installtid
-rw-r--r-- rpm rpm system_u:object_r:rpm_var_lib_t:s0 Name
-rw-r--r-- rpm rpm system_u:object_r:rpm_var_lib_t:s0 Packages
-rw-r--r-- rpm rpm system_u:object_r:rpm_var_lib_t:s0 Providename
-rw-r--r-- rpm rpm system_u:object_r:rpm_var_lib_t:s0 Provideversion
-rw-r--r-- rpm rpm system_u:object_r:rpm_var_lib_t:s0 Pubkeys
-rw-r--r-- rpm rpm system_u:object_r:rpm_var_lib_t:s0 Requirename
-rw-r--r-- rpm rpm system_u:object_r:rpm_var_lib_t:s0 Requireversion
-rw-r--r-- rpm rpm system_u:object_r:rpm_var_lib_t:s0 Sha1header
-rw-r--r-- rpm rpm system_u:object_r:rpm_var_lib_t:s0 Sigmd5
-rw-r--r-- rpm rpm system_u:object_r:rpm_var_lib_t:s0 Triggername

(hopefully that :s0 isn't a problem)

And 'rpm --qa' and 'rpm --rebuilddb' still don't do anything.

unSpawn 03-28-2009 07:38 PM

CYP attach the output from running 'strace -v rpm -qf /bin/ps 2>&1 | tee /tmp/rpm.log' as root account user?

bjcatlin 03-28-2009 07:56 PM

1 Attachment(s)
Quote:

Originally Posted by unSpawn (Post 3491067)
CYP attach the output from running 'strace -v rpm -qf /bin/ps 2>&1 | tee /tmp/rpm.log' as root account user?

OK. Here is the rpm.log file (renamed to rpm.txt to attach). I'm going to try and read through it and figure out what it says as well. But I'd appreciate you looking through it, since I don't really know what I'm looking for yet.

unSpawn 03-28-2009 08:22 PM

One of the basic things of a strace log is that you can see what it tries to find, opens or reads. In your case it doesn't even try to find RPM configs or 'open("/var/lib/rpm/", ..)'. Did you ever try to relabel the complete filesystem after installing F10? If you boot the F10 installer CD/DVD in resuce mode, mount the drive. chroot to it, then run any rpm command, does that show anything usable?

bjcatlin 03-28-2009 10:18 PM

Quote:

Originally Posted by unSpawn (Post 3491099)
One of the basic things of a strace log is that you can see what it tries to find, opens or reads. In your case it doesn't even try to find RPM configs or 'open("/var/lib/rpm/", ..)'....

unSpawn, good news! That strace command that you showed me lead me in the right direction. I noticed that it was hitting a bunch of shared files in the /lib64 directory, so I did a bunch of searching. It seems that some other people have had problems with their /lib64 directory in the F8->F10 upgrade. So, I decided to take my asterisk server downstairs that is currently running F9 and upgrade it to F10 and see what the lib64 directory looked like. I did notice some subtle differences in the file sizes of some of the files, so I started from the bottom of the strace and copied the files from the F9->F10 server over to the F8->F10 server. It only took a couple of files replaced, and my rpm command is now working!!! It even shows the vast majority of files at the .fc10 level (with a few left over at the .fc9 level, which I'll have to look at individually).

Now I'll take a backup of the system and then start investigating all of the files in the lib64 dir to see if there is anything else that didn't upgrade properly.

So a great big thanks goes to you for helping me figure out the problem! Now I just have to get my asterisk server running again! :D

And, I have learned my lesson about jumping releases. Fedora 11 will be the next version installed on this thing.

unSpawn 03-29-2009 07:47 AM

Quote:

Originally Posted by bjcatlin (Post 3491160)
I did notice some subtle differences in the file sizes of some of the files, so I started from the bottom of the strace and copied the files from the F9->F10 server over to the F8->F10 server.

Differences could be due to anything from botched upgrade to prelinking. It's good to see you got things running again by copying over files. However that bypasses the package manager so that isn't a best practice. To fix it you could reinstall the package (which might require use of --force).


Quote:

Originally Posted by bjcatlin (Post 3491160)
It even shows the vast majority of files at the .fc10 level (with a few left over at the .fc9 level, which I'll have to look at individually).

To verify your install you could run 'rpm -qVa 2>&1 | tee /tmp/rpm_verify.log', then grep the log for errors. And for example to find files that are not part of a package in /lib you could run 'find /lib |while read ENTITY; do rpm -qf $ENTITY >/dev/null 2>&1 || echo $ENTITY; done | tee /tmp/rpm_disowned.log'.


Other than that: well done!


All times are GMT -5. The time now is 01:30 AM.