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 <noreply@anthropic.com>
This commit is contained in:
Smittix
2026-01-09 12:53:02 +00:00
parent 69de7e4afd
commit 1f60e64217
+12 -1
View File
@@ -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