yum安装时出现:Cannot retrieve metalink for repository: epel. Please verify its path and try again

Posted singularity

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了yum安装时出现:Cannot retrieve metalink for repository: epel. Please verify its path and try again相关的知识,希望对你有一定的参考价值。

yum安装时出现:Cannot retrieve metalink for repository: epel. Please verify its path and try again

在CentOS 6.3 x86_64下安装php-mcrypt的时候出现了问题:Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again,需要安装epel源。

解决方法: 一句话:把/etc/yum.repos.d/epel.repo,文件第3行注释去掉,把第四行注释掉。具体如下:

打开/etc/yum.repos.d/epel.repo,将

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

修改为

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

再清理源,重新安装

  1. yum clean all
  2. yum install -y 需要的包

 

如果还是不行,修改DNS,到/etc/resolv.conf下添加一下:

nameserver 8.8.8.8
search localdomain

然后重启network服务:service network restart

以上是关于yum安装时出现:Cannot retrieve metalink for repository: epel. Please verify its path and try again的主要内容,如果未能解决你的问题,请参考以下文章

yum安装时出现:Cannot retrieve metalink for repository: epel. Please verify its path and try again

yum安装时出现:Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again

yum安装时出现:Cannot retrieve metalink for repository: epel. Please verify its path and try again

centos yum安装时出现 cannot find a valid baseurl for repo: addons

解决yum安装时 Cannot retrieve repository metadata (repomd.xml) for repository

解决yum错误:Cannot retrieve repository metadata (repomd.xml) for repository