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.

- 1,431
- 4
- 22
- 35
5 Answers
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
- 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

- 374,641
- 47
- 450
- 633
-
3Heads up: `bjam` got renamed to b2` for purposes of building boost with boost v.1_48 – sehe Jun 25 '14 at 18:38
-
1`sudo checkinstall ./b2 install` worked after installing libbz2-dev – nurettin Aug 15 '16 at 21:14
-
plus 1 for checkinstall – kyb Mar 11 '19 at 10:31
On new boost version there is other way:
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

- 171
- 1
- 3
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.
If aptitude search
command don't give you sufficient results, try sudo aptitude update
and then run aptitude search
again.

- 7,943
- 3
- 27
- 24
On my version of Ubuntu (10.04) it's 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.
In any case what I usually do under Ubuntu is
sudo apt-get install bjam
Extract the downloaded boost archive to your hard-drive and then cd into the root and
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.

- 9,405
- 2
- 28
- 46
-
I can't get bjam...when I type `sudo apt-get bjam` it says that bjam is an invalid operation – tpar44 Apr 22 '11 at 22:58
-
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
but your inline shell command might be the simple and easy way for doing it

- 2,509
- 2
- 22
- 18