#!/usr/bin/env bash # ============================================================================= # run_once_05-install-pacstall.sh.tmpl (debian-only) # Install pacstall: AUR-like package manager for debian/ubuntu. # Reference: https://pacstall.dev # # Steps: # 1. Install pacstall's apt dependencies via apt # 2. Run pacstall's official installer (must be root, hence sudo) # # Body wrapped in os_family guard: no-op on arch (already has AUR + chaotic). # ============================================================================= set -euo pipefail log() { printf '\033[1;34m[pacstall]\033[0m %s\n' "$*"; } die() { printf '\033[1;31m[pacstall ERROR]\033[0m %s\n' "$*" >&2; exit 1; } # This script runs as the invoking user; sudo handles elevation. {{ if eq .os_family "debian" -}} # Skip if pacstall is already installed if command -v pacstall >/dev/null 2>&1; then log "pacstall already installed: $(pacstall -V 2>/dev/null || echo unknown)" exit 0 fi # Install pacstall's apt deps first (idempotent — pacstall will skip if present) log "installing pacstall apt dependencies" sudo apt-get update -y sudo apt-get install -y --no-install-recommends \ sudo wget build-essential unzip git zstd iputils-ping \ aptitude bubblewrap jq distro-info-data spdx-licenses \ gettext curl ca-certificates # Fetch and run pacstall's official installer. # It must be invoked as root (sudo). NON_INTERACTIVE=true + /dev/null 2>&1; then die "pacstall installer ran but pacstall not on PATH" fi log "pacstall installed: $(pacstall -V 2>/dev/null || echo unknown)" {{ else -}} # Not a debian-base box — nothing to do. log "skipping pacstall install (os_family={{ .os_family }}, not debian)" {{ end -}}