查询已安装的boost包:rpm -qa | grep -i boost
然后用yum remove命令删除已安装的boost包
下载最新版本的boost,例如:boost_1_59_0.tar.bz2
tar --bzip2 -xf boost_1_59_0.tar.bz2
cd boost_1_59_0/
./bootstrap.sh --prefix=/usr/local/share/boost-1.59.0/
./b2 install --build-dir=/tmp/ --prefix=/usr/local/share/boost-1.59.0/ --build-type=minimal --layout=tagged toolset=gcc
cp -p /etc/profile /etc/profile.`date +%Y%m%d%H%M%S`
cat >> /etc/profile <<EOF
export BOOST_ROOT=/usr/local/share/boost-1.59.0
export BOOST_INCLUDE=\$BOOST_ROOT/include/
export BOOST_LIB=\$BOOST_ROOT/lib
EOF
source /etc/profile
cat > /etc/ld.so.conf.d/boost.conf <<EOF
$BOOST_LIB
EOF
ldconfig