無味
发布于 2024-03-23 / 65 阅读
0

linux安装epel-release解决错误“Error: Unable to find a match: epel-release”

安装epel-release软件包错误

[root@ecs-20784 opt]# yum install -y epel-release
Last metadata expiration check: 0:18:55 ago on Sat 23 Mar 2024 06:50:37 PM CST.
No match for argument: epel-release
Error: Unable to find a match: epel-release

  1. 下载epel软件源安装包

[root@ecs-20784 opt]# wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

如果您使用的是 CentOS 8 或 RHEL 8,请将 "7" 替换为 "8"。

  1. 安装

[root@ecs-20784 opt]# sudo yum install epel-release-latest-7.noarch.rpm

  1. 清理缓存

[root@ecs-20784 opt]# yum clean all && yum makecache

未清理缓存可能还会提示未安装

  1. 安装

[root@ecs-20784 opt]# yum install -y epel-release
Last metadata expiration check: 0:19:39 ago on Sat 23 Mar 2024 06:50:37 PM CST.
No match for argument: epel-release
Error: Unable to find a match: epel-release
[root@ecs-20784 opt]# cat /etc/redhat-release
cat: /etc/redhat-release: No such file or directory
[root@ecs-20784 opt]# yum clean all && yum makecache
12 files removed
HCE 2.0 base                                                                             67 MB/s | 6.1 MB     00:00
HCE 2.0 updates                                                                         2.1 MB/s |  12 MB     00:05
Last metadata expiration check: 0:00:02 ago on Sat 23 Mar 2024 07:11:25 PM CST.
Metadata cache created.