linux - 无法升级 cabal 本身

标签 linux haskell ubuntu cabal

我正在尝试在 Linux 上升级 Cabal:

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

我得到了很多错误:

$ cabal install cabal cabal-install
.............................

checking for sendfile in sys/socket.h... no
checking for gethostent... yes
checking for accept4... yes
configure: creating ./config.status
config.status: creating network.buildinfo
config.status: creating include/HsNetworkConfig.h
configure: WARNING: unrecognized options: --with-compiler, --with-gcc
Building network-2.6.2.0...
Preprocessing library network-2.6.2.0...
ghc: ghc no longer supports single-file style package databases (dist/package.conf.inplace) use 'ghc-pkg init' to create the database with the correct format.
Failed to install network-2.6.2.0
Configuring old-locale-1.0.0.7...
Building old-locale-1.0.0.7...
Preprocessing library old-locale-1.0.0.7...
ghc: ghc no longer supports single-file style package databases (dist/package.conf.inplace) use 'ghc-pkg init' to create the database with the correct format.
Failed to install old-locale-1.0.0.7
Configuring random-1.1...
Building random-1.1...
Preprocessing library random-1.1...
ghc: ghc no longer supports single-file style package databases (dist/package.conf.inplace) use 'ghc-pkg init' to create the database with the correct format.
Failed to install random-1.1
Configuring stm-2.4.4...
Building stm-2.4.4...
Preprocessing library stm-2.4.4...
ghc: ghc no longer supports single-file style package databases (dist/package.conf.inplace) use 'ghc-pkg init' to create the database with the correct format.
Failed to install stm-2.4.4
Configuring text-1.2.1.1...
Building text-1.2.1.1...
Preprocessing library text-1.2.1.1...
ghc: ghc no longer supports single-file style package databases (dist/package.conf.inplace) use 'ghc-pkg init' to create the database with the correct format.
Failed to install text-1.2.1.1
Configuring zlib-0.5.4.2...
Building zlib-0.5.4.2...
Preprocessing library zlib-0.5.4.2...
ghc: ghc no longer supports single-file style package databases (dist/package.conf.inplace) use 'ghc-pkg init' to create the database with the correct format.
Failed to install zlib-0.5.4.2
cabal: Error: some packages failed to install:
HTTP-4000.2.19 depends on text-1.2.1.1 which failed to install.
cabal-install-1.22.4.0 depends on zlib-0.5.4.2 which failed to install.
mtl-2.2.1 failed during the building phase. The exception was:
ExitFailure 1
network-2.6.2.0 failed during the building phase. The exception was:
ExitFailure 1
network-uri-2.6.0.3 depends on text-1.2.1.1 which failed to install.
old-locale-1.0.0.7 failed during the building phase. The exception was:
ExitFailure 1
old-time-1.1.0.3 depends on old-locale-1.0.0.7 which failed to install.
parsec-3.1.9 depends on text-1.2.1.1 which failed to install.
random-1.1 failed during the building phase. The exception was:
ExitFailure 1
stm-2.4.4 failed during the building phase. The exception was:
ExitFailure 1
text-1.2.1.1 failed during the building phase. The exception was:
ExitFailure 1
zlib-0.5.4.2 failed during the building phase. The exception was:
ExitFailure 1

最佳答案

很可能发生的情况是您已经升级了 GHC,而 GHC 7.10 需要 Cabal 1.22,否则会出现错误 ghc:ghc 不再支持单文件样式包数据库 (dist/package.conf.inplace) 使用“ghc-pkg init”以正确的格式创建数据库。 出现。由于您使用的是 Ubuntu,因此您可以从 the PPA 安装 cabal-install :

sudo apt-add-repository ppa:hvr/ghc
sudo apt-get update && sudo apt-get install cabal-install-1.22

由于 PPA 安装位置不在 PATH 中,您可以将 /opt/cabal/1.22/bin 添加到您的 PATH,或者选择运行 /opt/cabal/1.22/bin/cabal install cabal 如果您希望将所有 Haskell 二进制文件放在一个位置,然后使用 apt-get 卸载 cabal-install

否则在 haskell.org 有可用的二进制文件.

关于linux - 无法升级 cabal 本身,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30700447/

相关文章:

linux - boost_python-mt.so 不可用

c - 使用 Visual Studio 2010 构建 Linux 内核

java - 找不到 Gerrit JDBC 驱动程序

haskell - 我可以检查 Haskell 如何分配内存吗?

c - 在 Linux Mint 中编译 C 程序时出错

ruby-on-rails - 使用带有光学字符识别的 Ruby 和 Ubuntu

c++ - CPU 时间测量

mysql - 如何使用 Snap 的 MysqlSimple snaplet 连接到 MySQL

haskell - 如何使用Shake执行sh命令

windows - 如何连接代理 : IPC connect call