This commit is contained in:
Jonas H
2026-03-12 09:26:44 +01:00
3 changed files with 45 additions and 0 deletions

View File

@@ -41,6 +41,24 @@ COMMON_PACKAGES=(
firefox
zoxide
)
# On Arch-based systems, partial upgrades are unsupported — installing a
# package that pulls in a newer library breaks packages built against the old
# one. The right fix is 'sudo pacman -Syu', but doing that over SSH risks
# a dropped connection mid-kernel-upgrade. So we just warn and let the user
# decide.
check_arch_updates() {
sudo pacman -Sy --noconfirm # refresh databases only, no upgrade
local updates
updates=$(pacman -Qu 2>/dev/null | wc -l)
if [[ "$updates" -gt 0 ]]; then
echo ""
echo "WARNING: $updates system package(s) are out of date."
echo " If pacman fails with dependency conflicts, run 'sudo pacman -Syu'"
echo " locally (not over SSH, to avoid kernel upgrade risks), then re-run"
echo " this script."
echo ""
fi
}
case "$DISTRO" in
endeavouros|arch)
@@ -62,6 +80,7 @@ case "$DISTRO" in
echo "Installing packages for Fedora..."
sudo dnf install -y "${PACKAGES[@]}"
;;
*)
echo "ERROR: Unsupported distribution: $DISTRO"
exit 1