Error executing yum command: Cannot retrieve metalink for repository: epel/x86_64

Asked 2 years ago, Updated 2 years ago, 160 views

Environment:
CentOS 7
vagrant+VirtualBox

When you run the yum command, you get the following error and you fail:(yum list also fails with the same error)
I don't know how to deal with it, so would anyone know?

When I looked it up online, I found an article saying that the same error occurred when there was an error in the network, but when I pinged outside, it came back.


on the last line Cannot retrieve metalink for repository:epel/x86_64.Please verify its path and try again
and repository: epel/x86_64 metalink is missing.

There are many directories in /var/cache/yum/x86_64/7/ just in case, is this irrelevant?

Also, yum clean all succeeded, but it did not change.

error messages:

Plugins loaded:fastestmirror

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

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

     2. Configure the baseurl/etc. for the repository, to point to a working
        upstream.This is most used 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. Disable the repository, 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>

     4. Configure the failing repository to be skipped, if it is unavailable.
        Note that 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 much)
        lower).If it is a very temporary problem through, this is off anice
        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

centos yum

2022-09-30 17:29

1 Answers

I don't know the direct cause, but I commented out the metalink line of /etc/yum.repos.d/epel.repo and commented in the baseurl line instead, and the yum command was used.

It looks like the following.

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


2022-09-30 17:29

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.