从 centosplus 存储库安装 postfix “无法解析主机:mirrors.linode.com;未知错误”

从 centosplus 存储库安装 postfix “无法解析主机:mirrors.linode.com;未知错误”

我正在关注一个教程安装具有 MariaDB 支持的 Postfix。由于默认/etc/yum.repos.d/CentOS-Base.repo存储库不支持带有 MariaDB 的 Postfix,因此我使用exclude=postfixenabled=1行修改了该文件

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

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

#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://mirrors.linode.com/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://mirrors.linode.com/centos/$releasever/centosplus/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1

我运行yum --enablerepo=centosplus install postfix,但出现错误:

Loaded plugins: fastestmirror
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"
http://mirrors.linode.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.linode.com; Unknown error"
Trying other mirror.
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=centosplus&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"
    http://mirrors.linode.com/centos/7/centosplus/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.linode.com; Unknown error"
    Trying other mirror.


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

知道我能做些什么来解决这个问题吗?

答案1

“无法解析主机:mirrors.linode.com;未知错误”

/etc/resolv.conf通过添加以下行来编辑您的:

nameserver 8.8.8.8 nameserver 8.8.4.4 nameserver 127.0.0.1

在您的顶部添加 Google DNS 名称服务器resolv.conf将提供 yum有效的 DNS 服务器来解析 IP 地址和主机

相关内容