CentOS镜像,RPM,epel位置

1.镜像位置

CentOS官网

1.1 点击下载:

在这里插入图片描述

1.2 获取位置

在这里插入图片描述
所有获取镜像的列表

在这里插入图片描述

比如获取清华iso镜像:在这里插入图片描述

2.RPM位置

点击下方链接
所有获取镜像的列表

比如我获取的是清华开源,从此根目录找对应版本的RPM,
https://mirrors.tuna.tsinghua.edu.cn/centos

centos源 下载页面的

<think> 我们正在查找CentOS系统的EPEL镜像源配置方法。根据用户提供的引用内容,特别是引用[1]、[2]和[3],我们可以总结出配置CentOS 7的EPEL镜像源的步骤。但用户没有明确CentOS版本,因此我们需要考虑不同版本的配置差异。 由于用户之前提到的是CentOS 10(但实际上不存在),而引用中都是关于CentOS 7和6的配置,因此我们需要根据用户当前系统的版本来调整。 不过,用户本次的问题只要求查找CentOS系统的epel镜像源,没有指定版本。我们将提供适用于CentOS 7和CentOS 8/Stream的配置方法,并说明CentOS 6(虽然已停止支持)的配置以供参考。 ### 一、CentOS 7 配置阿EPEL源 1. **备份现有EPEL源(如果有)**: ```bash sudo mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup 2>/dev/null sudo mv /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/epel-testing.repo.backup 2>/dev/null ``` 2. **下载阿EPEL源配置文件**: ```bash sudo wget -O /etc/yum.repos.d/epel-7.repo https://mirrors.aliyun.com/repo/epel-7.repo ``` 或者手动创建`/etc/yum.repos.d/epel.repo`,内容如下: ```ini [epel] name=Extra Packages for Enterprise Linux 7 - $basearch baseurl=https://mirrors.aliyun.com/epel/7/$basearch enabled=1 gpgcheck=1 gpgkey=https://mirrors.aliyun.com/epel/RPM-GPG-KEY-EPEL-7 [epel-debuginfo] name=Extra Packages for Enterprise Linux 7 - $basearch - Debug baseurl=https://mirrors.aliyun.com/epel/7/$basearch/debug enabled=0 gpgkey=https://mirrors.aliyun.com/epel/RPM-GPG-KEY-EPEL-7 gpgcheck=1 [epel-source] name=Extra Packages for Enterprise Linux 7 - $basearch - Source baseurl=https://mirrors.aliyun.com/epel/7/SRPMS enabled=0 gpgkey=https://mirrors.aliyun.com/epel/RPM-GPG-KEY-EPEL-7 gpgcheck=1 ``` 3. **更新缓存**: ```bash sudo yum clean all sudo yum makecache ``` ### 二、CentOS 8/Stream 配置阿EPELCentOS 8已经停止支持,但CentOS Stream 8和9仍然可以使用EPEL。这CentOS Stream 8为例(CentOS Stream 9类似,只需将版本号改为9): 1. **备份现有EPEL源**(同上)。 2. **下载EPEL源配置文件**: ```bash # 对于CentOS Stream 8 sudo wget -O /etc/yum.repos.d/epel-8.repo https://mirrors.aliyun.com/repo/epel-8.repo ``` 或者手动创建`/etc/yum.repos.d/epel.repo`,内容如下(以CentOS Stream 8为例): ```ini [epel] name=Extra Packages for Enterprise Linux 8 - $basearch baseurl=https://mirrors.aliyun.com/epel/8/Everything/$basearch enabled=1 gpgcheck=1 gpgkey=https://mirrors.aliyun.com/epel/RPM-GPG-KEY-EPEL-8 [epel-debuginfo] name=Extra Packages for Enterprise Linux 8 - $basearch - Debug baseurl=https://mirrors.aliyun.com/epel/8/Everything/$basearch/debug enabled=0 gpgkey=https://mirrors.aliyun.com/epel/RPM-GPG-KEY-EPEL-8 gpgcheck=1 [epel-source] name=Extra Packages for Enterprise Linux 8 - $basearch - Source baseurl=https://mirrors.aliyun.com/epel/8/Everything/SRPMS enabled=0 gpgkey=https://mirrors.aliyun.com/epel/RPM-GPG-KEY-EPEL-8 gpgcheck=1 ``` 注意:CentOS Stream 9的配置只需将上述配置中的`8`替换为`9`。 3. **更新缓存**: ```bash sudo dnf clean all sudo dnf makecache ``` ### 三、CentOS 6配置(已停止支持,仅参考) ```bash sudo wget -O /etc/yum.repos.d/epel-6.repo https://mirrors.aliyun.com/repo/epel-6.repo ``` ### 四、验证EPEL源 安装一个EPEL源中的包测试(例如`htop`): ```bash sudo yum install htop # CentOS 7/6 sudo dnf install htop # CentOS 8/9 ``` ### 注意事项 - **GPG密钥检查**:如果遇到GPG密钥验证失败,可以临时将`gpgcheck=0`(不推荐),或者手动导入正确的GPG密钥(从gpgkey指定的URL下载并导入)[^2]。 - **版本匹配**:确保EPEL版本与系统版本匹配,否则可能出现兼容性问题。 ### 阿EPEL镜像源地址格式说明 阿EPEL镜像源的通用格式为: ``` https://mirrors.aliyun.com/epel/[版本号]/[路径] ``` 其中: - `版本号`:7, 8, 9等,对应CentOS主版本。 - `路径`:根据架构(如`x86_64`)和仓库类型(如`Everything`、`debug`、`SRPMS`)变化。 ### 参考链接 - [阿云开源镜像站:EPEL镜像](https://developer.aliyun.com/mirror/epel) - [EPEL官方文档](https://fedoraproject.org/wiki/EPEL) §§相关问题§§ 1. 如何解决配置EPEL源后出现的GPG密钥验证失败问题?[^2] 2. CentOS 8系统如何配置阿云Base源和EPEL源? 3. 如何验证EPEL源是否生效? </think> 以下是针对 CentOS 系统配置阿EPEL 镜像源的完整指南,适用于主流 CentOS 版本: ### 一、EPEL 源简介 EPEL(Extra Packages for Enterprise Linux)是由 Fedora 社区维护的高质量附加软件包仓库,提供 CentOS/RHEL 默认仓库中未包含的额外软件(如 `htop`、`nginx` 等)[^1]。 ### 二、配置阿EPEL 源(通用方法) #### 1️⃣ **CentOS 7 配置**(当前主流版本) ```bash # 1. 备份原有配置 sudo mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup 2>/dev/null # 2. 下载阿EPEL源配置 sudo wget -O /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo # 3. 更新缓存 sudo yum clean all && sudo yum makecache ``` #### 2️⃣ **CentOS 8/Stream 配置** ```bash # 1. 备份原有配置 sudo mv /etc/yum.repos.d/epel*.repo /etc/yum.repos.d/backup/ 2>/dev/null # 2. 下载对应版本配置(根据系统选择) # CentOS Stream 8 sudo wget -O /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-8.repo # CentOS Stream 9 sudo wget -O /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-9.repo # 3. 更新缓存 sudo dnf clean all && sudo dnf makecache ``` #### 3️⃣ **手动配置方法**(适用于自定义需求) 创建 `/etc/yum.repos.d/aliyun-epel.repo`: ```ini [epel] name=Aliyun EPEL Repository baseurl=https://mirrors.aliyun.com/epel/$releasever/Everything/$basearch/ enabled=1 gpgcheck=1 gpgkey=https://mirrors.aliyun.com/epel/RPM-GPG-KEY-EPEL-$releasever ``` ### 三、验证与使用 1. **检查仓库状态**: ```bash yum repolist epel # CentOS 7 dnf repolist epel # CentOS 8+ ``` 输出应包含: ``` epel AliYun EPEL Repository 12,000+ packages ``` 2. **安装 EPEL 软件示例**: ```bash sudo yum install htop # CentOS 7 sudo dnf install tmux # CentOS 8+ ``` ### 四、故障排除 - **GPG 密钥错误**:禁用检查(不推荐)或手动导入密钥: ```bash sudo rpm --import https://mirrors.aliyun.com/epel/RPM-GPG-KEY-EPEL-$releasever ``` - **404 错误**:检查 `$releasever` 变量值: ```bash rpm -E %{rhel} # 查看实际版本号 ``` ### 五、不同版本镜像路径参考 | 系统版本 | 阿EPEL 源地址格式 | |----------------|-------------------------------------------| | **CentOS 7** | `https://mirrors.aliyun.com/epel/7/$basearch` | | **CentOS 8** | `https://mirrors.aliyun.com/epel/8/Everything/$basearch` | | **CentOS Stream 9** | `https://mirrors.aliyun.com/epel/9/Everything/$basearch` | > 完整软件列表:访问 [阿EPEL 镜像站](https://mirrors.aliyun.com/epel/)
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值