-
Notifications
You must be signed in to change notification settings - Fork 589
Description
echo "[+] Installing packages..."
catch errors if specific packages (like python-is-python3) don't exist on older distros
apt-get install -y "${DEBIAN_PKGS[@]}" || {
echo "Warning: Some packages failed. Attempting minimal install..."
apt-get install -y git flex bison build-essential zip curl zlib1g-dev gcc-multilib g++-multilib
}
}
install_fedora() {
echo "[+] Detected Fedora/RHEL/CentOS."
echo "[+] Installing Development Tools group..."
dnf groupinstall -y "Development Tools" || yum groupinstall -y "Development Tools"
echo "[+] Installing dependencies..."
dnf install -y "${FEDORA_PKGS[@]}" || yum install -y "${FEDORA_PKGS[@]}"
}
install_opensuse() {
echo "[+] Detected openSUSE."
echo "[+] Installing Basis Pattern..."
zypper install -y -t pattern devel_basis
echo "[+] Installing dependencies..."
zypper install -y "${OPENSUSE_PKGS[@]}"
}
--- Main Execution ---
if [[ $EUID -ne 0 ]]; then
echo "Error: This script must be run as root."
exit 1
fi
DISTRO=$(detect_distro)
case "$DISTRO" in
ubuntu|debian|linuxmint|pop|kali)
install_debian
;;
fedora|rhel|centos|almalinux|rocky)
install_fedora
;;
opensuse*|suse)
install_opensuse
;;
*)
echo "Distro '$DISTRO' not explicitly supported by this script."
echo "Attempting to detect based on package manager..."
if command -v apt-get &> /dev/null; then
install_debian
elif command -v dnf &> /dev/null; then
install_fedora
elif command -v zypper &> /dev/null; then
install_opensuse
else
echo "Error: Could not detect apt, dnf, or zypper."
exit 1