I have an RHEL 6 server with gcc version 4.4.7. I wanted to update the gcc version to 6.2.0 . Yum update doesn't work. Also, SO answers for a similar question on does not work.
Has anyone updated gcc in RHEL 6 x86_64 server recently?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
Technically, you should not update the stock GCC of the OS, but install the newer GCC alongside it.
This is possible thanks to Software Collections, and it's pretty simple:
# 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
Now anytime you want to compile using newer GCC, type:
scl enable devtoolset-8 bash