1.查看服务器版本,lsb_release -a
[root@jack031 yum.repos.d]# lsb_release -a
LSB Version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: RedHatEnterpriseServer
Description: Red Hat Enterprise Linux Server release 5.5 (Tikanga)
Release: 5.5
Codename: Tikanga
2.卸载HedHat5.5的yum命令
先查看RedHat上是否安装yum
[root@jack031 yum.repos.d]# rpm -qa|grep yum
yum-updatesd-0.9-2.el5
yum-metadata-parser-1.1.2-3.el5.centos
yum-3.2.22-39.el5.centos
yum-fastestmirror-1.1.16-21.el5.centos
删除所有的yum软件 rpm -qa|grep yum|xargs rpm -e –-nodeps
3.下载新的yum包
wget http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/yum-fastestmirror-1.1.16-16.el5.centos.noarch.rpm
wget http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/yum-3.2.22-37.el5.centos.noarch.rpm
wget http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/yum-updatesd-0.9-2.el5.noarch.rpm
wget http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm
rpm -ivh yum-*
注意:yum和yum-fastestmirror相互依赖,所以同时安装即可。
3.下载yum的配置源
wget http://docs.linuxtone.org/soft/lemp/CentOS-Base.repo 下载到 /etc/yum.repos.d/
4. 导入KEY文件,注意大小写
rpm --import http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5
5.测试 yum
yum search MySQL