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?

  • RHEL 6 goes end of life in November 2020. There are two major versions newer than it out already (RHEL 7 and 8.) Those versions will pack newer compilers already. Just move on to a newer version. – filbranden Jan 17 at 2:28

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
| improve this answer | |
  • I get the error Loaded plugins: product-id, refresh-packagekit, rhnplugin There was an error communicating with RHN. RHN Satellite or RHN Classic support will be disabled. rhn-plugin: Error communicating with server. The message was: Error Class Code: 6001 Error Class Info: RHN is in the process of being decommissioned and systems are no longer able to receive updates or make use of any RHN services. Please see https://access.redhat.com/articles/2979901 for more info. – user3682248 Jan 17 at 2:04
  • So why not follow the link in the error message and do as instructed: access.redhat.com/articles/2979901 – Danila Vershinin Jan 17 at 2:16
  • that link points to a regular FAQ,am trying to find how else can I install gcc 6.2.0? – user3682248 Jan 17 at 3:56
  • Try to look closely at the link. It is not a regular FAQ. – Danila Vershinin Jan 17 at 4:08
  • I looked,can't figure out how to overcome – user3682248 Jan 17 at 4:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.