Cannot retrieve metalink for repository

Purpose

In our base CentOS 6.3 image it uses a few endpoints in the EPEL repos that are set by default that use SSL 3.0. Due to this you will receive the error noted below when attempting to use yum update from the instance. This article will show you how to remedy that while we work on deploying an updated CentOS 6.x image.

Loaded plugins: fastestmirror, security
Determining fastest mirrors
Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again

Notes

We will update this knowledge base article once we have an updated and fixed CentOS 6.x image.

The CentOS 5.8 and CentOS 7 images available to use don't have this issue.

Walkthrough Steps

Running this command will update the repo to use HTTP rather than HTTPS:

sudo sed -i "s/mirrorlist=https/mirrorlist=http/" /etc/yum.repos.d/epel.repo

You should then be able to update with this command:

yum -y update



Fix connection failure errors

Symptom: You get "network is unreachable" or "couldn't connect to host" errors while runningyum command.
Loaded plugins: fastestmirror, presto
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist
http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was
14: PYCURL ERROR 7 - "Failed to connect to
2a02:2498:1:3d:5054:ff:fed3:e91a: Network is unreachable"
Error: Cannot find a valid baseurl for repo: base

记得查看代理:

$ sudo vi /etc/yum.conf
[main]
proxy=http://xxxx.com:8080

转自:hpcloud

你可能感兴趣的:(linux,centos,Repo,mirrorlist,metalink)