How to fix CentOS 5 or 6 error: YumRepo Error: All mirror URLs are not using ftp, http[s] or file

The error looks like-

And here goes the resolution (please carefully update/use the exact CentOS version you are using, in my case it was CentOS 6.9)

1. Go to /etc/yum.repos.d/ directory:

# cd /etc/yum.repos.d/

2. Make copy of original file:

# cp CentOS-Base.repo CentOS-Base.repo.old

3. Open and edit file with any text editor:

# vi CentOS-Base.repo looks

4. After editing it should looks like:

[base]
name=CentOS-$releasever - Base
# mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://vault.centos.org/6.9/os/$basearch
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
exclude=redhat-logos

5. Clean yum cache

# yum clean all

6. Run again yum update command:

# yum update

That’s It

An alternate Repo other than CentOS vault-

[base]
name=CentOS-$releasever - Base
# mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://ftp.uem.br/linux/CentOS/6.10/os/$basearch
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
exclude=redhat-logos

Ref: https://arstech.net/yumrepo-error-all-mirror-urls-are-not-using-ftp-https-or-file/

Share

3 thoughts on “How to fix CentOS 5 or 6 error: YumRepo Error: All mirror URLs are not using ftp, http[s] or file

  1. I just found this on stackoverflow that worked for me

    echo “https://vault.centos.org/6.10/os/x86_64/” > /var/cache/yum/x86_64/6/base/mirrorlist.txt
    echo “http://vault.centos.org/6.10/extras/x86_64/” > /var/cache/yum/x86_64/6/extras/mirrorlist.txt
    echo “http://vault.centos.org/6.10/updates/x86_64/” > /var/cache/yum/x86_64/6/updates/mirrorlist.txt
    echo “http://vault.centos.org/6.10/sclo/x86_64/rh” > /var/cache/yum/x86_64/6/centos-sclo-rh/mirrorlist.txt
    echo “http://vault.centos.org/6.10/sclo/x86_64/sclo” > /var/cache/yum/x86_64/6/centos-sclo-sclo/mirrorlist.txt

Leave a Reply to Ritalinux Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.