Rotating Header Image

Bootstrapping cabal

Often I have to install cabal onto a machine where I just have GHC 6.8.2 running. I’ve found the following little script quite practical to install the basics.  Once you have that installed, it is very easy to install other haskell packages with cabal.

# Copyright 2009 Christophe Poucet. All Rights Reserved.
# Author: <christophe (dot) poucet (at) gmail (dot) com> (Christophe Poucet)
# License: BSD3


install_package() {
  local name=$1
  local version=$2

  wget $webroot/$name/$version/$name-$version.tar.gz
  tar xvzf $name-$version.tar.gz
  cd $name-$version
  runghc Setup configure
  runghc Setup build
  sudo runghc Setup install
  cd ..
  rm -rf $name-$version
  rm -f $name-$version.tar.gz

install_package mtl
install_package parsec 3.0.0
install_package network
install_package HTTP 4000.0.4
install_package zlib
install_package Cabal
install_package cabal-install 0.6.2
Be Sociable, Share!


  1. lilac says:

    FYI, the ‘cabal-install’ tarball on hackage includes a script ‘’ which does much the same as this (but seems to get by installing fewer packages).

  2. liesen says:

    doesn’t (bundled with cabal-installed) do exactly this?

  3. cpoucet says:

    I have not looked at the code of, but I can say that at the time, did not work for me while this did.

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>