Switching
-
8. Switching System GCC
(Optional) Finally, to easy Managing GCC Versions use Alternatives
So now to Set System for to manage a Multi Compiler.
First, possibly disable the existing Target with:sudo mv /usr/local/bin/gcc /usr/local/bin/gcc.bak
Then to Add the New GCC with alternatives use:
sudo alternatives --install /usr/local/bin/gcc gcc /usr/bin/x86_64-redhat-linux-gcc 20
Again Add the System GCC:
sudo alternatives --install /usr/local/bin/gcc gcc /usr/bin/gcc 10
(The Setup is working if as of default /usr/local/bin is preceding /usr/bin on the $PATH Env Var)
Next to Switch between GCC Versions play:sudo alternatives --config gcc
Last, to test the GCC in use:
gcc -v
Congratulations, your GCC 13.1 should be now nicely working on Fedora 36. Good Luck! :)
Contents