在redhat系统中,使用yum命令下载安装包的时候报错:This system is not registered to Red Hat Subscription Management.You can use subscription-manager to register
提示需要注册付费
1、卸载系统自带的yum源
rpm -qa|grep yum|xargs rpm -e --nodeps 卸载
rpm -qa|grep yum 查看
2、下载安装国内的yum源
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.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/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-41.el6.noarch.rpm
安装yum源
rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
rpm -ivh --force python-urlgrabber-3.9.1-11.el6.noarch.rpm
rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
rpm -ivh yum-3.2.29-81.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-41.el6.noarch.rpm
3、更改repo文件
备份自带repo文件
cd /etc/yum.repos.d 切换到文件路径
mv rhel-source.repo rhel-source.repo.bak 备份
下载配置repo文件
wget http://mirrors.163.com/.help/CentOS6-Base-163.repo 需在/etc/yum.repos.d路径下操作
vim CentOS6-Base-163.repo 修改配置
:1,$s/$releasever/6 全文替换releasever为6
4、生成缓存
执行命令需保证服务器可以联网,不然会报错,提示无法访问镜像源
yum clean all
yum makecache