Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Fedora 24: How do I install and change the default gcc compiler version?

I am attempting to install some software using a fork of Linuxbrew known as Cadfaelbrew. (It is used primarily in the HEP industry.)

Unfortunately there is a bug which means Cadfaelbrew does not recognize gcc version 6.2 as supporting c++11.

However Cadfaelbrew does work with gcc version 4.9 on CentOS. (Which is a very similar OS to Fedora, as both are Rethat like OS's.)

To sidestep this problem (I cannot fix the bug myself) I would like to install gcc version 4.9 on my Fedora 24 system (using dnf, probably?).

I then need to change the default gcc compiler so that the command gcc/g++ point to the gcc/g++ version 4.9 compilers rather than the version 6.2 compilers.

How can I do that?

In addition, I would like to know how to revert the changes so that I am able to use gcc/g++ version 6 by default in the future.

Fedora 24: How do I install and change the default gcc compiler version?

I am attempting to install some software using a fork of Linuxbrew known as Cadfaelbrew. (It is used primarily in the HEP industry.)

Unfortunately there is a bug which means Cadfaelbrew does not recognize gcc version 6.2 as supporting c++11.

However Cadfaelbrew does work with gcc version 4.9 on CentOS. (Which is a very similar OS to Fedora, as both are Rethat Redhat like OS's.)

To sidestep this problem (I cannot fix the bug myself) I would like to install gcc version 4.9 on my Fedora 24 system (using dnf, probably?).

I then need to change the default gcc compiler so that the command gcc/g++ point to the gcc/g++ version 4.9 compilers rather than the version 6.2 compilers.

How can I do that?

In addition, I would like to know how to revert the changes so that I am able to use gcc/g++ version 6 by default in the future.