Uninstall boost and install another version

后端 未结 5 1219
我寻月下人不归
我寻月下人不归 2020-12-31 09:51

I\'ve installed the boost libraries on Linux Mint 12 using the command sudo apt-get install libboost-dev libboost-doc, which installs the default version availa

相关标签:
5条回答
  • 2020-12-31 10:08

    As @savamane wrote you can uninstall it with

    apt-get --purge remove libboost-dev libboost-doc

    Another suggestion to install the .deb packages as suggested here. (Download the one fitted for your architecture though).

    For still supported distros, you can simply search for the package at the distributions at http://packages.ubuntu.com/. For example libboost-system1.46.1 can be found in under the precise -> Libraries tab.

    For unsupported distros, there is still a chance to find them at http://archive.ubuntu.com/. For example can libboost-all-dev_1.40.0.1_amd64.deb be found in http://archive.ubuntu.com/ubuntu/pool/universe/b/boost-defaults/.

    0 讨论(0)
  • 2020-12-31 10:13

    You can uninstall with

    apt-get --purge remove libboost-dev libboost-doc
    

    Download the package you need from boost website, extract and follow "getting started" instructions found inside index.html in the extracted directory.

    0 讨论(0)
  • 2020-12-31 10:14

    Boost can installed by two ways

    • Deb package
    • wget and install manually

    In some case we might have installed by both type which can cause version error. Lets see how to uninstall both.

    sudo apt-get update
    
    # to uninstall deb version
    sudo apt-get -y --purge remove libboost-all-dev libboost-doc libboost-dev
    # to uninstall the version which we installed from source
    sudo rm -f /usr/lib/libboost_*
    

    Then we need to install other dependencies if they are not met

    sudo apt-get -y install build-essential g++ python-dev autotools-dev libicu-dev libbz2-dev
    

    Lets download the boost version which we need from the link. I am downloading the 1.54 version. Then untar and install it.

    # go to home folder
    cd
    wget http://downloads.sourceforge.net/project/boost/boost/1.54.0/boost_1_54_0.tar.gz
    tar -zxvf boost_1_54_0.tar.gz
    cd boost_1_54_0
    # get the no of cpucores to make faster
    cpuCores=`cat /proc/cpuinfo | grep "cpu cores" | uniq | awk '{print $NF}'`
    echo "Available CPU cores: "$cpuCores
    ./bootstrap.sh  # this will generate ./b2
    sudo ./b2 --with=all -j $cpuCores install
    

    Now let's check the installed version

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

    You will something like below

    //  BOOST_LIB_VERSION must be defined to be the same as BOOST_VERSION
    #define BOOST_LIB_VERSION "1_54"
    

    Version 1.54 of boost is installed

    That's it, it worked for me. Let me know if you face any issues.

    0 讨论(0)
  • 2020-12-31 10:17

    Downgrade your boost version. I'm not familiar with Mint, but assuming it is deb-based, you can do:

    apt-cache show libboost-dev
    

    to see all installable version and install a specific version with

    sudo apt-get install libboost-dev=1.42.0.1
    

    There are also convenience packages for the major boost versions:

    sudo apt-get install libboost1.44-dev
    
    0 讨论(0)
  • 2020-12-31 10:23

    This is how you install a specific Boost version:

    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
    
    0 讨论(0)
提交回复
热议问题