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.
For Ubuntu, please refer to the ppa:hvr/ghc PPA.
NOTE: Currently, only amd64 binaries are provided; let us know if there's demand for other architectures.
apt edit-sourcesand add the respective line for your Debian release:
deb http://downloads.haskell.org/debian buster main
deb http://downloads.haskell.org/debian stretch main
deb http://downloads.haskell.org/debian jessie main
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BA3CBA3FFE22B574or alternatively
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys BA3CBA3FFE22B574in case port 11371 is blocked by your firewall
apt install ghc-8.4.4 cabal-install-3.0
update-alternatives --config opt-ghcUnless configured manually, the default symlinks point to the latest stable version in "auto mode".
update-alternatives --config opt-cabal
NOTE: Debian 10 includes packages named ghc and cabal-install which provide GHC 8.4.4 and Cabal 126.96.36.199 respectively (and which install to /usr/bin/).
Currently, the following packages are available for Debian 10 (Buster):
NOTE: Debian 9 includes packages named ghc and cabal-install which provide GHC 8.0.1 and Cabal 188.8.131.52 respectively (and which install to /usr/bin/).
Currently, the following packages are available for Debian 9 (Stretch):
NOTE: Debian 8 includes packages named ghc and cabal-install which provide GHC 7.6.3 and Cabal 184.108.40.206 respectively (and which install to /usr/bin/).
Currently, the following packages are available for Debian 8 (Jessie):