I got the following problem on 18.04:

  • GCC was updated from GCC 7.3 to GCC 7.4
  • A new kernel was installed (compiled with 7.3)

Now the NVIDIA driver will not install as it requires that the installed version was also used to compile the kernel.

I tried the IGNORE_CC_MISMATCH without success. What is the preferred way of solving the problem:

  • Recompile the kernel package with the current gcc
  • Downgrade GCC to 7.3

I guess one should file a bug to canonical (title: Always deploy kernels compiled with current version of GCC).

  • You should install the version in the repository. You can use Additional Drivers for that. Do not install the binary from Nvidia.
    – user880592
    Apr 30, 2019 at 10:30
  • @GabrielaGarcia Sometimes, that package is broken too
    – user877329
    Apr 30, 2019 at 10:38
  • It's possible but very unlikely, rarely.
    – user880592
    Apr 30, 2019 at 10:39
  • You need to download the latest Nvidia driver that is compatible with your Kernel version you can download it from nvidia website or use the proprietary drivers from Ubuntu.
    – JoKeR
    Apr 30, 2019 at 10:57
  • 1
    use sudo sh ./NVIDIA-Linux-x86_64-*.run --no-cc-version-check I believe NVIDIA-Linux-x86_64-*.run is unsetting IGNORE_CC_MISMATCH unless you use the --no-cc-version-check flag. See askubuntu.com/a/1143434/144906 May 15, 2019 at 19:58

1 Answer 1


You can change which gcc version you use by running

sudo update-alternatives --config gcc

It will list you installed version of gcc and you can set any gcc version as default.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.