我注意到我在Ubuntu 15.04上运行旧版本的GHC。我可以在不必从源代码编译的情况下获得更新的吗?
答案 0 :(得分:11)
我强烈建议您使用Stack。它让我的生活更容易110%并解决了你的问题。
你可以获得GHC 7.8
1106个不会破坏的套餐(没有阴谋集团,没有集合沙箱安装马拉松),或者你可以获得GHC 7.10
1028个套餐 - source 。
您甚至可以在不同的项目中运行不同版本的GHC
!有关详细信息,请查看FAQ。要安装在Ubuntu系统上,请按照installation docs。
修改:只是尝试使用stack
创建一个新的GHC 7.10
项目,并且它比预期的要多一些。安装stack
后,您将运行:
stack new
然后,您需要修改stack.yaml
,并从
resolver: lts-2.19
为:
resolver: ghc-7.10
然后你可以运行:
stack setup
或者
stack build --install-ghc # to build as well!
您将拥有一个stack
项目GHC 7.10
。 stack.yaml
的参考是here。
答案 1 :(得分:5)
There is a PPA with prepackaged binaries for many recent versions of GHC.
Add the following to your /etc/apt/sources.list.d/extra-ppas.list
file:
deb http://ppa.launchpad.net/hvr/ghc/ubuntu vivid main
deb-src http://ppa.launchpad.net/hvr/ghc/ubuntu vivid main
Install one of the PPA's versions of GHC. They are named tool-version
while the ones that come with Ubuntu are simply named tool
. The most recent at the time of this writing is ghc-7.10.2
, for example.
GHC will be installed under /opt/ghc/<version>/bin
. Add this folder to your path to use that version of GHC.