Skip to content
Latchkey

Docker Build "apt-get update" 404 / Release Moved in CI

An apt-get update inside the build hit a 404 or a "Release file moved/no longer valid". The repository metadata the base image points at changed location - a suite was renamed, an old release moved to archive, or a mirror is briefly out of sync.

What this error means

A RUN apt-get update step fails with 404 Not Found, Repository ... Release file ... is no longer valid, or E: The repository ... does not have a Release file. A later apt-get install then aborts because the index never updated.

docker
#7 1.83 Err:1 http://deb.debian.org/debian bullseye/main amd64 Packages
#7 1.83   404  Not Found
#7 1.90 E: Failed to fetch http://deb.debian.org/debian/dists/bullseye/main/...  404  Not Found

Common causes

The base image targets an old or moved release

When a Debian/Ubuntu release ages out, its packages move to an archive host; the original deb.debian.org path 404s until the sources are pointed at the archive.

A stale or out-of-sync mirror

A mirror partway through syncing can serve a Release file that no longer matches its index, producing 404s and "no longer valid" errors - often transient.

Pinned suite renamed

A hard-coded suite name in sources.list that the distro renamed leaves apt fetching a path that no longer exists.

How to fix it

Pin a current base image and update sources together

Move to a supported release tag, or repoint sources at the archive for an EOL release.

Dockerfile
# move off the EOL tag:
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates \
 && rm -rf /var/lib/apt/lists/*

Retry transient mirror 404s; fix EOL sources

A briefly out-of-sync mirror clears on retry; an EOL release needs its sources repointed.

How to prevent it

  • Track supported base-image release tags; avoid building on EOL suites.
  • Pin a specific base image digest so the release does not silently age out.
  • Repoint apt sources to the archive host when you must build an old release.

Frequently asked questions

What causes "apt-get update "404 Not Found""?
When a Debian/Ubuntu release ages out, its packages move to an archive host; the original deb.debian.org path 404s until the sources are pointed at the archive.
How do I fix apt-get update "404 Not Found"?
Move to a supported release tag, or repoint sources at the archive for an EOL release.
Can Latchkey fix this automatically?
Yes. Latchkey runs your GitHub Actions on managed runners that detect this failure, apply the fix, and retry the job automatically - self-healing is on by default.

Related guides

References

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