Friday, February 5, 2016

Upgrading cabal of Haskell in Linux

When updating cabal, one might get this:

$ cabal update
$ cabal install cabal-install cabal
.......
Linking dist/build/cabal/cabal ...
Installing executable(s) in /home/alex/.cabal/bin
Installed cabal-install-1.22.8.0

$ cabal --version
cabal-install version 1.16.0.2
using version 1.16.0 of the Cabal library
Where is cabal we just installed gone? And the answer is that it's at /home/{your_user}/.cabal/bin And the old one is at /usr/bin/cabal How can we fix that? We should add the path to the newer version to PATH. As a rule, I do that via ~/.bashrc:

$ vim ~/.bashrc
And then

export PATH=/home/alex/.cabal/bin:$PATH
$ source ~/.bashrc
To ensure from now on the newer version of cabal will be used:

$ cabal --version
cabal-install version 1.22.8.0
using version 1.22.7.0 of the Cabal library 

No comments :

Post a Comment