Centos7 解決gcc 4.85版本(升級更改版本gcc)
阿新 • • 發佈:2020-08-05
由於需要原始碼編譯最新的包,需要用到gcc9.0版本,做個記錄!
- 安裝 gcc官方源:
#!/bin/bash yum install centos-release-scl scl-utils-build 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.el7 centos-sclo-rh gcc.x86_64 4.8.5-39.el7 base (預設) devtoolset-7-gcc-c++.x86_64 7.3.1-5.16.el7 centos-sclo-rh devtoolset-8-gcc-c++.x86_64 8.3.1-3.2.el7 centos-sclo-rh devtoolset-9-gcc-c++.x86_64 9.3.1-2.el7 centos-sclo-rh gcc-c++.x86_64 4.8.5-39.el7 base (預設)
- 安裝 gcc9 gcc9-c++
yum -y install devtoolset-9-gcc devtoolset-9-gcc-c++
# 官方推薦的載入方式(推薦)
scl enable devtoolset-9 bash
# 使用內建指令碼載入
source /opt/rh/devtoolset-9/enable