Use the GCC Toolset

The GCC Toolset provides updated development tools on Red Hat Enterprise Linux. Install, enable, and manage the toolset to build and debug C and C++ applications.

What is the GCC Toolset

Red Hat Enterprise Linux 10 introduces the GCC Toolset, which is an Application Stream that contains updated versions of development and performance analysis tools. The GCC Toolset is similar in role to Red Hat Developer Toolset.

GCC Toolset is available as an Application Stream in the form of a Software Collection in the AppStream repository. The GCC Toolset is fully supported under Red Hat Enterprise Linux Subscription Level Agreements, is functionally complete, and is intended for production use. Applications and libraries provided by the GCC Toolset do not replace the Red Hat Enterprise Linux system versions, do not override them, and do not automatically become default or preferred choices. By using a framework called Software Collections, an additional set of developer tools is installed into the /opt/ directory and is explicitly enabled by the user on-demand by using the scl utility. Unless noted otherwise for specific tools or features, the GCC Toolset is available for all architectures supported by Red Hat Enterprise Linux.

Install the GCC Toolset

Installing the GCC Toolset on a system installs the main tools and all necessary dependencies. Note that some parts of the toolset are not installed by default and must be installed separately.

Procedure

To install the GCC Toolset version N:
# dnf install gcc-toolset-N

Install individual packages from the GCC Toolset

To install only certain tools from the GCC Toolset instead of the whole toolset, list the available packages and install the selected ones with the dnf package management tool. Use selective installation to access packages not installed by default with the full toolset.

Procedure

  1. List the packages available in the GCC Toolset version N:
    $ dnf list available gcc-toolset-N-\
  2. To install any of these packages:
    # dnf install package_name

    Replace package_name with a space-separated list of packages to install. For example, to install the gcc-toolset-15-annobin-annocheck and gcc-toolset-15-binutils-devel packages:

    # dnf install gcc-toolset-15-annobin-annocheck gcc-toolset-15-binutils-devel

Uninstall the GCC Toolset

Remove the GCC Toolset from your system by uninstalling it using the dnf package management tool.

Procedure

To uninstall the GCC Toolset version N:
# dnf remove gcc-toolset-N \

Access the GCC Toolset

To access the GCC Toolset, you can run a specific tool using the scl utility, or start a shell session where the toolset versions override the system versions.

Procedure

  • To run a single tool from the GCC Toolset version N:
    $ gcc-toolset-N-env tool

    Replace tool with the command provided by the tool you want to run.

  • To run a shell session where tool versions from the GCC Toolset version N override system versions of these tools:
    $ gcc-toolset-N-env bash
    Note

    The scl utility is not used for the GCC Toolset in Red Hat Enterprise Linux 10. The scl enable command does not work with the GCC Toolset.