在红帽EL5上运行yum,提示“This system is not registered with RHN”,意思是没有在官网上注册,不能下载RH的软件包,替代方案是采用centos源。

1.卸载rhel的默认安装的yum包

查看yum包:

# rpm -qa|grep yum

卸载yum包。卸载要使用nodeps参数,否则由于依赖关系是无法卸载成功的:

# rpm -qa|grep yum|xargs rpm -e --nodeps

2.下载新的yum包并安装(请注意下载对应系统及位数的安装包)

# wget http://tel.mirrors.163.com/centos/5/os/x86_64/CentOS/yum-3.2.22-40.el5.centos.noarch.rpm

# wget http://tel.mirrors.163.com/centos/5/os/x86_64/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm

# wget http://tel.mirrors.163.com/centos/5/os/x86_64/CentOS/yum-metadata-parser-1.1.2-4.el5.x86_64.rpm

# rpm -ivh yum-*


3.下载yum的配置源到/etc/yum.repos.d/

# cd /etc/yum.repos.d/

# wget http://docs.linuxtone.org/soft/lemp/CentOS-Base.repo


4.运行yum makecache生成缓存

# yum makecache

接下来就可以正常使用yum了。