企划网
企划行业交流平台
随时掌握最新行业资讯

记录解决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

metalink

上一篇:怎么打开电脑的蓝牙功能(电脑安装蓝牙功能的步骤)

下一篇:域名为什么无法访问香港云服务器

来源:互联网 / 发布时间:2025-11-17 22:19:06