Blog - Installing Haskell Platform on Debian testing

Installing Haskell Platform on Debian testing

I usually hit some snags when installing Haskell Platform (HP) on either Ubuntu or Debian. I thought this time I would get lucky, and get it installed without trouble.

First Attempt

In anticipation of a great success, I first blew away all my local installs of HP and GHC, followed by direct haskell-platform package installation:

apt-get install haskell-platform

D’oh, Debian testing’s HP is at 2012.2.0.0. Too old, I want a later version.

HP 2013.2.0.0 requires GHC 7.6.3, so let’s install that. I follow the links on Haskell Platform for Linux and find the GHC 7.6.3 binary release. Trying to install it according to its installation steps..

Hmm, a problem with libgmp.so.3:

~/t/ghc-7.6.3$ ./configure
checking for path to top of build tree... utils/ghc-pwd/dist-install/build/tmp/ghc-pwd:
error while loading shared libraries: libgmp.so.3: cannot open shared object file:
No such file or directory

So I download the GHC 7.6.3 source package, build it and install it. At this point you need to have some older version of GHC still installed. So I use GHC 7.4.1 from the Debian testing package.

With all this done, installing Haskell Platform from source is easy if you managed to correctly install all the prerequisites.

Then I try to update my cabal-install, so I do:

cabal update
cabal install cabal-install

Whoops:

Building cabal-install-1.18.0.2...
Preprocessing executable 'cabal' for cabal-install-1.18.0.2...
Main.hs:118:8:
Could not find module `Distribution.Version'
There are files missing in the `Cabal-1.18.1.1' package,
try running 'ghc-pkg check'.
Use -v to see a list of the files searched for.

Even though I had blown away my .cabal and previous HP installation directories from under my $HOME, I still had managed to leave in a .ghc directory. Nuking that fixed the last problem.

Final Installation Steps

For my future reference, here are the high-level steps I took to install the latest released Haskell Platform:

Prerequisites: some version of GHC installed. In my case GHC 7.4.1 from Debian. Various other packages are needed for HP, these are easy to google so not listing them here.