PDA

View Full Version : yum error db4 error(-30977)



jim
25th October 2005, 03:24 AM
every time I try to install a rpm or yum update I get this error

rpmdb: PANIC: Invalid argument
rpmdb: PANIC: fatal region error detected; run recovery
error: db4 error(-30977) from dbcursor->c_put: DB_RUNRECOVERY: Fatal error, run database recovery
error: error(-30977) storing record into Requireversion
rpmdb: PANIC: fatal region error detected; run recovery
error: db4 error(-30977) from dbcursor->c_get: DB_RUNRECOVERY: Fatal error, run database recovery
error: error(-30977) getting "" records from Requireversion index
rpmdb: PANIC: fatal region error detected; run recovery
error: db4 error(-30977) from dbcursor->c_get: DB_RUNRECOVERY: Fatal error, run database recovery
error: error(-30977) getting "5.83" records from Requireversion index
rpmdb: PANIC: fatal region error detected; run recovery
error: db4 error(-30977) from dbcursor->c_get: DB_RUNRECOVERY: Fatal error, run database recovery
error: error(-30977) getting "4.2.15-1" records from Requireversion index
rpmdb: PANIC: fatal region error detected; run recovery
error: db4 error(-30977) from dbcursor->c_get: DB_RUNRECOVERY: Fatal error, run database recovery
error: error(-30977) getting "" records from Requireversion index
rpmdb: PANIC: fatal region error detected; run recovery
rpmdb: PANIC: fatal region error detected; run recovery
error: db4 error(-30977) from db->close: DB_RUNRECOVERY: Fatal error, run database recovery
rpmdb: PANIC: fatal region error detected; run recovery
error: db4 error(-30977) from db->close: DB_RUNRECOVERY: Fatal error, run database recovery
rpmdb: PANIC: fatal region error detected; run recovery
error: db4 error(-30977) from db->close: DB_RUNRECOVERY: Fatal error, run database recovery
rpmdb: PANIC: fatal region error detected; run recovery
error: db4 error(-30977) from db->close: DB_RUNRECOVERY: Fatal error, run database recovery
rpmdb: PANIC: fatal region error detected; run recovery
error: db4 error(-30977) from dbenv->close: DB_RUNRECOVERY: Fatal error, run database recovery


So I turn around and then run

sudo rm -f /var/lib/rpm/__db*
after I install each rpm to get them all installed. This is a PITA

What can I do to repair this...

jim
25th October 2005, 03:35 AM
Update .. after a command like so


[jim@mobile ~]$ sudo rpm -vv --rebuilddb
D: rebuilding database /var/lib/rpm into /var/lib/rpmrebuilddb.3212
D: creating directory /var/lib/rpmrebuilddb.3212
D: opening old database with dbapi 3
D: opening db environment /var/lib/rpm/Packages joinenv
rpmdb: PANIC: fatal region error detected; run recovery
error: db4 error(-30977) from dbenv->open: DB_RUNRECOVERY: Fatal error, run database recovery
D: opening db index /var/lib/rpm/Packages rdonly mode=0x0
error: cannot open Packages index using db3 - (-30977)
D: removing directory /var/lib/rpmrebuilddb.3212
D: May free Score board((nil))
[jim@mobile ~]$



[jim@mobile ~]$ sudo rpm -Va
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
[jim@mobile ~] $

jim
25th October 2005, 04:28 AM
I fixed my problem with yum...

Step 1
as root

cd /var/lib/rpm
rm -f __db*

Step 2

rpm --rebuilddb (this could take a while... )

nowpc
26th January 2007, 02:21 AM
Slightly strange that this post hasn't received any responses in 2 years, but hey, I'm gonna say that I'm grateful for this information, and it's done the trick. So, thanks, Jim!

astupidog
31st January 2007, 06:48 PM
helped me too... thanks

metzjtm
9th April 2007, 12:21 AM
It helped me too. Thanks. :)

MonkeyMan
20th April 2007, 11:59 PM
Me Too! I think?

affanjavid
23rd April 2007, 07:51 PM
Yeh it works but why it happen often ? data corruption ? might be caused by bad internet connections?

razorhead
6th July 2007, 02:58 AM
It helped me too. I think my problem was caused by using RPM while yum was running the initial update after the install. //impatience ... smile

johncruise
13th March 2008, 11:57 PM
I know this thread is kind of old but might as well contribute here...

I had problems using "sudo rpm --rebuilddb" but doing "su - ; rpm --rebuilddb" solved it. So my tip would be to login as root and running it there rather than invoking the command via sudo.

by the way, this thread helped me too :)

Dox96
17th October 2008, 12:50 PM
Would you believe it, it's been three years since the original solution was posted, and it worked for me too in Fedora 9. :-)

supertrick
25th February 2009, 08:54 PM
Useful information. relevant for F10 as well

fredtcat
7th April 2009, 01:18 AM
I was searching for something using add/remove software (in FC10), and hit cancel... I suppose that yum doesn't like being so rudely interrupted. Ran rpm --updatedb as this post suggests, and everything is fine. Thanks poster!

eliashickman
7th April 2009, 04:59 PM
@ fredtcat.
The same thing happened to me. One day they'll have some kind of parity/error recovery/torrent method to installing rpms. Hopefully, this day will come soon. :)

pepe123
26th September 2009, 05:48 PM
worked for me in F11.

ecuaman
19th February 2010, 06:41 AM
I love that this post received all of the responses after it was solved!

Good job coming up with your own solution, it worked for me in F10 as well, only I had to run
rpm --initdb before
rpm --rebuilddb

Thank you so much for posting this solution.

jrdallas2
7th March 2010, 02:00 AM
I got this error when I tried to install the updates:

Error Type: <class 'yum.Errors.RepoError'>
Error Value: Error getting repository data for installed, repository not found
File : /usr/share/PackageKit/helpers/yum/yumBackend.py, line 3125, in <module>
main()
File : /usr/share/PackageKit/helpers/yum/yumBackend.py, line 3122, in main
backend.dispatcher(sys.argv[1:])
File : /usr/lib/python2.6/site-packages/packagekit/backend.py, line 699, in dispatcher
self.dispatch_command(args[0], args[1:])
File : /usr/lib/python2.6/site-packages/packagekit/backend.py, line 657, in dispatch_command
self.update_packages(only_trusted, package_ids)
File : /usr/share/PackageKit/helpers/yum/yumBackend.py, line 1948, in update_packages
signed = self._is_package_repo_signed(pkg)
File : /usr/share/PackageKit/helpers/yum/yumBackend.py, line 1437, in _is_package_repo_signed
repo = self.yumbase.repos.getRepo(pkg.repoid)
File : /usr/lib/python2.6/site-packages/yum/repos.py, line 121, in getRepo
'Error getting repository data for $s, repository not found' $ (repoid)

I don't know what it means. Would appreciate any and all help. Thanks.

cagonto1980
7th April 2010, 01:08 PM
Hi.

That error means that yum is trying to connect to a not valid repository, it seems it's called "installed", as I see from the error messages.

To fix this, you should take a look on folder /etc/yum.repos.d/ (or something similar).

There, inside files, you must find a repository with ID equal to "installed".
When you find it, look for a line saying "enabled=1" inside its definition block.

If that line exists, change the 1 to 0 and save the file.

If it doesn't exist, add a line saying "enabled=0" for that repository.

When you have disabled the invalid repository, then try to run yum again.

I hope this helps you.

Regards.

---------- Post added at 02:08 PM CDT ---------- Previous post was at 01:09 PM CDT ----------

I forgot there is a simpler way to get it.

You have just to use the --disablerepo yum option.

yum --disablerepo=installed [...]

But using this option will not change the configuration files, so you will have to use it every time you run yum.

glennzo
7th April 2010, 03:04 PM
Hi.

That error means that yum is trying to connect to a not valid repository, it seems it's called "installed", as I see from the error messages.

To fix this, you should take a look on folder /etc/yum.repos.d/ (or something similar).

There, inside files, you must find a repository with ID equal to "installed".
When you find it, look for a line saying "enabled=1" inside its definition block.

If that line exists, change the 1 to 0 and save the file.

If it doesn't exist, add a line saying "enabled=0" for that repository.

When you have disabled the invalid repository, then try to run yum again.

I hope this helps you.
There is no repository called "installed". Open a terminal and type

yum repolist
This will list all enabled repositories.

---------- Post added at 02:08 PM CDT ---------- Previous post was at 01:09 PM CDT ----------


I forgot there is a simpler way to get it.

You have just to use the --disablerepo yum option.

yum --disablerepo=installed [...]

But using this option will not change the configuration files, so you will have to use it every time you run yum.
What a pain to have to disable a repo every time you use yum. You shouldn't have to do this to the normal Fedora repositories. The typical fix for the errors reported by jrdallas2 are

yum clean all
yum update
That usually fixes things. No guarantees.

cagonto1980
8th April 2010, 11:29 AM
Yes, but --disablerepo option is a quick workaround that avoids to update all packages, wich can take a lot of time.

With this option user can do the task he wanted immediately.

Of course, Fedora upgrade updates the repo list and fixes this error.