docker
build_error
ai_generated
true
E: Failed to fetch http://archive.ubuntu.com/... 404 Not Found
ID: docker/apt-get-update-failed
88%Fix Rate
90%Confidence
50Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 27 | active | — | — | — |
Root Cause
apt package cache stale in Docker build. Common with cached layers.
genericWorkarounds
-
95% success Always run apt-get update && apt-get install in same RUN layer
RUN apt-get update && apt-get install -y pkg && rm -rf /var/lib/apt/lists/*
Sources: https://docs.docker.com/build/building/best-practices/#apt-get
-
85% success Use specific base image tags, not :latest
# Use specific version tags: FROM ubuntu:22.04 # Not FROM ubuntu:latest FROM python:3.12-slim # Not FROM python:latest FROM node:20-alpine # Not FROM node:latest
Sources: https://docs.docker.com/build/building/best-practices/#from
Dead Ends
Common approaches that don't work:
-
Pin specific mirror URL
60% fail
Mirrors change too; doesn't fix stale cache layer
-
Use --no-cache for entire build
50% fail
Rebuilds everything, very slow
Error Chain
Frequently confused with: