解决:This system is not registered to Red Hat Subscription Management

使用yum命令安装软件时候出现以下错误:

 

This system is not registered to Red Hat Subscription Management.You can use subscription-manager to register

 

查了以下说是使用redhat的yum源是需要注册付费的。那怎么能行!

 

1.毫不犹豫卸载RedHat自带的yum包

#查看已安装的yum

rpm -qa|grep yum

#卸载已安装的yum

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

#再次查看已安装的yum

rpm -qa|grep yum

 

2.使用国内新的centos的yum包替换redhat自带的

找到国内的镜像地址:http://mirrors.163.com/centos/,如图:

 

分别找到以下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-3.2.29-81.el6.centos.noarch.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-40.el6.noarch.rpm
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/python-iniparse-0.3.1-2.1.el6.noarch.rpm

接着就是分别安装几个包:

[root@rhel-server download]# rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm

[root@rhel-server download]# rpm -ivh python-urlgrabber-3.9.1-11.el6.noarch.rpm

[root@rhel-server download]# rpm -ivh python-urlgrabber-3.9.1-11.el6.noarch.rpm

#这2个rpm要一起装!!!

[root@rhel-server download]#rpm -ivh yum-3.2.29-81.el6.centos.noarch.rpm

yum-plugin-fastestmirror-1.1.30-40.el6.noarch.rpm

 

3.备份Redhat自带的repo文件

[root@rhel-server etc]# cd /etc/yum.repos.d

[root@rhel-server yum.repos.d]# mv rhel-source.repo rhel-source.repo.bak

 

4.下载163的repo文件

[root@rhel-server yum.repos.d]# wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
[root@rhel-server yum.repos.d]# ls

CentOS6-Base-163.repo  rhel-source.repo.bak

 

替换文件中的$releasever为版本号6

[root@rhel-server yum.repos.d]# vim CentOS6-Base-163.repo
使用全文替换:
:1,$s/$releasever/6
 

 

运行以下命令生成缓存

yum clean all
yum makecache

 

 

 

 

 

 

 

 

 

 

你可能感兴趣的:(Linux)