Skip to main content

Supported Distributions

cosh-ng automatically detects the current operating system by reading /etc/os-release (Linux) or calling sw_vers (macOS), and routes to the corresponding package manager and service manager backend.

Support Matrix

DistributionPackage ManagerService ManagerNotes
Alinux (2/3/4)dnfsystemdAlibaba Cloud native Linux
CentOS 7/8/9dnfsystemd
Fedoradnfsystemd
Ubuntuapt-getsystemd
Debianapt-getsystemd
openSUSE Leap/Tumbleweedzyppersystemd
macOSbrewOnly pkg subsystem available

Detection Logic

Distribution detection is implemented via Distro::detect():

  1. When the compile target is macOS, calls sw_vers -productVersion to get the version
  2. On Linux, reads /etc/os-release and parses the ID and VERSION_ID fields
  3. Maps ID to a known distribution variant
  4. Unrecognized ID values fall into Unknown, and most operations return UnsupportedDistro error

Package Manager Mapping

Distribution IDPackage ManagerInstall CommandSearch Command
alinux / centos / fedoraDnfdnf install -ydnf search -q
ubuntu / debianAptapt-get install -yapt-cache search
opensuse-leap / opensuse-tumbleweed / slesZypperzypper install -yzypper search
macOSBrewbrew installbrew search

Service Manager

All Linux distributions use systemd (systemctl) uniformly. macOS does not support the svc subsystem.

Adding New Distribution Support

To add support for a new distribution, see the developer documentation Adding Distribution Support Guide.