From 1f60e6421761c362d8abacfc739e14d628c4cb26 Mon Sep 17 00:00:00 2001 From: Smittix Date: Fri, 9 Jan 2026 12:53:02 +0000 Subject: [PATCH] Improve apt_install error handling in setup script Show actual error output when apt-get fails instead of silently failing. Now displays which packages failed, the last 10 lines of apt output, and suggests a manual fix command. Co-Authored-By: Claude Opus 4.5 --- setup.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 21571e7..ca213aa 100644 --- a/setup.sh +++ b/setup.sh @@ -287,7 +287,18 @@ install_macos_packages() { # ---------------------------- # Debian/Ubuntu install (APT) # ---------------------------- -apt_install() { $SUDO apt-get install -y --no-install-recommends "$@" >/dev/null; } +apt_install() { + local pkgs="$*" + local output + local ret=0 + output=$($SUDO apt-get install -y --no-install-recommends "$@" 2>&1) || ret=$? + if [[ $ret -ne 0 ]]; then + fail "Failed to install: $pkgs" + echo "$output" | tail -10 + fail "Try running: sudo apt-get update && sudo apt-get install -y $pkgs" + return 1 + fi +} apt_try_install_any() { local p