Score:0

403 forbidden on individual Apt packages

jp flag

I am trying to create a Docker container based on Ubuntu 22.04. When I apt-get install packages, I get a weird error: several dozen, sometimes a few hundred, packages succeed without issue, then one individual package will fail with a 403 forbidden error.

This issue is intermittent. When one package fails, it will consistently continue to fail when I retry the Docker build. But once I clear the Docker build cache, or try again the next day, a different package will be the problem.

Occasionally, there are no problems, and the entire build succeeds.

Causes I have ruled out:

  • Bad repository: the problematic package is always from the same Apt repository as all of the other packages which just succeeded seconds earlier
  • Firewall issue: when I curl the URL that gave the 403 error, either outside of the container or in a fresh ubuntu:22.04 container, it works just fine
  • DNS: Many other packages from the same URL installed just fine during the same install command

I have also tried switching from archive.ubuntu.com to us.archive.ubuntu.com, which did not solve the issue. I am currently trying to use mirror://mirrors.ubuntu.com/mirrors.txt, but this results in installs that are several orders of magnitude slower.

I have found several other questions where the 403 error is consistent across all packages or repositories, due to firewall or DNS issues. This is a different issues, because I will have packages install successfully from the same repository moments before the failure.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.