Search code examples
haskelldebiancabalhaskell-platformcabal-install

cabal-install and Debian


So, this is a bit of a personal problem, but maybe people will have good advice or workarounds.

The problem is about installing cabal-install and haskell-platform under Debian.

When you apt-get install haskell-platform, it ships with cabal-install, and its command cabal is available.

Now this cabal-install is not up-to-date:

> which cabal
/usr/bin/cabal
> /usr/bin/cabal --version
cabal-install version 0.8.0
using version 1.8.0.2 of the Cabal library

But, my understanding of running cabal update is that it updates cabal, but since it is not a "Debian thingy", it puts it in ~/.cabal/bin/.

> ~/.cabal/bin/cabal --version
cabal-install version 0.8.2
using version 1.8.0.2 of the Cabal library

Now my system has 2 cabals, and the one I get by typing cabal is not the one I want to use... Because it'll keep updating the other one instead of itself, and is therefore ineffective.

So what I did was I aliased it in my ~/.bashrc:

alias cabal='~/.cabal/bin/cabal'

Now:

> cabal --version
cabal-install version 0.8.2
using version 1.8.0.2 of the Cabal library

So, my final questions:

  • Is there a deb repository that holds cabal 0.8.2?
  • Could my current solution lead to problems? (For instance, which cabal still points to my useless /usr/bin/cabal, so if scripts use this command they'll get fooled...)
  • Did someone come up with a better solution? (Mine is a bit ad-hoc but that's all I could come up to with my poor knowledge of what is happening behind the scenes...)
  • Please correct me if anything I say above is wrong or inaccurate.

Solution

  • What I do is installing cabal with the --global flag. This will install cabal into /usr/local/bin/cabal, thus it will always superseed the Debian packages cabal.

    Another way, is to generally avoid the Debian packages and install the Haskell platform straight from its source. This approach is also better, if you always want to have the latest releases of the Haskell libs.