ubuntu prerequisites
# Multiprecision arithmetic library developers tools
sudo apt-get install libgmp-dev -y
sudo -K
ghc installation
# get distr
cd $HOME/Downloads
wget http://www.haskell.org/ghc/dist/7.8.3/ghc-7.8.3-x86_64-unknown-linux-deb7.tar.bz2
tar xvfj ghc-7.8.3-x86_64-unknown-linux-deb7.tar.bz2
cd ghc-7.8.3
# install to
mkdir $HOME/Development/bin/ghc-7.8.3
# or choose another path
./configure --prefix=$HOME/Development/bin/ghc-7.8.3
make install
# symbol links
cd $HOME/Development/bin
ln -s `pwd`/ghc-7.8.3 ghc
# add $HOME/Development/bin/ghc to $PATH
$ PATH=$HOME/Development/bin/ghc/bin:${PATH}
# remove temporary files
cd $HOME/Downloads
rm ghc-7.8.3-x86_64-unknown-linux-deb7.tar.bz2
rm -rf ghc-7.8.3
# clone dist
cd $HOME/Downloads
wget http://www.haskell.org/cabal/release/cabal-1.20.0.2/Cabal-1.20.0.2.tar.gz
# extract
tar xzvf Cabal-1.20.0.2.tar.gz
cd Cabal-1.20.0.2
# build
ghc --make Setup.hs
./Setup configure --user
./Setup build
./Setup install
# remove temporary files
cd $HOME/Downloads
rm Cabal-1.20.0.0.tar.gz
rm -rf Cabal-1.20.0.0
# remove old
rm -rf $HOME/.cabal
# get distributive
cd $HOME/Downloads
wget http://www.haskell.org/cabal/release/cabal-install-1.20.0.3/cabal-install-1.20.0.3.tar.gz
# extract archive
tar xzvf cabal-install-1.20.0.3.tar.gz
cd cabal-install-1.20.0.3
# install
./bootstrap.sh
# remove temporary files
cd $HOME/Downloads
rm cabal-install-1.20.0.0.tar.gz
rm -rf cabal-install-1.20.0.0
# add path to cabal to PATH environment
$ PATH=$HOME/.cabal/bin:$PATH