dkms failure because gcc version is newer than that used to compile kernel
Instead of installing multiple versions of gcc you can pass the following option to the nvidia installer:
--no-cc-version-check
Worked for me on Ubuntu 18.04.2, kernel 4.18.0-20 and nvidia 430.14.