[SOLVED] yum cannot find a baseurl

General support questions
Post Reply
intermediatelinux
Posts: 56
Joined: 2014/01/25 09:32:09

[SOLVED] yum cannot find a baseurl

Post by intermediatelinux » 2019/02/11 11:25:29

I was initially going to put this onto an Ansible group, as I first noticed the issue when manually running an Ansible playbook. But I checked and this is indeed CentOS, as the issue appears on the host on question.

When I run yum check-update on one of my hosts, it displays the error:

Code: Select all

[darren@dhost ~]$ sudo yum check-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/x86_64/6/base/mirrorlist.txt
Error: Cannot find a valid baseurl for repo: base
My /etc/yum.repos.d/CentOS-Base.repo looks like this:

Code: Select all

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

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

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
I checked google and of course, there are a lot of suggestions. I tried to uncomment baseurl and comment out mirror. I did this, and it didn’t fix the issue.

This would be frustrating enough, if it were not for the fact that there are six other VMs sitting on that ESXi host, and they have what I believe are identical yum repos. They all point to the same DNS server, and they can all ping mirror.centos.org.

EDIT: I just took a 'working' /etc/yum.repos.d/CentOS-Base.repo from my database server, backed up the 'faulty' one and placed the working file onto the host in question. Same error.

I should also add that the server which is having these problems is the DNS server itself, so whilst the other boxes point to it, it points to itself.

Code: Select all

[~] darren@database1% (175) grep nameserver /etc/resolv.conf
nameserver 192.168.1.19
nameserver 192.168.1.15
nameserver 192.168.1.254
nameserver 8.8.8.8
But ..

Code: Select all

[~] darren@dns1% (175) grep nameserver /etc/resolv.conf
nameserver 127.0.0.1
nameserver 192.168.1.15
nameserver 192.168.1.254
But I don't think that this is related to name resolution, as every box can ping any host I choose - inside or outside our LAN.

Anyone care to offer a suggestion?
Last edited by intermediatelinux on 2019/02/11 14:08:59, edited 1 time in total.

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: yum cannot find a baseurl

Post by TrevorH » 2019/02/11 13:58:27

I suspect you have a web proxy sitting between you and the internet and it's sending you something other than what yum is ecpecting. What do you get if you run curl "http://mirrorlist.centos.org/?release=6 ... =os&infra="
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

intermediatelinux
Posts: 56
Joined: 2014/01/25 09:32:09

Re: yum cannot find a baseurl

Post by intermediatelinux » 2019/02/11 14:05:20

TrevorH wrote:
2019/02/11 13:58:27
I suspect you have a web proxy sitting between you and the internet and it's sending you something other than what yum is ecpecting. What do you get if you run curl "http://mirrorlist.centos.org/?release=6 ... =os&infra="

Code: Select all

[darren@host ~]$ curl "http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os&infra="
<html><head><title>302 Document moved</title></head><body><h1>302 Document moved</h1>This document has moved <a href="http://fritz.box/tools/kids_not_allowed.lua?account=landevice
There is indeed a proxy in the shape of apache on the web server. But the DNS box does not use it. And its configuration is identical to (to take but a couple of examples) the mail server, the slave DNS server, the prod database, the staging database .. and they all run yum without a problem.

intermediatelinux
Posts: 56
Joined: 2014/01/25 09:32:09

Re: yum cannot find a baseurl

Post by intermediatelinux » 2019/02/11 14:06:14

Oh, hang on ... 'kids not allowed'?

I wonder ....

intermediatelinux
Posts: 56
Joined: 2014/01/25 09:32:09

[solved] Re: yum cannot find a baseurl

Post by intermediatelinux » 2019/02/11 14:08:09

You're a genius, man. It was my modem - Internet access to/from that box was 'blocked' as I thought 'meh .. internal DNS? Why would that want external access??'

Thanks for the help.

Post Reply