How to Fix YumRepo Error: All mirror URLs are not using ftp, http[s] or file.

11560
Share:
how-to-fix-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]

Background

I'm still using CentOS 6 in some of my VPSes. I just don't have the time to do either migrate or update them. When I'm trying to update some of my packages, the yum package manager respond with this error:

Loaded plugins: fastestmirror
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 EOL


It seems that some URLs in my repository configuration aren't valid anymore. After a quick googling, I figured out that I need to replace the URL with vault.centos.org.

$ cd /etc/yum.repos.d/

To update our repository configuration with new URL, first we need to backup your current repository configuration file.

$ sudo cp CentOS-Base.repo CentOS-Base.repo.backup

Then, edit your repository configuration file using your favorite text editor. I'm using vi in this example:

$ sudo vi CentOS-Base.repo

Basically we need to change from this value:

#baseurl=http://mirror.centos.org/centos/$releasever

To this value:

baseurl=https://vault.centos.org/6.10

Thankfully, we can do this easily using vi:

:%s/#baseurl=http:\/\/mirror.centos.org\/centos\/$releasever/baseurl=https:\/\/vault.centos.org\/6.10/g

Save the file with:

:wq

And then re-run yum update process:

$ sudo yum update
Loaded plugins: fastestmirror
Setting up Update Process
Determining fastest mirrors
base | 3.7 kB 00:00
epel | 4.7 kB 00:00
epel/primary_db | 6.1 MB 00:00
extras | 3.4 kB 00:00
mariadb | 2.9 kB 00:00
remi-php73 | 3.0 kB 00:00
remi-php73/primary_db | 202 kB 00:00
remi-safe | 3.0 kB 00:00
remi-safe/primary_db | 1.2 MB 00:00
updates | 3.4 kB 00:00
updates/primary_db | 12 MB 00:08
No Packages marked for Update

Note

Although this method could help mitigate the issue, it's still recommended to upgrade your CentOS version.

Final Words

I hope that you now know how to fix yum error: Cannot find a valid baseurl for repo: base. If you run into any issues or have any feedback feel free to drop a comment below.

Tags Linux
Share:

0 comment

Leave a reply

Your email address will not be published. Required fields are marked *