redhat6重装centos6的yum(This system is not registered with RHN.)

在redhat6上使用yum时,报以下信息:
This system is not registered with RHN.
RHN support will be disabled.

原因是redhat的yum源是需要付费的,在网上查到的解决办法就是重新安装centos的yum,以下是安装步骤:

1、卸载原yum

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

2、下载centos的yum包

根据自己的系统版本号和系统位数下载yum包;下面使用的是163的镜像源。

cat /etc/issue && arch 
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-urlgrabber-3.9.1-11.el6.noarch.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-41.el6.noarch.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.29-81.el6.centos.noarch.rpm

3、rpm安装

如果是因为你安装的包已经存在但是版本不一样会出现conflicts with的提示,你需要根据提示把原来的包卸载之后再次安装新的包。

rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
##相互依赖的包一起安装
rpm -ivh yum-plugin-fastestmirror-1.1.30-41.el6.noarch.rpm yum-3.2.29-81.el6.centos.noarch.rpm python-urlgrabber-3.9.1-11.el6.noarch.rpm

4、更换yum源:

wget -O /etc/yum.repos.d/rhel6.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo
##替换repo文件中的$releasever 为系统版本号

vi /etc/yum.repos.d/rhel6.repo
:%s/$releasever/6   

参考网址:https://blog.csdn.net/ytx2014214081/article/details/78468947

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值