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

In this article I will show how to fix CentOS 6 error: YumRepo Error: All mirror URLs are not using ftp, http[s]


When trying update CentOS 6 with yum update command getting error:

Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Update Process
Determining fastest mirrors
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
Eg. Invalid release/repo/arch combination/
removing mirrorlist with no valid mirrors: /var/cache/yum/x86_64/6/base/mirrorlist.txt
Error: Cannot find a valid baseurl for repo: base


CentOS 6 reached end of life on the 30th November 2020. YUM attempting connect to deprecated repositories. So, we need update deprecated repositories URL’s and point to the vault.


To fix this problem you edit /etc/yum.repos.d/CentOS-Base.repo and replace all mirrorlist

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

4. Replace mirrorlist‘s

Replace sections:


With following:

name=CentOS-$releasever - Base
# mirrorlist=$releasever&arch=$basearch&repo=os&infra=$infra
# baseurl=$releasever/os/$basearch/

# released updates
name=CentOS-$releasever - Updates
# mirrorlist=$releasever&arch=$basearch&repo=updates&infra=$infra
# baseurl=$releasever/updates/$basearch/

# additional packages that may be useful
name=CentOS-$releasever - Extras
# mirrorlist=$releasever&arch=$basearch&repo=extras&infra=$infra
# baseurl=$releasever/extras/$basearch/

5. Clean yum cache

# yum clean all

6. Run again yum update command:

# yum update

Now you can successfully update your CentOS 6.

Discuss article in ArsTech Forum


If you like what you are reading, please:

Buy me a coffeeBuy me a coffee


Notable Replies

  1. Avatar for DeRoo DeRoo says:

    I know this a old, but I really like CentOS 6.8
    I tried everything that was in the article and I get the same results.
    Probably because when I opened CentOS-Base.repo, it was already what you said to change it to.
    Is there any hope?


Continue the discussion at