I have set up a centOS 6.5 server
using VMWare Workstation 9
on a Windows 8.1
host laptop. When trying to use yum
to ins
I think another reason for this error message is if your release is no longer supported. None of the suggestions in this thread worked for me, and my internet connectivity was fine, but then I realized that I'm running Centos 5 (I know, ancient...) which reached its end-of-life on 2017 Mar 31 - right around when the yum repo error started showing up.
I faced the same problem with CentOS 5.11 and here complete solution file I ended up with :-
nano /etc/yum.repos.d/CentOS-Base.repo
`
# CentOS-Base.repo
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# http://vault.centos.org/5.11/
# http://vault.centos.org/5.11/updates/
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
[base]
name=CentOS-$releasever - Base
baseurl=http://vault.centos.org/5.11/centosplus/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=http://vault.centos.org/5.11/updates//$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
baseurl=http://vault.centos.org/5.11/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
baseurl=http://vault.centos.org/5.11/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
There are two things you can do:
One of these should fix your issue.
Also, if you didn't do this yet, go back to original /etc/yum.repos.d/CentOS-Base.repo file.
The answer from @Steve Kehlet above got me on the correct path after finding this Q&A searching for the same symptom. More generally though, the answer turns out to be any sort of filtering web proxy (frequently employed within Corp environments) can cause this when it redirects yum's "http" request. In many of these cases, vendors provide a "web proxy" of some sort (specific to each particular firewall/filtering implementation - ask your sysadmins).
The important part not mentioned in this answer so far is, you can make CentOS yum work with this proxy, by adding the following line to /etc/yum.conf
proxy=http://proxy.yoursite.whatever:port_num
This will let yum know how to work with your company's proxy, and fix the unintuitive "All mirror urls are not using..." error
[root@server1 ~]# yum update Loaded plugins: fastestmirror, refresh-packagekit, security Setting up Update Process Loading mirror speeds from cached hostfile YumRepo Error: All mirror URLs are not using ftp, http[s] or file. Eg. echo/ removing mirrorlist with no valid mirrors: /var/cache/yum/x86_64/6/base/mirrorlist.txt Error: Cannot find a valid baseurl for repo: base
If you see the above error means first you need to check the internet is working or not (ping 8.8.8.8) , if the internet is working means you can debug otherwise check your firewall and get the internet.
Be sure that you can ping vault.centos.org.
Then edit /etc/yum.repos.d/CentOS-Base.repo
Comment out mirrorlist
and uncomment baseurl
Change all
baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
to
baseurl=http://vault.centos.org/$releasever/centosplus/$basearch/
And enjoy your yum update!!! ;)