美文网首页
centos8更换国内源(阿里源)

centos8更换国内源(阿里源)

作者: 棉花糖716 | 来源:发表于2021-06-29 08:59 被阅读0次
    1. 备份旧的配置文件
    mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
    
    1. 下载新的 CentOS-Base.repo 到 /etc/yum.repos.d/
    wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo
    

    并替换部分字段(非阿里云机器需要做)

    sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo
    

    3.生成缓存

    yum makecache
    

    4.配置完毕,正常安装软件(测试速度飞快)

    yum -y install vim
    

    完毕!

    相关文章

      网友评论

          本文标题:centos8更换国内源(阿里源)

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