RHEL5.5更改Yum为CENTOS

结合网上现有整理出来的,前二天才测试通过,如果大家发现有问题请及时告知我,我可以更新。

###一、建立yum安装包目录,并进入到该目录:
mkdir /usr/local/src/yum-packages
cd /usr/local/src/yum-packages


###二、下载yum所需的所有rpm包:
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/python-iniparse-0.2.3-4.el5.noarch.rpm
wget http://mirrors.sohu.com/centos/5.5/os/i386/CentOS/yum-3.2.22-26.el5.centos.noarch.rpm
wget http://mirrors.sohu.com/centos/5.5/os/i386/CentOS/yum-metadata-parser-1.1.2-

3.el5.centos.i386.rpm
wget http://mirror.centos.org/centos-5/5/os/i386/CentOS/yum-fastestmirror-1.1.16-

14.el5.centos.1.noarch.rpm

###三、删除所有YUM包
rpm -qa | grep yum
yum-3.2.19-18.el5.centos
yum-fastestmirror-1.1.16-13.el5.centos
yum-metadata-parser-1.1.2-2.el5

###四、先安装python环境:
rpm -ivh python-iniparse-0.2.3-4.el5.noarch.rpm


###五、安装所有的yum包:
rpm -ivh yum-3.2.22-26.el5.centos.noarch.rpm yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm yum-

fastestmirror-1.1.16-14.el5.centos.1.noarch.rpm


###六、下载配置文件或是替换更新源
wget http://centos.ustc.edu.cn/CentOS-Base.repo  -O /etc/yum.repos.d/CentOS-Base.repo
还有一个源(http://sudone.com/download/CentOS-Base.repo
或是复制CentOS5.5的/etc/yum.repos.d下的有且仅有两个的CentOS-Media.repo和CentOS-Base.repo到Redhat

Enterprise 5.4相同的目录下。

###七、使用CentOS5.5的?/etc/pki/rpm-gpg/下所有文件替换掉RedHat的/etc/pki/rpm-gpg/所有文件。

CentOS的/?etc/pki/rpm-gpg/下只有RPM-GPG-KEY-beta和RPM-GPG-KEY-CentOS-5
拷到RedHat的相应目录下后,终端运行?#rpm --import /etc/pki/rpm-gpg/RPM*

再运行yum -y update,?就OK了。

###八、执行
yum update
附件:收集几个国内速度最快的centos yum(更新源)
1.http://ftp.sjtu.edu.cn/centos/,上海交大,但服务器位于北京,中国教育网网络中心。
北方用户与教育网用户推荐,速度飞快。
CentOS版本也挺多,现在用5.2和5.3的用户较新。
CenOS-Base.repo:无连接,麻烦手动
2.http://centos.ustc.edu.cn,中国科技大学,服务器位于合肥。
南方用户推荐。
同样的,CenOS版本非常丰富,适合长期使用。
CenOS-Base.repo:http://centos.ustc.edu.cn/CentOS-Base.repo
3.http://mirrors.sohu.com/,sohu的开源镜像服务器,服务器位于山东省联通。
速度飞快,全国用户推荐,经常用FireFox下载CD镜像。
我看几乎支持目前所有的开源项目,可以看到该镜像服务器为FreeBSD、archlinux、Fedora、CentOS、Ubuntu、

debian、gentoo、 slackware主流开源系统,以及cygwin、mysql、php、nginx等主流的开源程序提供更新。
这个镜像服务器更新还比较及时的,频率为每两天更新一次。
顺道贴上CentOS的CD和DVD下载地址:
http://mirrors.sohu.com/centos/5.5/isos/i386/CentOS-5.5-i386-bin-DVD.iso
http://mirrors.sohu.com/centos/5.5/isos/i386/CentOS-5.5-i386-LiveCD-Release2.iso
下载CentOS-Base-sohu.repo, 放入/etc/yum.repos.d/
4.http://mirrors.163.com/centos,网易的开源服务器镜像
速度也不错,全国用户推荐.
下载CentOS-Base-163.repo, 放入/etc/yum.repos.d/