当前位置:   article > 正文

CentOS 7.9 停止维护(2024-6-30)后可用在线yum源 —— 筑梦之路_centos7停止维护 yum源

centos7停止维护 yum源

众所周知,centos 7 在2024年6月30日,生命周期结束,官方不再进行支持维护,而很多环境一时之间无法完全更新替换操作系统,因此对于yum源还是需要的,特别是对于互联网环境来说,在线yum源使用方便很多,而不需要去搭建本地yum源和内网yum源。

这里以阿里云为例,其他国内开源镜像站类似。此处主要以7.9为例。

1. 备份默认的repo文件

  1. cd /etc/yum.repos.d
  2. mkdir backup
  3. mv *.repo backup

2.配置阿里云的yum源

  1. cat > CentOS-aliyun-lhr.repo << 'EOF'
  2. [base]
  3. name=CentOS-$releasever - Base - mirrors.aliyun.com
  4. failovermethod=priority
  5. baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/
  6. http://mirrors.aliyuncs.com/centos/$releasever/os/$basearch/
  7. http://mirrors.cloud.aliyuncs.com/centos/$releasever/os/$basearch/
  8. gpgcheck=1
  9. gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
  10. #released updates
  11. [updates]
  12. name=CentOS-$releasever - Updates - mirrors.aliyun.com
  13. failovermethod=priority
  14. baseurl=http://mirrors.aliyun.com/centos/$releasever/updates/$basearch/
  15. http://mirrors.aliyuncs.com/centos/$releasever/updates/$basearch/
  16. http://mirrors.cloud.aliyuncs.com/centos/$releasever/updates/$basearch/
  17. gpgcheck=1
  18. gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
  19. #additional packages that may be useful
  20. [extras]
  21. name=CentOS-$releasever - Extras - mirrors.aliyun.com
  22. failovermethod=priority
  23. baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/
  24. http://mirrors.aliyuncs.com/centos/$releasever/extras/$basearch/
  25. http://mirrors.cloud.aliyuncs.com/centos/$releasever/extras/$basearch/
  26. gpgcheck=1
  27. gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
  28. #additional packages that extend functionality of existing packages
  29. [centosplus]
  30. name=CentOS-$releasever - Plus - mirrors.aliyun.com
  31. failovermethod=priority
  32. baseurl=http://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/
  33. http://mirrors.aliyuncs.com/centos/$releasever/centosplus/$basearch/
  34. http://mirrors.cloud.aliyuncs.com/centos/$releasever/centosplus/$basearch/
  35. gpgcheck=1
  36. enabled=0
  37. gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
  38. #contrib - packages by Centos Users
  39. [contrib]
  40. name=CentOS-$releasever - Contrib - mirrors.aliyun.com
  41. failovermethod=priority
  42. baseurl=http://mirrors.aliyun.com/centos/$releasever/contrib/$basearch/
  43. http://mirrors.aliyuncs.com/centos/$releasever/contrib/$basearch/
  44. http://mirrors.cloud.aliyuncs.com/centos/$releasever/contrib/$basearch/
  45. gpgcheck=1
  46. enabled=0
  47. gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
  48. EOF
  1. cat > epel-aliyun.repo <<'EOF'
  2. [epel]
  3. name=Extra Packages for Enterprise Linux 7 - $basearch
  4. baseurl=http://mirrors.aliyun.com/epel/7/$basearch
  5. failovermethod=priority
  6. enabled=1
  7. gpgcheck=0
  8. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
  9. [epel-debuginfo]
  10. name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
  11. baseurl=http://mirrors.aliyun.com/epel/7/$basearch/debug
  12. failovermethod=priority
  13. enabled=0
  14. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
  15. gpgcheck=0
  16. [epel-source]
  17. name=Extra Packages for Enterprise Linux 7 - $basearch - Source
  18. baseurl=http://mirrors.aliyun.com/epel/7/SRPMS
  19. failovermethod=priority
  20. enabled=0
  21. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
  22. gpgcheck=0
  23. EOF

 3. 检查验证

  1. yum clean all
  2. yum makecache fast
  3. yum install vim lrzsz wget curl net-tools

4. 其他可用yum源搜集

1)官方yum源

  1. cat > CentOS-Base.repo <<'EOF'
  2. [base]
  3. name=CentOS-7.9.2009
  4. enabled=1
  5. failovermethod=priority
  6. baseurl=https://vault.centos.org/7.9.2009/os/$basearch/
  7. gpgcheck=1
  8. gpgkey=https://vault.centos.org/RPM-GPG-KEY-CentOS-7
  9. [updates]
  10. name=CentOS-7.9.2009
  11. enabled=1
  12. failovermethod=priority
  13. baseurl=https://vault.centos.org/7.9.2009/updates/$basearch/
  14. gpgcheck=1
  15. gpgkey=https://vault.centos.org/RPM-GPG-KEY-CentOS-7
  16. [extras]
  17. name=CentOS-7.9.2009
  18. enabled=1
  19. failovermethod=priority
  20. baseurl=https://vault.centos.org/7.9.2009/extras/$basearch/
  21. gpgcheck=1
  22. gpgkey=https://vault.centos.org/RPM-GPG-KEY-CentOS-7
  23. EOF

 2)官方epel扩展源

  1. cat > epel.repo <<'EOF'
  2. [epel]
  3. name=Extra Packages for Enterprise Linux 7 - $basearch
  4. #baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch
  5. metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
  6. failovermethod=priority
  7. enabled=1
  8. gpgcheck=1
  9. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
  10. [epel-debuginfo]
  11. name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
  12. #baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch/debug
  13. metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch=$basearch
  14. failovermethod=priority
  15. enabled=0
  16. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
  17. gpgcheck=1
  18. [epel-source]
  19. name=Extra Packages for Enterprise Linux 7 - $basearch - Source
  20. #baseurl=http://download.fedoraproject.org/pub/epel/7/SRPMS
  21. metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-source-7&arch=$basearch
  22. failovermethod=priority
  23. enabled=0
  24. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
  25. gpgcheck=1
  26. EOF
  1. cat > epel-testing.repo <<'EOF'
  2. [epel-testing]
  3. name=Extra Packages for Enterprise Linux 7 - Testing - $basearch
  4. #baseurl=http://download.fedoraproject.org/pub/epel/testing/7/$basearch
  5. metalink=https://mirrors.fedoraproject.org/metalink?repo=testing-epel7&arch=$basearch
  6. failovermethod=priority
  7. enabled=0
  8. gpgcheck=1
  9. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
  10. [epel-testing-debuginfo]
  11. name=Extra Packages for Enterprise Linux 7 - Testing - $basearch - Debug
  12. #baseurl=http://download.fedoraproject.org/pub/epel/testing/7/$basearch/debug
  13. metalink=https://mirrors.fedoraproject.org/metalink?repo=testing-debug-epel7&arch=$basearch
  14. failovermethod=priority
  15. enabled=0
  16. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
  17. gpgcheck=1
  18. [epel-testing-source]
  19. name=Extra Packages for Enterprise Linux 7 - Testing - $basearch - Source
  20. #baseurl=http://download.fedoraproject.org/pub/epel/testing/7/SRPMS
  21. metalink=https://mirrors.fedoraproject.org/metalink?repo=testing-source-epel7&arch=$basearch
  22. failovermethod=priority
  23. enabled=0
  24. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
  25. gpgcheck=1
  26. EOF

3) 清华大学yum源

  1. cat > CentOS-tsinghua.repo <<'EOF'
  2. [base]
  3. name=CentOS-7.9.2009
  4. enabled=1
  5. failovermethod=priority
  6. baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/7.9.2009/os/$basearch/
  7. gpgcheck=1
  8. gpgkey=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/RPM-GPG-KEY-CentOS-7
  9. [updates]
  10. name=CentOS-7.9.2009
  11. enabled=1
  12. failovermethod=priority
  13. baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/7.9.2009/updates/$basearch/
  14. gpgcheck=1
  15. gpgkey=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/RPM-GPG-KEY-CentOS-7
  16. [extras]
  17. name=CentOS-7.9.2009
  18. enabled=1
  19. failovermethod=priority
  20. baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/7.9.2009/extras/$basearch/
  21. gpgcheck=1
  22. gpgkey=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/RPM-GPG-KEY-CentOS-7
  23. [epel]
  24. name=Extra Packages for Enterprise Linux 7 -
  25. enabled=1
  26. failovermethod=priority
  27. baseurl=https://mirrors.tuna.tsinghua.edu.cn/epel/7/$basearch/
  28. gpgcheck=0
  29. gpgkey=https://mirrors.tuna.tsinghua.edu.cn/epel/RPM-GPG-KEY-EPEL-7
  30. EOF

4)中科大yum源

  1. cat > CentOS-ustc.repo <<'EOF'
  2. [base]
  3. name=CentOS- - Base
  4. baseurl=https://mirrors.ustc.edu.cn/centos-vault/centos/7.9.2009/os/$basearch/
  5. gpgcheck=1
  6. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
  7. [updates]
  8. name=CentOS- - Updates
  9. baseurl=https://mirrors.ustc.edu.cn/centos-vault/centos/7.9.2009/updates/$basearch/
  10. gpgcheck=1
  11. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
  12. [extras]
  13. name=CentOS- - Extras
  14. baseurl=https://mirrors.ustc.edu.cn/centos-vault/centos/7.9.2009/extras/$basearch/
  15. gpgcheck=1
  16. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
  17. [centosplus]
  18. name=CentOS- - Plus
  19. baseurl=https://mirrors.ustc.edu.cn/centos-vault/centos/7.9.2009/centosplus/$basearch/
  20. gpgcheck=1
  21. enabled=0
  22. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
  23. EOF

5)网易yum源

  1. cat > CentOS-163.repo <<'EOF'
  2. [base]
  3. name=CentOS-$releasever - Base - 163.com
  4. #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
  5. baseurl=http://mirrors.163.com/centos-vault/7.9.2009/os/$basearch/
  6. gpgcheck=1
  7. gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
  8. #released updates
  9. [updates]
  10. name=CentOS-$releasever - Updates - 163.com
  11. #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
  12. baseurl=http://mirrors.163.com/centos-vault/7.9.2009/updates/$basearch/
  13. gpgcheck=1
  14. gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
  15. #additional packages that may be useful
  16. [extras]
  17. name=CentOS-$releasever - Extras - 163.com
  18. #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
  19. baseurl=http://mirrors.163.com/centos-vault/7.9.2009/extras/$basearch/
  20. gpgcheck=1
  21. gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
  22. #additional packages that extend functionality of existing packages
  23. [centosplus]
  24. name=CentOS-$releasever - Plus - 163.com
  25. baseurl=http://mirrors.163.com/centos-vault/7.9.2009/centosplus/$basearch/
  26. gpgcheck=1
  27. enabled=0
  28. gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
  29. EOF

其他centos版本的yum源配置:

CentOS 6 在线可用yum源配置——筑梦之路_centos6可用yum源-CSDN博客

CentOS 8 停止维护后换可用yum源——筑梦之路_centos yum 阿里云镜像还支持吗-CSDN博客

参考资料:

https://www.cnblogs.com/yeziwinone/p/17916626.html

centos镜像_centos下载地址_centos安装教程-阿里巴巴开源镜像站

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/天景科技苑/article/detail/830696
推荐阅读
相关标签
  

闽ICP备14008679号