Ask Your Question

How to downgrade gcc (from v 8 to v 7)

asked 2018-08-22 12:51:22 -0500

constantoverride gravatar image

I'm running gcc version 8 and I want to downgrade it to version 7 (because I want to try to compile kernel with gcc 7 to see if it still compile-errors!).
How to do that? I'm assuming that I have to use dnf. I'm on Fedora 28 (sort of)

$ gcc --version
gcc (GCC) 8.1.1 20180712 (Red Hat 8.1.1-5)
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
edit retag flag offensive close merge delete


On an unrelated note(since I mentioned this in the parenthesis of the question body): I just figured out how to fix my kernel compilation error (that pesky 'get_identifier_with_length' error) with gcc 8, it needed the kernel patches from commits: b86729109c5fd0a480300f40608aac68764b5adf and 80d172431696482d9acd8d2c4ea78fed8956e2a1 full info

constantoverride gravatar imageconstantoverride ( 2018-08-22 14:01:03 -0500 )edit

3 Answers

Sort by ยป oldest newest most voted

answered 2018-08-22 13:28:45 -0500

fedofix gravatar image

updated 2018-08-22 13:29:44 -0500

edit flag offensive delete link more


Wow. I can't believe it's that simple. That wants to downgrade it from 8.1.1 to 8.0.1 but I'm sure there's some flag to tell it 7. Thanks!

constantoverride gravatar imageconstantoverride ( 2018-08-22 14:04:56 -0500 )edit

This doesn't work to get past the first version supported by the OS version (so v8.0.1 for Fedora 28).

coderforlife gravatar imagecoderforlife ( 2019-01-08 16:18:28 -0500 )edit

answered 2018-08-22 13:48:56 -0500

villykruse gravatar image

If you are brave you could try to install gcc from the previous fedora release

dnf --releasever=27 install gcc-7.3.1-6.fc27

The binutils package is basically the same version in fc27 and fc28 so you may not need to downgrade that.

Safer would be to create a virtual machine and install fedora 27.

edit flag offensive delete link more


I don't know, that seems dangerous: using gcc from another fedora release. Are you implying that fc28 didn't ship with gcc 7 ? which would mean I can't downgrade to a gcc 7 of fc28, which is why you're suggesting 7 from fc27

constantoverride gravatar imageconstantoverride ( 2018-08-22 14:06:39 -0500 )edit
florian gravatar imageflorian ( 2018-08-22 15:07:27 -0500 )edit

This doesn't work, tons of packages are in conflict.

coderforlife gravatar imagecoderforlife ( 2019-01-08 16:19:32 -0500 )edit

Then use plan B: Create a virtual machine and install fedora 27.

villykruse gravatar imagevillykruse ( 2019-01-09 00:37:58 -0500 )edit

Question Tools

1 follower


Asked: 2018-08-22 12:51:22 -0500

Seen: 2,995 times

Last updated: Aug 22 '18