CentOS 8にgcc 9をインストール(AppStream)


はじめに

Application Stream(AppStream)を利用してCentOS8にgcc9をインストール
参考:RHEL 8 でのアプリケーション開発 Red Hat Enterprise Linux 8 | Red Hat Customer Portal

サポート

本手法で導入した場合、Red Hat Enterprise Linux 8 Application Streams Life Cycle - Red Hat Customer Portalより、2021-11がEOLだと思われる。
それ以降に報告された脆弱性や不具合への対応は実施されない可能性がある。

LOG

インストール

# cat /etc/redhat-release
CentOS Linux release 8.1.1911 (Core)

# yum install -y gcc-toolset-9
... 略
# scl enable gcc-toolset-9 bash

各種確認

# which gcc
/opt/rh/gcc-toolset-9/root/usr/bin/gcc

# gcc --version
gcc (GCC) 9.1.1 20190605 (Red Hat 9.1.1-2)
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

# yum info gcc-toolset-9
Failed to set locale, defaulting to C.UTF-8
Last metadata expiration check: 0:03:16 ago on Sat Jan 25 04:13:00 2020.
Installed Packages
Name         : gcc-toolset-9
Version      : 9.0
Release      : 3.el8
Architecture : x86_64
Size         : 2.1 k
Source       : gcc-toolset-9-9.0-3.el8.src.rpm
Repository   : @System
From repo    : AppStream
Summary      : Package that installs gcc-toolset-9
License      : GPLv2+
Description  : This is the main package for gcc-toolset-9 Software Collection.

# yum info gcc-toolset-9-gcc
Failed to set locale, defaulting to C.UTF-8
Last metadata expiration check: 0:03:43 ago on Sat Jan 25 04:13:00 2020.
Installed Packages
Name         : gcc-toolset-9-gcc
Version      : 9.1.1
Release      : 2.4.el8
Architecture : x86_64
Size         : 75 M
Source       : gcc-toolset-9-gcc-9.1.1-2.4.el8.src.rpm
Repository   : @System
From repo    : AppStream
Summary      : GCC version 9
URL          : http://gcc.gnu.org
License      : GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD
Description  : The gcc-toolset-9-gcc package contains the GNU Compiler Collection version 9.