AwaitedOne
AwaitedOne

Reputation: 1012

Find correct Boost version installed and how to remove the old version

I had boost previously installed by

sudo apt-get libboost-dev
sudo apt-get libboost-all-dev

and I think I got boost 1.58.

Then I needed the latest boost for boost_serialization, for that I tried installing boost by downloading from here, and then the following commands.

tar --bzip2 -xf boost_1_65_1.tar.bz2
./bootstrap.sh --prefix=/usr/
sudo checkinstall ./b2 install 

I checked the boost version installed by different ways.

First

std::cout << "Using Boost "
            << BOOST_VERSION / 100000     << "."  // major version
            << BOOST_VERSION / 100 % 1000 << "."  // minor version
            << BOOST_VERSION % 100                // patch level
            << std::endl;

Which gives Using Boost 1.65.1

Second

dpkg -S /usr/include/boost/version.hpp

Which gives libboost1.58-dev:amd64: /usr/include/boost/version.hpp

Third

cat /usr/include/boost/version.hpp | grep "BOOST_LIB_VERSION"

which displays // BOOST_LIB_VERSION must be defined to be the same as BOOST_VERSION #define BOOST_LIB_VERSION "1_65_1"

Fourth

dpkg -s libboost-dev | grep 'Version'

which displays Version: 1.58.0.1ubuntu1

Which is the difference? Do I have both the versions installed or only 1.65?

I tried removing 1.58 by sudo apt-get autoremove, but I get the same information again.

I also tried removing the old by

dpkg -S /usr/include/boost/version.hpp
sudo apt-get autoremove package

and it just display the following information

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package package

Upvotes: 0

Views: 3997

Answers (1)

SoronelHaetir
SoronelHaetir

Reputation: 15162

Building and installing the tarball is not going to update what apt thinks is installed, since you used /usr as your prefix it may well have overwritten the actual files but apt will still think the old version is installed.

Upvotes: 2

Related Questions