一、安裝devtoolset
#1、
sudo yum install centos-release-scl
#2、
sudo yum install devtoolset-7-gcc*
二、使用
#激活
scl enable devtoolset-7 bash
#查看版本
三、错误处理
报错
file /usr/lib/debug/usr/lib64/libitm.so.1.0.0.debug from install of devtoolset-7-gcc-debuginfo-7.3.1-5.16.el7.x86_64 conflicts with file from package gcc-base-debuginfo-4.8.5-28.el7_5.1.x86_64
file /usr/lib/debug/usr/lib64/libatomic.so.1.debug from install of devtoolset-7-gcc-debuginfo-7.3.1-5.16.el7.x86_64 conflicts with file from package gcc-debuginfo-4.8.5-28.el7_5.1.x86_64
file /usr/lib/debug/usr/lib64/libtsan.so.0.0.0.debug from install of devtoolset-7-gcc-debuginfo-7.3.1-5.16.el7.x86_64 conflicts with file from package gcc-debuginfo-4.8.5-28.el7_5.1.x86_64
解决
yum remove gcc-debuginfo-4.8.5-28.el7_5.1.x86_64
yum -y remove gcc-base-debuginfo-4.8.5-28.el7_5.1.x86_64