在选择 CentOS 镜像时,通常指的是 镜像源(Mirror),而不是 ISO 安装镜像。CentOS 是一个开源操作系统,其官方和全球各地有很多镜像站点,用于提速软件包的下载。
以下是不同场景下如何选择 CentOS 的镜像:
🌐 一、安装系统时的 ISO 镜像选择
推荐选择:
- 官方镜像:https://www.centos.org/download/
- 国内镜像(更快):
- 清华大学镜像站:https://mirrors.tuna.tsinghua.edu.cn/centos/
- 阿里云镜像站:https://mirrors.aliyun.com/centos/
- 华为云镜像站:https://mirrors.huaweicloud.com/centos/
- 中科大镜像站:http://mirrors.ustc.edu.cn/centos/
常见版本类型:
- Minimal ISO:最小化安装镜像(推荐用于服务器)
- DVD ISO:完整安装包(适合本地安装或自定义系统)
- Everything ISO:包含所有软件包(体积较大)
- LiveCD / LiveDVD:可用于体验 CentOS 桌面环境
📦 二、系统安装后的 yum 源镜像配置
默认情况下,yum 使用的是官方源,速度较慢。建议换成国内镜像源以提高下载速度。
更换步骤(以阿里云为例):
# 备份原 repo 文件
sudo mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
# 下载阿里云的 repo 文件
sudo curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
# 清除缓存并生成新缓存
sudo yum clean all
sudo yum makecache
⚠️ 注意:根据你的 CentOS 版本(如 CentOS 7、8 或 Stream)选择对应的 repo 文件。
🧩 三、CentOS 的版本选择
| 类型 | 描述 | 推荐用途 |
|---|---|---|
| CentOS Linux 7 / 8 | 稳定的传统版本,适用于企业级生产环境 | 传统服务器部署 |
| CentOS Stream | Red Hat Enterprise Linux (RHEL) 的上游开发分支 | 开发测试 / 追踪未来 RHEL 版本 |
| CentOS Stream 8 / 9 / 10 | 当前主流版本,替代了原来的 CentOS Linux | 替代 CentOS Linux 使用 |
⚠️ 自 CentOS 8 停止维护后,官方主推 CentOS Stream,但部分用户更倾向于使用 Rocky Linux、AlmaLinux 等替代发行版。
✅ 总结推荐
| 场景 | 推荐镜像 | 备注 |
|---|---|---|
| 安装镜像下载 | 清华 / 阿里 / 华为镜像站 | 下载速度快 |
| YUM 源配置 | 阿里云 / 清华源 | 更新快、稳定 |
| CentOS 版本 | CentOS Stream 8 / 9 或 Rocky Linux / AlmaLinux | 根据需求选择长期支持版本 |
如果你告诉我你是要安装什么版本的 CentOS 或是用于什么用途(比如 Web 服务器、数据库、开发等),我可以给你更具体的建议。
云知识