Page 1 of 1

Yum Update - Could not retrieve mirrorlist error 14. With working DNS...?

Posted: 2019/04/19 18:50:46
by vimba
Hypervisor: Virtual Box
Hypervisor Version: 5.2.22r126460 (Qt5.6.2)
Centos installation: CentOS-7-x86_64-Minimal-1810
Centos version: CentOS Linux release 7.6.1810 (core)

Code: Select all

[root@centos ~]# hostnamectl
   Static hostname: centos.localhost
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 205a932fb8c744ccb46f07f2f344c15e
           Boot ID: 87713adb17774f558897935c00619583
    Virtualization: kvm
  Operating System: CentOS Linux 7 (Core)
       CPE OS Name: cpe:/o:centos:centos:7
            Kernel: Linux 3.10.0-957.el7.x86_64
      Architecture: x86-64

VIDEO WALKTRHOUGH OF PROBLEM:
https://www.youtube.com/watch?v=iwz4vfA ... e=youtu.be

Problem:
Unable to update yum package manager with working DNS?

Code: Select all

[root@centos ~]# yum -v update
Loading "fastestmirror" plugin
Config time: 0.011
Yum version: 3.4.3
rpmdb time: 0.000
Updating Everything
Building updates object
Setting up Package Sacks
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=extras&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7.6.1810releasever&arch=x86_64basearch&repo=updates&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"
http://mirror.centos.org/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirror.centos.org; Unknown error"
Trying other mirror.


 One of the configured repositories failed (CentOS-7 - Base),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Run the command with the repository temporarily disabled
            yum --disablerepo=base ...

     4. Disable the repository permanently, so yum won't use it by default. Yum
        will then just ignore the repository until you permanently enable it
        again or use --enablerepo for temporary usage:

            yum-config-manager --disable base
        or
            subscription-manager repos --disable=base

     5. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=base.skip_if_unavailable=true

failure: repodata/repomd.xml from base: [Errno 256] No more mirrors to try.
http://mirror.centos.org/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirror.centos.org; Unknown error"

ping works?

Code: Select all

[root@centos ~]# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=119 time=53.1 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=119 time=49.0 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=119 time=47.7 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=119 time=47.0 ms
64 bytes from 8.8.8.8: icmp_seq=5 ttl=119 time=44.9 ms
64 bytes from 8.8.8.8: icmp_seq=6 ttl=119 time=40.1 ms
^C
--- 8.8.8.8 ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 5173ms
rtt min/avg/max/mdev = 40.146/47.004/53.126/3.945 ms

Code: Select all

[root@centos ~]# ping google.com
PING google.com (172.217.21.142) 56(84) bytes of data.
64 bytes from arn11s02-in-f14.1e100.net (172.217.21.142): icmp_seq=1 ttl=52 time=44.3 ms
64 bytes from arn11s02-in-f14.1e100.net (172.217.21.142): icmp_seq=2 ttl=52 time=42.3 ms
64 bytes from arn11s02-in-f14.1e100.net (172.217.21.142): icmp_seq=3 ttl=52 time=35.0 ms
64 bytes from arn11s02-in-f14.1e100.net (172.217.21.142): icmp_seq=4 ttl=52 time=53.4 ms
^C
--- google.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 35.056/43.808/53.488/6.576 ms

System has DNS?

Code: Select all

cat /etc/resolv.conf
# Generated by NetworkManager
search localhost
nameserver 8.8.8.8
ip info, set statically with nmtui:

Code: Select all

root@centos ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 08:00:27:73:5f:30 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.10/24 brd 192.168.1.255 scope global noprefixroute enp0s3
       valid_lft forever preferred_lft forever
    inet6 fe80::a00:27ff:fe73:5f30/64 scope link
       valid_lft forever preferred_lft forever

repolist:

Code: Select all


# 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
# unless you are manually picking other mirrors.
#
# 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
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-7

#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-7

#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-7

#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-7


any ideas??


--- log ---
201904192318: Added repolist to post

Re: Yum Update - Could not retrieve mirrorlist error 14. With working DNS...?

Posted: 2019/04/19 19:43:32
by avij
What do you get if you run

Code: Select all

curl -v "http://mirrorlist.centos.org/?repo=os&arch=x86_64&release=7"
(note the quotes, they're needed)?

Re: Yum Update - Could not retrieve mirrorlist error 14. With working DNS...?

Posted: 2019/04/19 20:05:52
by vimba
Hello Avij

thank you

here is the output

Code: Select all

[root@centos ~]# curl -v "http://mirrorlist.centos.org/?repo=os&arch=x86_64&release=7"
* Could not resolve host: mirrorlist.centos.org; Unknown error
* Closing connection 0
curl: (6) Could not resolve host: mirrorlist.centos.org; Unknown error
[root@centos ~]#
[root@centos ~]#
[root@centos ~]#
[root@centos ~]# curl -v http://mirrorlist.centos.org/?repo=os&arch=x86_64&release=7
[1] 4209
[2] 4210
[root@centos ~]#
[2]+  Done                    arch=x86_64
[root@centos ~]#
[root@centos ~]#
[root@centos ~]# * Could not resolve host: mirrorlist.centos.org; Unknown error
* Closing connection 0
curl: (6) Could not resolve host: mirrorlist.centos.org; Unknown error

[1]+  Exit 6                  curl -v http://mirrorlist.centos.org/?repo=os
[root@centos ~]#
[root@centos ~]#
[root@centos ~]#

video of executing the commands:
https://www.youtube.com/watch?v=JSfO97S ... e=youtu.be

201904192317 edit:
here is the nsswitch conf

Code: Select all

more /etc/nsswitch.conf
#
# /etc/nsswitch.conf
#
# An example Name Service Switch config file. This file should be
# sorted with the most-used services at the beginning.
#
# The entry '[NOTFOUND=return]' means that the search for an
# entry should stop if the search in the previous entry turned
# up nothing. Note that if the search failed due to some other reason
# (like no NIS server responding) then the search continues with the
# next entry.
#
# Valid entries include:
#
#       nisplus                 Use NIS+ (NIS version 3)
#       nis                     Use NIS (NIS version 2), also called YP
#       dns                     Use DNS (Domain Name Service)
#       files                   Use the local files
#       db                      Use the local database (.db) files
#       compat                  Use NIS on compat mode
#       hesiod                  Use Hesiod for user lookups
#       [NOTFOUND=return]       Stop searching if not found so far
#

# To use db, put the "db" in front of "files" for entries you want to be
# looked up first in the databases
#
# Example:
#passwd:    db files nisplus nis
#shadow:    db files nisplus nis
#group:     db files nisplus nis

passwd:     files sss
shadow:     files sss
group:      files sss
#initgroups: files sss

#hosts:     db files nisplus nis dns
hosts:      files dns myhostname

# Example - obey only what nisplus tells us...
#services:   nisplus [NOTFOUND=return] files
#networks:   nisplus [NOTFOUND=return] files
#protocols:  nisplus [NOTFOUND=return] files
#rpc:        nisplus [NOTFOUND=return] files
#ethers:     nisplus [NOTFOUND=return] files
#netmasks:   nisplus [NOTFOUND=return] files

bootparams: nisplus [NOTFOUND=return] files

ethers:     files
netmasks:   files
networks:   files
protocols:  files
rpc:        files
services:   files sss

netgroup:   nisplus sss

publickey:  nisplus

automount:  files nisplus sss
aliases:    files nisplus


Re: Yum Update - Could not retrieve mirrorlist error 14. With working DNS...?

Posted: 2019/04/19 20:22:00
by avij
Well, that's odd. Have you done anything odd to curl, like updated it from some other source?

If you have bind-utils installed you could try running dig @8.8.8.8 mirrorlist.centos.org to verify that the DNS server indeed works. Pinging the DNS server might not be a sufficient test.

You could also try some other public DNS server like 1.1.1.1.

Re: Yum Update - Could not retrieve mirrorlist error 14. With working DNS...?

Posted: 2019/04/19 20:26:24
by vimba
Hello

everything should be defaults
i installed "CentOS-7-x86_64-Minimal-1810"

edit2 201904200601:

About CURL

Looks to be a certificate error?
https://stackoverflow.com/questions/311 ... -encryptio

related bug mentioned iby AMB in stackoverflow:
"There is a bug report that Redhat/CentOS overrides the curl settings and disables ECC ciphers by default."
bug: https://bugzilla.redhat.com/show_bug.cgi?id=1185708


Solution: CURL needs to be updated to a newer version, need to build rpm package manually with all dependencies and upgrade curl...

relationship to yum dns problem: after upgrading curl, will yum automtaically fix itself?? right now yum does not understand HTTPS so its likely that it will resolve after updating the related dependencies to CURL.





edit 201904192234:


maybe its a port issue..?? or its an issue with incorrect base urls..?

repolist:

Code: Select all


# 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
# unless you are manually picking other mirrors.
#
# 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
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-7

#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-7

#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-7

#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-7



Code: Select all

more /etc/resolv.conf
# Generated manually 201904192229
# search localhost
nameserver 1.1.1.1

Code: Select all


[root@centos ~]# yum -v clean all
Loading "fastestmirror" plugin
Config time: 0.012
Yum version: 3.4.3
Cleaning repos: base extras updates
Operating on /var/cache/yum/x86_64/7 (see CLEAN OPTIONS in yum(8) for details)
Cleaning up list of fastest mirrors
Disk usage of /var/cache/yum/*/* after cleanup:
0      enabled repos
0      disabled repos
0      untracked repos
0      other data
0      total
[root@centos ~]#
[root@centos ~]# yum -v repolist
Loading "fastestmirror" plugin
Config time: 0.011
Yum version: 3.4.3
Determining fastest mirrors
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=extras&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"
^C^C

Exiting on user cancel
[root@centos ~]#
[root@centos ~]#
[root@centos ~]#
[root@centos ~]# yum -v update
Loading "fastestmirror" plugin
Config time: 0.011
Yum version: 3.4.3
rpmdb time: 0.000
Updating Everything
Building updates object
Setting up Package Sacks
Loading mirror speeds from cached hostfile
^Z
[1]+  Stopped                 yum -v update
[root@centos ~]#
[root@centos ~]#
[root@centos ~]#
[root@centos ~]#
[root@centos ~]#

Code: Select all


more /etc/nsswitch.conf
#
# /etc/nsswitch.conf


#hosts:     db files nisplus nis dns
hosts:      dns files myhostname
# ^updated above: dns BEFORE files

virtualbox setup:
Image

Image

Re: Yum Update - Could not retrieve mirrorlist error 14. With working DNS...?

Posted: 2019/04/20 13:12:51
by vimba
I installed fedora server in virutalbox which has an updated version of CURL, but the problem still exists..

there is some problem with virtualbox brdige mode ?? because i can do the command on git-bash windows and it works... i give up on brdige netwrok and will try virtualbox NAT


FEDORA CODE:

Code: Select all


[root@localhost ~]# curl -v "http://mirrorlist.centos.org/?repo=os&arch=x86_64&release=7"

*   Trying 212.69.166.138...
* TCP_NODELAY set
* Connected to mirrorlist.centos.org (212.69.166.138) port 80 (#0)
> GET /?repo=os&arch=x86_64&release=7 HTTP/1.1
> Host: mirrorlist.centos.org
> User-Agent: curl/7.61.1
> Accept: */*
>
* Empty reply from server
* Connection #0 to host mirrorlist.centos.org left intact
curl: (52) Empty reply from server
[root@localhost ~]#
[root@localhost ~]# curl -v http://mirrorlist.centos.org/?repo=os&arch=x86_64&release=7
[2] 1214
[3] 1215
[3]-  Done                    arch=x86_64
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# *   Trying 85.236.43.108...
* TCP_NODELAY set
* Connected to mirrorlist.centos.org (85.236.43.108) port 80 (#0)
> GET /?repo=os HTTP/1.1
> Host: mirrorlist.centos.org
> User-Agent: curl/7.61.1
> Accept: */*
>

[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# * Empty reply from server
* Connection #0 to host mirrorlist.centos.org left intact
curl: (52) Empty reply from server

[2]-  Exit 52                 curl -v http://mirrorlist.centos.org/?repo=os
[root@localhost ~]#



Re: Yum Update - Could not retrieve mirrorlist error 14. With working DNS...?

Posted: 2019/04/20 14:00:06
by TrevorH
The analysis that curl needs to be rebuilt is completely wrong. Our shipped version of curl works perfectly thanks.

You must put quotes around the URLs you are using at the command line as they contain & characters that are treated as the end of the command and then put into the background. It's not doing what you think it is and it's not valid. What you should run and the response you get should look like:

Code: Select all

$ curl -v "http://mirrorlist.centos.org/?repo=os&arch=x86_64&release=7"
* About to connect() to mirrorlist.centos.org port 80 (#0)
*   Trying 2001:1b48:203::4:10...
* Connected to mirrorlist.centos.org (2001:1b48:203::4:10) port 80 (#0)
> GET /?repo=os&arch=x86_64&release=7 HTTP/1.1
> User-Agent: curl/7.29.0
> Host: mirrorlist.centos.org
> Accept: */*
> 
< HTTP/1.1 200 OK
< Date: Sat, 20 Apr 2019 13:58:22 GMT
< Server: PasteWSGIServer/0.5 Python/2.7.5
< X-Frame-Options: SAMEORIGIN
< X-Xss-Protection: 1; mode=block
< X-Content-Type-Options: nosniff
< Referrer-Policy: same-origin
< Content-Length: 561
< Content-Type: text/plain; charset=UTF-8
< 
http://mirror.vtti.vt.edu/centos/7.6.1810/os/x86_64/
http://mirrors.ocf.berkeley.edu/centos/7.6.1810/os/x86_64/
http://mirrors.advancedhosters.com/centos/7.6.1810/os/x86_64/
http://mirror.scalabledns.com/centos/7.6.1810/os/x86_64/
http://mirror.keystealth.org/centos/7.6.1810/os/x86_64/
http://repo1.ash.innoscale.net/centos/7.6.1810/os/x86_64/
http://mirror.facebook.net/centos/7.6.1810/os/x86_64/
http://mirror.jaleco.com/centos/7.6.1810/os/x86_64/
http://mirror.web-ster.com/centos/7.6.1810/os/x86_64/
http://mirror.fileplanet.com/centos/7.6.1810/os/x86_64/
* Connection #0 to host mirrorlist.centos.org left intact
The version of curl that we ship as part of the distro works perfectly with all the CentOS public mirrors that are available. Ther eis no need to update it to a newer version (which is also know as breaking it!).

Your Vbox adapter says it is in "Hostonly" mode. That is the wrong networking mode for anything useful as it restricts it to only accessing the host on which it's running. You are not using the bridged mode that you think you are (and need to be using).

Re: Yum Update - Could not retrieve mirrorlist error 14. With working DNS...?

Posted: 2019/04/20 14:06:59
by vimba
Hello

okay thanks. 1) I understand that NAT is a dead-end, no?

"The version of curl that we ship as part of the distro works perfectly with all the CentOS public mirrors that are available."
2) this rules out a cipher problem, correct?


"You are not using the bridged mode that you think you are (and need to be using)."
3) I dont understand, how am i supposed to change adapter?
4) I thought bridged adapter used the physical nic and not touch the "HOST ONLY" adapter? see image below...
Image

5) here is output of curl as in your code

Code: Select all

[root@centos ~]#
[root@centos ~]#
[root@centos ~]# clear
[root@centos ~]# curl -v "http://mirrorlist.centos.org/?repo=os&arch=x86_64&release=7"
* About to connect() to mirrorlist.centos.org port 80 (#0)
*   Trying 85.236.43.108...
* Connected to mirrorlist.centos.org (85.236.43.108) port 80 (#0)
> GET /?repo=os&arch=x86_64&release=7 HTTP/1.1
> User-Agent: curl/7.29.0
> Host: mirrorlist.centos.org
> Accept: */*
>
* Empty reply from server
* Connection #0 to host mirrorlist.centos.org left intact
curl: (52) Empty reply from server


any ideas??

Re: Yum Update - Could not retrieve mirrorlist error 14. With working DNS...?

Posted: 2019/04/21 16:01:24
by vimba
Hello

I updated virutal box to the latest version
Updated by uninstalling the old version and installing the new version..

yum & curl now works as expected

this might have been a driver issue


https://www.youtube.com/watch?v=ow8ZXqt ... e=youtu.be