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

在OpenSUSE Tumbleweed安装g++ 11遇仓库无效错误,求解决步骤

在OpenSUSE Tumbleweed安装g++ 11的解决步骤

1. 移除无效仓库

先删除之前添加的无效devel:gcc仓库:

zypper removerepo devel:gcc

2. 添加gcc11专属仓库

Tumbleweed的gcc11包存放在版本专属仓库中,执行以下命令添加:

zypper addrepo https://download.opensuse.org/repositories/devel:/gcc:/11/openSUSE_Tumbleweed/devel:gcc:11.repo

3. 刷新仓库缓存

更新仓库元数据确保能获取到最新包信息:

zypper refresh

4. 安装gcc11与g++11

直接安装对应版本的编译工具链:

zypper install gcc11 gcc11-c++

5. (可选)设置gcc11为默认编译器

如果需要将gcc11设为系统默认版本,用update-alternatives配置:

# 将gcc11加入备选列表
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100
# 将g++11加入备选列表
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 100
# 手动选择默认gcc版本(若存在多个版本时可选)
update-alternatives --config gcc
# 手动选择默认g++版本(若存在多个版本时可选)
update-alternatives --config g++

问题说明

之前安装失败是因为通用的devel:gcc仓库已不再为Tumbleweed提供gcc11包,而版本专属的devel:gcc:11仓库保留了旧版本的gcc编译工具链。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.20 15:17:46