Last week I had to make some adjustments to a legacy PHP project that runs on PHP 5.3 and is hosted on a CentOs 6.10-based server. After trying to simply install a package required to build an extension for PHP 5.3, I noticed the following error on the output:
http://asi-fs-n.contabo.net/centos/6/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found" Trying other mirror. To address this issue please refer to the below knowledge base article https://access.redhat.com/articles/1320623 If above article doesn't help to resolve this issue please open a ticket with Red Hat Support. drweb | 951 B 00:00 plesk-ext-panel-migrator | 2.9 kB 00:00 YumRepo Error: All mirror URLs are not using ftp, http[s] or file. Eg. Invalid release/repo/arch combination/ http://asi-fs-n.contabo.net/centos/6/updates/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found" Trying other mirror. [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found" Trying other mirror. Failed to add groups file for repository: base - None Error: No Groups Available in any repository
This server has been not modified for at least 8 years, so it definitely needed a couple of adjustments in certain things to get the current things to work properly. One of these adjustments was to fix this error that is caused because the repository URL define in the CentOS-Base.repo file isn't updated anymore, so it needs to be changed for one that is maintained (or at least exists).
The first thing you need to do is to create a backup of the current
.repo file using the following command:
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
Then, update all of the references of
$releasever to a fixed version of CentOS, specifically 6.10 in your
CentOS-Base.repo file. You need to change as well the repo URL from mirror.centos.org to vault.centos.org, for example, an original reference like this:
Should look like this then:
You can as well just use the following default repo file with the following content using nano or vim, after modifying it, your file will look like this:
[base] name=CentOS-$releasever - Base baseurl=https://vault.centos.org/6.10/os/$basearch/ gpgcheck=1 gpgkey=https://vault.centos.org/6.10/os/$basearch//RPM-GPG-KEY-CentOS-6 #released updates [updates] name=CentOS-$releasever - Updates baseurl=https://vault.centos.org/6.10/updates/$basearch/ gpgcheck=1 gpgkey=https://vault.centos.org/6.10/updates/$basearch//RPM-GPG-KEY-CentOS-6 #additional packages that may be useful [extras] name=CentOS-$releasever - Extras baseurl=https://vault.centos.org/6.10/extras/$basearch/ gpgcheck=1 gpgkey=https://vault.centos.org/6.10/extras/$basearch//RPM-GPG-KEY-CentOS-6 #additional packages that extend functionality of existing packages [centosplus] name=CentOS-$releasever - Plus baseurl=https://vault.centos.org/6.10/centosplus/$basearch/ gpgcheck=1 gpgkey=https://vault.centos.org/6.10/centosplus/$basearch//RPM-GPG-KEY-CentOS-6 #contrib - packages by Centos Users [contrib] name=CentOS-$releasever - Contrib baseurl=https://vault.centos.org/6.10/contrib/$basearch/ gpgcheck=1 gpgkey=https://vault.centos.org/6.10/contrib/$basearch//RPM-GPG-KEY-CentOS-6
Save the changes and clean the repositories using yum clean all:
yum clean all
And update the repositories with:
After doing this I was fortunately able to install packages on the system without any other issue. You might get a 404 after trying to install or update packages for the first time, but it will work after then. I hope this helps you in case you're facing this issue as well.