Centos更换镜像源(亲测可用)

Love The Way You Lie 2023-01-02 08:22 605阅读 0赞

2020-12-02 centos 停止更新centos 6,导致yum出现报错

解决方案:
1、进入 /etc/yum.repo.d/ 文件夹,先将原来的CentOS-Base.repo备份
2、然后编辑CentOS-Base.repo,复制下面的内容把原内容覆盖
3、yum clean
4、yum makecache

  1. # CentOS-Base.repo
  2. #
  3. # The mirror system uses the connecting IP address of the client and the
  4. # update status of each mirror to pick mirrors that are updated to and
  5. # geographically close to the client. You should use this for CentOS updates
  6. # unless you are manually picking other mirrors.
  7. #
  8. # If the mirrorlist= does not work for you, as a fall back you can try the
  9. # remarked out baseurl= line instead.
  10. #
  11. #
  12. [base]
  13. name=CentOS-6.10 - Base - mirrors.aliyun.com
  14. failovermethod=priority
  15. baseurl=http://mirrors.aliyun.com/centos-vault/6.10/os/$basearch/
  16. gpgcheck=1
  17. gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
  18. #released updates
  19. [updates]
  20. name=CentOS-6.10 - Updates - mirrors.aliyun.com
  21. failovermethod=priority
  22. baseurl=http://mirrors.aliyun.com/centos-vault/6.10/updates/$basearch/
  23. gpgcheck=1
  24. gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
  25. #additional packages that may be useful
  26. [extras]
  27. name=CentOS-6.10 - Extras - mirrors.aliyun.com
  28. failovermethod=priority
  29. baseurl=http://mirrors.aliyun.com/centos-vault/6.10/extras/$basearch/
  30. gpgcheck=1
  31. gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
  32. #additional packages that extend functionality of existing packages
  33. [centosplus]
  34. name=CentOS-6.10 - Plus - mirrors.aliyun.com
  35. failovermethod=priority
  36. baseurl=http://mirrors.aliyun.com/centos-vault/6.10/centosplus/$basearch/
  37. gpgcheck=1
  38. enabled=0
  39. gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6

参考:https://www.cnblogs.com/ltlinux/p/14107377.html

发表评论

表情:
评论列表 (有 0 条评论,605人围观)

还没有评论,来说两句吧...

相关阅读

    相关 CentOS7更换yum镜像

    目录 •写在前面 •具体步骤 -------------------- •写在前面 更换镜像源的理由总是惊人的相似,都是因为访问国外的网速不好,所以我们选择更换成