Somehow in an unlucky moment(s) you’ll find that your yum command stop working, I have experienced it a couple of time, never find out how it happen.
It is quite simple to re install yum in an rpm base linux distros, specifically CentOS in my case. What you need to do first is to download the source file (rpm) from CentOS repo.
Check your current kernel, make sure you download the correct package later;
uname -a Linux xxx.yyy.com 2.6.18-128.7.1.el5 #1 SMP Mon Aug 24 08:21:56 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux
Go to the correct repo url, and search for yum rpm link url. For x86_64 Kernel, go to http://mirror.centos.org/centos-5/5.3/os/x86_64/CentOS/ (assuming that you are using the latest version of CentOS), copy the link of yum package, and download them into your server, you must at this point have wget installed.
cd /usr/local/src/ wget http://mirror.centos.org/centos-5/5.3/os/x86_64/CentOS/yum-3.2.19-18.el5.centos.noarch.rpm
Check yor current version of installed yum
rpm -qa | grep yum yum-metadata-parser-1.1.2-2.el5 yum-updatesd-0.9-2.el5 yum-utils-1.1.16-13.el5.centos yum-3.2.19-18.el5.centos yum-fastestmirror-1.1.16-13.el5.centos
The result confirmed that you have yum-3.2.19-18, erase it using rpm and no dependencies check option.
rpm -e --nodeps yum-3.2.19-18.el5.centos
Reinstall with rpm from yum rpm you just downloaded;
rpm -ivh yum-3.2.19-18.el5.centos.noarch.rpm


2 Comments
thanks. this saved me:)
THX !!!!!