EPEL (Extra Packages for Enterprise Linux) 是由 Fedora 社区打造,为 RHEL 及其衍生发行版如 CentOS、Scientific Linux 提供高质量软件包的项目。EPEL 包含许多官方源中没有的常用软件,对于 CentOS 7 用户来说,安装 EPEL 源是必备操作之一。本文将详细介绍如何通过安装 epel-release-latest-7.noarch.rpm 来配置 EPEL 源,并确保安装后正确保存配置。
在终端执行以下命令确认系统版本:cat /etc/centos-release确保输出包含 CentOS Linux release 7.x。
使用 wget 下载适用于 CentOS 7 的 epel-release 包:wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm如果系统中没有 wget,可以先安装:yum install -y wget。
下载完成后,使用 rpm 命令安装:sudo rpm -ivh epel-release-latest-7.noarch.rpm或者使用 yum 本地安装:sudo yum install -y epel-release-latest-7.noarch.rpm。
安装后,可以通过以下命令查看已启用的源列表:yum repolist如果看到 epel/x86_64 相关的仓库,则表示成功。也可以直接搜索 EPEL 中的软件测试:yum search htop。
EPEL 源配置文件位于 /etc/yum.repos.d/epel.repo。你可以备份此文件以便恢复:cp /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.bak若需自定义(如启用或禁用源),可直接编辑该文件。
yum update -y。rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7。通过以上步骤,你已经成功为 CentOS 7 配置了 EPEL 源。今后可以方便地安装大量扩展软件包,提升工作效率。如果在操作中遇到任何问题,欢迎留言交流。
本文关键词:CentOS7 EPEL安装、epel-release安装教程、Linux软件源配置、RHEL7 yum扩展源
本文由主机测评网于2026-03-05发表在主机测评网_免费VPS_免费云服务器_免费独立服务器,如有疑问,请联系我们。
本文链接:https://www.vpshk.cn/20260328898.html