Score:0

Compiler mismatch, can't upgrade Ubuntu

mz flag

Let me give you a brief introduction:

I use a really old and tiny netbook (11 years) to play around with new tools, try out different OS and so on, kind of a little (and portable) lab. Hardware specs are low, as expected (Old Intel Atom, 2 GB RAM and a 500GB HDD). Recently, I updated it with lubuntu which uses LXQt, works decent.

Now with the problem:

While sudo apt update'ing in the couple days before I noticed an error related with nvidia-tesla-450-kernel-dkms, no big deal since it would end up working, but at this moment when trying to sudo apt upgrade to keep up to date 6 packages I get an error stating that there has been an error processing nvidia-tesla-450-kernel-dkms. A bit higher says

Error! Bad return status for module build on kernel: 5.15.0-56-generic (x86_64). Consult /var/lib/dkms/nvidia-tesla-450/450.203.03/build/make.log for more information.

When inspecting the log file I encountered this:

Compiler version check failed: [...]

gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0, GNU ld (GNU Binutils for Ubuntu) 2.38

does not match the compiler used here:

gcc (Debian 12.2.0-9) 12.2.0

[...]

It is recommended to set the CC environment variable to the compiler that was used to compile the kernel.

What should I do? I've been reading this but I'm not completely sure what to do. Do I have to use an older version of the compiler rather than the updated one to solve the problem? If so, how? I'm not that experienced solving technical problems in Ubuntu.

hr flag
So you have installed gcc-12 and made it the default on your system? or am I reading it the wrong way around?
Alejandro avatar
mz flag
@steeldriver No, it is a quite a fresh install of lubuntu, no big changes so far. The only part that may have gone wrong was adding Kali Linux's repos and installing a few headless tools, which after a few problems (and a long wait) I gave up. Maybe that has caused the problem? A lot of libs and other packages installation were cancelled. If there is no easy solution for this I might just reinstall the OS, no personal data will be lost and I'll remove the question. I'm just wondering what the solution is so I can get some experience solving these types of problems.
hr flag
OK so adding the output of `apt policy gcc` to your question might be helpful in sorting this out
Alejandro avatar
mz flag
@steeldriver The output of `apt policy gcc` lead to the solution. The problem was gcc-12 being installed along other kali tools, which caused the compiler mismatch problem. I had gcc-11 (which was the one originally used) and gcc-12 on top of it, being originated in kali-repos. Removing gcc version 12 should solve it (although I couldn't due to another error), ended up reinstalling the OS.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.