在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)
我发现了一个类似的问题:
并听从了他的建议.它似乎起作用了.如果我看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:
但我也有与1.74相同的库:
有人可以建议如何卸载所有Boost,然后我会做一个全新的安装吗?