Centos7安装gcc-11

配置scl源


cat > /etc/yum.repos.d/CentOS-SCLo-scl.repo << 'EOF'
[centos-sclo-sclo]
name=CentOS-7 - SCLo sclo
baseurl=https://mirrors.aliyun.com/centos-vault/7.9.2009/sclo/$basearch/sclo/
gpgcheck=0
enabled=1
EOF

cat > /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo << 'EOF'
[centos-sclo-rh]
name=CentOS-7 - SCLo rh
baseurl=https://mirrors.aliyun.com/centos-vault/7.9.2009/sclo/$basearch/rh/
gpgcheck=0
enabled=1
EOF

安装


# 1. 重新生成缓存(这次绝对不会再报 404 或找不到 baseurl 了)
yum clean all
yum makecache

# 2. 安装现代版 GCC 11 编译器
yum install devtoolset-11-gcc devtoolset-11-gcc-c++ -y

# 3. 激活新环境
scl enable devtoolset-11 bash

# 4. 确认激活成功(屏幕应该输出 gcc 11.x.x)
gcc --version

# 5. 最后一步,安装你的 Python 依赖!
pip3 install greenlet

发表回复

后才能评论