In this article I will show how to fix CentOS 6 error: YumRepo Error: All mirror URLs are not using ftp, http[s]
Problem
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

Cause
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.
Resolution
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:
[base] [updates] [extras]
With following:
[base] name=CentOS-$releasever - Base # mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra # baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/ baseurl=https://vault.centos.org/6.10/os/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 # released updates [updates] name=CentOS-$releasever - Updates # mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra # baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/ baseurl=https://vault.centos.org/6.10/updates/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 # additional packages that may be useful [extras] name=CentOS-$releasever - Extras # mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra # baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/ baseurl=https://vault.centos.org/6.10/extras/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
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

Thanks for this, worked well.
Thank you!
Thanks!
Thank you!
Thank you!!1
Obrigado !
Thanks!
Muchas gracias!!
tnx!
Terima Kasih!
tnx
Ty! I rlly appreciate that
thank you too!
Thanks you bro
thank you
Obrigado!!!
thank you
Thank you very much
thank you too
Thank you very much!!!
Thank you too, Vladislav!
what do i have to replace in particular ? please point it out for me.
Other then you didn’t scold me for still using CentOS 6.
It worked great!!!!!
Thank you.
THis is the only place I got right solution! Thank you very much
Thank you!
It’s working, Thanks
Thanks so much!
thank you
Thanks. But one moment. If you still getting errors -> check other files in folder /etc/yum.repos.d/ and fix them same way.
Thank you!
doesn’t work for me still same problem, after changes above 😐
Same here. Will appreciate greatly any further suggestions…
thanks a lot, this worked perfectly.
thanks!
Grazie!!!!!!!
The same problem still appears when I try the yum update command…
Thanks, still works in Apr 2021
excellent
Soy nuevo en estos sistemas, pero queria preguntarte, que presionas justo despues de terminar de introducir {base},{updates},{extras}, para seguir con el clear
In my case, I needed to update two other files as well (check all files where it marks enables=1):
# cp CentOS-SCLo-scl.repo CentOS-SCLo-scl.repo.old
[centos-sclo-sclo]
name=CentOS-6 – SCLo sclo
# baseurl=http://mirror.centos.org/centos/6/sclo/$basearch/sclo/
baseurl=https://vault.centos.org/centos/6.10/sclo/$basearch/sclo/
mirrorlist=http://mirrorlist.centos.org?arch=$basearch&release=6&repo=sclo-sclo
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo
# cp CentOS-SCLo-scl-rh.repo CentOS-SCLo-scl-rh.repo.old
[centos-sclo-rh]
name=CentOS-6 – SCLo rh
#baseurl=http://mirror.centos.org/centos/6/sclo/$basearch/rh/
baseurl=https://vault.centos.org/centos/6.10/sclo/$basearch/rh/
mirrorlist=http://mirrorlist.centos.org?arch=$basearch&release=6&repo=sclo-rh
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo
Thank you!
This worked to me too… And I have to remove the ius*.repo* too to working, because I get the following error.
Could not resolve host: mirrors.iuscommunity.org
Thanks a lot for this article. It’s worked for me.
thank you!
Muchas gracias! me ayudo.
Thanks. I have been trying to solve this issue for a long time now.
Thanks for this, worked well.
Centos 6
Hey, I wasn’t able to make a copy of th centos repo, it says permission denied, what can I do
You need to be root user for it.Type whoami in terminal where you get root user name and type that command prefix to it.
Eg: sudocp CentOS-Base.repo CentOS-Base.repo.old
Thank you very much, you are the better!!!
thank you
Thanks !! its worked well
thank you!
FUNCIONANDO!!
Sweet!!!!
I LOVE YOU I NEEDED THIS SO DESPERATELY FOR A HOMEWORK ASSIGNMENT DEAR GOD BLESS YOU AND YOUR FAMILY :,)
THANK YOU
THANK YOU
THANK YOUUUUUUU
thank you too
Thank you
Thank You !
[root@quickstart /]# sudo yum update
Loaded plugins: fastestmirror, security
Setting up Update Process
Loading mirror speeds from cached hostfile
Error: Cannot find a valid baseurl for repo: base
Gracias, funcionó!!
Thanks a million. It worked well. So grateful.
thank you too!
As of writing, the *-Vault repo file would almost do the trick, but it leaves out 6.10 (reasonable because it wasn’t yet Vault at the time). You might could update the Vault repos instead.
(update the Vault .repo file, that is :D)
https://forum.arstech.net/t/how-to-fix-centos-6-error-yumrepo-error-all-mirror-urls-are-not-using-ftp-http-s-or-file/22
That just sends me to a page that links me back to this page,
[root@localhost yum.repos.d]# yum update
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Update Process
Repository updates is listed more than once in the configuration
Determining fastest mirrors
base | 3.7 kB 00:00
base/primary_db | 4.7 MB 00:03
https://ookla.bintray.com/rhel/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 – “The requested URL returned error: 403 Forbidden”
Trying other mirror.
To address this issue please refer to the below wiki article
https://wiki.centos.org/yum-errors
If above article doesn’t help to resolve this issue please use https://bugs.centos.org/.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: bintray–ookla-rhel. Please verify its path and try again
[root@localhost yum.repos.d]#