LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 11-04-2006, 02:06 PM   #1
Red Knuckles
Member
 
Registered: Jan 2006
Location: Colorado USA
Distribution: Debian AMD 64 Testing, Sabayon Linux x86-64 3.4, and Ubuntu AMD 64 7.04
Posts: 235

Rep: Reputation: 30
Talking Solved: rpmdb open failed


In recent install [updated once or twice previously] of FC 6 when I try to run 'yum -y update' I get the following output:

# yum -y update
Loading "installonlyn" plugin
rpmdb: PANIC: fatal region error detected; run recovery
error: db4 error(-30977) from dbenv->open: DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db3 - (-30977)
error: cannot open Packages database in /var/lib/rpm
Traceback (most recent call last):
File "/usr/bin/yum", line 29, in ?
yummain.main(sys.argv[1:])
File "/usr/share/yum-cli/yummain.py", line 85, in main
base.getOptionsConfig(args)
File "/usr/share/yum-cli/cli.py", line 199, in getOptionsConfig
errorlevel=opts.errorlevel)
File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 125, in doConfigSetup
self.conf = config.readMainConfig(startupconf)
File "/usr/lib/python2.4/site-packages/yum/config.py", line 597, in readMainConfig
vars['releasever'] = _getsysver(startupconf.installroot, startupconf.distroverpkg)
File "/usr/lib/python2.4/site-packages/yum/config.py", line 656, in _getsysver
idx = ts.dbMatch('provides', distroverpkg)
TypeError: rpmdb open failed

What's going on and how do I fix??? When I try to edit '/etc/yum.repos.d' as root with kwrite I get:

The file 'file:///etc/yum.repos.d' could not be opened: it is not a normal file, it is a folder.

That seems very wrong to me. How to edit?

When I try '# gedit /etc/yum.repos.d' I get:

Could not open the file /etc/yum.repos.d.

Last edited by Red Knuckles; 11-05-2006 at 01:44 PM.
 
Old 11-04-2006, 02:14 PM   #2
Lenard
Senior Member
 
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 58
Quote:
The file 'file:///etc/yum.repos.d' could not be opened: it is not a normal file, it is a folder.
This is not an error, it is a warning message. The directory /etc/yum.repo.d is not a file. The same applies for for gedit.

For the yum error, try cleaning the cache; yum clean all

.
 
Old 11-04-2006, 02:20 PM   #3
Red Knuckles
Member
 
Registered: Jan 2006
Location: Colorado USA
Distribution: Debian AMD 64 Testing, Sabayon Linux x86-64 3.4, and Ubuntu AMD 64 7.04
Posts: 235

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by Lenard
This is not an error, it is a warning message. The directory /etc/yum.repo.d is not a file. The same applies for for gedit.

For the yum error, try cleaning the cache; yum clean all

.
I did and got this:

# yum clean all
Loading "installonlyn" plugin
rpmdb: PANIC: fatal region error detected; run recovery
error: db4 error(-30977) from dbenv->open: DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db3 - (-30977)
error: cannot open Packages database in /var/lib/rpm
Traceback (most recent call last):
File "/usr/bin/yum", line 29, in ?
yummain.main(sys.argv[1:])
File "/usr/share/yum-cli/yummain.py", line 85, in main
base.getOptionsConfig(args)
File "/usr/share/yum-cli/cli.py", line 199, in getOptionsConfig
errorlevel=opts.errorlevel)
File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 125, in doConfigSetup
self.conf = config.readMainConfig(startupconf)
File "/usr/lib/python2.4/site-packages/yum/config.py", line 597, in readMainConfig
vars['releasever'] = _getsysver(startupconf.installroot, startupconf.distroverpkg)
File "/usr/lib/python2.4/site-packages/yum/config.py", line 656, in _getsysver
idx = ts.dbMatch('provides', distroverpkg)
TypeError: rpmdb open failed

As far as the warning for '/etc/yum.repo.d' how do I check, edit, or add/remove repos then? Do I have the wrong file? I must because it is a folder?
 
Old 11-04-2006, 02:52 PM   #4
Red Knuckles
Member
 
Registered: Jan 2006
Location: Colorado USA
Distribution: Debian AMD 64 Testing, Sabayon Linux x86-64 3.4, and Ubuntu AMD 64 7.04
Posts: 235

Original Poster
Rep: Reputation: 30
Ok, I fingered out how to deal with repos in FC 6. Apparently I was used to them all being in one file but now they are in a folder and you have to edit each file seperately. ie. 'kwrite /etc/yum/repos.d/fedora-core.repo' and in my case also '/etc/yum/repos.d/fedora-extras.repo' and '/etc/yum/repos.d/fedora-updates.repo'. For some reason [WHY???] FC 6 comments out all base urls in repos by default [#] so you have to remove the # before the base urls that you wish to have enabled [enabled=1]. In my case so far that is only core, extras and update. I did that but yum still won't run and gives the same error for 'yum clean all'. At least that is what I think I learned from scanning other posts. If I'm wrong someone correct me! I still don't understand why rpmdb open failed??? Is it trying to tell me something when it mentions 'Fatal error, run database recovery' and 'rpmdb: PANIC: fatal region error detected; run recovery'? Aren't I looking for a command to recover the rpmdb? Or am I looking for a rpm command? Will keep looking...
 
Old 11-04-2006, 03:42 PM   #5
Red Knuckles
Member
 
Registered: Jan 2006
Location: Colorado USA
Distribution: Debian AMD 64 Testing, Sabayon Linux x86-64 3.4, and Ubuntu AMD 64 7.04
Posts: 235

Original Poster
Rep: Reputation: 30
NOT Solved!

As of my last post I had not rebooted my computer. What solved the problem was removing the '#' from the base urls in repos AND rebooting computer. Then I ran:

# yum clean all
Loading "installonlyn" plugin
Cleaning up Everything
# yum -y update
Loading "installonlyn" plugin
Setting up Update Process
Setting up repositories
core 100% |=========================| 1.1 kB 00:00
updates 100% |=========================| 1.2 kB 00:00
extras 100% |=========================| 1.1 kB 00:00
Reading repository metadata in from local files
primary.xml.gz 100% |=========================| 824 kB 00:02
################################################## 2242/2242
primary.xml.gz 100% |=========================| 81 kB 00:00
################################################## 249/249
primary.xml.gz 100% |=========================| 1.3 MB 00:28
################################################## 4027/4027
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for kdeadmin to pack into transaction set.
kdeadmin-3.5.5-0.1.fc6.i3 100% |=========================| 35 kB 00:00

so it appears as if it's going to update. Looks like a long one too. Maybe I never updated my FC 6 install yet afterall...

Last edited by Red Knuckles; 11-04-2006 at 04:50 PM.
 
Old 11-04-2006, 04:57 PM   #6
Red Knuckles
Member
 
Registered: Jan 2006
Location: Colorado USA
Distribution: Debian AMD 64 Testing, Sabayon Linux x86-64 3.4, and Ubuntu AMD 64 7.04
Posts: 235

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by Red Knuckles
As of my last post I had not rebooted my computer. What solved the problem was removing the '#' from the base urls in repos AND rebooting computer. Then I ran:

# yum clean all
Loading "installonlyn" plugin
Cleaning up Everything
# yum -y update
Loading "installonlyn" plugin
Setting up Update Process
Setting up repositories
core 100% |=========================| 1.1 kB 00:00
updates 100% |=========================| 1.2 kB 00:00
extras 100% |=========================| 1.1 kB 00:00
Reading repository metadata in from local files
primary.xml.gz 100% |=========================| 824 kB 00:02
################################################## 2242/2242
primary.xml.gz 100% |=========================| 81 kB 00:00
################################################## 249/249
primary.xml.gz 100% |=========================| 1.3 MB 00:28
################################################## 4027/4027
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for kdeadmin to pack into transaction set.
kdeadmin-3.5.5-0.1.fc6.i3 100% |=========================| 35 kB 00:00

so it appears as if it's going to update. Looks like a long one too. Maybe I never updated my FC 6 install yet afterall...

I spoke to soon. When I do the above yum updates a few packages and then I get I very long list like this:

rpmdb: PANIC: fatal region error detected; run recovery
error: db4 error(-30977) from db->sync: DB_RUNRECOVERY: Fatal error, run database recovery
rpmdb: PANIC: fatal region error detected; run recovery
error: db4 error(-30977) from db->sync: DB_RUNRECOVERY: Fatal error, run database recovery
rpmdb: PANIC: fatal region error detected; run recovery
error: db4 error(-30977) from db->sync: DB_RUNRECOVERY: Fatal error, run database recovery
rpmdb: PANIC: fatal region error detected; run recovery
error: db4 error(-30977) from db->sync: DB_RUNRECOVERY: Fatal error, run database recovery
rpmdb: PANIC: fatal region error detected; run recovery
error: db4 error(-30977) from db->sync: DB_RUNRECOVERY: Fatal error, run database recovery
rpmdb: PANIC: fatal region error detected; run recovery
error: db4 error(-30977) from db->sync: DB_RUNRECOVERY: Fatal error, run database recovery
rpmdb: PANIC: fatal region error detected; run recovery
error: db4 error(-30977) from db->sync: DB_RUNRECOVERY: Fatal error, run database recovery
rpmdb: PANIC: fatal region error detected; run recovery
error: db4 error(-30977) from db->sync: DB_RUNRECOVERY: Fatal error, run database recovery
rpmdb: PANIC: fatal region error detected; run recovery


and I'm back to 'rpmdb open failed'. Then I reboot and do it again and it updates a few more packages and the same error again. How to fix? I thought that when yum was updating it was accessing repos over the internet. I'm confused as to where the error is. For what it's worth:

# ls /var/lib/rpm
Basenames __db.000 __db.002 Dirnames Group Name Providename Pubkeys Requireversion Sigmd5
Conflictname __db.001 __db.003 Filemd5s Installtid Packages Provideversion Requirename Sha1header Triggername
 
Old 11-04-2006, 05:15 PM   #7
Red Knuckles
Member
 
Registered: Jan 2006
Location: Colorado USA
Distribution: Debian AMD 64 Testing, Sabayon Linux x86-64 3.4, and Ubuntu AMD 64 7.04
Posts: 235

Original Poster
Rep: Reputation: 30
Is it possible that the repos themselves are the problem? These are the 3 I have enabled:

[core]
name=Fedora Core $releasever - $basearch
baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/$releasever/$basearch/os/
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=core-$releasever&arch=$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY

[extras]
name=Fedora Extras $releasever - $basearch
baseurl=http://download.fedora.redhat.com/pub/fedora/linux/extras/$releasever/$basearch/
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=extras-$releasever&arch=$basearch
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-extras
gpgcheck=1

[updates]
name=Fedora Core $releasever - $basearch - Updates
baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/updates/$releasever/$basearch/
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-fc$releasever&arch=$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
 
Old 11-04-2006, 07:37 PM   #8
Lenard
Senior Member
 
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 58
Yes, not only is this possible but very likely....... they are still working on getting everything back right after a near fatal overload/crash when FC6 was released.

Place a pound sign (#) at the start of all three baseurl lines, example;

#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/$releasever/$basearch/os/

This line is wrong (the core section);
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY

it should read like the other two.

.

Last edited by Lenard; 11-04-2006 at 07:40 PM.
 
Old 11-05-2006, 01:40 PM   #9
Red Knuckles
Member
 
Registered: Jan 2006
Location: Colorado USA
Distribution: Debian AMD 64 Testing, Sabayon Linux x86-64 3.4, and Ubuntu AMD 64 7.04
Posts: 235

Original Poster
Rep: Reputation: 30
Solved!

Quote:
Originally Posted by Lenard
Yes, not only is this possible but very likely....... they are still working on getting everything back right after a near fatal overload/crash when FC6 was released.

Place a pound sign (#) at the start of all three baseurl lines, example;

#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/$releasever/$basearch/os/

This line is wrong (the core section);
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY

it should read like the other two.

.
I got the solution to this problem from 2 different forums. I replaced the # sign in front of the 3 base urls where I had removed them. Also corrected the 'gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY'
line to read
'gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora'
in the 'core' repos.

Then I ran:

# rm /var/lib/rpm/__db*
# rpm --rebuilddb
# yum -y update

and it updated 29 packages without error or warning. Thanks Lenard [LinuxQuestions.org]. Thanks timdsmith [Fedora Forum].

Last edited by Red Knuckles; 11-05-2006 at 01:43 PM.
 
  


Reply



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
Failed to open passdb! lynnevan Slackware 1 10-03-2006 01:41 PM
fedora4 rpmdb? james.farrow Fedora 9 06-25-2005 06:08 PM
Help me to recover my rpmdb J_Szucs Linux - General 1 09-09-2004 09:39 AM
RPMDB Recovery inTUXicated Linux - General 3 02-10-2004 10:33 AM
rpmdb error acid_kewpie Linux - General 0 02-02-2002 07:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 11:22 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration