LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora > Fedora - Installation
User Name
Password
Fedora - Installation This forum is for the discussion of installation issues with Fedora.

Notices

Reply
 
Search this Thread
Old 03-28-2009, 05:31 AM   #1
bjcatlin
LQ Newbie
 
Registered: Mar 2009
Location: Longmont, CO
Distribution: Fedora 10
Posts: 5

Rep: Reputation: 0
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.
 
Old 03-28-2009, 06:19 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,118
Blog Entries: 54

Rep: Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786
Quote:
Originally Posted by bjcatlin View Post
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 View Post
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?
 
Old 03-28-2009, 12:24 PM   #3
bjcatlin
LQ Newbie
 
Registered: Mar 2009
Location: Longmont, CO
Distribution: Fedora 10
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by unSpawn View Post
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 View Post
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 View Post
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 View Post
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'.
 
Old 03-28-2009, 07:05 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,118
Blog Entries: 54

Rep: Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786
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?
 
Old 03-28-2009, 07:24 PM   #5
bjcatlin
LQ Newbie
 
Registered: Mar 2009
Location: Longmont, CO
Distribution: Fedora 10
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by unSpawn View Post
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.

Last edited by bjcatlin; 03-28-2009 at 07:32 PM.
 
Old 03-28-2009, 07:38 PM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,118
Blog Entries: 54

Rep: Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786
CYP attach the output from running 'strace -v rpm -qf /bin/ps 2>&1 | tee /tmp/rpm.log' as root account user?
 
Old 03-28-2009, 07:56 PM   #7
bjcatlin
LQ Newbie
 
Registered: Mar 2009
Location: Longmont, CO
Distribution: Fedora 10
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by unSpawn View Post
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.
Attached Files
File Type: txt rpm.txt (30.6 KB, 1 views)
 
Old 03-28-2009, 08:22 PM   #8
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,118
Blog Entries: 54

Rep: Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786
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?

Last edited by unSpawn; 03-28-2009 at 08:23 PM.
 
Old 03-28-2009, 10:18 PM   #9
bjcatlin
LQ Newbie
 
Registered: Mar 2009
Location: Longmont, CO
Distribution: Fedora 10
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by unSpawn View Post
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!

And, I have learned my lesson about jumping releases. Fedora 11 will be the next version installed on this thing.
 
Old 03-29-2009, 07:47 AM   #10
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,118
Blog Entries: 54

Rep: Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786
Quote:
Originally Posted by bjcatlin View Post
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 View Post
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!
 
  


Reply

Tags
fedora 10, fedora 8, rpm, upgrade


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
No user sound following upgrade from Fedora 9 to Fedora 10. gzickert Fedora 1 12-08-2008 01:07 PM
LXer: Upgrade Your Desktop From Fedora 8 To Fedora 9 With PreUpgrade LXer Syndicated Linux News 0 05-20-2008 09:41 AM
Fedora 6 dead hitokiri17 Fedora 4 01-28-2007 04:05 PM
REQ: guide to upgrade php 5.1.2 to 5.1.3 or a rpm (Fedora Core 5) markg85 Linux - Software 6 05-10-2006 04:19 AM
Fedora 1 upgrade to Fedora ? without hosing snort? deckeraj Fedora - Installation 2 02-27-2006 07:30 AM


All times are GMT -5. The time now is 01:14 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration