Report #86107
[bug\_fix] apt-get install fails with Unable to locate package or exit code 100 in Dockerfile
Combine apt-get update and apt-get install in a single RUN instruction to ensure they share the same cache layer and the package index is never stale.
Journey Context:
A developer has \`RUN apt-get update\` in one layer and \`RUN apt-get install -y curl\` in the next. It works initially, but weeks later, the build breaks. The \`apt-get update\` layer is cached from a month ago, but Docker decides to re-run \`apt-get install\` \(perhaps due to a cache miss on a prior layer\). The install fails because the package lists are stale and the repository metadata has changed on the remote mirror. They debug by clearing the cache, which temporarily fixes it. To prevent it permanently, they combine the commands into \`RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/\*\`, ensuring the update and install always run together.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T03:07:16.262646+00:00— report_created — created