Red Hat branch of Linux distros maintains a collection of packages called ‘Development Tools‘ in which among other things the GNU toolchain is included as listed below:
- gcc c/c++ compiler
- gcc-c++ compiler
- binutils and all dependencies.
We should use the package management utility Yum to install the aforementioned packages. Run the following command on terminal as root.
yum groupinstall 'Development Tools'
If the above command fails (possibly in RHEL7/CentOS7), try
yum group install 'Development Tools'
After the installation, you can verify the GCC version like so: