Last Updated: May 26, 2018
· seuros

Install Haskell's Cabal/Stack on Ubuntu


sudo add-apt-repository -y ppa:hvr/ghc
sudo apt-get update
sudo apt-get install -y cabal-install-1.22 ghc-7.10.2
cat >> ~/.bashrc <<EOF
export PATH=~/.cabal/bin:/opt/cabal/1.22/bin:/opt/ghc/7.10.2/bin:$PATH
# Remember to edit .bashrc everytime you upgrade cabal from the repository.
source ~/.bashrc
cabal --version #check you have the correct version
cabal update
# Optionally you can install Alex and Happy
# Alex is a lexical analyser generator
# Happy is a parser generator
cabal install alex happy


wget -q -O- | sudo apt-key add -
echo "deb$(lsb_release -sc) stable main"|sudo tee /etc/apt/sources.list.d/fpco.list
sudo apt-get update
sudo apt-get install stack -y