0

Following the instructions from this post on how to update cabal-install, I seemed to be able to install the latest version (or at least some version > 1.18, which is what I wanted.

$ cabal install Cabal cabal-install
Resolving dependencies...
Configuring cabal-install-1.22.6.0...
Building cabal-install-1.22.6.0...
Preprocessing executable 'cabal' for cabal-install-1.22.6.0...
<snip>
Linking dist/build/cabal/cabal ...
Installing executable(s) in /home/kavi/.cabal/bin
Installed cabal-install-1.22.6.0

However, when I tried cabal sandbox, it failed, so I checked cabal --version.

$ cabal --version
cabal-install version 1.16.0.2
using version 1.16.0 of the Cabal library 

As you can see, the version is not the one that cabal claimed to install.

Adding ~/.cabal/bin to my path did nothing to help. (Yes, I did restart my terminal).

$ echo $PATH
<snip>:/home/kavi/.cabal/bin
$ cabal --version
cabal-install version 1.16.0.2
using version 1.16.0 of the Cabal library 

I tried restarting my computer, but still:

$ cabal --version
cabal-install version 1.16.0.2
using version 1.16.0 of the Cabal library

I am using Ubuntu 14.04.

Community
  • 1
  • 1
k_g
  • 4,333
  • 2
  • 25
  • 40

1 Answers1

4

You should add /home/kavi/.cabal/bin to the beginning of the $PATH.

which cabal tells which executable shell will pick to execute, on my machine:

% echo $PATH
/Users/ogre/.local/bin:...

% which cabal
/Users/ogre/.local/bin/cabal
phadej
  • 11,947
  • 41
  • 78
  • Ah, so having it at the end does nothing? – k_g Dec 13 '15 at 09:23
  • @k_g shell picks executable from the first directory it finds it in. The order matters, but in this cae you'd like to have `~/.cabal/bin` somewhere before system-wide directories. – phadej Dec 13 '15 at 09:48