GHC & Cabal APT Repository

This APT repository provides convenient .deb packages for GHC & Cabal releases which can also be installed side-by-side for convenient working/testing with multiple/older GHCs and/or CI systems.

These packages are structured as follows:

ghc-$VER (core package, contains ghc and executables such as haddock)
ghc-$VER-dyn (contains dynamic libraries for version prior to GHC 7.8)
ghc-$VER-prof (contains profiling libs)
ghc-$VER-htmldocs (contains generated HTML Haddock output)

The GHC packages install into a respective version-indexed /opt/ghc/$VER/ folder and so in order to use them, one way is to bring a particular GHC version into scope by placing the respective /opt/ghc/$VER/bin folder early in the PATH environment variable.

There's also a /opt/ghc/bin (& /opt/cabal/bin) folder which contains version-suffixed symlinks to all currently installed GHC versions for convenient use with Cabal where you can select the desired GHC version simply by the -w CLI flag like in cabal v2-build -w ghc-7.8.4

The default ghc symlinks are idiomatically managed by update-alternatives(1) and can be configured via sudo update-alternatives --config opt-ghc
sudo update-alternatives --config opt-cabal

Note that /opt/ghc/bin also contains a default symlink for cabal, so it's enough to include /opt/ghc/bin in your PATH to get access to both cabal and ghc.

If you have any feature requests or encounter any issues, please report them here.

Ubuntu Instructions

For Ubuntu, please refer to the ppa:hvr/ghc PPA.

Debian Instructions

NOTE: Currently, only amd64 binaries are provided; let us know if there's demand for other architectures.

  1. Invoke apt edit-sources and add the respective line for your Debian release:
    For Debian 10:
    deb http://downloads.haskell.org/debian buster main
    For Debian 9:
    deb http://downloads.haskell.org/debian stretch main
    For Debian 8:
    deb http://downloads.haskell.org/debian jessie main
  2. Register the GPG signing key with apt via e.g. apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BA3CBA3FFE22B574 or alternatively apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys BA3CBA3FFE22B574 in case port 11371 is blocked by your firewall
  3. Update package index via apt update
  4. Install the desired GHC & Cabal packages, e.g. apt install ghc-8.4.4 cabal-install-3.0
  5. Add /opt/ghc/bin to your PATH environment variable
  6. (optional) Configure which versions the ghc and cabal symlinks in /opt/ghc/bin refer to with update-alternatives(1): update-alternatives --config opt-ghc
    update-alternatives --config opt-cabal
    Unless configured manually, the default symlinks point to the latest stable version in "auto mode".

Debian 10 (Buster)

NOTE: Debian 10 includes packages named ghc and cabal-install which provide GHC 8.4.4 and Cabal 2.2.0.0 respectively (and which install to /usr/bin/).

Currently, the following packages are available for Debian 10 (Buster):


Debian 9 (Stretch)

NOTE: Debian 9 includes packages named ghc and cabal-install which provide GHC 8.0.1 and Cabal 1.24.0.1 respectively (and which install to /usr/bin/).

Currently, the following packages are available for Debian 9 (Stretch):


Debian 8 (Jessie)

NOTE: Debian 8 includes packages named ghc and cabal-install which provide GHC 7.6.3 and Cabal 1.20.0.3 respectively (and which install to /usr/bin/).

Currently, the following packages are available for Debian 8 (Jessie):