Skip to content

Refactor: Detect package manager instead of distro in installer#67

Merged
thiagoralves merged 2 commits into
developmentfrom
feature/package-manager-detection
Jan 12, 2026
Merged

Refactor: Detect package manager instead of distro in installer#67
thiagoralves merged 2 commits into
developmentfrom
feature/package-manager-detection

Conversation

@thiagoralves

Copy link
Copy Markdown
Contributor

Summary

  • Replace distro-based dependency detection (/etc/os-release ID check) with package manager detection (command -v)
  • Automatically supports all derivative distros (Linux Mint, Pop!_OS, Rocky Linux, etc.) without enumeration
  • Added support for pacman (Arch-based), zypper (openSUSE/SUSE), and apk (Alpine Linux)

Problem

The installer failed on Linux Mint and other derivative distros:

Distro: linuxmint
Unsupported Linux distro: linuxmint

Solution

Detect the package manager instead of the distro ID:

Package Manager Distros Automatically Supported
apt Debian, Ubuntu, Linux Mint, Pop!_OS, elementary OS, Zorin, MX Linux, etc.
dnf Fedora, RHEL 8+, CentOS Stream, Rocky Linux, AlmaLinux, etc.
yum RHEL 7, CentOS 7, Amazon Linux
pacman Arch Linux, Manjaro, EndeavourOS, Garuda, etc.
zypper openSUSE, SUSE Linux Enterprise
apk Alpine Linux

MSYS2 Compatibility

MSYS2 detection remains unchanged - it is checked first via uname -s (returns MSYS*/MINGW*) before any package manager detection, so MSYS2's pacman never conflicts with Linux pacman.

Test plan

  • Test on Debian/Ubuntu (apt)
  • Test on Linux Mint (apt) - previously failing
  • Test on Fedora (dnf)
  • Test on MSYS2/Windows (pacman via uname detection)

🤖 Generated with Claude Code

Replace distro-based dependency detection with package manager detection
for broader Linux distribution support. This automatically enables support
for derivative distros (Linux Mint, Pop!_OS, Rocky Linux, etc.) without
needing to enumerate each one.

Added support for:
- pacman (Arch, Manjaro, EndeavourOS)
- zypper (openSUSE, SUSE)
- apk (Alpine Linux)

MSYS2 detection remains unchanged (via uname -s check before package
manager detection).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@thiagoralves thiagoralves requested a review from Copilot January 12, 2026 15:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the Linux dependency installer to detect package managers instead of specific distros, automatically supporting derivative distributions without enumeration.

Changes:

  • Replaced /etc/os-release distro ID detection with command -v package manager detection
  • Added support for pacman (Arch-based), zypper (openSUSE/SUSE), and apk (Alpine Linux)
  • Removed python3-venv from yum/dnf installers

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread install.sh Outdated
gcc gcc-c++ make cmake \
python3 python3-devel python3-pip python3-venv \
&& yum clean all
python3 python3-devel python3-pip \

Copilot AI Jan 12, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removal of python3-venv from yum-based installations could break functionality if virtual environments are required elsewhere in the installation process. Verify that virtual environment creation is not needed, or restore python3-venv to maintain consistency with the original implementation.

Suggested change
python3 python3-devel python3-pip \
python3 python3-devel python3-pip python3-venv \

Copilot uses AI. Check for mistakes.
Comment thread install.sh Outdated
gcc gcc-c++ make cmake \
python3 python3-devel python3-pip python3-venv \
&& dnf clean all
python3 python3-devel python3-pip \

Copilot AI Jan 12, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removal of python3-venv from dnf-based installations could break functionality if virtual environments are required elsewhere in the installation process. Verify that virtual environment creation is not needed, or restore python3-venv to maintain consistency with the original implementation.

Suggested change
python3 python3-devel python3-pip \
python3 python3-devel python3-pip python3-venv \

Copilot uses AI. Check for mistakes.
Restores python3-venv package to ensure venv module is available on
minimal/container images where it may not be bundled with python3.
Better to fail early with clear package error than later at venv creation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@thiagoralves thiagoralves changed the base branch from main to development January 12, 2026 15:53
@thiagoralves thiagoralves merged commit 97195a4 into development Jan 12, 2026
1 check passed
@thiagoralves thiagoralves deleted the feature/package-manager-detection branch January 12, 2026 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants