解决centos6 Error: Cannot retrieve metalink for repository

  • 2019 年 10 月 5 日
  • 筆記

在安装webmin面板的时候到最后出现了安装错误的提示.然后更新源时发现 Vim

Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again

主要是源文件有点问题,解决方案如下

解决方案

首先编辑文件 Vim

vim /etc/yum.repos.d/epel.repo 将

[epel] name=Extra Packages for Enterprise Linux 6 – $basearch #baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch 修改为

[epel] name=Extra Packages for Enterprise Linux 6 – $basearch baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch #mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch 最后在清理一下源

yum clean all

另类解决方案

有些时候服务器默认的DNS服务器为:127.0.0.1,我们更新一下DNS服务即可解决相关的问题.

直接修改

vi /etc/resolv.conf

列如我修改为GOOGLE DNS

nameserver 8.8.4.4 nameserver 8.8.8.8

如果还是出现问题,最高重启一下网络

/etc/init.d/networking restart

Exit mobile version