At the time of writing, the latest version of Boost library in official Personal Package Archive (PPA) is 1.55.

$> aptitude search boost
p libboost1.55-all-dev - Boost C++ Libraries development files (ALL)

Which is far from the latest. In order to install the latest Boost version (including all libraries), you need to download the latest source code from Boost website (currently the latest version is 1.69.0).

$> cd /tmp/
$> wget
$> tar xzvf boost_1_69_0.tar.gz

Now you need to specify where to put the include headers and libraries, after the compiling source code.

$> ./ --prefix=/usr/

Let’s build the source code (that takes a while).

$> ./b2

The final step is to install the headers and libraries, or simply to copy them to the location specified with –prefix command line option.

$> sudo ./b2 install

Check installed Boost version

Now you have installed the latest version of Boost, let’s try to compile C++ source code to print Boost version to verify that’s all works fine.

#include <boost/version.hpp>
#include <iostream>

int main()
  std::cout << "Boost version: " << BOOST_VERSION / 100000
            << "." << BOOST_VERSION / 100 % 1000 << "."
            << BOOST_VERSION % 100 << std::endl;

  return 0;
$> g++ -Wall -g -ggdb -Werror -std=c++11 -o get_boost_version get_boost_version.cpp
$> ./get_boost_version
Boost version: 1.69.0