尧图网站建设 尧图网络
  • 首页
  • 关于我们
  • 服务项目
  • 案例展示
  • 建站流程
  • 资讯中心
  • 联系我们
首页/资讯中心/详情

centos官方镜像源(`mirrorlist.centos.org`)已经彻底关闭,无法访问

centos官方镜像源(`mirrorlist.centos.org`)已经彻底关闭,无法访问
📅 发布时间:2026/6/30 8:21:45
[root@192 ~]# sudo yum install -y yum-utils device-mapper-persistent-data lvm2 已加载插件:fastestmirror, product-id, search-disabled-repos, subscription-manager This system is not registered with an entitlement server. You can use subscription-manager to register. Loading mirror speeds from cached hostfile Could not retrieve mirrorlist http://mirrorlist.centos.org?arch=x86_64&release=7&repo=sclo-rh error was 14: curl#7 - "Failed connect to mirrorlist.centos.org:80; 拒绝连接" One of the configured repositories failed (未知), and yum doesn't have enough cached data to continue. At this point the only safe thing yum can do is fail. There are a few ways to work "fix" this: 1. Contact the upstream for the repository and get them to fix the problem. 2. Reconfigure the baseurl/etc. for the repository, to point to a working upstream. This is most often useful if you are using a newer distribution release than is supported by the repository (and the packages for the previous distribution release still work). 3. Run the command with the repository temporarily disabled yum --disablerepo=<repoid> ... 4. Disable the repository permanently, so yum won't use it by default. Yum will then just ignore the repository until you permanently enable it again or use --enablerepo for temporary usage: yum-config-manager --disable <repoid> or subscription-manager repos --disable=<repoid> 5. Configure the failing repository to be skipped, if it is unavailable. Note that yum will try to contact the repo. when it runs most commands, so will have to try and fail each time (and thus. yum will be be much slower). If it is a very temporary problem though, this is often a nice compromise: yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true Cannot find a valid baseurl for repo: centos-sclo-rh/x86_64

这个报错很经典,是因为 CentOS 7 在 2024 年 6 月 30 日已经全面停止维护(EOL),官方镜像源(mirrorlist.centos.org)已经彻底关闭,无法访问了。

你需要将 yum 源全部替换为国内可用的存档镜像(vault)或阿里/腾讯云镜像。

请按以下步骤操作,先修复 yum 源,再安装 Docker:

🛠️ 第一步:修复 CentOS 7.9 yum 源

由于yum-utils还没装上,我们要手动修改源配置文件。

  1. 备份原有源配置(好习惯):

    sudomv/etc/yum.repos.d /etc/yum.repos.d.baksudomkdir/etc/yum.repos.d
  2. 写入可用的阿里云 Vault 源(CentOS 7 的归档源):
    直接复制下面整段命令,一次性执行,它会创建一个能用的CentOS-Base.repo文件。

    sudotee/etc/yum.repos.d/CentOS-Base.repo<<-'EOF' # CentOS-Base.repo [base] name=CentOS-7 - Base - mirrors.aliyun.com baseurl=http://mirrors.aliyun.com/centos-vault/7.9.2009/os/$basearch/ gpgcheck=1 gpgkey=http://mirrors.aliyun.com/centos-vault/7.9.2009/RPM-GPG-KEY-CentOS-7 [updates] name=CentOS-7 - Updates - mirrors.aliyun.com baseurl=http://mirrors.aliyun.com/centos-vault/7.9.2009/updates/$basearch/ gpgcheck=1 gpgkey=http://mirrors.aliyun.com/centos-vault/7.9.2009/RPM-GPG-KEY-CentOS-7 [extras] name=CentOS-7 - Extras - mirrors.aliyun.com baseurl=http://mirrors.aliyun.com/centos-vault/7.9.2009/extras/$basearch/ gpgcheck=1 gpgkey=http://mirrors.aliyun.com/centos-vault/7.9.2009/RPM-GPG-KEY-CentOS-7 EOF
  3. 清理并重建 yum 缓存:

    sudoyum clean allsudoyum makecache

    这次执行应该不会报错了。


🚀 第二步:重新安装 Docker CE

源修好后,现在可以按正常流程走了。

  1. 安装依赖工具(刚才失败的那步,现在重试):

    sudoyuminstall-yyum-utils device-mapper-persistent-data lvm2
  2. 添加 Docker 阿里云镜像源:

    sudoyum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
  3. 安装 Docker CE:

    sudoyuminstall-ydocker-ce docker-ce-cli containerd.io
  4. 启动 Docker 并设置开机自启:

    sudosystemctl startdockersudosystemctlenabledocker
  5. 验证安装:

    dockerversion

⚠️ 特别提醒

  • 由于 CentOS 7 已停止维护,后续yum install安装任何软件都可能会遇到依赖包缺失的问题。如果出现这种情况,通常需要手动下载老版本的 rpm 包,会比较麻烦。
  • 强烈建议:如果业务环境允许,可以考虑尽快迁移到AlmaLinux 8/9或Rocky Linux 8/9,它们是 CentOS 的最佳替代品,且仍在活跃维护中。

先按上面的步骤试一下,如果执行yum makecache时还有报错,可以把新的提示发给我。

相关新闻

  • 五大突破性功能解析:网盘直链下载解决方案的技术革命
  • C++23新特性在CLion 2026.1中的实战体验:std::expected错误处理与协程优化深度评测
  • Obsidian PDF++:如何实现沉浸式PDF阅读体验的3个核心设计

最新新闻

  • 冰箱快速维修注意事项
  • 澳洲留学签证材料翻译去哪翻译?办理澳洲留学签证都需要翻译哪些材料?需要多少钱?
  • TI TLK10xL以太网PHY电缆诊断与接口配置实战指南
  • TI评估板安全规范与法律条款解析:从开发工具到产品设计的风险规避
  • 小龙虾技能-05-devops-cloud-05_Monitoring_监控告警
  • 从GPT-3到GPT-4 Turbo:提示词适配性断层分析——3个被忽略的版本迁移致命陷阱

日新闻

  • 【计算机毕业设计案例】基于 Spring Boot+Vue 的电影售票系统设计与实现 前后端分离架构下影院在线购票管理平台(程序+文档+讲解+定制)
  • 到底 TMD 用哪个: npm, pnpm, Yarn, Bun, Deno? 傻瓜, 当然用 npm 啦
  • Google限制Meta使用Gemini模型 凸显AI授权竞争白热化

周新闻

  • Windows字体自定义终极方案:No!! MeiryoUI完全指南
  • Deepin Boot Maker:告别命令行,3分钟制作Linux启动盘的智能解决方案
  • Plain Craft Launcher 2:重新定义你的Minecraft游戏体验

月新闻

  • 【总结】入门篇:50句话让你记住架构核心概念
  • WeChatMsg技术方案解析:实现Mac微信数据自主管理的完整解决方案
  • WeChatMsg:革新性微信数据备份方案,打造你的专属数字记忆库

关于尧图

  • 公司简介
  • 团队介绍
  • 企业文化
  • 荣誉资质

服务项目

  • 定制开发
  • 电商建站
  • UI 设计
  • 运维服务

快速链接

  • 案例展示
  • 建站流程
  • 常见问题
  • 资讯中心

联系方式

  • 📍北京市朝阳区互联网产业园 A 座 10 层
  • 📞400-888-8888
  • ✉️contact@rkmt.cn
  • 🕐周一至周日 9:00-21:00

© 2024 北京尧图网络科技有限公司 版权所有 | 京 ICP 备 XXXXXXXX 号