I could try updating it by the standard Ubuntu means but this will
most likely imply I need to get some third party ppa and pull as side
effect lot of crap that will make my system unstable
You can add a PPA, install only the packages you want and (if the PPA contains more than just the Boost libraries) remove it, so that no other package will get auto-updated. I think that's the easiest way to go.
However, a tool I am using that compiles and links using the "default"
system settings ends up picking the 1.46.1
What kind of tool is it? Maybe you can configure it to use Boost from a custom location? If it's gcc-based, making it pass -I and -L flags to the compiler and linker might help.
can I not simply sweep out all those old Boost 1.46 installations
and move over to the default /usr/include and /usr/lib the 1.50
installation? would doing this cause my system to break?
In most GNU/Linux distributions (with Ubuntu among them) the /usr
prefix is reserved for software managed with the distribution's package manager. Installing a non-packaged software there will work at first, but you may have some trouble (e.g. package manager complaints) when some package will actually contain the same files. That's why for manually compiled, non-packaged software it's a common practice to use other prefixes like /usr/local
or /opt/something
.
Most shared libraries are versioned, so it is safe to have multiple versions of them installed on the same system at the same time. Particularly, you can have multiple versions of Boost runtime packages in Ubuntu. If you still want to make a manual install of Boost to /usr
, you don't have to remove the old Boost runtime version, which is good if you found out that some important software packages depend on them.
However, before installing your newly compiled Boost to /usr
, firstly remove from your system all *boost*dev packages (and all other *dev packages that depend on them), because they contain the header files (many Boost components are header-only), static libraries and symbolic links to particular runtime libraries version.
To confirm that it works, I just compiled and installed Boost 1.51 to /usr
on my Ubuntu 11.04 using this method and nothing broke. Aptitude still uses Boost 1.42:
$ ldd /usr/bin/aptitude | grep boost
libboost_iostreams.so.1.42.0 => /usr/lib/libboost_iostreams.so.1.42.0 (0x00007f536ee77000)
And newly compiled programs use the new version:
$ g++ my-boost-test.c -lboost_thread -o my-boost-test
$ ldd my-boost-test | grep boost
libboost_thread.so.1.51.0 => /usr/lib/libboost_thread.so.1.51.0 (0x00007f543d1df000)
libboost_chrono.so.1.51.0 => /usr/lib/libboost_chrono.so.1.51.0 (0x00007f543c49e000)
libboost_system.so.1.51.0 => /usr/lib/libboost_system.so.1.51.0 (0x00007f543c29a000)