Cannot retrieve metalink for repository: epel

8,646

Use only http in place of https i.e

metalink=http://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch

That should work.

Share:
8,646
Melcma
Author by

Melcma

Updated on September 18, 2022

Comments

  • Melcma
    Melcma over 1 year

    I've got two CentOS servers, one inside a Vagrant virtual machine with VirtualBox provider and one on rented VPS. They use the same playbook for provisioning. Everything is fine on VPS one but I'm having an errors around EPEL for the local one. I've reverted my playbook few commits back, when I was 100% sure everything was working, but still the same error.

    I'm using 5 roles made by geerlingguy in following order:

    - { role: geerlingguy.repo-epel }
    - { role: geerlingguy.firewall }
    - { role: geerlingguy.nginx }
    - { role: geerlingguy.git }
    - { role: geerlingguy.nodejs }
    

    Running my playbook returns me an error:

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

    When I SSH into vagrant machine and try to run any yum command:

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

    I can use yum if I add flag --disablerepo=epel

    That's a content from my /etc/yum.repos.d/epel.repo file

    [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
    

    Things I've tried so far:

    • removed firewall role
    • installed the same version of CentOS for vagrant VM and VPS
    • reverted epel.repo links from https to http
    • installed epel.repo manually
    • uncommented baseurl, commented out metalinks