ubuntu 安装/卸载/查找 boost

参考:

查看当前版本

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

卸载

先查看当前版本,然后卸载指定的版本:

dpkg -S /usr/include/boost/version.hpp   
# 查找结果: libboost1.74-dev:amd64: /usr/include/boost/version.hpp
sudo apt-get autoremove libboost1.74-dev
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

ystraw_ah

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值