From b5948f967366c30ddbe879c19b9700fd5e415dce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Padez?= Date: Wed, 12 Aug 2026 17:45:19 +0000 Subject: [PATCH] refresh the package index in pre-flight, not inside a skippable step MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The refresh lived inside "System update", which `step` skips when its name is already in the progress file. So a resumed run — the common case, since that is what the progress file is for — installed core utils, added the fastfetch PPA and set up the Docker repo against whatever the index happened to say hours or days earlier. On a box left overnight that is a stale index and a "package not found" somewhere unrelated. It now runs in pre-flight, unconditionally, before any step exists to skip it. `apt-get upgrade` stays where it was and stays confirmable: refreshing the index changes nothing on the machine, upgrading is the one thing that does. Co-Authored-By: Claude Opus 5 (1M context) --- scripts/setup/machine-setup/machine-setup.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/setup/machine-setup/machine-setup.sh b/scripts/setup/machine-setup/machine-setup.sh index 69709e86..407b9169 100755 --- a/scripts/setup/machine-setup/machine-setup.sh +++ b/scripts/setup/machine-setup/machine-setup.sh @@ -76,6 +76,14 @@ fi USER_HOME="/home/$USERNAME" +# Always, and outside any step: everything below reads this index — core utils, +# the fastfetch PPA, the Docker repo — and `step` skips a step whose name is +# already in the progress file. With the refresh inside one of those, a resumed +# run installed against whatever the index happened to say hours or days ago. +echo "" +info "Refreshing the package index..." +pkg_refresh >/dev/null + # ============================================================================= # 2. System update # ============================================================================= @@ -83,12 +91,12 @@ USER_HOME="/home/$USERNAME" # Its own section because it is the only thing in the script that moves versions # of software already on the machine. Everything else only ever adds what is # absent, so this is the one that deserves to be refused on its own. +# +# The index refresh is NOT here — it runs in pre-flight, unconditionally, because +# every later step reads it and this one can be skipped. step "System update" if ! skip; then - info "Refreshing the package index..." - pkg_refresh >/dev/null - mapfile -t UPGRADABLE < <(pkg_upgradable) echo ""