Movatterモバイル変換


[0]ホーム

URL:


opam on Github

How to install opam

This page describes how to install and configure opam. For further help on howto use opam, either readopam --help or move on to theUsage guide.

Upgrading from a previous version

Generally, you should just reproduce the same installation steps as for theoriginal installation: upgrade from your system's package manager, or re-run thebinary installer. Opam will automatically update its internal repository at~/.opam on first run if needed (if using our installer script, a backup can bemade automatically).

To upgrade shell scripts, and enable sandboxing, don't forget to runopam init--reinit -ni.

Then see theUpgrade guide to check the changes.

Binary distribution

The quickest way to get the latest opam up and working is to runthis script:

bash -c "sh <(curl -fsSL https://opam.ocaml.org/install.sh)"

orthis script on Windows using PowerShell:

Invoke-Expression "& { $(Invoke-RestMethod https://opam.ocaml.org/install.ps1) }"

This will simply check your architecture, download and install the properpre-compiled binary, backup your opam data if from an older version, and runopam init.

(If you have trouble withcurl, justdownload the scriptand runsh install.sh)

We provide pre-compiled binaries for:

  • Linux (amd64, arm64, ppc64le, s390x, riscv64, armhf, i686)
  • macOS (amd64, arm64)
  • FreeBSD (amd64)
  • OpenBSD (amd64)
  • NetBSD (amd64)
  • Windows (amd64)(other platforms are available using the other methods below)

If you don't like scripts, you can just pick your downloadhere, put it in your PATH asopam, and set it as executable, e.g.

sudo install <downloaded file> /usr/local/bin/opam

Note that this script is intended for end-users, not CI. For that purpose,you can use pre-builtDocker images for variousconfigurations.

Using your system's package manager

This is generally the recommended way,when available and up-to-date. Youcan check the following table, and the way to install opam thereafter:

repology package status

Arch Linux

pacman -S opam

Debian and Ubuntu

apt install opam

Fedora

dnf install opam

Mageia

urpmi opam

Alpine Linux

apk add opam

OpenBSD

pkg_add opam

FreeBSD

pkg install ocaml-opam

macOS

Opam packages forHomebrew andMacPorts are available.

# Homebrewbrew install opam# MacPortport install opam

Guix & Guix System

guix install opam

Windows

winget install Git.Git OCaml.opam

WinGet the Windows Package Manager is available on Windows 11, modern versions of Windows 10, and Windows Server 2025.See theofficial documentation for additional info.

From Sources

Getting the Sources

Sources of the latest stable version of opam are available on Github:

You can also download the full archives, including opam dependencies (thesedon't require any extra downloads):

  • 2.4.1
    • MD5: 57df5d14234be1ba65ad6acb3a22e860
    • SHA512: 25e0b60c214f94c91780658ce4af149c89549b6d164d07739eca2e8b1c2ea2086e17a64ba486c4a8365fcdf532729848f410f63e3579f2bdd564fc333ab3f787

Follow the instructions in the includedREADME.md to get opam built andinstalled from there.

Generated fromInstall.mdusingopam2web, courtesy ofOCamlPro.Commercial support.

[8]ページ先頭

©2009-2025 Movatter.jp