You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在CentOS Stream 8上安装devtoolset-11?原SCL仓库方法失效

在CentOS Stream 8上安装devtoolset-11的步骤
  • 安装对应SCL仓库配置包
    CentOS Stream 8中提供devtoolset的仓库配置包是centos-release-scl-rh,替代了CentOS 7里的centos-release-scl,执行以下命令安装:
sudo dnf install -y centos-release-scl-rh
  • 安装devtoolset-11工具链
    仓库启用后,按需选择安装方式:

    • 仅安装核心编译工具(gcc、g++、binutils):
    sudo dnf install -y devtoolset-11-gcc devtoolset-11-gcc-c++ devtoolset-11-binutils
    
    • 安装完整的devtoolset-11工具集合:
    sudo dnf install -y devtoolset-11
    
  • 启用devtoolset-11

    • 临时启用(仅当前终端会话生效):
    scl enable devtoolset-11 bash
    
    • 永久启用(所有终端会话生效):
      将以下内容添加到~/.bashrc文件末尾:
      source /opt/rh/devtoolset-11/enable
      
      执行命令重新加载配置:
      source ~/.bashrc
      
  • 验证安装结果
    执行命令查看gcc版本,确认输出为11.x系列:

gcc --version

内容的提问来源于stack exchange,提问作者jiopaley

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.25 16:15:39