参考:
- https://blog.csdn.net/guoguangwu/article/details/89245243
- https://blog.csdn.net/qq_39885372/article/details/104397883
查看当前版本
dpkg -S /usr/include/boost/version.hpp
如果没有查到,也不表示没有安装,有可能是手动下载安装包安装的。检查办法是
sudo find /usr -name "libboost"
如果都有查到,说明没有安装。
命令安装指定版本
可以先安装一个:
sudo apt install aptitude
然后查看可以安装的版本:
aptitude search boost
p dm-writeboost-dkms - log-structured caching for Linux
p ibus-typing-booster - Completion input method to speedup typing
p libboost-all-dev - Boost C++ Libraries development files (ALL) (default version)
p libboost-all-dev:i386 - Boost C++ Libraries development files (ALL) (default version)
p libboost-atomic-dev - atomic data types, operations, and memory ordering constraints (default version
p libboost-atomic-dev:i386 - atomic data types, operations, and memory ordering constraints (default version
i libboost-atomic1.67-dev - atomic data types, operations, and memory ordering constraints
i A libboost-atomic1.67.0 - atomic data types, operations, and memory ordering constraints
p libboost-atomic1.71-dev - atomic data types, operations, and memory ordering constraints
p libboost-atomic1.71.0 - atomic data types, operations, and memory ordering constraints
p libboost-atomic1.74-dev - atomic data types, operations, and memory ordering constraints
p libboost-atomic1.74-dev:i386 - atomic data types, operations, and memory ordering constraints
p libboost-atomic1.74.0 - atomic data types, operations, and memory ordering constraints
p libboost-atomic1.74.0:i386 - atomic data types, operations, and memory ordering constraints
p libboost-chrono-dev - C++ representation of time duration, time point, and clocks (default version)
p libboost-chrono-dev:i386 - C++ representation of time duration, time point, and clocks (default version)
p libboost-chrono1.67-dev - C++ representation of time duration, time point, and clocks
p libboost-chrono1.67.0 - C++ representation of time duration, time point, and clocks
p libboost-chrono1.71-dev - C++ representation of time duration, time point, and clocks
p libboost-chrono1.71.0 - C++ representation of time duration, time point, and clocks
p libboost-chrono1.74-dev - C++ representation of time duration, time point, and clocks
p libboost-chrono1.74-dev:i386 - C++ representation of time duration, time point, and clocks
p libboost-chrono1.74.0 - C++ representation of time duration, time point, and clocks
...
例如,我需要安装libboost-atomic1.67-dev
版本,则运行下面的命令:
sudo apt-get install libboost-atomic1.67-dev
dpkg -S /usr/include/boost/version.hpp # 查看安装好的版本
手动安装
参考:https://blog.csdn.net/qq_39885372/article/details/104397883文章来源:https://www.toymoban.com/news/detail-425731.html
卸载
先查看当前版本,然后卸载指定的版本:文章来源地址https://www.toymoban.com/news/detail-425731.html
dpkg -S /usr/include/boost/version.hpp
# 查找结果: libboost1.74-dev:amd64: /usr/include/boost/version.hpp
sudo apt-get autoremove libboost1.74-dev
到了这里,关于ubuntu 安装/卸载/查找 boost的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!