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:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user