【问题标题】:My apt got messed up installing boost我的 apt 搞砸了安装 boost
【发布时间】:2014-02-02 12:34:09
【问题描述】:

在 ubuntu 上

#> sudo apt-get install libboost-all-dev

Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies.
 libboost-all-dev : Depends: libboost-dev but it is not going to be installed
                    Depends: libboost-atomic-dev but it is not going to be installed
                    Depends: libboost-chrono-dev but it is not going to be installed
                    Depends: libboost-context-dev but it is not going to be installed
                    Depends: libboost-date-time-dev but it is not going to be installed
                    Depends: libboost-exception-dev but it is not going to be installed
                    Depends: libboost-filesystem-dev but it is not going to be installed
                    Depends: libboost-graph-dev but it is not going to be installed
                    Depends: libboost-graph-parallel-dev but it is not going to be installed
                    Depends: libboost-iostreams-dev but it is not going to be installed
                    Depends: libboost-locale-dev but it is not going to be installed
                    Depends: libboost-math-dev but it is not going to be installed
                    Depends: libboost-mpi-dev but it is not going to be installed
                    Depends: libboost-mpi-python-dev but it is not going to be installed
                    Depends: libboost-program-options-dev but it is not going to be installed
                    Depends: libboost-python-dev but it is not going to be installed
                    Depends: libboost-random-dev but it is not going to be installed
                    Depends: libboost-regex-dev but it is not going to be installed
                    Depends: libboost-serialization-dev but it is not going to be installed
                    Depends: libboost-signals-dev but it is not going to be installed
                    Depends: libboost-system-dev but it is not going to be installed
                    Depends: libboost-test-dev but it is not going to be installed
                    Depends: libboost-thread-dev but it is not going to be installed
                    Depends: libboost-timer-dev but it is not going to be installed
                    Depends: libboost-wave-dev but it is not going to be installed
 libboost-chrono1.54-dev : Depends: libboost1.54-dev (= 1.54.0-2ubuntu3) but it is not going to be installed
 libboost-date-time1.54-dev : Depends: libboost1.54-dev (= 1.54.0-2ubuntu3) but it is not going to be installed
 libboost-exception1.54-dev : Depends: libboost1.54-dev (= 1.54.0-2ubuntu3) but it is not going to be installed
 libboost-filesystem1.54-dev : Depends: libboost1.54-dev (= 1.54.0-2ubuntu3) but it is not going to be installed
 libboost-graph-parallel1.54-dev : Depends: libboost1.54-dev (= 1.54.0-2ubuntu3) but it is not going to be installed
 libboost-graph1.54-dev : Depends: libboost1.54-dev (= 1.54.0-2ubuntu3) but it is not going to be installed
 libboost-iostreams1.54-dev : Depends: libboost1.54-dev (= 1.54.0-2ubuntu3) but it is not going to be installed
 libboost-locale1.54-dev : Depends: libboost1.54-dev (= 1.54.0-2ubuntu3) but it is not going to be installed
 libboost-log1.54-dev : Depends: libboost1.54-dev (= 1.54.0-2ubuntu3) but it is not going to be installed
 libboost-math1.54-dev : Depends: libboost1.54-dev (= 1.54.0-2ubuntu3) but it is not going to be installed
 libboost-mpi1.54-dev : Depends: libboost1.54-dev (= 1.54.0-2ubuntu3) but it is not going to be installed
 libboost-program-options1.54-dev : Depends: libboost1.54-dev (= 1.54.0-2ubuntu3) but it is not going to be installed
 libboost-python1.54-dev : Depends: libboost1.54-dev (= 1.54.0-2ubuntu3) but it is not going to be installed
 libboost-random1.54-dev : Depends: libboost1.54-dev (= 1.54.0-2ubuntu3) but it is not going to be installed
 libboost-regex1.54-dev : Depends: libboost1.54-dev (= 1.54.0-2ubuntu3) but it is not going to be installed
 libboost-serialization1.54-dev : Depends: libboost1.54-dev (= 1.54.0-2ubuntu3) but it is not going to be installed
 libboost-signals1.54-dev : Depends: libboost1.54-dev (= 1.54.0-2ubuntu3) but it is not going to be installed
 libboost-system1.54-dev : Depends: libboost1.54-dev (= 1.54.0-2ubuntu3) but it is not going to be installed
 libboost-test1.54-dev : Depends: libboost1.54-dev (= 1.54.0-2ubuntu3) but it is not going to be installed
 libboost-thread1.54-dev : Depends: libboost1.54-dev (= 1.54.0-2ubuntu3) but it is not going to be installed
 libboost-timer1.54-dev : Depends: libboost1.54-dev (= 1.54.0-2ubuntu3) but it is not going to be installed
 libboost-wave1.54-dev : Depends: libboost1.54-dev (= 1.54.0-2ubuntu3) but it is not going to be installed
 libboost1.54-all-dev : Depends: libboost1.54-dev but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

最后一行:尝试不使用任何软件包的“apt-get -f install”(或指定解决方案)。

好的。

#> sudo apt-get -f install

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  libboost-atomic1.53.0 libboost-chrono1.53.0 libboost-context1.53.0 libboost-graph-parallel1.53.0 libboost-graph1.53.0 libboost-iostreams1.53.0 libboost-math1.53.0 libboost-mpi1.53.0 libboost-python1.53.0 libboost-random1.53.0
  libboost-serialization1.53.0 libboost-signals1.53.0 libboost-test1.53.0 libboost-timer1.53.0 libboost-tools-dev libboost-wave1.53.0 libboost1.53-tools-dev openjdk-7-jre-lib
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  libboost1.54-dev
Suggested packages:
  libboost1.54-doc libboost-coroutine.54-dev libboost-log.54-dev doxygen default-jdk fop
The following NEW packages will be installed
  libboost1.54-dev
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
51 not fully installed or removed.
Need to get 0 B/10.3 MB of archives.
After this operation, 101 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
(Reading database ... 253168 files and directories currently installed.)
Unpacking libboost1.54-dev (from .../libboost1.54-dev_1.54.0-2ubuntu3_i386.deb) ...
dpkg: error processing /var/cache/apt/archives/libboost1.54-dev_1.54.0-2ubuntu3_i386.deb (--unpack):
 trying to overwrite '/usr/share/boostbook/xsl/docbook-layout.xsl', which is also in package libboost1.53-tools-dev 1.53.0-6+exp3ubuntu8
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/libboost1.54-dev_1.54.0-2ubuntu3_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

我该如何摆脱这种混乱?谢谢。

【问题讨论】:

  • 这个问题似乎跑题了。在 Ubuntu 特定论坛上似乎更好。
  • 从 Boost 官网下载可能更方便。构建它(如果您需要库,它们不是仅标题)只需 2 行。

标签: ubuntu boost apt


【解决方案1】:

有些命令是多余的,但作为一个很好的衡量标准:

sudo apt-get --purge remove libboost-all-dev libboost-dev libboost-doc
sudo apt-get install -f
sudo dpkg --configure -a
sudo apt-get clean
sudo apt-get update
sudo apt-get install libboost1.54-dev

注意apt-get clean - 它会清除/var/cache/apt/archives 中检索到的包的本地repo。你不应该在那里存储任何东西,也不应该存储任何应用程序,但请注意缓存将会消失。

【讨论】:

  • 第一行失败,出现很多错误,类似于The following packages have unmet dependencies. libboost-chrono1.54-dev : Depends: libboost1.54-dev (= 1.54.0-2ubuntu3) but it is not going to be installed
  • 你是否继续其他行?
  • 第 2 行失败,如问题中所述,第 3 行失败并出现大量依赖错误。
  • 当你坚持到最后一行时会发生什么?
  • dpkg: 错误处理 /var/cache/apt/archives/libboost1.54-dev_1.54.0-2ubuntu3_i386.deb (--unpack): 试图覆盖'/usr/share/boostbook/xsl /docbook-layout.xsl',也在包 libboost1.53-tools-dev 1.53.0-6+exp3ubuntu8 没有写入报告,因为已经达到 MaxReports
【解决方案2】:

我刚才也遇到了同样的问题。 解决它

  1. Ubuntu packages site下载libboost1.54-dev deb包
  2. 强制覆盖冲突

    sudo dpkg -i --force-overwrite libboost1.54-dev_1.54.0-2ubuntu3_amd64.deb

  3. 然后安装失败的包

    sudo apt-get install -f

  4. 移除 boost 1.53

    sudo apt-get 自动删除

【讨论】:

    【解决方案3】:

    这个 repo https://launchpad.net/~boost-latest/+archive/ubuntu/ppa 包含所有版本的 libboost 并为我修复了它!

    sudo add-apt-repository ppa:boost-latest/ppa sudo apt-get update

    现在你可以安装你想要的版本了,写这篇文章的时候最新的是 1.55:

    sudo apt-get install libboost1X.55-all-dev

    【讨论】:

    • 这对我来说是开箱即用的! (而所有其他答案对我都不起作用) - 谢谢
    • 当我执行sudo apt-get install libboost1X.55-all-dev 时,我遇到了 E: Unable to locate package libboost1X.55-all-dev E: Couldn't find any package by glob 'libboost1X.55-all-dev' E : 通过正则表达式 'libboost1X.55-all-dev' 找不到任何包。
    【解决方案4】:

    我最初尝试了上面mockinterface的建议并坚持了下来,但仍然遇到了问题。

    最后我检查了错误是在包上:libboost1.54-dev_1.54.0-2ubuntu3_amd64.deb

    所以我跑了:sudo dpkg -i --force-overwrite /var/cache/apt/archives/libboost1.54-dev_1.54.0-2ubuntu3_amd64.deb

    然后我运行了 apt-get update 和 apt-get upgrade ,再次对系统感到满意。

    apt-get 升级很重要,因为它会再次正确设置各种库。

    【讨论】:

      【解决方案5】:

      对我来说,它可以手动安装“不会安装”的软件包(按此顺序):

      sudo apt-get install libboost1.46-dev sudo apt-get install libboost-dev sudo apt-get install libboost-all-dev

      安装工作正常,但我还没有测试包是否工作。

      【讨论】:

        【解决方案6】:

        我尝试了@mockinterface 的用途,但使用了synaptic。尽可能完全删除任何提及 boost 的内容,并注明被杀死的内容(奇怪的是,aptitude 等)以便稍后重新安装。

        然后正如@Igor R. 在评论中建议的那样,从源代码构建boost

        那时/usr/local/lib/liboost*.so* 充满了东西,我相信比 Debian/Ubuntu 存储库更古老。

        然而,删除 所有 boost 似乎是一项艰巨的任务,因为 libreoffice、compiz 和 unity 依赖于 libboost-date-time1.54.0libboost-program-options1.46.1libboost-serialization1.46.

        【讨论】:

          【解决方案7】:
          sudo aptitude install libboost1.55-all-dev
          

          这终于对我有用了。

          【讨论】:

          • 这对我不起作用:找不到名称或描述与“libboost1.55-all-dev”匹配的任何包
          • 您使用的是哪个操作系统?此问题仅在安装 boost 1.54 的 ubuntu 14 中显示
          • 我使用的是 ubuntu 16.4
          • ubuntu 16.4 应该可以正常使用“sudo apt-get install libboost-all-dev”
          • 是的,sudo apt-get install libboost-all-dev,它工作正常,但是这会安装最新版本,但我需要编译一个使用 1.55 版创建的程序
          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2023-04-03
          • 2013-03-14
          • 2011-07-25
          • 1970-01-01
          • 1970-01-01
          • 2018-02-18
          相关资源
          最近更新 更多