11

所以我正在尝试设置一个 ssh 堡垒服务器,但我在设置 EPEL 以安装 Python3.6 时遇到问题。

我在用CentOS Linux release 7.4.1708 (Core)

所以我试图先使用 安装EPELsudo yum -y install epel-release(我之前当然做过sudo yum -y update并且效果很好),但它告诉我Package 'epel-release' not found

因此,我尝试了使用RedHat Package Manager的不同方法:

sudo rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

这成功安装了包,我可以看到两者epel.repo和(我epel-testing.repoetc/yum.repos.d帖子末尾复制了它们的包含)

但是,现在,每当我尝试使用 yum 做某事时,无论是更新还是安装某些软件包,它都会给我以下错误(例如,我使用过yum -y install Python3.6或者我也尝试过安装tsclientpython-pip):

[root@scw-39016b yum.repos.d]# yum install -y Python3.6
Loaded plugins: fastestmirror
base                                                     | 3.6 kB     00:00
centos-kernel                                            | 2.9 kB     00:00
epel/armhfp/metalink                                     |  42 kB     00:00
Could not parse metalink https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=armhfp error was
No repomd file


 One of the configured repositories failed (Unknown),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Run the command with the repository temporarily disabled
            yum --disablerepo=<repoid> ...

     4. Disable the repository permanently, so yum won't use it by default. Yum
        will then just ignore the repository until you permanently enable it
        again or use --enablerepo for temporary usage:

            yum-config-manager --disable <repoid>
        or
            subscription-manager repos --disable=<repoid>

     5. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true

File /var/cache/yum/armhfp/7/epel/metalink.xml does not exist

我已经尝试了数百万种方法来解决这个问题,但似乎没有任何帮助:(

我重新安装了 5 次,我已经完成了sudo yum clean all,我也尝试在 repo 文件和其他方式中取消注释baseurl和评论metalink,等等......,但没有任何帮助:(

有人可以让我知道,请问是什么导致了这个错误?

我在某处读到它可能与启用/禁用某些存储库有关,但我不明白如何处理它..

非常感谢 !!!

epel.repo

[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

[epel-debuginfo]
name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch/debug
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1

[epel-source]
name=Extra Packages for Enterprise Linux 7 - $basearch - Source
baseurl=http://download.fedoraproject.org/pub/epel/7/SRPMS
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-source-7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1

epel-testing.repo

[epel-testing]
name=Extra Packages for Enterprise Linux 7 - Testing - $basearch
baseurl=http://download.fedoraproject.org/pub/epel/testing/7/$basearch
metalink=https://mirrors.fedoraproject.org/metalink?repo=testing-epel7&arch=$basearch
failovermethod=priority
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

[epel-testing-debuginfo]
name=Extra Packages for Enterprise Linux 7 - Testing - $basearch - Debug
baseurl=http://download.fedoraproject.org/pub/epel/testing/7/$basearch/debug
metalink=https://mirrors.fedoraproject.org/metalink?repo=testing-debug-epel7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1

[epel-testing-source]
name=Extra Packages for Enterprise Linux 7 - Testing - $basearch - Source
baseurl=http://download.fedoraproject.org/pub/epel/testing/7/SRPMS
metalink=https://mirrors.fedoraproject.org/metalink?repo=testing-source-epel7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1
4

8 回答 8

9

我们通过更新 curl 解决了这个问题。我相信 yum 在后台使用 libcurl,而且似乎旧版本的 curl 无法协商到 epel repo 的 TLS 连接。

yum update curl --disablerepo=epel
于 2019-04-25T14:00:43.657 回答
4

我在虚拟机上遇到了这个问题。我刚刚更改了 metalink https 访问并将其设置为标准 http,如下所示:metalink= http:// mirrors.fedoraproject.org....

于 2018-06-12T13:06:05.893 回答
4

您正在armhfp用作您的拱门,并且您正在查看的 epel metalink 中没有它的存储库。

如果您下载下面的链接,您将获得一个名为metalink. 您将看到没有匹配的 repo repo=epel-7&arch=armhfp。这是你问题的根源。

https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=armhfp

您需要使用其他一些为armhfparch 提供 CentOS-7 支持的镜像。

例如, http: //mirror.centos.org/altarch/7/os/armhfp/

为了使用它,您需要删除epel-releaseRPM 并安装以下内容:

rpm -ivh http://mirror.centos.org/altarch/7/os/armhfp/Packages/centos-userland-release-7-4.1708.el7.centos.0.1.armv7hl.rpm

然后yum install为您的包裹做一个。

于 2018-01-18T14:57:14.290 回答
3

当我试图在我的 Raspberry Pi 3(新运行的 CentOS 7)上安装 Python3 时,我遇到了你的问题。经过一番 google-fu,我发现了这个站点,它帮助我在 armhfp 上安装了 EPEL。这就是它所说的:

如何在 armhfp 上启用 EPEL 7?

答案很简单,因为没有用于 armfhp 的官方 EPEL 存储库。但是因为很多用户都要求这样做,所以我们决定在它们空闲时使用 centos armhfp 构建器从 EPEL 7 (重新)构建源包(并尝试自动跟踪它们)。请注意,这只是一个没有任何 QA/测试的自动重建,并且生成的 pkg 也没有签名。要使用该存储库,请按以下方式进行:

cat > /etc/yum.repos.d/epel.repo << EOF
[epel]
name=Epel rebuild for armhfp
baseurl=https://armv7.dev.centos.org/repodir/epel-pass-1/
enabled=1
gpgcheck=0

EOF

完成这些步骤后,我能够sudo yum install epel-release成功运行,然后在我的树莓派上安装 python3。

然而,在你这样做之前,你需要让 yum 工作。我不确定我是不是最好的帮助,但我建议删除(或至少禁用)您拥有的当前版本的 epel 存储库。

yum remove epel
yum remove epel-release
yum remove epel-testing

看来您启用了已损坏的第 3 方回购。这会导致您的 yum 出现问题,这就是您需要删除或禁用存储库的原因。

于 2018-02-07T04:44:36.360 回答
2

我们有一个非常相似的问题,我已经看到了几个请求帮助,最常见的响应是“不要使用‘https’,但这会让你受到 MITM 攻击”。必须有更好的答案。

我们刚刚在服务器上重新安装了 CentOS Linux 版本 7.7.1908 (Core),并且每次尝试时都像 OP 一样sudo yum install epel-release,我们打破了 yum。

这是安装:

-bash-4.2$ sudo yum install epel-release
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.sonic.net
 * extras: mirror.fileplanet.com
 * updates: mirror.fileplanet.com
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-11 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================================================================================================================
 Package                                                     Arch                                                  Version                                             Repository                                             Size
===================================================================================================================================================================================================================================
Installing:
 epel-release                                                noarch                                                7-11                                                extras                                                 15 k

Transaction Summary
===================================================================================================================================================================================================================================
Install  1 Package

Total download size: 15 k
Installed size: 24 k
Is this ok [y/d/N]: y
Downloading packages:
epel-release-7-11.noarch.rpm                                                                                                                                                                                |  15 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : epel-release-7-11.noarch                                                                                                                                                                                        1/1 
  Verifying  : epel-release-7-11.noarch                                                                                                                                                                                        1/1 

Installed:
  epel-release.noarch 0:7-11                                                                                                                                                                                                       

Complete!

现在,即使我们只是尝试运行yum list它也会失败:

-bash-4.2$ yum list
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile


 One of the configured repositories failed (Unknown),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Run the command with the repository temporarily disabled
            yum --disablerepo=<repoid> ...

     4. Disable the repository permanently, so yum won't use it by default. Yum
        will then just ignore the repository until you permanently enable it
        again or use --enablerepo for temporary usage:

            yum-config-manager --disable <repoid>
        or
            subscription-manager repos --disable=<repoid>

     5. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true

Cannot retrieve metalink for repository: epel/x86_64. Please verify its path and try again

这是/etc/yum.repos.d/epel.repo:

-bash-4.2$ cat epel.repo
[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

[epel-debuginfo]
name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch/debug
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1

[epel-source]
name=Extra Packages for Enterprise Linux 7 - $basearch - Source
#baseurl=http://download.fedoraproject.org/pub/epel/7/SRPMS
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-source-7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1

那么是我们尝试访问的存储库的问题还是我们尝试使用“https”协议访问的事实?如果是前者,我如何找到正确的存储库?如果是后者,我们如何诊断潜在问题?这是一个全新的安装——我们真正做的只是安装autos并挂载主目录,安装rvm并创建一些用户和组。

FWIW,yum check-update不报告任何内容并且yum update curl(有或没有“--disablerepo=epel”)也没有做任何事情。

我已经为此苦恼了一天,需要专业的帮助。;-/

这个难题还有另一部分,这就是为什么我怀疑根本问题与“https”有关。我们遇到了这个问题,为什么尝试使用这些说明安装 MongoDB:https ://docs.mongodb.com/v4.0/tutorial/install-mongodb-on-red-hat/#using-rpm-packages-recommended

我们创建/etc/yum.repos.d/mongodb-org-4.0.repo了以下内容:

[mongodb-org-4.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.0/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc

然后尝试安装 MongoDB 并得到了一些不同的错误:

-bash-4.2$ sudo vi /etc/yum.repos.d/mongodb-org-4.0.repo
-bash-4.2$ sudo yum install -y mongodb-org
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.keystealth.org
 * extras: mirror.fileplanet.com
 * updates: mirrors.sonic.net
https://repo.mongodb.org/yum/redhat/7/mongodb-org/4.0/x86_64/repodata/repomd.xml: [Errno 14] curl#60 - "Peer's Certificate issuer is not recognized."
Trying other mirror.
It was impossible to connect to the CentOS servers.
This could mean a connectivity issue in your environment, such as the requirement to configure a proxy,
or a transparent proxy that tampers with TLS security, or an incorrect system clock.
You can try to solve this issue by using the instructions on https://wiki.centos.org/yum-errors
If above article doesn't help to resolve this issue please use https://bugs.centos.org/.



 One of the configured repositories failed (MongoDB Repository),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Run the command with the repository temporarily disabled
            yum --disablerepo=mongodb-org-4.0 ...

     4. Disable the repository permanently, so yum won't use it by default. Yum
        will then just ignore the repository until you permanently enable it
        again or use --enablerepo for temporary usage:

            yum-config-manager --disable mongodb-org-4.0
        or
            subscription-manager repos --disable=mongodb-org-4.0

     5. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=mongodb-org-4.0.skip_if_unavailable=true

failure: repodata/repomd.xml from mongodb-org-4.0: [Errno 256] No more mirrors to try.
https://repo.mongodb.org/yum/redhat/7/mongodb-org/4.0/x86_64/repodata/repomd.xml: [Errno 14] curl#60 - "Peer's Certificate issuer is not recognized.”

但是,现在如果我尝试这个,我会得到“(未知)”错误。

这很令人困惑。

于 2019-10-01T03:04:34.653 回答
1

问题是,即使我们通过 rpm 安装 epel,在epel.repoepel-testing.repo文件中配置的 baseurl 的路径也是无效的,因为https://download.fedoraproject.org/不存在。
有效路径是:https ://dl.fedoraproject.org/pub/

在此处输入图像描述

因此,修改/etc/yum.repos.d/epel.repo中的基本 url :baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch

对此:
baseurl=http://dl.fedoraproject.org/pub/epel/7/$basearch

于 2020-08-16T16:40:47.790 回答
1

我遇到了同样的问题,为了解决它,我做了以下事情:

$ yum install epel-release
$ cd /etc/yum.repos.d
$ rm epel-testing.repo
$ yum clean all
$ yum update -

它对我有用!

于 2020-05-08T22:50:22.010 回答
0

这就是我所做的

须藤纳米 /etc/yum.repos.d/epel.repo

注释掉 metalink 并将现有的 baseurl 注释掉。

name=Extra Packages for Enterprise Linux 7 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch
#metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

可以删除{

[epel-debuginfo]
name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch/debug
#metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1

[epel-source]
name=Extra Packages for Enterprise Linux 7 - $basearch - Source
#baseurl=http://download.fedoraproject.org/pub/epel/7/SRPMS
#metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-source-7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1

}

添加一个新的baseurl

baseurl=https://armv7.dev.centos.org/repodir/epel-pass-1/

保存文件 sudo yum update

我能够让 epel repos 更新和下载,并检查是否使用 yum install epel-release 安装了 epel-release,我收到了已安装的软件包消息。更新:将 gpgcheck=1 更改为 0 应该没问题。我还删除了 gpgkey= 行。

让我知道它是否有帮助!

[续] 当我安装 htop.armv7h1 时,我必须使用 yum 执行 --nogpgcheck 并且它安装得很好。

于 2021-07-14T18:16:31.883 回答