Saturday, January 14, 2012

ImportError: cannot import name _ yum error

Advertisements

You may get this error while  installing something using yum.

Error:

Traceback (most recent call last):
  File "/usr/bin/yum", line 28, in ?
    import yummain
  File "/usr/share/yum-cli/yummain.py", line 30, in ?
    from yum import _
ImportError: cannot import name _


Reason:
Yum is corrupt.

Solution:
Update the yum forcefully.
You can get the latest yum from net. In my case it was for openvz container.
http://wiki.openvz.org/Install_yum#CentOS_5_i386

Download using wget:
wget http://mirror.centos.org/centos/5/os/i386/CentOS/yum-3.2.22-37.el5.centos.noarch.rpm

Install it:
rpm -Uvh --force yum-3.2.22-37.el5.centos.noarch.rpm
Thats it.

No comments:

Post a Comment

Be nice. That's all.