Cardano Academy
Search…
⌃K

Installing GHC and Cabal [Deprecated]

Install ghc and cabal with ghcup

It's recommended to use ghcup to get GHC and Cabal.
If you are running Linux, macOS (on Intel), FreeBSD or Windows Subsystem for Linux, run the following in your terminal (as a user other than root), then follow the onscreen instructions.
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
For macOS on Apple Silicon, run this instead:
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | arch -x86_64 /bin/bash
When running the installing script, it will mention the required dependencies, open another terminal to install these dependencies, then come back to proceed the installing script.
After installing, you can either reload your env file or simply restart the terminal, so you can use ghcupcommand.

Check your GHC and Cabal version

Check your GHC version and Cabal version by running:
ghc --version
cabal --version
In this tutorial, we are using GHC 8.10.2 and Cabal 3.4.0.0, you can install this version by running:
ghcup install ghc 8.10.2
ghcup install cabal 3.4.0.0
Then set it as the currently "active" GHC and Cabal version:
ghcup set ghc 8.10.2
ghcup set cabal 3.4.0.0
Re-check your current GHC and Cabal version. If it's still not the correct version, try to restart your terminal.