Installation of Coq on Linux
Clone this wiki locally
The recommended installation method is through the Coq platform. Other installation methods are also documented below.
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.
Beginners are advised to install the binary using the Snap package.
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.
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.
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).
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
To check that CoqIDE is correctly installed, run the command:
You may want to change the default key bindings for CoqIDE.
To install Proof-General, refer to the official Proof-General website.
To the extent possible under law, the contributors of “Cocorico!, the Coq wiki” have waived all copyright and related or neighboring rights to their contributions.
By contributing to Cocorico!, the Coq wiki, you agree that you hold the copyright and you agree to license your contribution under the CC0 license or you agree that you have permission to distribute your contribution under the CC0 license.