centos7中yum安装gcc编译器11
001、系统信息
[root@PC1 software]# cat /etc/system-release CentOS Linux release 7.6.1810 (Core)
002、当前gcc编译器版本
[root@PC1 software]# gcc --version gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36) 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.
003、列出所有可用的gcc安装包
[root@PC1 software]# yum list devtoolset-*-gcc Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile * base: mirrors.bupt.edu.cn * centos-sclo-rh: mirrors.bupt.edu.cn * centos-sclo-sclo: mirrors.bupt.edu.cn * extras: mirrors.bupt.edu.cn * updates: mirrors.bupt.edu.cn Installed Packages devtoolset-11-gcc.x86_64 11.2.1-9.1.el7 @centos-sclo-rh Available Packages devtoolset-10-gcc.x86_64 10.2.1-11.2.el7 centos-sclo-rh devtoolset-11-annobin-plugin-gcc.x86_64 10.38-1.el7 centos-sclo-rh devtoolset-7-gcc.x86_64 7.3.1-5.16.el7 centos-sclo-rh devtoolset-8-gcc.x86_64 8.3.1-3.2.el7 centos-sclo-rh devtoolset-9-gcc.x86_64 9.3.1-2.2.el7 centos-sclo-rh
004、利用yum安装
[root@PC1 software]# yum -y install centos-release-scl [root@PC1 software]# yum -y install devtoolset-11-gcc devtoolset-11-gcc-c++ devtoolset-11-binutils [root@PC1 software]# scl enable devtoolset-11 bash [root@PC1 software]# echo "source /opt/rh/devtoolset-11/enable" >>/etc/profile
005、测试当下的gcc版本
[root@PC1 software]# gcc --version gcc (GCC) 11.2.1 20220127 (Red Hat 11.2.1-9) Copyright (C) 2021 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.
。
006、重启,测试是否长久生效
[root@PC1 software]# reboot
007、测试版本
[root@PC1 ~]# gcc --version gcc (GCC) 11.2.1 20220127 (Red Hat 11.2.1-9) Copyright (C) 2021 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.
。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律
2022-07-17 linux 中shell统计fasta文件中每条染色体上的碱基数目
2022-07-17 linux shell统计 fasta文件中每条染色体上的碱基数
2022-07-17 linux 中删除匹配特定字符的行及其后的若干行
2022-07-17 linux 中 sed命令匹配特定字符之间的数据
2022-07-17 linux 中 sed匹配特定字符并输出其后的若干行
2021-07-17 linux系统中如何删除^M
2021-07-17 linux系统中实现文件指定列的互换