Search code examples
gccrhel7

How to update GCC from 4.8 to 8.2 on RHEL7


I am looking to update my GCC to the newest version (8.2 as of today) but when I attempt to use yum update gcc it doesn't have any new packages to update. I am also not having any help looking at the GCC's website. Any help would be greatly appreciated!


Solution

  • Red Hat Enterprise Linux, being an "enterprise" operating system, is designed to be stable and similar for a long time. That means you do not get the "latest and greatest" by default, but a known-good implementation that remains the default on that particular RHEL version for the long term. Generally you only get substantial software upgrades by upgrading RHEL. Unfortunately, there is no RHEL 8 yet.

    devtoolset allows you to switch to newer, out-of-band versions of development software like GCC, in a way that doesn't "contaminate" the whole OS installation. I used it, with great success, to get GCC 4.8 (and its C++11 support) on CentOS 6, where the official GCC is 4.4.

    devtoolset-8 has GCC 8.2.1.

    Or you could choose to use a distribution more suited for home users, such as Fedora.

    Or you could download the GCC source and build it yourself (but ew!).