Ubuntu installs high version of gcc and multi-version switch

 1、apt-get update

2、apt-get install -y gcc-7 g++-7

 update-alternatives /usr/bin/gcc-5 50  --slave

 update-alternatives /usr/bin/gcc-7 70  --slave

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

gcc  -v

update-alternatives --config gcc

 

Reference: https://www.cnblogs.com/dakewei/p/13049150.html

Guess you like

Origin blog.csdn.net/xiaoshunzi111/article/details/107244502