Skip to content

Instantly share code, notes, and snippets.

@vanderw
Forked from ric-bianchi/install-gcc-centos7.sh
Created March 25, 2026 03:33
Show Gist options
  • Select an option

  • Save vanderw/04be96d3518181e6e7fa3adf850cefdf to your computer and use it in GitHub Desktop.

Select an option

Save vanderw/04be96d3518181e6e7fa3adf850cefdf to your computer and use it in GitHub Desktop.
Install a modern GCC on Centos 7. Tested with GCC 9.
# By default, only GCC 4.8 is installed with devtools on Centos7.
# So here we will install a recent version of GCC.
# Source: https://linuxize.com/post/how-to-install-gcc-compiler-on-centos-7/
# 1. Install the SCL.
sudo yum install centos-release-scl
# 2. See what versions are available.
sudo yum search devtoolset
# 3. Pick one and install it. The `9` will install GCC 9.
sudo yum install devtoolset-9
# 4. Enable the new compiler in your shell
scl enable devtoolset-9 bash # if you use `fish`, replace `bash` with `fish`
# 5. Verify the version
gcc --version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment