Using YUM package via CentOS online sources in RHEL5

This guide provides the steps to use the YUM package for CentOS on a Red Hat Enterprise Linux 5 installation.

Delete current YUM package

Find all the YUM packages

# rpm -qa |grep yum

Delete all yum package,if error cause by dependence ,add –nodeps

# rpm -e

Download the relative packages

wget http://mirrors.163.com/centos/5/os/i386/CentOS/yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm
wget http://mirrors.163.com/centos/5/os/i386/CentOS/yum-3.2.22-20.el5.centos.noarch.rpm
wget http://mirrors.163.com/centos/5/os/i386/CentOS/python-iniparse-0.2.3-4.el5.noarch.rpm

Install, verbose, and print hash marks (ivh)

# rpm -ivh python-iniparse-0.2.3-4.el5.noarch.rpm yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm yum-3.2.22-20.el5.centos.noarch.rpm –force –nodeps

Download the CentOS Base Repository

# wget http://sudone.com/download/CentOS-Base.repo -O /etc/yum.repos.d/CentOS-Base.repo

Update your system

# yum update

Source: http://www.linuxcream.com/blog/linux-system/linux_redhat/using-yum-package-via-centos-online-sources-in-rhel5/