"how to install gcc/g++ 8 on centos" Code Answer


centos 8 already comes with gcc 8.

on centos 7, you can install gcc 8 from developer toolset. first you need to enable the software collections repository:

yum install centos-release-scl

then you can install gcc 8 and its c++ compiler:

yum install devtoolset-8-gcc devtoolset-8-gcc-c++

to switch to a shell which defaults gcc and g++ to this gcc version, use:

scl enable devtoolset-8 -- bash

you need to wrap all commands under the scl call, so that the process environment changes performed by this command affect all subshells. for example, you could use the scl command to invoke a shell script that performs the required actions.

By rkw on March 1 2022

Answers related to “how to install gcc/g++ 8 on centos”

Only authorized users can answer the Search term. Please sign in first, or register a free account.