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

如何在Oracle Linux 8.10中安装GCC-Toolset 15?(官方文档显示支持但dnf安装失败)

How to Install GCC-Toolset 15 on Oracle Linux 8.10

The issue you're facing happens because GCC-Toolset 15 is delivered as a module in Oracle Linux 8's Application Stream, and the default active module stream for gcc-toolset likely points to version 14 instead of 15. Here's how to fix it:

Step-by-Step Solution

  1. Verify available GCC-Toolset modules (optional sanity check):
    First, confirm that the 15 module stream exists in your system's repositories by running:

    dnf module list gcc-toolset
    

    You should see an entry like gcc-toolset:15 listed under the Oracle Linux 8 Application Stream repository.

  2. Enable the GCC-Toolset 15 module and install the package:
    Update your Dockerfile to explicitly enable the 15 module stream before installing the package. This tells DNF to target the correct version:

    FROM oraclelinux:8.10
    RUN dnf module enable -y gcc-toolset:15 && dnf install -y gcc-toolset-15
    ENTRYPOINT ["/bin/bash"]
    

    The -y flags skip interactive confirmation, which is critical for non-interactive environments like Docker builds.

  3. Rebuild and test your image:
    Re-run your Docker build command:

    docker build -t gcc-docker .
    

    This should successfully resolve the gcc-toolset-15 package and complete the installation.

Why This Works

Oracle Linux 8 uses Application Stream modules to ship multiple versions of software without conflicting with the system's default tools. By default, the gcc-toolset module may be set to the 14 stream on Oracle Linux 8.10. Explicitly enabling the :15 stream directs DNF to pull packages from that specific module version, aligning with what's documented in OL-PRODUCT-LIFECYCLE.pdf.

If you need to use GCC-Toolset 15 in a shell session after installation, activate it with:

scl enable gcc-toolset-15 bash

You can also add this activation line to your shell profile for persistent use across sessions.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.04.27 12:42:47