avatar

技术小站

老骥伏枥,日行千里

  • 首页
  • Java
  • Web
  • 框架
  • 微服务
  • 架构
  • 数据库
  • 中间件
  • 研发
  • 关于
Home CentOS 镜像
文章

CentOS 镜像

Posted 2025-01-25 Updated 2025-01- 25
By 管理员
11~14 min read

CentOS 镜像

简介

CentOS,是基于Red Hat Linux提供的可自由使用源代码的企业级Linux发行版本;是一个稳定,可预测,可管理和可复制的免费企业级计算平台。

下载地址: https://mirrors.aliyun.com/centos/

相关仓库:

  • CentOS过期源(centos-vault):https://developer.aliyun.com/mirror/centos-vault
  • CentOS arm源(centos-altarch):https://developer.aliyun.com/mirror/centos-altarch/
  • CentOS Stream源(centos-stream):https://developer.aliyun.com/mirror/centos-stream
  • CentOS debuginfo源(centos-debuginfo):https://developer.aliyun.com/mirror/centos-debuginfo/

配置方法

通知:CentOS 8操作系统版本结束了生命周期(EOL),Linux社区已不再维护该操作系统版本。建议您切换到Anolis或Alinux。如果您的业务过渡期仍需要使用CentOS 8系统中的一些安装包,请根据下文切换CentOS 8的源。

1. 备份

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

2. 下载新的 CentOS-Base.repo 到 /etc/yum.repos.d/

centos8(centos8官方源已下线,建议切换centos-vault源)
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo

或者

curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo

centos6(centos6官方源已下线,建议切换centos-vault源)

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-6.10.repo

或者

curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-6.10.repo

CentOS 7

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo

或者

curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo

3. 运行 yum makecache 生成缓存

yum makecache

4. 其他

非阿里云ECS用户会出现 Couldn't resolve host 'mirrors.cloud.aliyuncs.com' 信息,不影响使用。用户也可自行修改相关配置: eg:

sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo

CentOS 8 结束生命周期如何切换源

公网用户:

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
yum clean all && yum makecache

阿里云ecs用户:

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.aliyuncs.com/repo/Centos-vault-8.5.2111.repo
sed -i 's/mirrors.cloud.aliyuncs.com/url_tmp/g' /etc/yum.repos.d/CentOS-Base.repo && sed -i 's/mirrors.aliyun.com/mirrors.cloud.aliyuncs.com/g' /etc/yum.repos.d/CentOS-Base.repo && sed -i 's/url_tmp/mirrors.aliyun.com/g' /etc/yum.repos.d/CentOS-Base.repo
yum clean all && yum makecache

相关链接

  • 官方主页: http://www.centos.org/
  • 邮件列表: https://wiki.centos.org/GettingHelp/ListInfo
  • 论坛: https://forums.centos.org/
  • 文档: http://www.centos.org/docs/
  • Wiki: http://wiki.centos.org/
Linux
Linux
License:  CC BY 4.0
Share

Further Reading

Apr 27, 2025

当 SSH 登录 CentOS 7 系统时认证缓慢的解决方案

当 SSH 登录 CentOS 7 系统时认证缓慢,可尝试以下方法来解决: 1. 禁用 DNS 反向解析 SSH 服务器在认证时可能会进行 DNS 反向解析,这可能会耗费大量时间。你可以通过修改 SSH 配置文件来禁用此功能。 首先,使用以下命令打开 SSH 配置文件: sudo vi /etc/s

Jan 25, 2025

CentOS 镜像

CentOS 镜像 简介 CentOS,是基于Red Hat Linux提供的可自由使用源代码的企业级Linux发行版本;是一个稳定,可预测,可管理和可复制的免费企业级计算平台。 下载地址: https://mirrors.aliyun.com/centos/ 相关仓库: CentOS过期源(cen

Dec 24, 2024

[10 倍程序员] ⭐ 51W+ 的终端命令行工具助你成为 10 倍程序员

[10 倍程序员] ⭐51W+ 的终端命令行工具助你成为 10 倍程序员 终端是程序员的必备工具之一,10 倍程序员的终端跟普通程序员有何不同?本文将介绍许多牛逼且实用的开源工具,用上这些工具后你不一定会变成 10 倍程序员,但绝对能够让你感觉自己像个 10 倍程序员。 本文仅对工具做基本介绍,不提

OLDER

Ollama 运行 DeepSeek-R1-Distill 系列模型

NEWER

AI API聚合推荐

Recently Updated

  • 【Windows】ApifoxAppAgent开机启动项删除
  • Proxy AI 配置第三方AI模型
  • Windows11 莫名端口占用,而又找不到占用应用的奇怪问题
  • Crack Sublime Text 4.2.0.0 Build 4200
  • 当 SSH 登录 CentOS 7 系统时认证缓慢的解决方案

Trending Tags

Halo 研发 工具 Linux 数据库 Java AI 象棋 Web Docker

Contents

©2025 技术小站. Some rights reserved.

Using the Halo theme Chirpy