From 229ca0079557fbce6af7ef92b857c045fabc3fcf Mon Sep 17 00:00:00 2001 From: soulis-1256 Date: Sun, 16 Aug 2026 13:54:32 +0300 Subject: [PATCH] Use pacman -Syu when installing Arch packages -Sy without -u is a partial upgrade and can install jq against a newer glibc than the system has. Warn first, then run a full -Syu, and fail if jq still cannot execute. --- bin/docker-install.sh | 6 +++++- bin/setup.sh | 27 ++++++++++++++++++++++++++- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/bin/docker-install.sh b/bin/docker-install.sh index 9e05fde..40da992 100644 --- a/bin/docker-install.sh +++ b/bin/docker-install.sh @@ -63,7 +63,11 @@ $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev } install_docker_arch() { - sudo pacman -Sy --noconfirm --needed docker docker-compose + echo + echo "Arch Linux: about to run a full system upgrade (pacman -Syu)." + echo "A partial install (-Sy without -u) can break packages (GLIBC mismatch)." + echo + sudo pacman -Syu --noconfirm --needed docker docker-compose } install_docker_fedora() { diff --git a/bin/setup.sh b/bin/setup.sh index 6cd8bbd..0bc4ea8 100644 --- a/bin/setup.sh +++ b/bin/setup.sh @@ -124,7 +124,12 @@ install_packages() { sudo apt-get update -qq && sudo apt-get install -y "${pkgs[@]}" ;; pacman) - sudo pacman -Sy --noconfirm --needed "${pkgs[@]}" + echo + log_warning "Arch Linux: about to run a full system upgrade (pacman -Syu)." + log_info "A partial install (-Sy without -u) can break jq (GLIBC mismatch)." + log_info "This updates the whole system, then installs: ${pkgs[*]}" + echo + sudo pacman -Syu --noconfirm --needed "${pkgs[@]}" ;; dnf) sudo dnf install -y "${pkgs[@]}" @@ -172,6 +177,26 @@ check_dependencies() { if ! install_packages "${missing_packages[@]}"; then log_error "Failed to install missing packages. Please install them manually: ${missing_packages[*]}" fi + local still_broken=() + local pkg + for pkg in "${missing_packages[@]}"; do + case "$pkg" in + jq) echo "{}" | jq . &>/dev/null || still_broken+=("$pkg") ;; + fzf) fzf --version &>/dev/null || still_broken+=("$pkg") ;; + curl) curl --version &>/dev/null || still_broken+=("$pkg") ;; + *) command -v "$pkg" &>/dev/null || still_broken+=("$pkg") ;; + esac + done + if [ ${#still_broken[@]} -gt 0 ]; then + echo + log_warning "Installed, but still not runnable: ${still_broken[*]}" + if printf '%s\n' "${still_broken[@]}" | grep -qx jq; then + jq . &1 | head -5 || true + log_info "On Arch this is usually a partial upgrade. In WSL run: sudo pacman -Syu" + log_info "Then open a new WSL terminal and re-run setup." + fi + log_error "Please fix the packages above and re-run setup." + fi log_success "Successfully installed missing packages" else log_error "Please install the required packages manually: ${missing_packages[*]}"