Fix aircrack-ng detection to use apt-cache policy instead of apt-cache show

apt-cache show returns true even when Candidate is (none). Use
apt-cache policy and grep for a real version string to correctly
skip aircrack-ng on Ubuntu arm64 where it has no install candidate.
This commit is contained in:
n0mad1k
2026-03-22 17:34:52 -04:00
parent 054c044546
commit a0164c0275
+3 -3
View File
@@ -260,11 +260,11 @@ if apt-cache show sshuttle &>/dev/null 2>&1; then
PACKAGES+=(sshuttle) PACKAGES+=(sshuttle)
fi fi
# aircrack-ng not available on all Ubuntu arm64 mirrors — add only if present # aircrack-ng not available on all Ubuntu arm64 mirrors — add only if a real candidate exists
if apt-cache show aircrack-ng &>/dev/null 2>&1; then if apt-cache policy aircrack-ng 2>/dev/null | grep -q "Candidate: [^(none)]"; then
PACKAGES+=(aircrack-ng) PACKAGES+=(aircrack-ng)
else else
warn "aircrack-ng not available in apt cache -- skipping (install manually if needed)" warn "aircrack-ng has no install candidate -- skipping (install manually if needed)"
fi fi
info "Updating package cache..." info "Updating package cache..."