Redhat7.5 替换免费的yum
前言
在没有激活的机器上使用yum命令无法使用,临时替换免费版。推荐使用正版!
步骤
检查已经安装yum包
1
# rpm -qa | grep yum
删除已安装的yum包
1
# rpm -qa | grep yum|xargs rpm -e --nodeps
下载yum相关包
浏览器打开阿里镜像站,网址可能会变1
2
3# wget https://mirrors.aliyun.com/centos/7.6.1810/os/x86_64/Packages/yum-3.4.3-161.el7.centos.noarch.rpm
# wegt https://mirrors.aliyun.com/centos/7.6.1810/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
# wget https://mirrors.aliyun.com/centos/7.6.1810/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-50.el7.noarch.rpm安装yum
1
# rpm -ivh yum-*
下载源地址文件
1
2# cd /etc/yum.repos.d
# wget http://mirrors.aliyun.com/repo/Centos-7.repo备份原源地址文件
1
# mv /etc/yum.repos.d/redhat.repo /etc/yum.repos.d/redhat.repo.bak
修改阿里源地址文件
1
# sed -i "s;\$releasever;7.6.1810;g" /etc/yum.repos.d/Centos-7.repo
7.6.1810为版本号
清理缓存和重新生成缓存
1
2# yum clean all
# yum makecache