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

Have been getting below error on one of the Centos 5 VM

where yum is not working and giving below error

yum update kernel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
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/base/mirrorlist.txt
Error: Cannot find a valid baseurl for repo: base

uname -a
Linux vps.spring.com 2.6.32-042stab120.11 #1 SMP Wed Nov 16 12:05:45 MSK 2016 i686 i686 i386 GNU/Linux


root@vps [/]# cat /etc/redhat-release
CentOS release 5.11 (Final)

go to

cd /etc/yum.repos.d/

mv CentOS-Base.repo CentOS-Base.repo=bkp

vi CentOS-Base.repo

add below entries

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

yum clean all

yum update

This has resolved the issue associated with yum on Centos 5