Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a boost 1.49 in my ubuntu system. And I am trying to uninstall boost 1.49 and completely remove it from my system.

And after that install the Boost 1.54.0

I did like this to uninstall 1.49 from my system -

sudo apt-get --purge remove libboost-dev
sudo apt-get --purge remove libboost-all-dev

And after that when I do below command to see the version, it still says I have 1.49

cat /usr/include/boost/version.hpp | grep "BOOST_LIB_VERSION"
//  BOOST_LIB_VERSION must be defined to be the same as BOOST_VERSION
#define BOOST_LIB_VERSION "1_49"

Not sure why?

And I tried installing Boost 1.54.0 version like this -

wget http://sourceforge.net/projects/boost/files/boost/1.54.0/boost_1_54_0.tar.gz/download
tar -xvzf boost_1_54_0.tar.gz
cd boost_1_54_0/
./bootstrap.sh --with-libraries=atomic,date_time,exception,filesystem,iostreams,locale,program_options,regex,signals,system,test,thread,timer,log
sudo ./b2 install

But still it is not showing me boost 1.54.0 version installed?

Any pointers how to remove BOOST 1.49 from my system and install BOOST 1.54 in my machine?

share|improve this question
up vote 1 down vote accepted

Installation of Boost via apt installs several Boost packages which are not uninstalled on the remove that you are using. Try sudo apt-get autoremove which will remove the non-required packages. I tested this on my Ubuntu 12.04.x LTS which successfully removed the non-required Boost packages.

The way you are reinstalling the package might install Boost on your (/home) as opposed to on system (/usr..).

Use the --prefix option of b2 to set the installation location.

Depending on where it installs, at the completion of ./b2, you will see messages like these:

The Boost C++ Libraries were successfully built!

The following directory should be added to compiler include paths:


The following directory should be added to linker library paths:


So, update the LD_LIBRARY_PATH and C_INCLUDE_PATH accordingly for further usages of Boost.

share|improve this answer
Thanks Ketan. And after that how do I install BOOST 1.54.0? The way I am doing is correct? – lining Dec 31 '13 at 2:16
Yes, see my updated answer. – Ketan Dec 31 '13 at 2:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.