Skip to content

Instantly share code, notes, and snippets.

@ric-bianchi
Created August 4, 2020 16:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ric-bianchi/bc4b8da2405a27d7af5abe9910f8970c to your computer and use it in GitHub Desktop.
Save ric-bianchi/bc4b8da2405a27d7af5abe9910f8970c 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