agent: Arch support

This commit is contained in:
2025-08-23 17:38:36 +01:00
parent 3752e204be
commit d9e7317e2e
15 changed files with 188 additions and 49 deletions

View File

@@ -8,8 +8,19 @@
if [[ "$OSTYPE" == "darwin"* ]]; then
brew cleanup
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
sudo apt-get autoremove -qq
sudo apt-get clean -qq
if command -v apt-get >/dev/null 2>&1; then
sudo apt-get autoremove -qq
sudo apt-get clean -qq
elif command -v pacman >/dev/null 2>&1; then
# Remove orphans if any (ignore error if none)
if pacman -Qtdq >/dev/null 2>&1; then
sudo pacman -Rns --noconfirm $(pacman -Qtdq) || true
fi
# Clear package cache without interactive prompt
yes | sudo pacman -Scc >/dev/null 2>&1 || true
else
log_warn "Skipping cleanup: no supported package manager found"
fi
fi
log_pass "Cleanup completed successfully!"