# Install ocaml with Homebrew, apk, apt, dnf, MacPorts, Nix, pacman, zypper

General purpose programming language in the ML family. Version 5.4.1 via Homebrew; verified from local package data.

## Install

```sh
sudo av install brew:ocaml
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install ocaml
```

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install ocaml
```

  Evidence: MacPorts ports tree: lang/ocaml/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add ocaml
```

  Evidence: Alpine Linux edge package indexes: ocaml from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

- Debian apt (92%):

```sh
sudo apt install libcompiler-libs-ocaml-dev
```

  Evidence: Debian stable package indexes: libcompiler-libs-ocaml-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- dnf (92%):

```sh
sudo dnf install ocaml
```

  Evidence: Fedora Rawhide package metadata: ocaml from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#ocaml
```

  Evidence: nixpkgs package indexes: ocaml from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix

- pacman (92%):

```sh
sudo pacman -S ocaml
```

  Evidence: Arch Linux sync databases: ocaml from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

- zypper (92%):

```sh
sudo zypper install ocaml
```

  Evidence: openSUSE Tumbleweed package metadata: ocaml from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst

## Package facts

- **Package key:** brew:ocaml
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/ocaml>
- **Version:** 5.4.1
- **Source summary:** General purpose programming language in the ML family
- **Homepage:** <https://ocaml.org/>
- **Repository:** <https://github.com/ocaml/ocaml>
- **Upstream docs:** <https://ocaml.org/docs>
- **License:** LGPL-2.1-only WITH OCaml-LGPL-linking-exception
- **Source archive:** <https://caml.inria.fr/pub/distrib/ocaml-5.4/ocaml-5.4.1.tar.xz>
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- ocaml (cli)
- ocamlc (cli)
- ocamlc.byte (cli)
- ocamlc.opt (cli)
- ocamlcmt (cli)
- ocamlcp (cli)
- ocamldebug (cli)
- ocamldep (cli)
- ocamldep.byte (cli)
- ocamldep.opt (cli)
- ocamldoc (cli)
- ocamldoc.opt (cli)
- ocamllex (cli)
- ocamllex.byte (cli)
- ocamllex.opt (cli)
- ocamlmklib (cli)
- ocamlmktop (cli)
- ocamlobjinfo (cli)
- ocamlobjinfo.byte (cli)
- ocamlobjinfo.opt (cli)
- ocamlopt (cli)
- ocamlopt.byte (cli)
- ocamlopt.opt (cli)
- ocamloptp (cli)
- ocamlprof (cli)
- ocamlrun (cli)
- ocamlrund (cli)
- ocamlruni (cli)
- ocamlyacc (cli)
- ocaml (alias)
- ocamlc (alias)
- ocamlc.byte (alias)
- ocamlc.opt (alias)
- ocamlcmt (alias)
- ocamlcp (alias)
- ocamldebug (alias)
- ocamldep (alias)
- ocamldep.byte (alias)
- ocamldep.opt (alias)
- ocamldoc (alias)
- ocamldoc.opt (alias)
- ocamllex (alias)
- ocamllex.byte (alias)
- ocamllex.opt (alias)
- ocamlmklib (alias)
- ocamlmktop (alias)
- ocamlobjinfo (alias)
- ocamlobjinfo.byte (alias)
- ocamlobjinfo.opt (alias)
- ocamlopt (alias)
- ocamlopt.byte (alias)
- ocamlopt.opt (alias)
- ocamloptp (alias)
- ocamlprof (alias)
- ocamlrun (alias)
- ocamlrund (alias)
- ocamlruni (alias)
- ocamlyacc (alias)

## Install behavior

- Post-install hook: not defined
- Bottle: available on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 5.4.1
- Local data: ok
- Upstream repository: https://ocaml.org/
- info: No package-manager update timestamp was available.
- info: Release/tag comparison is only available for GitHub repositories.
## Project history and usage

OCaml is the main implementation of the Caml branch of the ML family: a strict, statically typed, type-inferred language with functional, imperative, modular, and object-oriented features. The brewed ocaml package installs the compiler suite, runtime tools, lexer and parser generators, documentation tools, debugger, dependency analyzer, and native-code and bytecode compilers.

### Project history

OCaml grew out of Caml work at INRIA. Caml Special Light arrived in 1995 with an optimizing native-code compiler and a module system inspired by Standard ML; Objective Caml followed in 1996 after Didier Remy and Jerome Vouillon's object-type work was integrated into the language. The official name became OCaml in 2011.

The language evolved through major compiler and ecosystem changes. OCaml 4.0 in 2012 added GADTs and first-class modules; OCaml 4.03 in 2016 split ocamlbuild out of the compiler distribution; OCaml 5.0 in 2022 rewrote the runtime, removed the global runtime lock, and introduced support for shared-memory parallelism and effect handlers.

### Adoption history

OCaml began with a strong academic base and gained industrial users around the Objective Caml period documented by ocaml.org. The official history page identifies adoption in static analysis tools, compilers, financial systems, and web development, and the language ecosystem later consolidated around opam, Dune, odoc, ocamlformat, merlin, and related platform tools.

### How it is used

Developers use OCaml for compilers, formal-methods tooling, static analysis, developer tools, financial infrastructure, web services, and systems where strong static typing and fast native code are useful. The package exposes both bytecode and native compilers, the interactive toplevel, ocamldebug, ocamldep, ocamldoc, ocamllex, ocamlyacc, and object-inspection tools.

### Why package nerds care

OCaml is package-nerd rich because the compiler version is also an ecosystem axis. opam switches, findlib package names, Dune language versions, compiler-libs compatibility, PPX AST versions, and long-lived compiler branches all affect whether an OCaml package can build.

### Timeline

- 1995: Caml Special Light introduced an optimizing native-code compiler and a stronger module system.
- 1996: Objective Caml was released, combining object-oriented programming with ML-style polymorphic type inference.
- 2000: Optional arguments and polymorphic variants were added.
- 2011: The official language name became OCaml.
- 2012: OCaml 4.0 added GADTs and first-class modules.
- 2013: opam 1.0 established a source-based package manager for OCaml switches and packages.
- 2022-12-16: OCaml 5.0.0 introduced runtime support for shared-memory parallelism and effect handlers.
- 2026-06: The OCaml manual describes the 5.5 release line.

### Related projects

- opam is the source-based package manager for OCaml; Dune is the dominant build system; ocamlfind/findlib is the older library discovery layer; ocamlbuild is the legacy build manager; merlin and ocaml-lsp-server provide editor integration; odoc and ocamldoc cover documentation generation.

### Sources

- <https://discuss.ocaml.org/t/ocaml-5-0-0-is-out/10974>
- <https://formulae.brew.sh/formula/ocaml>
- <https://ocaml.org/history>
- <https://ocaml.org/manual>
- <https://ocaml.org/releases>
- <https://ocaml.org/releases/4.03.0>
- <https://opam.ocaml.org/>
- <https://opam.ocaml.org/about.html>


## Security Notes

generalized runtime or code generation signal.

- **Geiger risk:** yellow / medium
- generalized runtime or code generation signal

## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** ocaml
- **Aliases:** o-caml, ocaml@5
- **Version Scheme:** 0
- **Revision:** 0
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable

## Other Package-Manager Records

- Debian apt - libcompiler-libs-ocaml-dev - 5.3.0-3: normalized package name match | Debian stable package indexes: libcompiler-libs-ocaml-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | OCaml compiler library (development files) | https://ocaml.org/
- Debian apt - libstdlib-ocaml - 5.3.0-3: normalized package name match | Debian stable package indexes: libstdlib-ocaml from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | OCaml standard library (runtime files) | https://ocaml.org/
- Debian apt - libstdlib-ocaml-dev - 5.3.0-3: normalized package name match | Debian stable package indexes: libstdlib-ocaml-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | OCaml standard library (development files) | https://ocaml.org/
- Debian apt - ocaml - 5.3.0-3: normalized package name match | Debian stable package indexes: ocaml from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | ML language implementation with a class-based object system | https://ocaml.org/
- Debian apt - ocaml-base - 5.3.0-3: normalized package name match | Debian stable package indexes: ocaml-base from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Runtime system for OCaml bytecode executables | https://ocaml.org/
- Debian apt - ocaml-base-nox - 5.3.0-3: normalized package name match | Debian stable package indexes: ocaml-base-nox from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | transitional package for ocaml-base | https://ocaml.org/
- Debian apt - ocaml-compiler-libs - 5.3.0-3: normalized package name match | Debian stable package indexes: ocaml-compiler-libs from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | transitional package for libcompiler-libs-ocaml-dev | https://ocaml.org/
- Debian apt - ocaml-interp - 5.3.0-3: normalized package name match | Debian stable package indexes: ocaml-interp from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | OCaml interactive interpreter and standard libraries | https://ocaml.org/
- Debian apt - ocaml-man - 5.3.0-3: normalized package name match | Debian stable package indexes: ocaml-man from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | OCaml interpreter and standard libraries (lib manpages) | https://ocaml.org/
- Debian apt - ocaml-nox - 5.3.0-3: normalized package name match | Debian stable package indexes: ocaml-nox from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | transitional package for ocaml | https://ocaml.org/
- Debian apt - ocaml-source - 5.3.0-3: normalized package name match | Debian stable package indexes: ocaml-source from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Sources for Objective Caml | https://ocaml.org/
- Nix - ocaml: normalized package name match | nixpkgs package indexes: ocaml from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix
- Ubuntu apt - libcompiler-libs-ocaml-dev - 4.14.1-1ubuntu1: normalized package name match | Ubuntu 24.04 LTS package indexes: libcompiler-libs-ocaml-dev from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | OCaml compiler library (development files) | https://ocaml.org/
- Ubuntu apt - libstdlib-ocaml - 4.14.1-1ubuntu1: normalized package name match | Ubuntu 24.04 LTS package indexes: libstdlib-ocaml from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | OCaml standard library (runtime files) | https://ocaml.org/
- Ubuntu apt - libstdlib-ocaml-dev - 4.14.1-1ubuntu1: normalized package name match | Ubuntu 24.04 LTS package indexes: libstdlib-ocaml-dev from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | OCaml standard library (development files) | https://ocaml.org/
- Ubuntu apt - ocaml - 4.14.1-1ubuntu1: normalized package name match | Ubuntu 24.04 LTS package indexes: ocaml from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | ML language implementation with a class-based object system | https://ocaml.org/


## Related links

- [Secret-risk packages](https://www.automicvault.com/pkg/secret-risk-packages/) - Has protected-tool coverage, approval-gate, or non-low Geiger security signals.
- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Developer build packages](https://www.automicvault.com/pkg/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [Language runtime packages](https://www.automicvault.com/pkg/language-runtime-packages/) - Matched language runtime, compiler, or interpreter metadata.
- [camlp5](https://www.automicvault.com/pkg/brew/camlp5/) - Popular package that depends on this formula.
- [cpdf](https://www.automicvault.com/pkg/brew/cpdf/) - Popular package that depends on this formula.
- [hevea](https://www.automicvault.com/pkg/brew/hevea/) - Popular package that depends on this formula.
- [ledit](https://www.automicvault.com/pkg/brew/ledit/) - Popular package that depends on this formula.
- [menhir](https://www.automicvault.com/pkg/brew/menhir/) - Popular package that depends on this formula.
- [ocaml-findlib](https://www.automicvault.com/pkg/brew/ocaml-findlib/) - Popular package that depends on this formula.
- [ocaml@4](https://www.automicvault.com/pkg/brew/ocaml-4/) - Package name indicates the same formula family.
- [erlang](https://www.automicvault.com/pkg/brew/erlang/) - Shares av.db curated category or tags: cli, functional-programming, language-runtime, programming-language, programming-languages.
- [fantom](https://www.automicvault.com/pkg/brew/fantom/) - Shares av.db curated category or tags: cli, compiler, language-runtime, programming-language, programming-languages.
- [faust](https://www.automicvault.com/pkg/brew/faust/) - Shares av.db curated category or tags: cli, compiler, functional-programming, language-runtime, programming-language.
- [futhark](https://www.automicvault.com/pkg/brew/futhark/) - Shares av.db curated category or tags: cli, compiler, functional-programming, language-runtime, programming-language.
- [erg](https://www.automicvault.com/pkg/brew/erg/) - Shares av.db curated category or tags: cli, compiler, language-runtime, programming-language, programming-languages.
- [gleam](https://www.automicvault.com/pkg/brew/gleam/) - Shares av.db curated category or tags: cli, compiler, language-runtime, programming-language, programming-languages.
- [haxe](https://www.automicvault.com/pkg/brew/haxe/) - Shares av.db curated category or tags: cli, compiler, language-runtime, programming-language, programming-languages.
- [oak](https://www.automicvault.com/pkg/brew/oak/) - Shares av.db curated category or tags: cli, compiler, language-runtime, programming-language, programming-languages.

## Combined YAML source

View the package source record on GitHub. [combined/ocaml.yml](https://github.com/automic-vault/db/blob/main/combined/ocaml.yml)


## Sources

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
