scl启用devtoolset-7不做任何事情

mas*_*nix 3 scl

我有一台相对较旧的服务器,上面装有 CentOS 6。默认的 gcc 是 4.4.7,但经过一番谷歌搜索后,我发现我可以通过devtoolset-7. 我是devtoolset-7通过root(即sudo -i)安装的,安装没问题。

然后我就这么做了scl enable devtoolkit-7 bash,但似乎没有任何作用。

[affan@abm-lab ~]$ gcc --version
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[affan@abm-lab ~]$ scl enable devtoolset-7 bash

[affan@abm-lab ~]$ gcc --version
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Run Code Online (Sandbox Code Playgroud)

有谁知道为什么scl不启用具有正确变量设置的子环境?

小智 6

我也有这个问题。我不知道为什么scl无法启用环境,但我能够加载它source /opt/rh/devtoolset-7/enable