fix: always run apt-get update in 11-apt.sh

Move apt-get update before the 'already installed' check so the
package index is always refreshed. Previously, on environments like
Codespaces where base packages are pre-installed, the update was
skipped entirely, causing downstream scripts (e.g. 23-stow.sh) to
fail with 'Unable to locate package'.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-03-18 10:46:46 +00:00
parent 8b2546a554
commit f331bf8122

View File

@@ -17,13 +17,14 @@ apt_packages=(
wget wget
) )
# Skip if all packages already installed sudo apt-get update -qq
# Skip install if all packages already installed
if dpkg -s "${apt_packages[@]}" &>/dev/null; then if dpkg -s "${apt_packages[@]}" &>/dev/null; then
apt --version | log_quote apt --version | log_quote
return 0 return 0
fi fi
sudo apt-get update -qq
sudo apt-get install -qq "${apt_packages[@]}" sudo apt-get install -qq "${apt_packages[@]}"
unset apt_packages unset apt_packages