Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 install packages I get the following error:

[root@localhost ~]# yum update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
 Eg. </html>/
removing mirrorlist with no valid mirrors: /var/cache/yum/i386/6/base/mirrorlist.txt
Error: Cannot find a valid baseurl for repo: base

The VM works on other machines (Windows 7 desktop and an Windows 8.1 laptop), just not the one I need it to work on. I am able to ping the host from the guest and the guest from the host, so there is a connection to the internet.

I have uninstalled and reinstalled Workstation 9. Ungraded to workstation 10. Rebuilt the CentOS 6.5 server. Nothing seems to solve the issue.

When I upgraded from Windows 8 to Windows 8.1, I had VMWare installed. I found out later that I should have uninstalled VMWare before upgrading. Could this have messed up my VMWare network adapters?

Anyone have any ideas?

like image 709
TheJimmer Avatar asked Jan 28 '14 03:01

TheJimmer


4 Answers

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!!! ;)

like image 151
makidoo Avatar answered Nov 24 '22 20:11

makidoo


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.

like image 22
michael bietenholz Avatar answered Nov 24 '22 18:11

michael bietenholz


Centos 6 version met its EOL last month (November 30, 2020)

You can use one of the unofficial mirrors listed by centos in your /etc/yum.repos.d/CentOS-Base.repo. In my case (6.10) I used the mirror http://mirror.nsc.liu.se/centos-store/6.10/ and it worked smoothly:

[base]
name=CentOS-$releasever - Base
baseurl=http://mirror.nsc.liu.se/centos-store/6.10/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
# same for the others [updates] etc in the file
like image 22
mateuszb Avatar answered Nov 24 '22 20:11

mateuszb


for centos 5.4, you can change /etc/yum.repos.d/CentOS-Base.repo into like this.

[base]
name=CentOS-5.4 - Base
#mirrorlist=http://mirrorlist.centos.org/?release=5.4&arch=$basearch&repo=os
baseurl=http://vault.centos.org/5.4/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#released updates 
[updates]
name=CentOS-5.4 - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=5.4&arch=$basearch&repo=updates
baseurl=http://vault.centos.org/5.4/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#packages used/produced in the build but not released
[addons]
name=CentOS-5.4 - Addons
#mirrorlist=http://mirrorlist.centos.org/?release=5.4&arch=$basearch&repo=addons
baseurl=http://vault.centos.org/5.4/addons/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#additional packages that may be useful
[extras]
name=CentOS-5.4 - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=5.4&arch=$basearch&repo=extras
baseurl=http://vault.centos.org/5.4/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-5.4 - Plus
#mirrorlist=http://mirrorlist.centos.org/?release=5.4&arch=$basearch&repo=centosplus
baseurl=http://vault.centos.org/5.4/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-5.4 - Contrib
#mirrorlist=http://mirrorlist.centos.org/?release=5.4&arch=$basearch&repo=contrib
baseurl=http://vault.centos.org/5.4/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
like image 35
lisency Avatar answered Nov 24 '22 18:11

lisency