Installing Haskell

View source | View history | Atom feed for this file

On a new machine

This is how I would do it given a new Debian stable machine with no previous installations of Haskell. It’s easy to just install haskell-platform, but this introduces an older version of cabal, which may or may not be annoying. The following is the minimal way to get things installed.

There might be some unexpected problems when executing the commands below. On Linux Mint (either 17.1 or 17.3), I couldn’t install cabal-install- because complained about not having transformers version 0.4 (the Linux Mint repositories have 0.3). However, installing from the older cabal-install- seems to work. On the other hand, Ubuntu MATE 16.04 seems to have no problem with version (but had documenting issues with (This is intended as an example of a problem one might run into, and not as an exhaustive list of issues.)

sudo aptitude install ghc ghc-haddock zlib1g-dev # or maybe libghc-zlib
                                    # will work too; actually, 
                                    # "libghc-zlib-dev" will pull
                                    # "zlib1g-dev" so it doesn't really
                                    # matter
tar -zxf cabal-install- && rm cabal-install-
# on Linux Mint using cabal-install-, I also had to install ghc-prof and ghc-dynamic for this to work.
echo "PATH+=':$HOME/.cabal/bin'" >> ~/.bashrc
cabal update && cabal install cabal cabal-install alex happy



cabal update
cabal install --force pandoc pandoc-citeproc

seemed to work. When I just did cabal install hakyll (since that is why I wanted Pandoc), the install failed with

pandoc-1.13.1 failed during the building phase. The exception was:
ExitFailure 1

(See the discussion here, which may or may not be relevant.)

Since I had some really old versions of Pandoc and cabal on my machine (from the Debian repositories), I just redefined my path with $HOME/.cabal/bin as the first item, so that the newer programs in there would take priority. See also the article about avoiding “Cabal hell”.

To update Pandoc to the latest version on Debian, I recently (2015-11-27) did:

cabal update
cabal install cabal
cabal install --max-backjumps=-1 --reorder-goals --force-reinstalls pandoc


did not work when I just did cabal install hakyll. I had to force install Pandoc again and then do cabal install hakyll once more. Strange…

2014-10-10: I had to do cabal --force-reinstall install hakyll. waiting to see if it works…