Skip to content

Installation of Coq on Linux

Aaron Puchert edited this page Jan 18, 2022 · 24 revisions
Clone this wiki locally

The recommended installation method is through the Coq platform. Other installation methods are also documented below.

Coq platform

The Coq platform is a distribution of the Coq proof assistant together with a selection of Coq libraries. It provides a set of scripts to compile and install opam, Coq, external Coq libraries and Coq plugins on macOS, Windows and many Linux distributions in a reliable way with consistent results.

Binary package

Beginners are advised to install the binary using the Snap package.

Installation from sources

Experienced users can rely on the Coq platform interactive scripts to install the Coq platform from sources using opam. This will create an opam switch with Coq and a standard set of packages, which can then be modified, e.g., by installing additional packages.

See the Linux specific instructions for the Coq platform scripts here: https://github.com/coq/platform/blob/2021.02/README_Linux.md#installation-by-compiling-from-sources-using-opam

Once the Coq platform is set up, you can install additional Coq packages by running opam install coq-packagename.

User interfaces

You will need a user interface to run Coq. The Coq platform bundles CoqIDE, which is a Coq-specific editor. Alternatively, you can install editor-support packages for VsCode, Emacs or Vim. See https://coq.inria.fr/user-interfaces.html for details.

Manual installation of Coq through opam

Complete instructions are available at https://coq.inria.fr/opam-using.html. They can be useful if you need to manage several versions of Coq and use specific versions of the OCaml compiler. Otherwise, we advise installing Coq through the Coq platform interactive scripts (see above).

Installation from package repositories

latest packaged version(s)

Arch package
Debian unstable package Debian 12 package Debian 11 package Debian 10 package
Fedora Rawhide package Fedora 35 package Fedora 34 package
Gentoo package
Manjaro testing package Manjaro stable package
nixpkgs unstable package nixpkgs stable package
openSUSE Tumbleweed package

Depending on your distribution, your package manager may include an up-to-date Coq package, or a very outdated one. On any Linux distribution, you can rely on Nix to get the latest stable version (or even the development version) and some additional packages.

To check that the installation is successful, run the command coqc -v.

To check that CoqIDE is correctly installed, run the command:

coqide &

You may want to change the default key bindings for CoqIDE.

To install Proof-General, refer to the official Proof-General website.