yum install fails with HTTP 403 trying to access repomd.xml
Asked Answered
C

4

11

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

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

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)...>

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...

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

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


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

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

Clumsy answered 9/9, 2015 at 14:59 Comment(2)
Do you have the proxy credentials specified for yum? That error is probably coming from the proxy if you don't.Leonidaleonidas
Is it in any of the other repo files? Does yum clean metadata && yum install git work better?Leonidaleonidas
C
5

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

  • Check the proxy configuration in /etc/yum.conf

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

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

  • Try again yum install <the_package>

Clumsy answered 30/9, 2015 at 10:2 Comment(1)
You are a God man...Cadmarr
G
8

subscription-manager refresh did the trick on a RHEL 7.9 server box.

Glycerin answered 12/2, 2021 at 13:51 Comment(0)
C
5

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

  • Check the proxy configuration in /etc/yum.conf

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

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

  • Try again yum install <the_package>

Clumsy answered 30/9, 2015 at 10:2 Comment(1)
You are a God man...Cadmarr
W
0

It is important to work out what is returning the 403 forbidden.

If you are accessing the internet via a proxy (or trying to, and it is misconfigured), it could be the proxy refusing your connection, in which case you will need to adjust the proxy config. A yum clean metadata might then be required to clear any cached settigns within yum.

If it is the actual repo server that is refusing, then (to expand on the answer from muthuh), one reason to receive a 403 ("Forbidden") error is that the server has lost its licencing entitlement (this is a thing with Red Hat, and possibly other commercial Fedora derivatives, and likely not Fedora itself)

subscription-manager refresh is the RHEL command to get the server to immediately re-validate its subscription data, and might in itself fix the issue.

I have seen the following:

# subscription-manager refresh
Unit xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx has been deleted (HTTP error code 410: Gone)

which required a full unregister/reregister cycle to fix.

Wilbert answered 19/7, 2024 at 10:25 Comment(0)
M
-1

Created VPC Endpoint and allowed access to packages, repos and amazonlinux resources.

{"Version": "03-19-2021",
"Statement": [
{"Sid": "Amazon Linux AMI Repository Access",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": [ "arn:aws:s3:::packages.*.amazonaws.com/*", "arn:aws:s3:::repo.*.amazonaws.com/*", "arn:aws:s3:::amazonlinux.*.amazonaws.com/*" ]
}]}

Refer to https://blog.saieva.com/category/aws/

Machzor answered 19/3, 2021 at 21:5 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.