在Ubuntu 22.04上运行以下代码以获取Boost 1.82:

sudo add-apt-repository ppa:mhier/libboost-latest
sudo apt update
sudo apt install libboost1.82-dev

从这里发问:https://stackoverflow.com/a/76543551/1107474

然而,不幸的是,在这个过程中我收到了这个错误:

Unpacking libboost1.82-dev (1.82-0~18~ubuntu22.04.1) ...
dpkg: error processing archive /var/cache/apt/archives/libboost1.82-dev_1.82-0~18~ubuntu22.04.1_amd64.deb (--unpack):
 trying to overwrite '/usr/include/boost/accumulators/accumulators.hpp', which is also in package libboost1.74-dev:amd64 1.74.0-14ubuntu3
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)

我发现了一个类似的问题:

https://askubuntu.com/questions/1062171/dpkg-deb-error-paste-subprocess-was-killed-by-signal-broken-pipe

并听从了他的建议.它似乎起作用了.如果我看Version.h,它说#define BOOST_LIB_VERSION "1_82"

然而,当我在我的系统上搜索‘Boost’时,我得到了1.74个库,但没有1.82个库.

我怎么才能解决这个烂摊子呢?我不知道我到底有什么版本的助推器.

如果我跑sudo apt install libboost1.82-dev,它会说:

libboost1.82-dev is already the newest version (1.82-0~18~ubuntu22.04.1).

更新

刚刚跑了一趟:

sudo apt purge libboost1.82-dev
sudo apt install libboost1.82-dev

我现在确实看到了1.82:

enter image description here

但我也有与1.74相同的库:

enter image description here

有人可以建议如何卸载所有Boost,然后我会做一个全新的安装吗?

推荐答案

trying to overwrite '/usr/include/boost/accumulators/accumulators.hpp',
which is also in package libboost1.74-dev:amd64 1.74.0-14ubuntu3

这是一个明显的迹象,表明你已经安装了与新版本冲突的旧版Boost.卸载旧版Boost

sudo apt purge libboost1.74-dev

sudo apt -f install

这是一个糟糕的解决方案.您有两个控制相同文件的包.卸载libboost1.74-dev,然后正常安装libboost1.82-dev.

Linux相关问答推荐

AddressSaniizer随机抛出没有任何解释的SIGSEGV

奇怪的 Bash 脚本行为

通过 ssh 在远程计算机上按索引访问数组元素

无法在嵌入式 Linux 中使用 libjpeg 以 RGB888 在 LCD(黑色)上显示 JPEG

仅查找并保留有效邮箱并删除无效记录,AWK

用于替换 struct 文档中文本的 Bash 脚本

如何更改文件的上次访问/修改/更改日期?

如何使用 shell 脚本将文本文件转换为 JSON 文件

Linux 系统调用文档

如何在Linux中将文件的特定行号中的数字乘以2(双)?

matlab中linux和windows上regexp()的不同行为

另一个远程的 Git 合并分支

sig_atomic_t 实际上是如何工作的?

是否可以在 XTerm 或 Konsole 中使 stdout 和 stderr 输出具有不同的 colored颜色 ?

DMA 和内存映射 IO 有什么区别?

GLIBCXX 版本

如何使用 C++ 在 Linux 中获取总 CPU 使用率

Android - 找不到命令

Linux SCHED_OTHER、SCHED_FIFO 和 SCHED_RR - 区别

System.currentTimeMillis 是否总是返回一个值 >= 以前的调用?