升压安装
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5759434/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Boost Installation
提问by tpar44
I have a question regarding the installation of the boost libraries. Is there a package that I can use the sudo apt-get install to install this package. I searched all of the questions in this forum and using the commands sudo apt-get install libboost1.40-dev
I cannot install theh package with this. Also, I can download it from boost.org but I do not know the correct path to install it too. I would prefer to install it using the sudo apt-get install
commands if possible. I am using Ubuntu 9.04.
Thanks.
我有一个关于安装 boost 库的问题。有没有我可以使用 sudo apt-get install 安装这个包的包。我搜索了这个论坛中的所有问题,并使用命令sudo apt-get install libboost1.40-dev
我无法安装这个包。另外,我可以从 boost.org 下载它,但我也不知道安装它的正确路径。sudo apt-get install
如果可能,我更愿意使用命令安装它。我正在使用 Ubuntu 9.04。谢谢。
采纳答案by beduin
You can use command aptitude search libboost
to see list of the availiable boost libraries. The last version of boost is 1.42 - maybe that's why you can't find version 1.40.
您可以使用命令aptitude search libboost
查看可用的 boost 库列表。boost 的最后一个版本是 1.42 - 也许这就是你找不到 1.40 版本的原因。
If aptitude search
command don't give you sufficient results, try sudo aptitude update
and then run aptitude search
again.
如果aptitude search
命令没有给您足够的结果,请尝试sudo aptitude update
然后aptitude search
再次运行。
回答by Ralf
On my version of Ubuntu (10.04) it's libboost1.40-all-dev
在我的 Ubuntu (10.04) 版本上,它是 libboost1.40-all-dev
On your version you've probably got an older version of boost, you should just be able to tab-complete to see which version you can install.
在您的版本上,您可能已经安装了旧版本的 boost,您应该能够通过 tab-complete 来查看您可以安装哪个版本。
In any case what I usually do under Ubuntu is
无论如何,我通常在 Ubuntu 下做的是
sudo apt-get install bjam
Extract the downloaded boost archive to your hard-drive and then cd into the root and
将下载的 boost 存档解压缩到您的硬盘驱动器,然后 cd 进入根目录并
sudo bjam install
This way you can get the newest version of boost, and not the slightly outdated one that is available for your Ubuntu version.
通过这种方式,您可以获得最新版本的 boost,而不是适用于您的 Ubuntu 版本的稍微过时的版本。
回答by sehe
If you want to run with the latest version, you can do the bjam install as mentioned by Ralf, but I suggest you build a 'pseudo' package so you can
如果你想使用最新版本运行,你可以按照 Ralf 提到的进行 bjam 安装,但我建议你构建一个“伪”包,这样你就可以
- uninstall it safely
- prevent/notice conflicts with official/existing boost packages.
- 安全地卸载它
- 防止/注意与官方/现有增强包的冲突。
Here is how to do that:
以下是如何做到这一点:
mkdir -pv /tmp/boostinst
cd /tmp/boostinst/
wget -c 'http://sourceforge.net/projects/boost/files/boost/1.66.0/boost_1_66_0.tar.bz2/download'
tar xf download
cd boost_1_66_0/
./bootstrap.sh --help
./bootstrap.sh --show-libraries
./bootstrap.sh
checkinstall ./b2 install
回答by MicWide
On new boost version there is other way:
在新的 boost 版本上还有其他方法:
sudo apt-get update
wget -c 'http://sourceforge.net/projects/boost/files/boost/1.50.0/boost_1_50_0.tar.bz2/download'
tar xf download
cd boost_1_50_0
./bootstrap.sh
./b2 install
回答by ucefkh
This is a link which explain step by step on how to install it (give it some time read!)
这是一个链接,它逐步解释了如何安装它(给它一些时间阅读!)
http://www.boost.org/doc/libs/1_41_0/more/getting_started/unix-variants.html
http://www.boost.org/doc/libs/1_41_0/more/getting_started/unix-variants.html
but your inline shell command might be the simple and easy way for doing it
但是您的内联 shell 命令可能是执行此操作的简单方法