美文网首页
CentOS8.4换源

CentOS8.4换源

作者: 梁帆 | 来源:发表于2021-07-08 13:43 被阅读0次
    系统是CentOS 8.4,用了常规centos7的换源方法,发现存在问题。比如当dnf命令查找某个包时发现: warning

    输出的语句:

    Warning: failed loading '/etc/yum.repos.d/CentOS-Base.repo', skipping.
    

    令人瞩目。
    这说明我们之前的换源方法不能正常用于centos8。在查阅了多方资料后,找到了解决方案:

    wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo
    sed -i 's/$releasever/8/g' /etc/yum.repos.d/CentOS-Base.repo
    yum clean all #清理缓存
    yum makecache #更新源
    
    依次执行这些命令,就可以解决问题。 没有warning了

    相关文章

      网友评论

          本文标题:CentOS8.4换源

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