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

解决方案 :

cd /etc/yum.repos.d/epel.repo
把baseurl那一行取消注释
把mirrorlist那一行加上注释

打开/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 需要的包

完结

比如我是卡在了yum install -y python-pip,接下来再yum下载的时候就成功了。

你可能感兴趣的:(centos,yum)