How to downgrade gcc to 9.3.0-17ubuntu1
I use nVidia's drivers from https:/
Trying to install NVIDIA-
(exact error message to be provided later, but is a gcc version mismatch between the gcc that compiled the kernel and the currently installed gcc)
This is a pretty critical failure. nVidia is correct: one should build kernel drivers with the same version of compiler that built the kernel, to avoid subtle and frustrating bugs.
Weird. Let's see:
$ cat /proc/version
Linux version 5.13.0-27-generic (buildd@
Okay, the kernel was compiled with gcc (Ubuntu 9.3.0-17ubuntu1
What's my version?
$ gcc --version
gcc (Ubuntu 9.4.0-1ubuntu1~
So there is a mismatch.
Sure enough, when I check, I see that gcc upgraded during today's updates:
$ zgrep --color=always --no-filename " upgrade " /var/log/dpkg.log* | sort | grep -i "g\(cc\|++\)"
...
2021-07-06 18:28:01 upgrade gcc-10-base:amd64 10-20200411-
2021-07-06 18:28:02 upgrade libgcc-s1:amd64 10-20200411-
2021-07-06 18:29:03 upgrade gcc-9:amd64 9.3.0-10ubuntu2 9.3.0-17ubuntu1
2021-07-06 18:29:05 upgrade libgcc-9-dev:amd64 9.3.0-10ubuntu2 9.3.0-17ubuntu1
2021-07-06 18:29:07 upgrade gcc-9-base:amd64 9.3.0-10ubuntu2 9.3.0-17ubuntu1
...
2022-03-08 15:58:21 upgrade g++-9:amd64 9.3.0-17ubuntu1
2022-03-08 15:58:21 upgrade gcc-9:amd64 9.3.0-17ubuntu1
2022-03-08 15:58:22 upgrade libgcc-9-dev:amd64 9.3.0-17ubuntu1
2022-03-08 15:58:23 upgrade gcc-9-base:amd64 9.3.0-17ubuntu1
...
2022-05-10 10:15:57 upgrade g++-9:amd64 9.4.0-1ubuntu1~
2022-05-10 10:15:58 upgrade gcc-9:amd64 9.4.0-1ubuntu1~
2022-05-10 10:16:00 upgrade libgcc-9-dev:amd64 9.4.0-1ubuntu1~
2022-05-10 10:16:01 upgrade gcc-9-base:amd64 9.4.0-1ubuntu1~
Easy peasy, I'll downgrade gcc-9-base to the previous version 9.3.0-17ubuntu1. (It's actually a couple of versions back, but, it's the most recent 9.3 package, and, I think I had this same install failure in Mar but didn't have time to dig into it then.) Let's see:
$ sudo apt update
...
$ sudo apt policy gcc-9-base
gcc-9-base:
Installed: 9.4.0-1ubuntu1~
Candidate: 9.4.0-1ubuntu1~
Version table:
*** 9.4.0-1ubuntu1~
500 http://
500 http://
100 /var/lib/
9.
500 http://
That's... weird. Where are 9.3.0-17ubuntu and 9.4.0-1ubuntu1?
I'd really like not to downgrade all the way to 9.3.0-10ubuntu2 if possible.
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- Ubuntu Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Stuart MacDonald for more information if necessary.