In CentOS, How To Switch To Default Gcc After Switched To A Higher Version Of Gcc With Devtoolset.

Home » CentOS » In CentOS, How To Switch To Default Gcc After Switched To A Higher Version Of Gcc With Devtoolset.
CentOS 1 Comment

I want to install several gcc with different versions in CentOS. The default version of gcc in CentOS6 is 4.9.3. So I use devtoolset install a higher version of gcc. Then I switch to the higher version of gcc by executing “source /opt/rh/devtoolset-5/enable”. But now if I want to switch back to the default gcc, how should I do?
By the way, is there any solution to install multiple gcc with different versions in CentOS 5?

One thought on - In CentOS, How To Switch To Default Gcc After Switched To A Higher Version Of Gcc With Devtoolset.

  • Exit the shell and start a new one.

    If you want to frequently shift between the different versions then probably the best way is to use the instructions in the devtoolset docs
    – i.e. do

    scl enable devtoolset-5 bash

    This will start a shell with the correct environment. You can then just terminate the shell that’s just been started to get back the the original environment.

    CentOS 5 is no longer a supported operating system – you should not be using it since it hasn’t had any security or bug fixes for a while. As such you won’t find any repositories with updated versions of software for it. The only way you are going to get updated versions of GCC on it is by compiling them yourself – and even then you may need dependencies that aren’t available for such an old distro.

    P.