You may get this error while installing or upgrading packages using yum command,
 

local@host# yum update
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
_

May be your yum package  has been corrupted you can easily fix this just follow below setps,
download the rpm file from the URL using wget command like,
 
# wget http://mirror.centos.org/centos/5/os/i386/CentOS/yum-3.2.22-37.el5.centos.noarch.rpm
 
# rpm -Uvh --force yum-3.2.22-40.el5.centos.noarch.rpm
Preparing...  ########################################### [100%]
   1:yum      ########################################### [100%]

After completing the installation you can update "yum" with this command,
 
local@host# yum update.
 
Now, As your yum is up to date, you can easily install / upgrade latest packages as you like