From 6481762d23e209b5219a32a996c1d1e0e61fe34a Mon Sep 17 00:00:00 2001 From: SamNet-dev Date: Thu, 5 Feb 2026 08:38:42 -0600 Subject: [PATCH] fix: support Fedora/RHEL/Arch/openSUSE for GFK installation On Fedora/RHEL, python3-venv package doesn't exist because the venv module is already included with python3. The script was failing with: "No match for argument: python3-venv" Fix: Handle venv installation per package manager: - apt (Debian/Ubuntu): install python3.X-venv - dnf (Fedora/RHEL 8+): just install python3-pip (venv included) - yum (RHEL/CentOS 7): just install python3-pip - pacman (Arch): install python-pip (venv included) - zypper (openSUSE): install python3-pip (venv included) - apk (Alpine): install py3-pip Fixes #24 --- paqctl.sh | 52 ++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 40 insertions(+), 12 deletions(-) diff --git a/paqctl.sh b/paqctl.sh index 0296039..2d029e1 100644 --- a/paqctl.sh +++ b/paqctl.sh @@ -1155,18 +1155,46 @@ install_python_deps() { return 1 fi - # Install python3-venv (version-specific package for Debian/Ubuntu) - # The generic python3-venv may not work, need python3.X-venv - local venv_pkg="python3-venv" - if [ "$PKG_MANAGER" = "apt" ]; then - # Get specific version like python3.12-venv - local pyver_full - pyver_full=$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")' 2>/dev/null) - if [ -n "$pyver_full" ]; then - venv_pkg="python${pyver_full}-venv" - fi - fi - install_package "$venv_pkg" + # Install venv support (varies by distro) + # - Debian/Ubuntu: needs python3-venv or python3.X-venv package + # - Fedora/RHEL/Arch/openSUSE: venv included with python3, just need pip + # - Alpine: needs py3-pip + case "$PKG_MANAGER" in + apt) + # Debian/Ubuntu needs python3-venv package (version-specific) + local pyver_full + pyver_full=$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")' 2>/dev/null) + if [ -n "$pyver_full" ]; then + install_package "python${pyver_full}-venv" || install_package "python3-venv" + else + install_package "python3-venv" + fi + ;; + dnf) + # Fedora/RHEL 8+: venv is included with python3, just ensure pip + install_package "python3-pip" || true + ;; + yum) + # Older RHEL/CentOS 7 + install_package "python3-pip" || true + ;; + pacman) + # Arch Linux: venv included with python, pip is separate + install_package "python-pip" || true + ;; + zypper) + # openSUSE: venv included with python3 + install_package "python3-pip" || true + ;; + apk) + # Alpine + install_package "py3-pip" || true + ;; + *) + # Try generic python3-venv, ignore if fails (venv may be built-in) + install_package "python3-venv" 2>/dev/null || true + ;; + esac # Create virtual environment local VENV_DIR="$INSTALL_DIR/venv"