Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Installing OPAM

OPAM is the OCaml package manager. We use it to install Coq and its libraries.

Linux

Ubuntu/Debian

sudo apt-get update
sudo apt-get install opam
opam init
eval $(opam env)

Fedora/RHEL

sudo dnf install opam
opam init
eval $(opam env)

Arch Linux

sudo pacman -S opam
opam init
eval $(opam env)

macOS

Using Homebrew

brew install opam
opam init
eval $(opam env)

Using MacPorts

sudo port install opam
opam init
eval $(opam env)

Windows

Use WSL2 (Windows Subsystem for Linux), then follow Linux instructions.

Create OPAM Switch

Create a dedicated environment for Ursus:

opam switch create ursus 4.12.0
eval $(opam env)

Verify Installation

opam --version
# Should show: 2.0.0 or later

Next Steps

Continue to Coq Installation

Troubleshooting

OPAM command not found after installation:

eval $(opam env)
# Add to ~/.bashrc or ~/.zshrc:
echo 'eval $(opam env)' >> ~/.bashrc

Permission errors:

# Don't use sudo with opam commands
opam init --disable-sandboxing

Reference