fix: run apt-get update before every apt-get install#101
Merged
Conversation
Ubuntu point-release supersessions (e.g. libgdk-pixbuf2.0 .4 → .5) cause 404 errors when the Docker image's package index is stale. The failure surfaces as a build error during php_build apt install but can affect any recipe that installs packages. Move apt-get update inside APT.Install() so every install call refreshes the index automatically. No call-site changes are needed — all recipes (php, ruby, python, node, r, httpd, hwc, autoconf, compiler) benefit unconditionally. Update tests to expect the update+install two-call sequence.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Ubuntu point-release supersessions cause 404 errors when a Docker image's apt package index is stale. The immediate trigger was
libgdk-pixbuf2.0-bin/libgdk-pixbuf-2.0-devversion.4being superseded by.5on the Ubuntu jammy mirrors — these are transitive dependencies pulled in bylibmagickwand-dev/libmagickcore-devduring PHP builds:This can happen to any recipe that installs packages, not just PHP.
Fix
Move
apt-get updateinsideAPT.Install()so every install call automatically refreshes the package index before installing. No call-site changes are needed — all recipes (php, ruby, python, node, r, httpd, hwc, autoconf, compiler) benefit unconditionally.Notes
AddPPAstill does its ownapt-get updateafter adding the repo (necessary to pick up the new PPA sources). This meansGCC.Setupruns update 3 times on cflinuxfs4 — harmless.InstallReinstallis unchanged (used only for downloading.debfiles in the Python recipe; same stale-index risk applies but that path is less exposed).