Files
dotfiles/install.d/11-apt.sh
Andrejus f331bf8122 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>
2026-03-18 10:46:46 +00:00

35 lines
652 B
Bash
Executable File

#!/usr/bin/env bash
# -----------------------------------------------------------------------------
# Description:
# (distros with apt only) Install core apt packages.
#
# apt only
[[ "$DOTS_PKG" != "apt" ]] && { log_skip "Not using apt"; return 0; }
apt_packages=(
build-essential
ca-certificates
curl
gnupg
gnupg2
wget
)
sudo apt-get update -qq
# Skip install if all packages already installed
if dpkg -s "${apt_packages[@]}" &>/dev/null; then
apt --version | log_quote
return 0
fi
sudo apt-get install -qq "${apt_packages[@]}"
unset apt_packages
apt --version | log_quote
log_pass "apt packages installed"