將所有 haskell 指令連結到不同版本

將所有 haskell 指令連結到不同版本

我最近安裝了 ghc 7.8,但現在我想回到 ghc 7.4

我透過二進位套件安裝了ghc 7.8,但我沒有正確卸載它。當我跑步時ghcghci或者runhaskell,我得到

/usr/local/bin/ghc: line 9: /usr/local/lib/ghc-7.8.2/bin/ghc: No such file or directory

如何更改所有這些應用程式以指向此處的正確版本 (7.4)?

/usr/bin/ghc-7.4.1

答案1

您可以使用 更新參考update-alternatives

例如:

sudo update-alternatives --set ghc /usr/bin/ghc-7.4.1/ghc
sudo update-alternatives --set ghci /usr/bin/ghc-7.4.1/ghci
sudo update-alternatives --set runhaskell /usr/bin/ghc-7.4.1/runhaskell

更多資訊

相關內容