Linux Centos7升级gcc RPM包安装,第三方SCL源仓库
升级 gcc 可以用编译,也可用编译好的 rpm 包来直接安装,编译非常耗时间。
1. 查看系统发行版本
1 2 | [root@Centos7 ~] # cat /etc/redhat-release CentOS Linux release 7.8.2003 (Core) |
2. 下载RPM包(任选一个源)
国外:
https://vault.centos.org/7.8.2003/os/x86_64/Packages/
国内:
清华源:https://mirrors.tuna.tsinghua.edu.cn/centos-vault/7.8.2003/os/x86_64/Packages/
中科大源:https://mirrors.ustc.edu.cn/centos-vault/7.8.2003/os/x86_64/Packages/
163源:http://mirrors.163.com/centos-vault/7.8.2003/os/x86_64/Packages/
网友共享 gcc-4.8.5 :
链接:https://pan.baidu.com/s/1rUFw9xv5_0l3-oT3vI48Hw?pwd=jjyl
提取码:jjyl
3. gcc安装包 & 依赖包
1 2 3 4 5 6 | rmp -ivh gcc -4.8.5-4.el7.x86_64.rpm rmp -ivh glibc-devel-2.17-105.el7.x86_64.rpm rmp -ivh glibc-headers-2.17-105.el7.x86_64.rpm rmp -ivh kernel-headers-3.10.0-327.el7.x86_64.rpm rmp -ivh libmpc-1.0.1-3.el7.x86_64.rpm rmp -ivh mpfr-3.1.1-4.el7.x86_64.rpm |
gcc 10.1.0 安装包 & 依赖包
1 2 3 4 | gcc -10.1.0 gmp-5.0.1 mpc-1.0.1 mpfr-3.1.5 |
4. 安装命令
1 2 3 4 5 6 7 8 9 10 | [root@localhost gcc ] # rpm -Uvh *.rpm --nodeps --force 准备中... ################################# [100%] 正在升级/安装... 1:mpfr-3.1.1-4.el7 ################################# [ 14%] 2:libmpc-1.0.1-3.el7 ################################# [ 29%] 3:cpp-4.8.5-4.el7 ################################# [ 43%] 4:kernel-headers-3.10.0-327.el7 ################################# [ 57%] 5:glibc-headers-2.17-105.el7 ################################# [ 71%] 6:glibc-devel-2.17-105.el7 ################################# [ 86%] 7: gcc -4.8.5-4.el7 ################################# [100%] |
5. 检查安装结果
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | [root@localhost gcc ] # gcc -v 使用内建 specs。 COLLECT_GCC= gcc COLLECT_LTO_WRAPPER= /usr/libexec/gcc/x86_64-redhat-linux/4 .8.5 /lto-wrapper 目标:x86_64-redhat-linux 配置为:.. /configure --prefix= /usr --mandir= /usr/share/man --infodir= /usr/share/info --with-bugurl=http: //bugzilla .redhat.com /bugzilla -- enable -bootstrap -- enable -shared -- enable -threads=posix -- enable -checking=release --with-system-zlib -- enable -__cxa_atexit --disable-libunwind-exceptions -- enable -gnu-unique-object -- enable -linker-build- id --with-linker- hash -style=gnu -- enable -languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto -- enable -plugin -- enable -initfini-array --disable-libgcj --with-isl= /builddir/build/BUILD/gcc-4 .8.5-20150702 /obj-x86_64-redhat-linux/isl-install --with-cloog= /builddir/build/BUILD/gcc-4 .8.5-20150702 /obj-x86_64-redhat-linux/cloog-install -- enable -gnu-indirect- function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux 线程模型:posix gcc 版本 4.8.5 20150623 (Red Hat 4.8.5-4) (GCC) |
还有另一种方式,用第三方SCL源仓库
https://blog.csdn.net/weixin_43333233/article/details/125928578
https://blog.csdn.net/m0_47696151/article/details/123519481
https://www.bbsmax.com/A/6pdDy69kzw/
不同的 devtoolset 对应了不同的 gcc 版本,如:
devtoolset-1 是 gcc 4.7
devtoolset-2 是 gcc 4.8
devtoolset-3 是 gcc 4.9
devtoolset-4 是 gcc 5.2/5.3
d evtoolset-6 是 gcc 6.2/6.3
devtoolset-7 是 gcc 7.2/7.3
参考:
http://yrclubs.com/archives/55/
https://blog.csdn.net/hiprogram/article/details/121465523
https://blog.csdn.net/bo_wei/article/details/124520886
https://blog.csdn.net/sinat_37792529/article/details/125041604
https://blog.csdn.net/wai_58934/article/details/125816853
推荐本站淘宝优惠价购买喜欢的宝贝:
本文链接:https://hqyman.cn/post/5359.html 非本站原创文章欢迎转载,原创文章需保留本站地址!
休息一下~~