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

General purpose programming language in the ML family. Version 4.14.4 via Homebrew; verified 2026-06-19.

## Install

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

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install ocaml@4
```

  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@4
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/ocaml@4>
- **Version:** 4.14.4
- **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-4.14/ocaml-4.14.4.tar.xz>
- **Last updated:** 2026-06-19T12:32:40-07:00
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- ocamlcp.byte (cli)
- ocamlcp.opt (cli)
- ocamlmklib.byte (cli)
- ocamlmklib.opt (cli)
- ocamlmktop.byte (cli)
- ocamlmktop.opt (cli)
- ocamloptp.byte (cli)
- ocamloptp.opt (cli)
- ocamlprof.byte (cli)
- ocamlprof.opt (cli)
- ocamlcp.byte (alias)
- ocamlcp.opt (alias)
- ocamlmklib.byte (alias)
- ocamlmklib.opt (alias)
- ocamlmktop.byte (alias)
- ocamlmktop.opt (alias)
- ocamloptp.byte (alias)
- ocamloptp.opt (alias)
- ocamlprof.byte (alias)
- ocamlprof.opt (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: 4.14.4
- Package-manager updated: 2026-06-19
- Local data: ok
- Upstream repository: https://ocaml.org/
- info: Release/tag comparison is only available for GitHub repositories.
## Project history and usage

ocaml@4 packages the OCaml 4 compiler line separately from the main ocaml formula. It exists for projects and dependency graphs that still need the OCaml 4 runtime, compiler-libs AST, PPX compatibility, or build behavior rather than the OCaml 5 runtime model.

### Project history

OCaml 4 began as the post-Objective Caml line that added features such as GADTs and first-class modules in 4.0. The 4.x series became the compatibility baseline for a large portion of the opam ecosystem across the 2010s and early 2020s, including packages whose PPX rewriters or compiler-libs dependencies track specific OCaml AST versions.

The 4.14 branch became the final OCaml 4 branch. OCaml.org release notes describe 4.14 as the last version of OCaml 4 and a long-term support branch for the transition to OCaml 5; OCaml 4.14.4 was released on 2026-06-15 with safe bug fixes and security fixes cherry-picked from OCaml 5.

### Adoption history

The separate Homebrew formula reflects the same compatibility pressure seen in opam switches: developers may need a compiler line older than the default package to build older projects, reproduce releases, or support dependencies not yet migrated to OCaml 5.

### How it is used

Users install ocaml@4 when a project specifies OCaml 4.14 or an older 4.x-compatible dependency set. The package exposes the standard OCaml compiler commands, including ocaml, ocamlc, ocamlopt, ocamldep, ocamldoc, ocamllex, ocamlyacc, ocamlobjinfo, and runtime utilities.

### Why package nerds care

Versioned compiler formulae are important for OCaml because compiler releases affect ABI, compiler-libs APIs, PPX ASTs, and package solver outcomes. ocaml@4 is a compact example of a package manager preserving a language ecosystem's old compiler branch while the main formula follows OCaml 5.

### Timeline

- 2012: OCaml 4.0 added GADTs and first-class modules.
- 2016: OCaml 4.03 split ocamlbuild into an independent project.
- 2022: OCaml 5.0 introduced a rewritten runtime and began the transition away from OCaml 4 as the main line.
- 2024-03-14: OCaml 4.14.2 release notes described 4.14 as the last OCaml 4 branch.
- 2026-06-15: OCaml 4.14.4 was released with safe bug fixes and security fixes cherry-picked from OCaml 5.

### Related projects

- ocaml@4 pairs with opam switches, findlib, Dune, ocamlbuild, and PPX tooling in older projects. Its practical relationship to brew:ocaml is version selection rather than a separate language lineage.

### Sources

- <https://discuss.ocaml.org/t/ocaml-5-0-0-is-out/10974>
- <https://formulae.brew.sh/formula/ocaml@4>
- <https://ocaml.org/history>
- <https://ocaml.org/releases/4.03.0>
- <https://ocaml.org/releases/4.14.2>
- <https://ocaml.org/releases/4.14.4>


## Security Notes

No matching local secret-handling manifest was found for ocaml@4. Nucleus package metadata is still published here so future coverage has a stable package URL.


## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** ocaml@4
- **Version Scheme:** 0
- **Revision:** 0
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** yes
- **URL Keys:** stable

## Other Package-Manager Records

- Debian apt - libcompiler-libs-ocaml-dev - 5.3.0-3: versioned package alias 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: versioned package alias 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: versioned package alias 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: versioned package alias 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: versioned package alias 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: versioned package alias 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: versioned package alias 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: versioned package alias 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: versioned package alias 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: versioned package alias 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: versioned package alias 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: versioned package alias 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: versioned package alias 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: versioned package alias 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: versioned package alias 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: versioned package alias 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

- [Language runtime packages](https://www.automicvault.com/pkg/language-runtime-packages/) - Matched language runtime, compiler, or interpreter metadata.
- [Networking and protocol packages](https://www.automicvault.com/pkg/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [ocaml](https://www.automicvault.com/pkg/brew/ocaml/) - Package name indicates the same formula family.
- [ocaml-findlib](https://www.automicvault.com/pkg/brew/ocaml-findlib/) - Package names and metadata indicate a similar tool family. Shared terms: ocaml.
- [clojure](https://www.automicvault.com/pkg/brew/clojure/) - Local package facts share a topical domain. Shared terms: general, language, programming, purpose.

## Combined YAML source

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


## Sources

- Nucleus package database
- package-page enrichment
- curated package history
- package version freshness
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
