tomfra
asked on
Yum fails after upgrading CentOS 5.2 -> CentOS 5.3
After upgrading CentOS 5.2 to CentOS 5.3 via "yum update" on a server, yum no longer works. "yum install package" or "yum update" now results in the following error:
------------------
Traceback (most recent call last):
File "/usr/bin/yum", line 29, in ?
yummain.user_main(sys.argv [1:], exit_code=True)
File "/usr/share/yum-cli/yummai n.py", line 229, in user_main
errcode = main(args)
File "/usr/share/yum-cli/yummai n.py", line 104, in main
result, resultmsgs = base.doCommands()
File "/usr/share/yum-cli/cli.py ", line 343, in doCommands
return self.yum_cli_commands[self .basecmd]. doCommand( self, self.basecmd, self.extcmds)
File "/usr/share/yum-cli/yumcom mands.py", line 580, in doCommand
return base.updatePkgs(extcmds)
File "/usr/share/yum-cli/cli.py ", line 565, in updatePkgs
self.update()
File "/usr/lib/python2.4/site-p ackages/yu m/__init__ .py", line 2481, in update
updates = self.up.getUpdatesTuples()
File "/usr/lib/python2.4/site-p ackages/yu m/__init__ .py", line 604, in <lambda>
up = property(fget=lambda self: self._getUpdates(),
File "/usr/lib/python2.4/site-p ackages/yu m/__init__ .py", line 495, in _getUpdates
self._up.rawobsoletes = self.pkgSack.returnObsolet es(newest= True)
File "/usr/lib/python2.4/site-p ackages/yu m/__init__ .py", line 591, in <lambda>
pkgSack = property(fget=lambda self: self._getSacks(),
File "/usr/lib/python2.4/site-p ackages/yu m/__init__ .py", line 416, in _getSacks
if self._pkgSack and thisrepo is None:
File "/usr/lib/python2.4/site-p ackages/yu m/packageS ack.py", line 263, in __len__
ret += len(sack)
ValueError: __len__() should return >= 0
------------------
I've tried "yum clean all" but that did not help. The server is a hardware node for hosting OpenVZ VPS accounts. No problems noticed except for this yum problem.
------------------
Traceback (most recent call last):
File "/usr/bin/yum", line 29, in ?
yummain.user_main(sys.argv
File "/usr/share/yum-cli/yummai
errcode = main(args)
File "/usr/share/yum-cli/yummai
result, resultmsgs = base.doCommands()
File "/usr/share/yum-cli/cli.py
return self.yum_cli_commands[self
File "/usr/share/yum-cli/yumcom
return base.updatePkgs(extcmds)
File "/usr/share/yum-cli/cli.py
self.update()
File "/usr/lib/python2.4/site-p
updates = self.up.getUpdatesTuples()
File "/usr/lib/python2.4/site-p
up = property(fget=lambda self: self._getUpdates(),
File "/usr/lib/python2.4/site-p
self._up.rawobsoletes = self.pkgSack.returnObsolet
File "/usr/lib/python2.4/site-p
pkgSack = property(fget=lambda self: self._getSacks(),
File "/usr/lib/python2.4/site-p
if self._pkgSack and thisrepo is None:
File "/usr/lib/python2.4/site-p
ret += len(sack)
ValueError: __len__() should return >= 0
------------------
I've tried "yum clean all" but that did not help. The server is a hardware node for hosting OpenVZ VPS accounts. No problems noticed except for this yum problem.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
"ovzkernel*"
No package match, and therefore "ValueError: __len__() should return >= 0" fails - I suppose. You could submit a bug to the yum project.
No package match, and therefore "ValueError: __len__() should return >= 0" fails - I suppose. You could submit a bug to the yum project.
ASKER
But there *IS* ovzkernel package (from the OpenVZ repo), when I uncomment the exclude line it actually offers me to install it. Really strange.
ASKER
OK, a nasty bug in the most recent version of Yum apparently:
Does not work (gives the error):
exclude=kernel* syslinux* ovzkernel*
exclude=ovzkernel* syslinux* kernel*
Works OK:
exclude=kernel* syslinux* ovzkernel
For some reason there cannot be the wilcard * character for the last package name. And yes, I am editing the file through command line (or mc actually) so the line end character should not be a problem, it's in the correct *nix format and this very same yum.conf file had been working just fine with previous versions of Yum.
Really a bug I guess. Anyway, since you helped me solve the problem, I will accept your solution. Thanks for the help!
Does not work (gives the error):
exclude=kernel* syslinux* ovzkernel*
exclude=ovzkernel* syslinux* kernel*
Works OK:
exclude=kernel* syslinux* ovzkernel
For some reason there cannot be the wilcard * character for the last package name. And yes, I am editing the file through command line (or mc actually) so the line end character should not be a problem, it's in the correct *nix format and this very same yum.conf file had been working just fine with previous versions of Yum.
Really a bug I guess. Anyway, since you helped me solve the problem, I will accept your solution. Thanks for the help!
"yum clean all" helped in my case
ASKER
The "yum clean all" did not help in my situation, I tried it. In my case it was probably indeed a yummy bug...
yum clean all
fixed mine
the yum update now works... my yum.conf didn't have any wild cards in it. It looked very clean and trim.
The odd part for me is that I generally keep all 5 of my servers uptodate -- so what ever this was it hit all at the same time. My last successful update was 5 weeks ago.
fixed mine
the yum update now works... my yum.conf didn't have any wild cards in it. It looked very clean and trim.
The odd part for me is that I generally keep all 5 of my servers uptodate -- so what ever this was it hit all at the same time. My last successful update was 5 weeks ago.
ASKER
For some reason, when this line in yum.conf is not commented out, yum gives the mentioned error:
exclude=kernel* syslinux* ovzkernel*
I see nothing wrong with this line and it worked just fine before the upgrade (and there is a very good reason to have the exlude line there). When it's there, it doesn't work. When I comment it out, it works OK. The syntax is correct, have just checked "man yum.conf".
Any ideas?