Upgrade GCC 4.6.3 on Ubuntu 12.04 to 4.8.2

后端 未结 3 849
旧时难觅i
旧时难觅i 2020-12-29 00:18

I\'m about to update default GCC (version 4.6.3) shipped by Ubuntu 12.04 to 4.8.2, though the compilation requires a standalone C++ compiler

admin@ubuntu: /u         


        
3条回答
  •  再見小時候
    2020-12-29 00:55

    1. Add the ppa by

      sudo add-apt-repository ppa:ubuntu-toolchain-r/test

    2. Install g++ and gcc (version 4.8)

      sudo apt-get update; sudo apt-get install gcc-4.8 g++-4.8

    3. Run the following commands one by one,

      sudo update-alternatives --remove-all gcc

      sudo update-alternatives --remove-all g++

      sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 20

      sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 20

      sudo update-alternatives --config gcc

      sudo update-alternatives --config g++

    That's it you are done!

提交回复
热议问题