美文网首页
redhat7系统配置阿里源失败解决办法

redhat7系统配置阿里源失败解决办法

作者: _Irving | 来源:发表于2023-02-13 09:47 被阅读0次
配置阿里源配置文件
  1. 备份阿里源配置文件
[wanchao@localhost ~]$  mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/Centos-Base.repo.bak
  1. 下载阿里源配置文件(2种方式)
[root@localhost ~]#wget -O /etc/yum.repos.d/CentOS-Base.repo  https://mirrors.aliyun.com/repo/Centos-7.repo

[root@localhost ~]#curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
  1. 更新镜像源
-清除yum缓存
[wanchao@localhost ~]$ yum clean all
-生成yum缓存
[wanchao@localhost ~]$ yum makecache
#1、修改yum配置文件
[wanchao@localhost ~]$ vim /etc/yum.repos.d/CentOS-Base.repo
#2、将全文中所有的“$releasever”字符串替换成“7”,因为我的系统centos7版本
#进入命令行模式
:%s/$releasever/7/g
#保存并退出
:wq
  1. 再次更新镜像源
[wanchao@localhost ~]$ yum clean all
[wanchao@localhost ~]$ yum makecache

相关文章

网友评论

      本文标题:redhat7系统配置阿里源失败解决办法

      本文链接:https://www.haomeiwen.com/subject/ibujkdtx.html