Search code examples
haskellcabalhaskell-platformcabal-install

What is the correct way to upgrade the versions of Haskell programs installed on /usr/bin?


I have the 3.0.1 version of Alex installed on my /usr/bin. I think the Haskell Platform originally put it there (although I'm not 100% sure...).

Unfortunately, version 3.0.1 is bugged so I need to upgrade it to 3.0.5. I tried using cabal to install the latest version of Alex but cabal install alex-3.0.5 it installed the executable on .cabal/bin over on my home folder instead of on /usr/bin

Do I just manually copy the executable to /usr/bin? (that sound like a lot of trouble to do all the time)

Do I change my PATH environment variable so that .cabal/bin comes before /usr/bin? (I'm afraid that an "ls" executable or similar over on the cabal folder might end up messing up my system)

Or is there a simpler way to go at it in general?


Solution

  • On second though, putting /.cabal/bin in front of /usr/bin in the PATH is simpler and is what most people do already.

    Its also not a big deal since only cabal will put files in .cabal/bin so it should be predictable and with little risk of overwriting stuff.