Cabal 无法在 Linux 上安装 network-2.6.3.1

Cabal failing to install network-2.6.3.1 on Linux

简而言之,我是 Haskell 世界的新手,在安装依赖于 network-2.6.3.1 的软件包时遇到问题。

cabal install happstack-server
Resolving dependencies...
Configuring network-2.6.3.1...
Failed to install network-2.6.3.1
cabal: Error: some packages failed to install:
happstack-server-7.4.6.2 depends on network-2.6.3.1 which failed to install.
hslogger-1.2.10 depends on network-2.6.3.1 which failed to install.
network-2.6.3.1 failed during the configure step. The exception was:
ExitFailure 127
sendfile-0.7.9 depends on network-2.6.3.1 which failed to install.

单独安装网络会产生类似的结果。是否有任何常见的错误安装嫌疑或推荐步骤?我已经成功安装了其他包,ghcid, ghc-mod etc.

更新

> ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.6.3
> cabal --version
cabal-install version 1.16.0.2 using version 1.16.0 of the Cabal library"
> ghc-pkg list 
/var/lib/ghc/package.conf.d
   Cabal-1.16.0
   GLURaw-1.3.0.0
   GLUT-2.4.0.0
   HTTP-4000.2.8
   HUnit-1.2.5.2
   MonadCatchIO-mtl-0.3.0.5
   OpenGL-2.8.0.0
   OpenGLRaw-1.3.0.0
   QuickCheck-2.6
   array-0.4.0.1
   async-2.0.1.4
   attoparsec-0.10.4.0
   base-4.6.0.1
   bin-package-db-0.0.0.0
   binary-0.5.1.1
   bytestring-0.10.0.2
   case-insensitive-1.1.0.2
   cgi-3001.1.8.3
   containers-0.5.0.0
   deepseq-1.3.0.1
   directory-1.2.0.1
   extensible-exceptions-0.1.1.4
   fgl-5.4.2.4
   filepath-1.3.0.1
   ghc-7.6.3
   ghc-prim-0.3.0.0
   hashable-1.2.1.0
   haskell-src-1.0.1.5
   haskell2010-1.1.1.0
   haskell98-2.0.0.2
   hoopl-3.9.0.0
   hpc-0.6.0.0
   html-1.0.1.2
   integer-gmp-0.5.0.0
   mtl-2.1.2
   network-2.4.1.2
   old-locale-1.0.0.5
   old-time-1.1.0.1
   parallel-3.2.0.3
   parsec-3.1.3
   pretty-1.1.1.0
   primitive-0.5.0.1
   process-1.1.0.2
   random-1.0.1.1
   regex-base-0.93.2
   regex-compat-0.95.1
   regex-posix-0.95.2
   rts-1.0
   split-0.2.2
   stm-2.4.2
   syb-0.4.0
   template-haskell-2.8.0.0
   text-0.11.3.1
   time-1.4.0.1
   transformers-0.3.0.0
   unix-2.6.0.1
   unordered-containers-0.2.3.0
   vector-0.10.0.1
   xhtml-3000.2.1
   zlib-0.5.4.1
/home/myHome/.ghc/x86_64-linux-7.6.3/package.conf.d
   base64-bytestring-1.0.0.1
   blaze-builder-0.4.0.2
   blaze-html-0.8.1.2
   blaze-markup-0.7.1.0
   bytestring-0.10.8.1
   bytestring-builder-0.10.8.1.0
   cereal-0.5.3.0
   exceptions-0.8.3
   fail-4.9.0.0
   monad-control-1.0.1.0
   mtl-2.2.1
   network-uri-2.6.1.0
   parsec-3.1.11
   system-filepath-0.4.13.4
   threads-0.5.1.4
   time-compat-0.1.0.3
   transformers-0.5.2.0
   transformers-base-0.4.4
   transformers-compat-0.5.1.4
   utf8-string-1.0.1.1

我建议使用 stack it is fairly simply to install, also I would recommend using a newer version of GHC - this hvr-ppa 可以帮助你(建议使用 GHC 7.10.2 或 8.0.1!)

删除旧的 ./ghc 目录并使用 stack

重新安装旧的工具
stack install ghcid
stack install ghc-mod
stack install happstack-server

注意:不要忘记将~/.local/bin添加到您的$PATH,否则将找不到ghc-mod等。

如果你不想使用 stack - 你需要找到在旧版本中安装网络包的 cabal-package - 在沙箱中安装那个,然后在另一个沙箱中安装 happstack-server沙箱。

如果我没记错的话——Cabal 1.16 不支持沙箱。