我遵循教程 install GCC in centos7,安装成功,但无法启用。这是命令。
sudo yum集团安装“开发工具” sudo yum安装centos-release sudo yum安装devtoolset-7 启用devtoolset-7 bash gcc -版本
下面是正在运行的日志:
-bash-4.2$ sudo yum group install "Development Tools"
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.ustc.edu.cn
* centos-sclo-rh: mirror.lzu.edu.cn
* centos-sclo-sclo: mirrors.ustc.edu.cn
* epel: hkg.mirror.rackspace.com
* extras: mirrors.ustc.edu.cn
* updates: mirrors.ustc.edu.cn
Maybe run: yum groups mark install (see man yum)
No packages in any requested group available to install or update
-bash-4.2$
-bash-4.2$
-bash-4.2$
-bash-4.2$
-bash-4.2$ sudo yum install centos-release-scl
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.ustc.edu.cn
* centos-sclo-rh: mirror.lzu.edu.cn
* centos-sclo-sclo: mirrors.ustc.edu.cn
* epel: hkg.mirror.rackspace.com
* extras: mirrors.ustc.edu.cn
* updates: mirrors.ustc.edu.cn
Package centos-release-scl-2-3.el7.centos.noarch already installed and latest version
Nothing to do
-bash-4.2$
-bash-4.2$
-bash-4.2$
-bash-4.2$ sudo yum install devtoolset-7
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.ustc.edu.cn
* centos-sclo-rh: mirror.bit.edu.cn
* centos-sclo-sclo: mirrors.ustc.edu.cn
* epel: my.mirrors.thegigabit.com
* extras: mirrors.ustc.edu.cn
* updates: mirrors.ustc.edu.cn
Package devtoolset-7-7.1-4.el7.x86_64 already installed and latest version
Nothing to do
-bash-4.2$
-bash-4.2$
-bash-4.2$ scl enable devtoolset-7 bash
bash-4.2$
bash-4.2$
bash-4.2$ gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
Copyright (C) 2015 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.有什么想法吗?
发布于 2020-12-08 09:13:02
可能你有一个混乱的env路径。检查文件.bashrc或.bash_profile并删除旧版本路径。
最后一次机会是直接/明确地使用:
source /opt/rh/devtoolset-7/enablehttps://stackoverflow.com/questions/65195907
复制相似问题