yum安装失败,HTTP 403尝试访问repomd.xml [英] yum install fails with HTTP 403 trying to access repomd.xml

查看:612
本文介绍了yum安装失败,HTTP 403尝试访问repomd.xml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在旧的Fedora 20虚拟机上安装软件包.

I'm trying to install a package on a old Fedora 20 virtual machine.

yum install <the_package_name>导致失败,并出现 HTTP 403 错误:

yum install<the_package_name> results in a failure with an HTTP 403 error:

http://download.fedoraproject.org/<...(truncated)...>/repomd.xml:
[Errno 14] HTTP Error 403 - Forbidden

我的Web浏览器在http://download.fedoraproject.org/pub/fedora/linux/updates/20上看不到任何内容,因此我意识到不再支持FC20(EOL),并且其存储库URL也已更改.因此,我将/etc/yum.repos.d/fedora.repo中的baseurl修复如下:

My web-browser can't see anything at http://download.fedoraproject.org/pub/fedora/linux/updates/20 so I realize FC20 is no more supported (EOL) and its repository URL has changed. So I fix the baseurl in /etc/yum.repos.d/fedora.repo to look like this:

baseurl=http://archives.fedoraproject.org/<...(truncated)...>

我确定URL现在正确,因为我可以使用curlwget下载repomd.xml,然后在Web浏览器中访问它...

I'm sure the URL is now correct, because I can download repomd.xml using curl or wget, and access it in my web browser...

但是yum install <the_package_name>继续失败,并显示 HTTP 403 错误!它无法通过正确的URL访问repomd.xml:

But yum install <the_package_name> continues to fail with an HTTP 403 error! It can't access repomd.xml at the correct URL:

http://archives.fedoraproject.org/<...(truncated)...>/repomd.xml:
[Errno 14] HTTP Error 403 - Forbidden

您能帮助我解决此问题并在旧的Fedora(FC 20)上安装软件包吗?

Can you help me overcome this issue and install packages on this old Fedora (FC 20)?

注意1:我正在从代理后面工作(不是我的选择).

Note 1: I'm working from behind a proxy (not my choice).

注意2:将我的Fedora 20升级到Fedora 21或22也不可行.

Note 2: Upgrading my Fedora 20 to Fedora 21 or 22 is not an option either.

  • /etc/yum.conf:删除伪线proxy=http://<wrong proxy IP address>
  • /etc/yum.repos.d/fedora.repo:更新Fedora存储库URL
  • /etc/yum.repos.d/fedora-updates.repo:更新Fedora存储库URL
  • yum clean metadata
  • /etc/yum.conf: remove spurious line proxy=http://<wrong proxy IP address>
  • /etc/yum.repos.d/fedora.repo: update the Fedora repository URL
  • /etc/yum.repos.d/fedora-updates.repo: update the Fedora repository URL
  • yum clean metadata

yum install <the_package>现在可以正常工作,谢谢!

yum install <the_package> works fine now, thanks!

推荐答案

(来自Etan Reisner的建议)可以帮助我解决问题:

Here are the suggestions (from Etan Reisner) that helped me solve the issue:

  • /etc/yum.conf

检查所有YUM .repo文件是否使用最新的Fedora存储库URL

Check all YUM .repo files are using the up-to-date Fedora repo URL

启动yum clean metadata以确保YUM使用更新的.repo文件内容

Launch yum clean metadata to ensure YUM uses the updated .repo files contents

再试一次yum install <the_package>

这篇关于yum安装失败,HTTP 403尝试访问repomd.xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆