在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