5
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

【CentOS7】 "Could not resolve host: ~"と出力されてyum updateに失敗する

Last updated at Posted at 2019-09-08

前回投稿したRaspberry Piに続き、こちらの記事を参考に古いMacminiにCentOS7をインストールしました。
IMG_20190908_215403.jpg
OSバージョンは↓こんな感じです。

[********@nomac ~]$ cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

[********@nomac ~]$ cat /etc/centos-release
CentOS Linux release 7.6.1810 (Core)

事象

色々揃えるために、yum updateを実行したところ、以下のような結果になってしまいます。

[********@nomac ~]$ sudo yum update
[sudo] password for ********: 
:fastestmirror, langpacks
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
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; "
http://fedora.mirror.tn/pub/centos/7.6.1810/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: fedora.mirror.tn; "

http://ftp.swin.edu.au/centos/7.6.1810/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: ftp.swin.edu.au; "

http://mirroronet.pl/pub/mirrors/CentOS/7.6.1810/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirroronet.pl; "

http://centos.mirror.py/centos/7.6.1810/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: centos.mirror.py; "
・
・
・
Downloading packages:
No Presto metadata available for base

updates/7/x86_64/prestodelta   FAILED                                          

updates/7/x86_64/prestodelta                  0% [                                   ]  0.0 B/s |    0 B  --:--:-- ETA 
http://ftp.iij.ad.jp/pub/linux/centos/7.6.1810/updates/x86_64/repodata/8217eeb8593a9dc3d7d21e99e2632bf99558a9e35ec4f246b89256a9fe059c37-prestodelta.xml.gz: [Errno 14] curl#6 - "Could not resolve host: ftp.iij.ad.jp; Unknown error"

updates/7/x86_64/prestodelta   FAILED                                          

updates/7/x86_64/prestodelta                  0% [                                   ]  0.0 B/s |    0 B  --:--:-- ETA 
http://ftp-srv2.kddilabs.jp/Linux/packages/CentOS/7.6.1810/updates/x86_64/repodata/8217eeb8593a9dc3d7d21e99e2632bf99558a9e35ec4f246b89256a9fe059c37-prestodelta.xml.gz: [Errno 14] curl#6 - "Could not resolve host: ftp-srv2.kddilabs.jp; Unknown error"
・
・
・
Error downloading packages:
  sane-backends-drivers-scanners-1.0.24-12.el7.x86_64: [Errno 256] No more mirrors to try.
  gnome-user-docs-3.28.2-1.el7.noarch: [Errno 256] No more mirrors to try.
  flatpak-libs-1.0.2-5.el7_6.x86_64: [Errno 256] No more mirrors to try.
・
・
・

このあたりなどに同じ事象について書かれているのですが、解決策には至らず。。

解決策(回避策?)

以下に書かれている方法で、解決しました。

[********@nomac ~]$ vi /etc/resolv.conf
nameserver 9.9.9.9                         ←追記

↑を実行した後、sudo yum updateを再度実行
ここで言及されているように、CentOSのバグなのか?謎です。。
とりあえず無事にyumが使えるようになったので、よしとします。

5
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?