我们已经准备好了,你呢?

我们与您携手共赢,为您的企业形象保驾护航!

当前位置: 首页 > 问答 > 记录解决yum报错:Cannot retrieve metalink for repository: epel/x86_64

在使用Linux系统的VPS、服务器过程当中,有时我们可能会遇到使用yum命名时出现“Cannot retrieve metalink for repository: epel/x86_64. Please verify its path and try again”错误,详细错误信息如下,那么如何解决“Cannot retrieve metalink for repository: epel/x86_64. ”错误呢?

Oneoftheconfiguredrepositoriesfailed(未知),andyumdoesn'thaveenoughcacheddatatocontinue.Atthispointtheonlysafethingyumcandoisfail.Thereareafewwaystowork"fix"this:1.Contacttheupstreamfortherepositoryandgetthemtofixtheproblem.2.Reconfigurethebaseurl/etc.fortherepository,topointtoaworkingupstream.Thisismostoftenusefulifyouareusinganewerdistributionreleasethanissupportedbytherepository(andthepackagesforthepreviousdistributionreleasestillwork).3.Disabletherepository,soyumwon'tuseitbydefault.Yumwillthenjustignoretherepositoryuntilyoupermanentlyenableitagainoruse--enablerepofortemporaryusage:yum-config-manager--disable4.Configurethefailingrepositorytobeskipped,ifitisunavailable.Notethatyumwilltrytocontacttherepo.whenitrunsmostcommands,sowillhavetotryandfaileachtime(andthus.yumwillbebemuchslower).Ifitisaverytemporaryproblemthough,thisisoftenanicecompromise:yum-config-manager--save--setopt=.skip_if_unavailable=trueCannotretrievemetalinkforrepository:epel/x86_64.Pleaseverifyitspathandtryagain

解决方法可以试试修改“/etc/yum.repos.d”文件夹中的“epel.repo”文件。修改内容如下:

如果你系统“epel.repo”文件当中原内容如下,

[epel]name=ExtraPackagesforEnterpriseLinux7-$basearch#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearchmetalink=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearchfailovermethod=priorityenabled=1gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

我们只需要把“metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch”前面加“#”号注释掉,并且把“#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch”取消注释!修改如下即可,一般这个问题就能得到解决了。

[epel]name=ExtraPackagesforEnterpriseLinux7-$basearchbaseurl=http://download.fedoraproject.org/pub/epel/7/$basearch#metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearchfailovermethod=priorityenabled=1gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

免责声明:本站内容(文字信息+图片素材)来源于互联网公开数据整理或转载,仅用于学习参考,如有侵权问题,请及时联系本站删除,我们将在5个工作日内处理。联系邮箱:chuangshanghai#qq.com(把#换成@)

我们已经准备好了,你呢?

我们与您携手共赢,为您的企业形象保驾护航!

在线客服
联系方式

热线电话

132-7207-3477

上班时间

周一到周五 09:00-18:00

二维码
线