correct • elegant • free

Installing the binary haskell-platform on Debian wheezy

Suppose you have a Debian 7 (wheezy) system, and you want / need to install the latest haskell-platform.

There is a binary build for “generic, Deb 7, style systems”, but it was built on Ubuntu 12.04, and doesn't actually work on Debian 7! Specifically (and oddly, IMHO), while the ghc binary is statically linked, and runs just fine, the cabal binary requires glibc-2.14 or later, and wheezy (admittedly now long in the tooth) only ships glibc-2.13:

cabal update
cabal: /lib/x86_64-linux-gnu/ version `GLIBC_2.14' not found (required by cabal)

The fix is easy: install glibc from jessie. There are a couple of steps. First, we need to make apt-get aware of jessie:

echo deb jessie main > /etc/apt/sources.list.d/jessie.list
apt-get update

Next, we need to tell apt-get not to use jessie packages for everything:

echo 'APT::Default-Release "wheezy";' > /etc/apt/apt.conf

Now we're ready to install the latest glibc:

apt-get install -t jessie libc6

And that's it! Note that, always the traditionalist, I use root shells, rather than the modern preference for prefixing each line with sudo.