首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >由于缺少zlib库,阴谋安装(Cabal cabal- install )失败

由于缺少zlib库,阴谋安装(Cabal cabal- install )失败
EN

Stack Overflow用户
提问于 2021-03-13 16:29:23
回答 2查看 1.4K关注 0票数 4

我想在Ubuntu20.04上安装Cabal 3.4.0.0。

代码语言:javascript
复制
$ sudo apt install cabal-install
$ cabal --version
cabal-install version 2.4.0.0

$ sudo cabal update
$ sudo cabal install Cabal cabal-install
...
Starting     zlib-0.6.2.3
Failed to install zlib-0.6.2.3
Build log ( /root/.cabal/logs/ghc-8.6.5/zlib-0.6.2.3-93Wbo8gIIzI9bg4p2MsNUF.log ):
cabal: Entering directory '/tmp/cabal-tmp-126381/zlib-0.6.2.3'
Configuring zlib-0.6.2.3...
cabal: Missing dependency on a foreign library:
* Missing (or bad) header file: zlib.h
* Missing (or bad) C library: z
This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is
already installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.If the
library file does exist, it may contain errors that are caught by the C
compiler at the preprocessing stage. In this case you can re-run configure
with the verbosity flag -v3 to see the error messages.
If the header file does exist, it may contain errors that are caught by the C
compiler at the preprocessing stage. In this case you can re-run configure
with the verbosity flag -v3 to see the error messages.
...
cabal: Error: some packages failed to install:
cabal-install-3.4.0.0-3glzV3hM64DLoOfz3dHKsn depends on cabal-install-3.4.0.0
which failed to install.
hackage-security-0.6.0.1-KiAyVYLxooJAP3ckeQHnBD depends on
hackage-security-0.6.0.1 which failed to install.
zlib-0.6.2.3-93Wbo8gIIzI9bg4p2MsNUF failed during the configure step. The
exception was:
ExitFailure 1

错误说:

这个问题通常可以通过安装提供这个库的系统包来解决(您可能需要"-dev“版本)。

如何在Ubuntu20.04上安装此软件包?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2021-08-12 12:50:35

您的目标是安装套餐。这个包有一个依赖项,在这里会产生一个问题:套餐

这个zlib包本质上是围绕图书馆[维基百科]的一个薄包装器。但是,正如错误所述,您没有安装zlib库,或者至少没有安装可以使用zlib库进行开发的包。

我们可以通过安装软件包来安装它,例如:

代码语言:javascript
复制
sudo apt-get install libghc-zlib-dev

如果我们检查Debian的包详细信息,我们就会发现,本质上这是一个将安装zlib1g-dev包的包,这是一个用zlib库开发软件的包。因此,我们可以决定用以下方式安装libghc-zlib-devzlib1g-dev

代码语言:javascript
复制
sudo apt-get install zlib1g-dev
票数 4
EN

Stack Overflow用户

发布于 2022-06-09 12:24:02

Nixos用户将pkgs.haskellPackages.zlib附加到environment.systemPackages

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66615901

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档