Skip to content

Depexts os distribution os family values

Jan Midtgaard edited this page Dec 8, 2025 · 15 revisions

os-distribution value is usually the value of ID in /etc/os-release os-family value is usually the first value of ID_LIKE in /etc/os-release

e.g.

Distribution os os-distribution os-family
Archlinux linux arch arch
Alpine linux alpine alpine
Debian linux debian debian
Ubuntu linux ubuntu debian
Mint linux linuxmint ubuntu
Fedora linux fedora fedora
CentOS linux centos rhel
Rocky linux rocky rhel
Oraclelinux linux ol fedora
OpenSUSE(leap) linux opensuse-leap suse
OpenSUSE(tumbleweed) linux opensuse-tumbleweed opensuse
Gentoo linux gentoo gentoo
NixOS linux nixos nixos
Homebrew macos homebrew homebrew
Macports macos macports macports
FreeBSD freebsd freebsd bsd
OpenBSD openbsd openbsd bsd
NetBSD netbsd netbsd bsd

For linux distributions it is generally better to use the os-family value whenever possible to make distributions derived of those ones work out of the box (e.g. PopOS for Ubuntu and Manjaro for Archlinux).

In the case of CentOS/Fedora/Oraclelinux, using os-family can get really painful with the addition of the EPEL repository so just using os-distribution in this case is usually easier.

For macOS it is better to use both os = "macos" & os-distribution = "<distro>" to avoid the very unlikely case where a linux distribution starts calling itself homebrew in the future.

For BSDs it is better to just use os as the os-family value is not very helpful for depexts purpose.

Package names to populate depexts can be looked up in various websites, like https://pkgs.org/ and https://repology.org/projects/

Windows is a bit more complicated. Quoting from https://github.com/ocaml/opam-repository/pull/25484#issuecomment-1999943746:

The Cygwin part becomes very confusing here, as it's both an OS in its own right but also an os-distribution for native Windows.

  • os-family is windows for both native Windows and Cygwin (i.e. Sys.win32 || Sys.cygwinos-family = windows)
  • os is win32 for a native Windows build of opam (which includes OCaml for Windows).

For os-distribution, we then have:

Distribution os os-distribution os-family Notes
Native[^1] Windows win32 cygwin windows Depexts + Unix tools provided by Cygwin
Native Windows win32 msys2[^2] windows Depexts + Unix tools provided by MSYS2
Native Windows win32 cygwinports windows Legacy "OCaml for Windows" (opam 2.0.10 only)
Cygwin cygwin cygwin windows Cygwin's own opam distribution

Creating conf- packages for windows needs to be done with quite some care. Quoting https://github.com/ocaml/opam-repository/pull/27996#issuecomment-2948565171:

Opam 2.2's native Windows support together with https://github.com/ocaml/opam-repository/pull/25442's new layout offer support for both MinGW and MSys2 - with an example conf-package port in https://github.com/ocaml/opam-repository/pull/26072. We've been trying to follow this example in a string of PRs to further improve Windows support: https://github.com/ocaml/opam-repository/pull/26146, https://github.com/ocaml/opam-repository/pull/26798, https://github.com/ocaml/opam-repository/pull/26811, https://github.com/ocaml/opam-repository/pull/26812, https://github.com/ocaml/opam-repository/pull/26815, https://github.com/ocaml/opam-repository/pull/26819, https://github.com/ocaml/opam-repository/pull/27553, https://github.com/ocaml/opam-repository/pull/27846, https://github.com/ocaml/opam-repository/pull/27917

[^1]: "Native" here refers to programs able to run outside of Cygwin/MSYS2, principally from the Command Prompt or Windows PowerShell. [^2]: At the moment, this is "tier 2" from opam's perspective - Cygwin is the primary supported mechanism for 2.2.0, but we're paying a lot of attention to MSYS2 partly because that's what Diskuv uses now and also because we expect we'll likely switch to recommending it across the board in future.

Clone this wiki locally