rhel6.2导入epel源,yum就报错的解决

rhel6.2导入epel源,yum就报错的解决

操作系统:rhel6.2 64位

[root@localhost ~]# yum repolist #确定本地yum源正常

Loaded plugins: product-id, security, subscription-manager

Updating certificate-based repositories.

repo id                                         repo name                                                                status

rhel62                                          Red Hat Enterprise Linux 6.2 x64                                         3,596

repolist: 3,596


[root@localhost ~]# rpm -Uvh http://mirrors.hustunique.com/epel/6/x86_64/epel-release-6-8.noarch.rpm  #导入epel源

[root@localhost yum.repos.d]# ls

epel.repo  epel-testing.repo  redhat.repo  rhel-source.repo

[root@localhost yum.repos.d]# yum install -y  ansible

Loaded plugins: product-id, security, subscription-manager

Updating certificate-based repositories.

Error: Cannot retrieve repository metadata (repomd.xml) for repository: epel. Please verify its path and try again

[root@localhost yum.repos.d]# yum repolist

Loaded plugins: product-id, security, subscription-manager

Updating certificate-based repositories.

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

以上错误分析可以得出是epel源配置文件epel.repo中PATH一定是有问题的

解决方法:打开baseurl,关闭mirrorlist

[root@localhost yum.repos.d]# yum repolist  #这下可以确定这样修改是正确的
Loaded plugins: product-id, security, subscription-manager
Updating certificate-based repositories.
epel                                                                                                    | 4.4 kB     00:00     
repo id                                  repo name                                                                       status
epel                                     Extra Packages for Enterprise Linux 6 - x86_64                                  11,124
rhel62                                   Red Hat Enterprise Linux 6.2 x64                                                 3,596
repolist: 14,720

附epel.repo配置文件

[root@localhost yum.repos.d]# more 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
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
[epel-debuginfo]
name=Extra Packages for Enterprise Linux 6 - $basearch - Debug
baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch/debug
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1
[epel-source]
name=Extra Packages for Enterprise Linux 6 - $basearch - Source
baseurl=http://download.fedoraproject.org/pub/epel/6/SRPMS
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1


你可能感兴趣的:(报错,yum,EPEL)