新安装的一台云服务器, 执行yum命令出现了错误, One of the configured repositories failed (Unknown), 最后是Cannot retrieve metalink for repository: epel/x86_64. Please verify its path and try again 。完整的错误信息是: 这里重点是最后一行 for repository: epel/x86_64. 说明是这个仓储出了问题。 解决办法1 删除这个仓库
1 |
rm -f mv /etc/yum.repos.d/epel.repo |
这样执行yum命令就可以正确的执行。不过少了 epel 仓库好多软件包不能用。 这里介绍 第二种解决方法 查看了
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
cat /etc/yum.repos.d/epel.repo [epel] name=Extra Packages for Enterprise Linux 7 - $basearch #baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch failovermethod=priority enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 [epel-debuginfo] name=Extra Packages for Enterprise Linux 7 - $basearch - Debug #baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch/debug mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch=$basearch failovermethod=priority enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 gpgcheck=1 [epel-source] name=Extra Packages for Enterprise Linux 7 - $basearch - Source #baseurl=http://download.fedoraproject.org/pub/epel/7/SRPMS mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-7&arch=$basearch failovermethod=priority enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 gpgcheck=1 |
然后测试了一下网络
1 2 3 4 |
[root@lampfree.com ~]# ping download.fedoraproject.org ping: download.fedoraproject.org: Name or service not known [root@lampfree.com ~]# ping mirrors.fedoraproject.org ping: mirrors.fedoraproject.org: Name or service not known |
发现网络不通,这里就需要解决网络问题。 修改dns cat /etc/resolv.conf
1 2 |
nameserver 8.8.8.8 nameserver 8.8.4.4 |
from:https://blog.csdn.net/b_o_n_z_t_f/article/details/121195667
View Details一. 问题现象
ping公网域名失败,提示Name or service not known,但可以ping通弹性公网IP。
二. 问题根因
出现该问题通常有三个原因:
/etc/resolv.conf未配置DNS地址或者DNS地址错误导致。
/etc/nsswitch.conf文件删除DNS解析记录导致。
/lib64/libnss_dns.so.2库文件丢失导致无法解析域名。