Upgrade GCC compiler

Latest response

I have RHEL 7.3 workstation installed on my system and using GCC-4.8.5 that was installed with developer toolset. I need to use GCC compiler 5.3 or above so wondering how to upgrade. Can i do it using Yum or do I have to download GCC from GNU's website and then install it.


The default compiler for RHEL7 is gcc 4.8.x. You can get 5.3 from Red Hat Developer Tool Set provided you have an active Red Hat Enterprise Linux Developer subscription.

What gcc versions are available in Red Hat Enterprise Linux?

Hi, I have been trying to update my gcc compiler exactly as Ravindra, but I have RH 7.2. I have various subscriptions (RHE Standard L3, Software Collections and Developer Toolkit, and a RH Developer Subscription listed with "zero % entitlement"). My two questions: 1) what do I need to buy / do to get access to RHE Linux Developer subscription, as you indicate is needed? 2) once (1) is done, what do I need to do to get yum to find the right rpm to install?

Thanks in advance for any help you can give!

If you want the Developer Toolset version of gcc 5.3, you'll want DTS 4.1 which you can do a yum install on and it will install alongside your 4.8 version. Btw, if you want gcc 6, DTS6 is now GA. (Note that we skipped naming DTS 5 so that gcc and DTS version numbers would match)

Hello Mike,

The Developer Subscription can be gained from the site developer.redhat.com once you have you need to reinstall your machine, because the Developer Subscription is a RHEL Server subscription.

You will get extra repositories chat have neder development tools.


Jan Gerrit Kootstra

Thanks for the info. So, I have to reinstall the whole operating system (painful for me) in order to use the Developer subscription? This is what I want to avoid.

Hi Paul,

No need to reinstall, simply unregister the system and re-register it with the pool ID of the developer subscription. :)
But, please bear in mind that the developer subscription may only be used for development and not for production !


Sorry to come back on an old thread. I am interested in what "only be used for development and not for production" actually means? If I use gcc5 for example, to build a product that I release to customers. Is that allowed or not?

Hi Jon,

It means that you can develop the product on a system that has the dev sub attached. :)
But for the process of releasing the product to customers, you need a paid subscription.


Thanks so much.

You're welcome, Paul ! :)

Please don't forget to clean up the repositories and the cache afterwards.

sudo yum clean all
sudo rm -r /var/cache/yum
sudo yum update

Then enable the repositories you want to add and run yum update again.