PDA

View Full Version : Yum Messed Up Need Help



fedorafan2
7th November 2006, 11:51 PM
Ok I have an fc5 server and I use yum for all my installs. I keep getting this error now and I dont know how to fix it


[root@linux ~]# yum install mod_security
rpmdb: lock_downgrade: Lock is no longer valid
error: cannot open Packages index using db3 - Invalid argument (22)
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 80, in main
base.getOptionsConfig(args)
File "/usr/share/yum-cli/cli.py", line 177, in getOptionsConfig
self.doConfigSetup(fn=opts.conffile, root=root)
File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 102, in doConfigSetup
self.conf = config.readMainConfig(fn, root)
File "/usr/lib/python2.4/site-packages/yum/config.py", line 589, in readMainConfig
vars['releasever'] = _getsysver(earlyconf.installroot, earlyconf.distroverpkg)
File "/usr/lib/python2.4/site-packages/yum/config.py", line 689, in _getsysver
idx = ts.dbMatch('provides', distroverpkg)
TypeError: rpmdb open failed
[root@linux ~]#


What do I do?

u-noneinc-s
8th November 2006, 12:21 AM
I see one discrepency between the file listed and the line # info between yours and mine (mine in bold)
THIS DOES NOT MEAN YOURS IS WRONG!!!
It is only an observation. I have never seen this "lock" error before.

File "/usr/lib/python2.4/site-packages/yum/config.py", line 589, in readMainConfig
vars['releasever'] = _getsysver(earlyconf.installroot, earlyconf.distroverpkg)
vars['releasever'] = _getsysver(earlyconf.installroot, earlyconf.distroverp$
Note yours ends pkg) mine ends p$)

pdb
8th November 2006, 12:31 AM
You might try rebuilding your rpm database:
rpm --rebuilddb

Janl
8th November 2006, 12:40 AM
Have you installed any of the YUM plugins?

fedorafan2
8th November 2006, 02:51 AM
Have you installed any of the YUM plugins?
What are plugins I dont have any extra repos installed if that is what you mean.

fedorafan2
8th November 2006, 02:55 AM
Here is the output of the rpm command.

[root@linux ~]# rpm --rebuilddb
rpmdb: lock_downgrade: Lock is no longer valid
error: cannot open Packages index using db3 - Invalid argument (22)
[root@linux ~]#

fedorafan2
8th November 2006, 03:08 AM
Ok I deleted the file _db.oo in /var/lib/rpm. Now yum doesn't error ( haven't tryed to install anything yet). But the rpm --rebuilddb command just does nothing until I hit ctrl+c. Any ideas

pdb
8th November 2006, 03:10 AM
Here is the output of the rpm command.

[root@linux ~]# rpm --rebuilddb
rpmdb: lock_downgrade: Lock is no longer valid
error: cannot open Packages index using db3 - Invalid argument (22)
[root@linux ~]#
STINK!!

This thread (http://www.linuxquestions.org/questions/showthread.php?t=273856) recommends running 'rm -rf /var/lib/rpm/__db*' and then trying to rebuild the database.

BillT440
8th November 2006, 03:10 AM
Could try deleting the double underscore files in /var/lib/rpm then rebuilding the rpm database. I'm just throwing darts though.

u-noneinc-s
8th November 2006, 03:16 AM
Ok I deleted the file _db.oo in /var/lib/rpm. Now yum doesn't error ( haven't tryed to install anything yet). But the rpm --rebuilddb command just does nothing until I hit ctrl+c. Any ideas
What do you mean it does nothing til you hit cont+c?
It might take a while to rebuild (I have not had the need to do it that I can recall anyway).

fedorafan2
8th November 2006, 03:20 AM
What do you mean it does nothing til you hit cont+c?
It might take a while to rebuild (I have not had the need to do it that I can recall anyway).
Just freezes up till I cancle it.

pdb
8th November 2006, 03:24 AM
Just freezes up till I cancle it.
I think u-noneinc-s may be right. Let it go for a (long) while and see how it goes. I remember when I upgraded to FC5 this last summer and ran 'yum update' my computer pretty much locked up trying to deal with all the updates.

fedorafan2
8th November 2006, 03:28 AM
I think u-noneinc-s may be right. Let it go for a (long) while and see how it goes. I remember when I upgraded to FC5 this last summer and ran 'yum update' my computer pretty much locked up trying to deal with all the updates.
K I am going to let it run

u-noneinc-s
8th November 2006, 03:34 AM
Was it a typo in your post when you said you removed (rm) the __db.oo because it should have been __db.000 (in fact, according to another thread it should have been rm --db.*)
http://www.fedoraforum.org/forum/showthread.php?t=135473&highlight=rpmdb+open+failed
http://www.fedoraforum.org/forum/showpost.php?p=668535&postcount=6

fedorafan2
8th November 2006, 04:27 AM
The rpm --rebuilddb command fixed it.
Thanks for all your help

pdb
8th November 2006, 04:28 AM
:) And there was much rejoicing.

fedorafan2
8th November 2006, 04:31 AM
the command yum info mod_security gives me a segmentation fault. :(

pdb
8th November 2006, 04:32 AM
Clean out your yum cache? 'yum clean all'

u-noneinc-s
8th November 2006, 04:35 AM
pdb... STINK!! ? Just curious. Also sorry for again repeating what you already posted :rolleyes: I don't know why I keep doing that. :D No filter between the eyes and the brain I guess. :confused:

pdb
8th November 2006, 04:37 AM
STINK!!
A non-vulgar expression of frustration

u-noneinc-s
8th November 2006, 04:44 AM
Shoulda guessed. Thanks

fedorafan2
8th November 2006, 05:19 AM
Fixed

Thanks for the help :)