Haskell and Ubuntu
by Mithrandir
For a normal user, wanting a haskell compiler only for some school courses, a simple apt-get command in Ubuntu is enough. This is not true for someone wanting to really develop something good in Haskell. If he wants to use Ubuntu, then he will get into some problems. I hope that this article will solve some of them.
The big problem relies on installing cabal. It requires ghc 6.10 but the Ubuntu guys are packaging 6.08. Manual install is not good enough (some security faults). However, there is a way around this issue.
First, remove any old haskell compilers and libs that you may have:
sudo apt-get remove ghc6
Warning! Don’t try
sudo apt-get remove ghc6*
because you’ll lose the ubuntu-desktop package. Fortunately, by just removing ghc6 you’ll also remove the libghc6* files. You can try a purge if you deem it necessary.
We are going to add a new PPA. Paste the following lines into /etc/apt/sources.list.d/haskell.list, touching the file if needed and changing jaunty accordingly
deb http://ppa.launchpad.net/someone561/ppa/ubuntu jaunty main deb-src http://ppa.launchpad.net/someone561/ppa/ubuntu jaunty main
The next one is optional – use it for package authentication.
sudo apt-key adv --recv-keys --keyserver\ keyserver.ubuntu.com E51D9310
Update your system:
sudo apt-get update
And install all the needed packages
sudo apt-get install ghc6 ghc6-prof ghc6-doc haddock sudo apt-get install libglut-dev happy alex libedit-dev zlib1g-dev sudo apt-get install checkinstall
Go to Haskell Platform and get the sources. Unpack them, cd to that directory and run:
./configure make sudo make install sudo checkinstall -y
To test, you can do this:
sudo cabal install hoogle
That’s all folks
[...] You will need a working Haskell compiler. The Glasgow Haskell Compiler is already installed on DICE machines — type ghci at a command prompt for the interactive toplevel, and ghc for the compiler. GHC is also available for a dozen other distributions and platforms. If you are installing it yourself, try the Haskell Platform first, as that brings in a good supply of tools and libraries. The platform is not supported on Debian yet, though if you are on Ubuntu you can try these instructions. [...]
Hi,
I tried this, but with jaunty replaced by karmic.
After the first “apt-get install” command above, I got the error message
“ghc6: Står i konflikt med: haddock”
which is swedish for “… is in conflict with …”.
Do you know if the ppa for karmic is ready for use ?
best regards, David
Hmm, try uninstalling haddock before installing ghc6. Haddock is a tool for haskell and this is why you get conflicts.
I didnt have haddock installed. I tried it from a clean Karmic install.
But I looked at the ppa page, and haddock isnt listed there (although i havent checked really whats included in the packages). Anyway, I skipped haddock, and now it seems to work .
It works fine !
I didnt realize Karmic has already ghc-6.10.4 in the repository, so all I had to do was to skip the first step, the ppa is not needed. With the above ppa for karmic, ghc was 6. 12, and it caused problems when trying to build parts of haskell-platform.