Skip to main content

detect_distribution

Function detect_distribution 

Source
pub fn detect_distribution() -> DistroInfo
Expand description

Detect the Linux distribution by parsing system files.

Follows a priority chain:

  1. /etc/os-release (standard, preferred)
  2. /etc/lsb-release (older Ubuntu/Debian)
  3. /etc/arch-release (Arch Linux marker file)
  4. /etc/debian_version (Debian fallback)

After identifying the distribution, determines the family and package manager. The MLSTACK_PKG_MANAGER environment variable overrides auto-detected package manager.