Centos7安装GCC

安装:

下面用到remi库请看这
yum install centos-release-scl

yum list devtoolset-7-gcc* --enablerepo=remi
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: ftp.sjtu.edu.cn
 * centos-sclo-rh: ftp.sjtu.edu.cn
 * centos-sclo-sclo: ftp.sjtu.edu.cn
 * epel: mirrors.bfsu.edu.cn
 * extras: ftp.sjtu.edu.cn
 * remi: mirrors.tuna.tsinghua.edu.cn
 * remi-safe: mirrors.tuna.tsinghua.edu.cn
 * updates: ftp.sjtu.edu.cn
Available Packages
devtoolset-7-gcc.x86_64                                                  7.3.1-5.16.el7                                      centos-sclo-rh
devtoolset-7-gcc-c++.x86_64                                              7.3.1-5.16.el7                                      centos-sclo-rh
devtoolset-7-gcc-gdb-plugin.x86_64                                       7.3.1-5.16.el7                                      centos-sclo-rh
devtoolset-7-gcc-gfortran.x86_64                                         7.3.1-5.16.el7                                      centos-sclo-rh
devtoolset-7-gcc-plugin-devel.x86_64                                     7.3.1-5.16.el7                                      centos-sclo-rh
## 版本最低为7,截止写文时最新是11
yum install devtoolset-7-gcc* # 直接全部安装

启动和检查:

scl enable devtoolset-7 bash

which gcc
/opt/rh/devtoolset-7/root/usr/bin/gcc

gcc --version
gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)
Copyright (C) 2017 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.

Centos7安装GCC
https://qiil.github.io/2022/08/05/Centos7安装GCC/
作者
QSY
发布于
2022年8月5日
许可协议