Skip to content
Latchkey

apt "Temporary failure resolving" a mirror in CI

apt tried to resolve a package mirror hostname and DNS did not answer, so it reports a temporary failure resolving that host. The mirror may be fine; name resolution inside the container or runner failed at that moment.

What this error means

apt-get update or install fails with "Err: ... Temporary failure resolving 'archive.ubuntu.com'" and "Some index files failed to download".

Terminal
Err:1 http://archive.ubuntu.com/ubuntu jammy InRelease
  Temporary failure resolving 'archive.ubuntu.com'
E: Some index files failed to download. They have been ignored,
   or old ones used instead.

Common causes

DNS is unreachable from the container

The container has no working resolver or the resolver timed out, so apt cannot turn the mirror name into an IP.

Egress or proxy config blocks the mirror

If apt must go through a proxy that is unset, resolution or connection to the public mirror fails.

How to fix it

Fix resolution and retry

  1. Check /etc/resolv.conf inside the container has a reachable nameserver.
  2. Verify the mirror resolves with getent hosts.
  3. Re-run apt-get update once DNS answers.
Terminal
getent hosts archive.ubuntu.com || cat /etc/resolv.conf
apt-get update

Point apt at the proxy when egress requires it

If the network requires a proxy, configure apt to use it so it can reach the mirror.

/etc/apt/apt.conf.d/95proxy
Acquire::http::Proxy "http://proxy.corp.example:8080";
Acquire::https::Proxy "http://proxy.corp.example:8080";

How to prevent it

  • Give job containers a reliable resolver rather than an empty resolv.conf.
  • Configure apt proxy settings when the runner network requires egress via a proxy.
  • Use an internal mirror reachable from the runner network when possible.

Frequently asked questions

What causes ""Temporary failure resolving""?
The container has no working resolver or the resolver timed out, so apt cannot turn the mirror name into an IP.
How do I fix "Temporary failure resolving"?
Fix resolution and retry

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card