关于centos6以下yum源失效的问题

今天偶尔启动了以下长时间未用的云服务器,使用yum安装某些软件,发现报网络延迟的错误

Errors during downloading metadata for repository 'docker-ce-stable':
  - Curl error (28): Timeout was reached for https://download.docker.com/linux/centos/8/x86_64/stable/repodata/repomd.xml [Connection timed out after 30000 milliseconds]

按照网上的解决方案进行解决,重新配置镜像源,出现以下的错误,这种情况应该是源失效了,解决思路参考这篇文章

CentOS-3 - Base - mirrors.aliyun.com                                                                                      76  B/s | 2.3 kB     00:30    
Errors during downloading metadata for repository 'base':
  - Status code: 404 for http://mirrors.cloud.aliyuncs.com/centos/3/os/x86_64/repodata/repomd.xml (IP: 100.100.2.148)
  - Status code: 404 for http://mirrors.aliyun.com/centos/3/os/x86_64/repodata/repomd.xml (IP: 121.89.58.189)
  - Curl error (28): Timeout was reached for http://mirrors.aliyuncs.com/centos/3/os/x86_64/repodata/repomd.xml [Connection timed out after 30000 milliseconds]

如果上述文章中的链接不行(我是不太行),建议:
centos6(centos6官方源已下线,建议切换centos-vault源)
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-6.10.repo
成功解决问题
阿里云镜像官方链接:https://developer.aliyun.com/mirror/
其他的操作系统相关镜像都可以在里面找到

最后建议各位使用新版本Or其他linux发行版,对于阿里云服务器,其可以快速切换

posted @ 2024-06-13 10:19  PostMan_Zc  阅读(44)  评论(0编辑  收藏  举报