Centos7升级gcc9
Centos7升级到gcc9:
yum install centos-release-scl -y && yum install devtoolset-9-gcc* -y && scl enable devtoolset-9 bash
安装成功后 只是临时的,退出shell或重启就会恢复原系统gcc版本。
如果要长期使用gcc 9.3的话:
echo "source /opt/rh/devtoolset-9/enable" >>/etc/profile
查看gcc版本:
gcc -v
如果提示/opt/rh/devtoolset-9//enable scriptlet does not exist
yum install devtoolset-9-runtime
或者
yum reinstall devtoolset-9-runtime
QA
Alibaba Cloud linux 2系统上安装 centos-release-scl
No package centos-release-scl available.
rpm -ivh https://cbs.centos.org/kojifiles/packages/centos-release-scl/2/3.el7.centos/noarch/centos-release-scl-2-3.el7.centos.noarch.rpm