Linux serverNETWORK ADMINISTRATIONS

How to Install Devtoolset-8 on Linux | How to upgrade g++ in Linux

Upgrade g++ version 4.8.5 to 8.3.1

steps –
Install Commands:
# 1. Install a package with repository for your system:
# On CentOS, install package centos-release-scl available in CentOS repository:
$ sudo yum install centos-release-scl

# On RHEL, enable RHSCL repository for you system:
$ sudo yum-config-manager –enable rhel-server-rhscl-7-rpms

# 2. Install the collection:
$ sudo yum install devtoolset-8

Run command (cmd session specific – should be used to temporarily upgrade to gcc upgrade):
# 3. Start using software collections:
$ scl enable devtoolset-8 bash

Run Command (global setting – should be used to use upgraded gcc all the time – point installed gcc to upgrade gcc with a symlink – if you don’t need old gcc for other builds):
FYI, we use this setting for permanently use upgraded gcc for all crypto builds.

#Rename old g++
$ sudo mv /usr/bin/g++ /usr/bin/g++.old

# sudo ln -s “intended g++” “old installed g++”
$ sudo ln -s /opt/rh/devtoolset-8/root/usr/bin/g++ /usr/bin/g++

source

centos 7

Leave a Reply

Your email address will not be published. Required fields are marked *