【问题标题】:How to install libicu-dev on Ubuntu如何在 Ubuntu 上安装 libicu-dev
【发布时间】:2015-10-31 20:26:15
【问题描述】:

我正在尝试在 Ubuntu 14.10 上通过 gem 安装 gollum。

当我尝试使用gem install gollum 时,我看到以下错误:

/usr/bin/ruby2.1 extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h
ERROR:  Error installing gollum:
    ERROR: Failed to build gem native extension.

    Building has failed. See above output for more information on the failure.
extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.1.0/gems/charlock_holmes-0.7.3 for inspection.
Results logged to /var/lib/gems/2.1.0/extensions/x86_64-linux/2.1.0/charlock_holmes-0.7.3/gem_make.out

我发现libicu-dev 是必需的。

所以我使用sudo apt-get install libicu-dev,但收到此错误:

$ sudo apt-get install libicu-dev 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libicu-dev : Depends: libicu52 (= 52.1-6) but 52.1-6ubuntu0.3 is to be installed
E: Unable to correct problems, you have held broken packages.

我试过apt-get install -f,但错误依旧。

我该如何解决这个问题?谢谢!

【问题讨论】:

    标签: ubuntu apt icu gollum-wiki ubuntu-14.10


    【解决方案1】:
    sudo apt install libicu52=52.1-6
    
    sudo apt-get install libicu-dev
    

    安装所需的版本。将出现一个降级警告,您需要确认如下所示:

    The following packages will be DOWNGRADED:
      libicu52
    0 upgraded, 0 newly installed, 1 downgraded, 0 to remove and 0 not upgraded.
    Need to get 7,643 kB of archives.
    After this operation, 0 B of additional disk space will be used.
    Do you want to continue? [Y/n] 
    

    【讨论】:

    • 虽然这段代码 sn-p 可以解决问题,但including an explanation 确实有助于提高帖子的质量。请记住,您正在为将来的读者回答问题,而这些人可能不知道您的代码建议的原因。也请尽量不要用解释性的 cmets 挤满你的代码,这会降低代码和解释的可读性!
    • 我确认这适用于 14.10,libicu55=55.1.7(` libicu-dev : Depends: libicu55 (= 55.1-7) but 55.1-7ubuntu0.4 is to be installed`)
    • 我可以确认它适用于 libicu67 [(= 67.1-7) but 67.1-6 ...]
    猜你喜欢
    • 2016-01-20
    • 2013-09-26
    • 1970-01-01
    • 2012-03-15
    • 2021-05-28
    • 1970-01-01
    • 2021-10-17
    • 1970-01-01
    • 2013-08-02
    相关资源
    最近更新 更多