刚安装的redhat系统,更换免费的yum源
由于redhat系统的yum源需要注册后再使用(也就是要花钱买),我们可以通过将redhat的源更换为centos(免费)的源来解决。
问题提示:
system is not registered with an entitlement server. You can use subscription-manager to register
解决方法:
建议在root模式下进行,su 回车,然后输入密码进入root模式。
cd /etc/yum.repos.d/
#备份
mv redhat.repo redhat.repo_bak
#下载centos 源
wget /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
#清除yum缓存
yum clean all
yum makecache
#更新
yum update
更新完后,yum应该可以用了。
但还是会报not register。
可以通过修改以下/etc/yum/pluginconf.d/product-id.conf和/etc/yum/pluginconf.d/subscription-manager.conf中的参数,使enabled=0即可关闭提醒。
需要注意的是安装的redhat 版本需要对应相应的centos版本。
以下代码可以查看redhat版本
cat /etc/redhat-release
附上centos7.5 yum源下载链接: