- 添加库
[root@xxx ~]# vim /etc/yum.repos.d/slc6-devtoolset-8.repo
往里面添加
[devtoolset-8-rh-release]
name=devtoolset 8 rh release
baseurl=https://cbs.centos.org/repos/sclo$releasever-devtoolset-8-rh-release/x86_64/os/
gpgcheck=0
enabled=1
2.安装GCC8 G++8 GF8
[root@xxx ~]# sudo yum install devtoolset-8-gcc devtoolset-8-gcc-c++ devtoolset-8-gcc-gfortran
3.使用
[root@xxx ~]# sudo source /opt/rh/devtoolset-8/enable
参考