cabal无法更新并且“某些软件包无法安装”

时间:2012-08-22 07:16:37

标签: haskell cabal cabal-install

我对Haskell世界很陌生,我想使用包HaskellCharts。 方法似乎是使用cabal,所以我从我的存储库安装了cabal-install(我在Ubuntu 10.04.4 LTS 32位上)。

我的规格是:

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.12.1
$ which ghc
/usr/bin/ghc

$ cabal --version
cabal-install version 0.8.0
using version 1.8.0.2 of the Cabal library

HaskellCharts安装指南(截至2010年5月27日)告诉我

cabal update
cabal install gtk2hs-buildtools
cabal install gtk
cabal install chart

cabal update成功了,并告诉我有更新版本的cabal。

$ cabal install gtk2hs-buildtools
然而,

产量

Resolving dependencies...
Downloading gtk2hs-buildtools-0.12.3.1...
Configuring gtk2hs-buildtools-0.12.3.1...
cabal: alex is required but it could not be found.
cabal: Error: some packages failed to install:
gtk2hs-buildtools-0.12.3.1 failed during the configure step. The exception
was:
ExitFailure 1

所以我首先尝试安装alex,但这也会导致错误,我无法解决这个错误:

$ cabal install alex
Resolving dependencies...
Downloading alex-3.0.2...
[1 of 1] Compiling Main             ( /tmp/alex-3.0.219087/alex-3.0.2/Setup.lhs, /tmp/alex-3.0.219087/alex-3.0.2/dist/setup/Main.o )
Linking /tmp/alex-3.0.219087/alex-3.0.2/dist/setup/setup ...
Configuring alex-3.0.2...
Preprocessing executables for alex-3.0.2...
Building alex-3.0.2...
ghc: unrecognised flags: -rtsopts
Usage: For basic information, try the `--help' option.
cabal: Error: some packages failed to install:
alex-3.0.2 failed during the building phase. The exception was:
ExitFailure 1

为了确保过时的版本/不兼容的软件包等版本不会出现问题,我尝试更新cabal本身。

$ cabal install cabal-install

导致

Resolving dependencies...
Warning: network.cabal: Ignoring unknown section type: test-suite
Warning: network.cabal: Ignoring unknown section type: test-suite
Configuring network-2.3.1.0...
configure: WARNING: unrecognized options: --with-compiler
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for an ANSI C-conforming const... yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking for stdlib.h... (cached) yes
checking for sys/types.h... (cached) yes
checking for unistd.h... (cached) yes
checking winsock2.h usability... no
checking winsock2.h presence... no
checking for winsock2.h... no
checking ws2tcpip.h usability... no
checking ws2tcpip.h presence... no
checking for ws2tcpip.h... no
checking wspiapi.h usability... no
checking wspiapi.h presence... no
checking for wspiapi.h... no
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking netinet/tcp.h usability... yes
checking netinet/tcp.h presence... yes
checking for netinet/tcp.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/uio.h usability... yes
checking sys/uio.h presence... yes
checking for sys/uio.h... yes
checking sys/un.h usability... yes
checking sys/un.h presence... yes
checking for sys/un.h... yes
checking for readlink... yes
checking for symlink... yes
checking for struct msghdr.msg_control... yes
checking for struct msghdr.msg_accrights... no
checking for struct sockaddr.sa_len... no
checking for in_addr_t in netinet/in.h... yes
checking for SO_PEERCRED and struct ucred in sys/socket.h... yes
checking for _head_libws2_32_a in -lws2_32... no
checking for getaddrinfo... yes
checking for gai_strerror... yes
checking whether AI_ADDRCONFIG is declared... yes
checking whether AI_ALL is declared... yes
checking whether AI_NUMERICSERV is declared... yes
checking whether AI_V4MAPPED is declared... yes
checking whether IPV6_V6ONLY is declared... yes
checking for sendfile in sys/sendfile.h... yes
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
Preprocessing library network-2.3.1.0...
Building network-2.3.1.0...
[ 1 of 10] Compiling Network.URI      ( Network/URI.hs, dist/build/Network/URI.o )

Network/URI.hs:580:24:
    Couldn't match expected type `Char' against inferred type `[Char]'
      Expected type: GenParser Char () Char
      Inferred type: URIParser String
    In the first argument of `notFollowedBy', namely `regName'
    In a stmt of a 'do' expression: notFollowedBy regName
cabal: Error: some packages failed to install:
HTTP-4000.2.3 depends on network-2.3.1.0 which failed to install.
cabal-install-0.10.2 depends on network-2.3.1.0 which failed to install.
network-2.3.1.0 failed during the building phase. The exception was:
ExitFailure 1

尝试通过network自行安装cabal install network软件包会产生完全相同的错误。

我试过

$ ghc-pkg check

打印出来:

There are problems in package QuickCheck-2.5:
  import-dirs: /home/kenny/.cabal/lib/QuickCheck-2.5/ghc-6.12.1 doesn't exist or isn't a directory
  library-dirs: /home/kenny/.cabal/lib/QuickCheck-2.5/ghc-6.12.1 doesn't exist or isn't a directory
  file Test/QuickCheck/All.hi is missing
  file Test/QuickCheck/Function.hi is missing
  file Test/QuickCheck.hi is missing
  file Test/QuickCheck/Arbitrary.hi is missing
  file Test/QuickCheck/Gen.hi is missing
  file Test/QuickCheck/Monadic.hi is missing
  file Test/QuickCheck/Modifiers.hi is missing
  file Test/QuickCheck/Property.hi is missing
  file Test/QuickCheck/Test.hi is missing
  file Test/QuickCheck/Text.hi is missing
  file Test/QuickCheck/Poly.hi is missing
  file Test/QuickCheck/State.hi is missing
  file Test/QuickCheck/Exception.hi is missing
  cannot find libHSQuickCheck-2.5.a on library path
There are problems in package Chart-0.16:
  import-dirs: /home/kenny/.cabal/lib/Chart-0.16/ghc-6.12.1 doesn't exist or isn't a directory
  library-dirs: /home/kenny/.cabal/lib/Chart-0.16/ghc-6.12.1 doesn't exist or isn't a directory
  file Graphics/Rendering/Chart.hi is missing
  file Graphics/Rendering/Chart/Types.hi is missing
  file Graphics/Rendering/Chart/Renderable.hi is missing
  file Graphics/Rendering/Chart/Axis.hi is missing
  file Graphics/Rendering/Chart/Axis/Floating.hi is missing
  file Graphics/Rendering/Chart/Axis/Indexed.hi is missing
  file Graphics/Rendering/Chart/Axis/Int.hi is missing
  file Graphics/Rendering/Chart/Axis/LocalTime.hi is missing
  file Graphics/Rendering/Chart/Axis/Types.hi is missing
  file Graphics/Rendering/Chart/Axis/Unit.hi is missing
  file Graphics/Rendering/Chart/Layout.hi is missing
  file Graphics/Rendering/Chart/Legend.hi is missing
  file Graphics/Rendering/Chart/Simple.hi is missing
  file Graphics/Rendering/Chart/Simple/Internal.hi is missing
  file Graphics/Rendering/Chart/Grid.hi is missing
  file Graphics/Rendering/Chart/Plot.hi is missing
  file Graphics/Rendering/Chart/Plot/Types.hi is missing
  file Graphics/Rendering/Chart/Plot/Annotation.hi is missing
  file Graphics/Rendering/Chart/Plot/AreaSpots.hi is missing
  file Graphics/Rendering/Chart/Plot/Bars.hi is missing
  file Graphics/Rendering/Chart/Plot/Candle.hi is missing
  file Graphics/Rendering/Chart/Plot/ErrBars.hi is missing
  file Graphics/Rendering/Chart/Plot/FillBetween.hi is missing
  file Graphics/Rendering/Chart/Plot/Hidden.hi is missing
  file Graphics/Rendering/Chart/Plot/Lines.hi is missing
  file Graphics/Rendering/Chart/Plot/Pie.hi is missing
  file Graphics/Rendering/Chart/Plot/Points.hi is missing
  file Graphics/Rendering/Chart/SparkLine.hi is missing
  cannot find libHSChart-0.16.a on library path
There are problems in package data-accessor-template-0.2.1.9:
  import-dirs: /home/kenny/.cabal/lib/data-accessor-template-0.2.1.9/ghc-6.12.1 doesn't exist or isn't a directory
  library-dirs: /home/kenny/.cabal/lib/data-accessor-template-0.2.1.9/ghc-6.12.1 doesn't exist or isn't a directory
  file Data/Accessor/Template.hi is missing
  file Data/Accessor/Template/Example.hi is missing
  cannot find libHSdata-accessor-template-0.2.1.9.a on library path
There are problems in package utility-ht-0.0.8:
  import-dirs: /home/kenny/.cabal/lib/utility-ht-0.0.8/ghc-6.12.1 doesn't exist or isn't a directory
  library-dirs: /home/kenny/.cabal/lib/utility-ht-0.0.8/ghc-6.12.1 doesn't exist or isn't a directory
  file Data/Bool/HT.hi is missing
  file Data/Eq/HT.hi is missing
  file Data/Function/HT.hi is missing
  file Data/Ix/Enum.hi is missing
  file Data/List/HT.hi is missing
  file Data/List/Key.hi is missing
  file Data/List/Match.hi is missing
  file Data/Maybe/HT.hi is missing
  file Data/Monoid/HT.hi is missing
  file Data/Ord/HT.hi is missing
  file Data/Record/HT.hi is missing
  file Data/String/HT.hi is missing
  file Data/Tuple/HT.hi is missing
  file Control/Monad/HT.hi is missing
  file Control/Functor/HT.hi is missing
  file Data/Strictness/HT.hi is missing
  file Text/Read/HT.hi is missing
  file Text/Show/HT.hi is missing
  file Data/Bool/HT/Private.hi is missing
  file Data/List/HT/Private.hi is missing
  file Data/List/Key/Private.hi is missing
  file Data/List/Match/Private.hi is missing
  file Data/Function/HT/Private.hi is missing
  file Data/Record/HT/Private.hi is missing
  cannot find libHSutility-ht-0.0.8.a on library path
There are problems in package data-accessor-0.2.2.2:
  import-dirs: /home/kenny/.cabal/lib/data-accessor-0.2.2.2/ghc-6.12.1 doesn't exist or isn't a directory
  library-dirs: /home/kenny/.cabal/lib/data-accessor-0.2.2.2/ghc-6.12.1 doesn't exist or isn't a directory
  file Data/Accessor.hi is missing
  file Data/Accessor/Basic.hi is missing
  file Data/Accessor/Container.hi is missing
  file Data/Accessor/Show.hi is missing
  file Data/Accessor/Tuple.hi is missing
  file Data/Accessor/BinaryRead.hi is missing
  file Data/Accessor/MonadState.hi is missing
  file Data/Accessor/Example.hi is missing
  file Data/Accessor/Private.hi is missing
  file Data/Accessor/MonadStatePrivate.hi is missing
  cannot find libHSdata-accessor-0.2.2.2.a on library path
There are problems in package mtl-2.1.2:
  import-dirs: /home/kenny/.cabal/lib/mtl-2.1.2/ghc-6.12.1 doesn't exist or isn't a directory
  library-dirs: /home/kenny/.cabal/lib/mtl-2.1.2/ghc-6.12.1 doesn't exist or isn't a directory
  file Control/Monad/Cont.hi is missing
  file Control/Monad/Cont/Class.hi is missing
  file Control/Monad/Error.hi is missing
  file Control/Monad/Error/Class.hi is missing
  file Control/Monad/Identity.hi is missing
  file Control/Monad/List.hi is missing
  file Control/Monad/RWS.hi is missing
  file Control/Monad/RWS/Class.hi is missing
  file Control/Monad/RWS/Lazy.hi is missing
  file Control/Monad/RWS/Strict.hi is missing
  file Control/Monad/Reader.hi is missing
  file Control/Monad/Reader/Class.hi is missing
  file Control/Monad/State.hi is missing
  file Control/Monad/State/Class.hi is missing
  file Control/Monad/State/Lazy.hi is missing
  file Control/Monad/State/Strict.hi is missing
  file Control/Monad/Trans.hi is missing
  file Control/Monad/Writer.hi is missing
  file Control/Monad/Writer/Class.hi is missing
  file Control/Monad/Writer/Lazy.hi is missing
  file Control/Monad/Writer/Strict.hi is missing
  cannot find libHSmtl-2.1.2.a on library path
There are problems in package transformers-0.3.0.0:
  import-dirs: /home/kenny/.cabal/lib/transformers-0.3.0.0/ghc-6.12.1 doesn't exist or isn't a directory
  library-dirs: /home/kenny/.cabal/lib/transformers-0.3.0.0/ghc-6.12.1 doesn't exist or isn't a directory
  file Control/Applicative/Backwards.hi is missing
  file Control/Applicative/Lift.hi is missing
  file Control/Monad/IO/Class.hi is missing
  file Control/Monad/Trans/Class.hi is missing
  file Control/Monad/Trans/Cont.hi is missing
  file Control/Monad/Trans/Error.hi is missing
  file Control/Monad/Trans/Identity.hi is missing
  file Control/Monad/Trans/List.hi is missing
  file Control/Monad/Trans/Maybe.hi is missing
  file Control/Monad/Trans/Reader.hi is missing
  file Control/Monad/Trans/RWS.hi is missing
  file Control/Monad/Trans/RWS/Lazy.hi is missing
  file Control/Monad/Trans/RWS/Strict.hi is missing
  file Control/Monad/Trans/State.hi is missing
  file Control/Monad/Trans/State/Lazy.hi is missing
  file Control/Monad/Trans/State/Strict.hi is missing
  file Control/Monad/Trans/Writer.hi is missing
  file Control/Monad/Trans/Writer/Lazy.hi is missing
  file Control/Monad/Trans/Writer/Strict.hi is missing
  file Data/Functor/Compose.hi is missing
  file Data/Functor/Constant.hi is missing
  file Data/Functor/Identity.hi is missing
  file Data/Functor/Product.hi is missing
  file Data/Functor/Reverse.hi is missing
  cannot find libHStransformers-0.3.0.0.a on library path
There are problems in package Cabal-1.14.0:
  import-dirs: /home/kenny/.cabal/lib/Cabal-1.14.0/ghc-6.12.1 doesn't exist or isn't a directory
  library-dirs: /home/kenny/.cabal/lib/Cabal-1.14.0/ghc-6.12.1 doesn't exist or isn't a directory
  file Distribution/Compiler.hi is missing
  file Distribution/InstalledPackageInfo.hi is missing
  file Distribution/License.hi is missing
  file Distribution/Make.hi is missing
  file Distribution/ModuleName.hi is missing
  file Distribution/Package.hi is missing
  file Distribution/PackageDescription.hi is missing
  file Distribution/PackageDescription/Configuration.hi is missing
  file Distribution/PackageDescription/Parse.hi is missing
  file Distribution/PackageDescription/Check.hi is missing
  file Distribution/PackageDescription/PrettyPrint.hi is missing
  file Distribution/ParseUtils.hi is missing
  file Distribution/ReadE.hi is missing
  file Distribution/Simple.hi is missing
  file Distribution/Simple/Build.hi is missing
  file Distribution/Simple/Build/Macros.hi is missing
  file Distribution/Simple/Build/PathsModule.hi is missing
  file Distribution/Simple/BuildPaths.hi is missing
  file Distribution/Simple/Bench.hi is missing
  file Distribution/Simple/Command.hi is missing
  file Distribution/Simple/Compiler.hi is missing
  file Distribution/Simple/Configure.hi is missing
  file Distribution/Simple/GHC.hi is missing
  file Distribution/Simple/LHC.hi is missing
  file Distribution/Simple/Haddock.hi is missing
  file Distribution/Simple/Hpc.hi is missing
  file Distribution/Simple/Hugs.hi is missing
  file Distribution/Simple/Install.hi is missing
  file Distribution/Simple/InstallDirs.hi is missing
  file Distribution/Simple/JHC.hi is missing
  file Distribution/Simple/LocalBuildInfo.hi is missing
  file Distribution/Simple/NHC.hi is missing
  file Distribution/Simple/PackageIndex.hi is missing
  file Distribution/Simple/PreProcess.hi is missing
  file Distribution/Simple/PreProcess/Unlit.hi is missing
  file Distribution/Simple/Program.hi is missing
  file Distribution/Simple/Program/Ar.hi is missing
  file Distribution/Simple/Program/Builtin.hi is missing
  file Distribution/Simple/Program/Db.hi is missing
  file Distribution/Simple/Program/HcPkg.hi is missing
  file Distribution/Simple/Program/Hpc.hi is missing
  file Distribution/Simple/Program/Ld.hi is missing
  file Distribution/Simple/Program/Run.hi is missing
  file Distribution/Simple/Program/Script.hi is missing
  file Distribution/Simple/Program/Types.hi is missing
  file Distribution/Simple/Register.hi is missing
  file Distribution/Simple/Setup.hi is missing
  file Distribution/Simple/SrcDist.hi is missing
  file Distribution/Simple/Test.hi is missing
  file Distribution/Simple/UHC.hi is missing
  file Distribution/Simple/UserHooks.hi is missing
  file Distribution/Simple/Utils.hi is missing
  file Distribution/System.hi is missing
  file Distribution/TestSuite.hi is missing
  file Distribution/Text.hi is missing
  file Distribution/Verbosity.hi is missing
  file Distribution/Version.hi is missing
  file Distribution/Compat/ReadP.hi is missing
  file Language/Haskell/Extension.hi is missing
  file Distribution/GetOpt.hi is missing
  file Distribution/Compat/Exception.hi is missing
  file Distribution/Compat/CopyFile.hi is missing
  file Distribution/Compat/TempFile.hi is missing
  file Distribution/Simple/GHC/IPI641.hi is missing
  file Distribution/Simple/GHC/IPI642.hi is missing
  file Paths_Cabal.hi is missing
  cannot find libHSCabal-1.14.0.a on library path
There are problems in package zlib-0.5.3.3:
  import-dirs: /home/kenny/.cabal/lib/zlib-0.5.3.3/ghc-6.12.1 doesn't exist or isn't a directory
  library-dirs: /home/kenny/.cabal/lib/zlib-0.5.3.3/ghc-6.12.1 doesn't exist or isn't a directory
  file Codec/Compression/GZip.hi is missing
  file Codec/Compression/Zlib.hi is missing
  file Codec/Compression/Zlib/Raw.hi is missing
  file Codec/Compression/Zlib/Internal.hi is missing
  file Codec/Compression/Zlib/Stream.hi is missing
  cannot find libHSzlib-0.5.3.3.a on library path
There are problems in package colour-2.3.3:
  import-dirs: /home/kenny/.cabal/lib/colour-2.3.3/ghc-6.12.1 doesn't exist or isn't a directory
  library-dirs: /home/kenny/.cabal/lib/colour-2.3.3/ghc-6.12.1 doesn't exist or isn't a directory
  file Data/Colour.hi is missing
  file Data/Colour/SRGB.hi is missing
  file Data/Colour/SRGB/Linear.hi is missing
  file Data/Colour/CIE.hi is missing
  file Data/Colour/CIE/Illuminant.hi is missing
  file Data/Colour/RGBSpace.hi is missing
  file Data/Colour/RGBSpace/HSL.hi is missing
  file Data/Colour/RGBSpace/HSV.hi is missing
  file Data/Colour/Names.hi is missing
  file Data/Colour/Internal.hi is missing
  file Data/Colour/Chan.hi is missing
  file Data/Colour/RGB.hi is missing
  file Data/Colour/Matrix.hi is missing
  file Data/Colour/CIE/Chromaticity.hi is missing
  cannot find libHScolour-2.3.3.a on library path
There are problems in package Cabal-1.10.2.0:
  import-dirs: /home/kenny/.cabal/lib/Cabal-1.10.2.0/ghc-6.12.1 doesn't exist or isn't a directory
  library-dirs: /home/kenny/.cabal/lib/Cabal-1.10.2.0/ghc-6.12.1 doesn't exist or isn't a directory
  file Distribution/Compiler.hi is missing
  file Distribution/InstalledPackageInfo.hi is missing
  file Distribution/License.hi is missing
  file Distribution/Make.hi is missing
  file Distribution/ModuleName.hi is missing
  file Distribution/Package.hi is missing
  file Distribution/PackageDescription.hi is missing
  file Distribution/PackageDescription/Configuration.hi is missing
  file Distribution/PackageDescription/Parse.hi is missing
  file Distribution/PackageDescription/Check.hi is missing
  file Distribution/ParseUtils.hi is missing
  file Distribution/ReadE.hi is missing
  file Distribution/Simple.hi is missing
  file Distribution/Simple/Build.hi is missing
  file Distribution/Simple/Build/Macros.hi is missing
  file Distribution/Simple/Build/PathsModule.hi is missing
  file Distribution/Simple/BuildPaths.hi is missing
  file Distribution/Simple/Command.hi is missing
  file Distribution/Simple/Compiler.hi is missing
  file Distribution/Simple/Configure.hi is missing
  file Distribution/Simple/GHC.hi is missing
  file Distribution/Simple/LHC.hi is missing
  file Distribution/Simple/Haddock.hi is missing
  file Distribution/Simple/Hugs.hi is missing
  file Distribution/Simple/Install.hi is missing
  file Distribution/Simple/InstallDirs.hi is missing
  file Distribution/Simple/JHC.hi is missing
  file Distribution/Simple/LocalBuildInfo.hi is missing
  file Distribution/Simple/NHC.hi is missing
  file Distribution/Simple/PackageIndex.hi is missing
  file Distribution/Simple/PreProcess.hi is missing
  file Distribution/Simple/PreProcess/Unlit.hi is missing
  file Distribution/Simple/Program.hi is missing
  file Distribution/Simple/Program/Ar.hi is missing
  file Distribution/Simple/Program/Builtin.hi is missing
  file Distribution/Simple/Program/Db.hi is missing
  file Distribution/Simple/Program/HcPkg.hi is missing
  file Distribution/Simple/Program/Ld.hi is missing
  file Distribution/Simple/Program/Run.hi is missing
  file Distribution/Simple/Program/Script.hi is missing
  file Distribution/Simple/Program/Types.hi is missing
  file Distribution/Simple/Register.hi is missing
  file Distribution/Simple/Setup.hi is missing
  file Distribution/Simple/SrcDist.hi is missing
  file Distribution/Simple/Test.hi is missing
  file Distribution/Simple/UHC.hi is missing
  file Distribution/Simple/UserHooks.hi is missing
  file Distribution/Simple/Utils.hi is missing
  file Distribution/System.hi is missing
  file Distribution/TestSuite.hi is missing
  file Distribution/Text.hi is missing
  file Distribution/Verbosity.hi is missing
  file Distribution/Version.hi is missing
  file Distribution/Compat/ReadP.hi is missing
  file Language/Haskell/Extension.hi is missing
  file Distribution/GetOpt.hi is missing
  file Distribution/Compat/Exception.hi is missing
  file Distribution/Compat/CopyFile.hi is missing
  file Distribution/Compat/TempFile.hi is missing
  file Distribution/Simple/GHC/IPI641.hi is missing
  file Distribution/Simple/GHC/IPI642.hi is missing
  file Paths_Cabal.hi is missing
  cannot find libHSCabal-1.10.2.0.a on library path

The following packages are broken, either because they have a problem
listed above, or because they depend on a broken package.
QuickCheck-2.5
Chart-0.16
data-accessor-template-0.2.1.9
utility-ht-0.0.8
data-accessor-0.2.2.2
mtl-2.1.2
transformers-0.3.0.0
Cabal-1.14.0
zlib-0.5.3.3
colour-2.3.3
Cabal-1.10.2.0

我通过cabal install --reinstall $PACKAGE重新安装了上面提到的所有软件包。 在此之后,对于Cabal-1.10.2.0,ghc-pkg check不会产生之外的错误。 我发现非常奇怪的是

$ cabal install --reinstall Cabal

尝试安装Cabal-1.14.0,看起来效果不错,但是ghc-pkg check仍抱怨Cabal-1.10.2.0丢失或损坏。

关于网络包安装失败的堆栈跟踪看起来好像网络包本身没有正确构建(似乎有编译错误?)。

我也使用sudo尝试了整个事情,但它没有任何区别。 我还发现cabal-install-0.10.2 failed during the building phase处理类似神秘的“软件包无法安装”错误,但问题似乎没有得到解决。

我该怎么办?目前它看起来像是一个非常搞砸的cabal安装给我。有什么我可以做的或者我应该忘记它并从Haskell网站下载Haskell平台吗?

1 个答案:

答案 0 :(得分:5)

最简单的解决方案是从GHC开始从头开始升级。版本6.12 。但是,如果由于某种原因你不能或不想升级GHC,这里有一些旨在帮助你解决每个问题的提示。

  

cabal:alex是必需的,但无法找到。

您运行cabal install alex的直觉是正确的答案。

  

ghc:无法识别的标志:-rtsopts

看起来你有一个老式的GHC;在GHC 7中添加了-rtsopts标志(我在后面的问题中看到你正在运行6.12)。您可能应该尝试安装较旧版本的alex - 也许是一款具有6.12的现代版本,该版本已于2.5年前发布。如果你认为它仍然支持GHC6,可以选择向alex维护者投诉。另一种选择是尝试自己修理它;看一下与alex捆绑在一起的.cabal文件,看看是否只是删除-rtsopts标志就可以继续了。

  

无法将预期类型`Char'与推断类型`[Char]'

匹配

对此不太确定,但听起来network的依赖关系上的版本限制不够严格。同样,一种解决方案是尝试安装旧版本的网络,另一种解决方案是尝试通过更改network的{​​{1}}文件来自行修复它。老实说,这听起来像是你所谈论的所有问题中最困难的问题。

(编辑添加:)对#haskell的一些讨论,似乎.cabal的类型在parsec-2和parsec-3之间发生了变化。所以也许这就像将网络的cabal文件中的依赖项碰到parsec> = 3而不是> = 2一样容易。

  

但是notFollowedBy仍抱怨Cabal-1.10.2.0缺失或破损

GHC能够跟踪单个库的多个版本,因此安装新版本的ghc-pkg check将无法修复旧版本。您可以要求cabal-install重新安装特定版本以尝试修复此问题; e.g。

Cabal