dkms failure because gcc version is newer than that used to compile kernel

I have a kernel module that was registered with dkms. When a recent upgrade bumped my kernel to 4.15.0-50 I started getting the below error from dkms. Apparently kernel 4.15.0-50 was compiled with gcc version 7.3.0, but part of the upgrade involved installing a new version of gcc (7.4.0), which is causing dkms to fail. gcc 7.3 is no longer available on my system. How do I install gcc 7.3 in addition to 7.4, or even downgrade 7.4 to 7.3?

DKMS make.log for nvidia-430.14 for kernel 4.15.0-50-generic (x86_64) Tue May 14 17:08:12 CDT 2019 make[1]: Entering directory '/usr/src/linux-headers-4.15.0-50-generic' Makefile:976: "Cannot use CONFIG_STACK_VALIDATION=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel"   SYMLINK /var/lib/dkms/nvidia/430.14/build/nvidia/nv-kernel.o   SYMLINK /var/lib/dkms/nvidia/430.14/build/nvidia-modeset/nv-modeset-kernel.o  Compiler version check failed:  The major and minor number of the compiler used to compile the kernel:  gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3)  does not match the compiler used here:  cc (Ubuntu 7.4.0-1ubuntu1~18.04) 7.4.0 Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions.  There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.   It is recommended to set the CC environment variable to the compiler that was used to compile the kernel.  The compiler version check can be disabled by setting the IGNORE_CC_MISMATCH environment variable to "1". However, mixing compiler versions between the kernel and kernel modules can result in subtle bugs that are difficult to diagnose.  *** Failed CC version check. Bailing out! ***  /var/lib/dkms/nvidia/430.14/build/Kbuild:182: recipe for target 'cc_version_check' failed make[2]: *** [cc_version_check] Error 1 make[2]: *** Waiting for unfinished jobs.... Makefile:1552: recipe for target '_module_/var/lib/dkms/nvidia/430.14/build' failed make[1]: *** [_module_/var/lib/dkms/nvidia/430.14/build] Error 2 make[1]: Leaving directory '/usr/src/linux-headers-4.15.0-50-generic' Makefile:81: recipe for target 'modules' failed make: *** [modules] Error 2 

issues with DKMS while installing nvidia drivers

I am new to the linux ecosystem. I am unable to install nvidia drivers. I tried installing version 415. But I am not able to understand the error due to lack of knowledge. I have tried the following commands.

sudo add-apt-repository ppa:graphics-drivers/ppa sudo apt update sudo apt install nvidia-415 

I got the following error( sorry I can only post pictures.) error screenshot

I am also not able to login into my account and coming back to the login screen after putting the login credentials. I would appreciate your advice on this. Thank you.

Unable to start ubuntu after install Nvidia-driver DKMS failed

It says: A start job is running for docker application container engine.
After I switch to tty interface, it prompt the error that:
INFO: task systems-journal:348 blocked for more than 120 seconds.
Tainted: P OE 4.15.0-43-generic #46-Ubuntu.
“echo o> /proc/says/kernel/hung_task_timeout_secs” disables this message.

It seems to be Nvidia-docker failed to install.

help! What does this mean? “No DKMS packages installed: not changing Secure Boot validation state”

I ran sudo apt-get update, sudo apt-get install, sudo apt-get upgrade

Processing triggers for libc-bin (2.23-0ubuntu10) ... Processing triggers for man-db (2.7.5-1) ... Processing triggers for ureadahead (0.100.0-19) ... Processing triggers for ufw (0.35-0ubuntu2) ... Processing triggers for systemd (229-4ubuntu21.10) ... Processing triggers for install-info (6.1.0.dfsg.1-5) ... Processing triggers for gnome-menus (3.13.3-6ubuntu3.1) ... Processing triggers for desktop-file-utils (0.22-1ubuntu5.2) ... Processing triggers for bamfdaemon (0.5.3~bzr0+16.04.20180209-0ubuntu1) ... Rebuilding /usr/share/applications/bamf-2.index... Processing triggers for mime-support (3.59ubuntu1) ... Processing triggers for hicolor-icon-theme (0.15-0ubuntu1.1) ... Processing triggers for update-notifier-common (3.168.9) ... flashplugin-installer: processing... flashplugin-installer: downloading http://archive.canonical.com/pool/partner/a/adobe-flashplugin/adobe-flashplugin_20181205.1.orig.tar.gz Get:1 http://archive.canonical.com/pool/partner/a/adobe-flashplugin/adobe-flashplugin_20181205.1.orig.tar.gz [30,5 MB] Fetched 30,5 MB in 19s (1.564 kB/s)                                             Installing from local file /var/lib/update-notifier/package-data-downloads/partial/adobe-flashplugin_20181205.1.orig.tar.gz Flash Plugin installed. Processing triggers for libglib2.0-0:amd64 (2.48.2-0ubuntu4.1) ... Setting up perl-modules-5.22 (5.22.1-9ubuntu0.6) ... Setting up libperl5.22:amd64 (5.22.1-9ubuntu0.6) ... Setting up perl (5.22.1-9ubuntu0.6) ... Setting up libpam-systemd:amd64 (229-4ubuntu21.10) ... Setting up udev (229-4ubuntu21.10) ... addgroup: The group `input' already exists as a system group. Exiting. update-initramfs: deferring update (trigger activated) Setting up chromium-codecs-ffmpeg-extra (71.0.3578.80-0ubuntu0.16.04.1) ... Setting up libcups2:amd64 (2.1.3-4ubuntu0.6) ... Setting up libcups2:i386 (2.1.3-4ubuntu0.6) ... Setting up libcupsimage2:amd64 (2.1.3-4ubuntu0.6) ... Setting up cups-common (2.1.3-4ubuntu0.6) ... Setting up cups-client (2.1.3-4ubuntu0.6) ... Setting up cups-bsd (2.1.3-4ubuntu0.6) ... Setting up libcupsmime1:amd64 (2.1.3-4ubuntu0.6) ... Setting up cups-daemon (2.1.3-4ubuntu0.6) ... Setting up cups-core-drivers (2.1.3-4ubuntu0.6) ... Setting up cups-server-common (2.1.3-4ubuntu0.6) ... Setting up libcupscgi1:amd64 (2.1.3-4ubuntu0.6) ... Setting up libstdc++6:amd64 (5.4.0-6ubuntu1~16.04.11) ... Setting up libstdc++6:i386 (5.4.0-6ubuntu1~16.04.11) ... Setting up libcupsppdc1:amd64 (2.1.3-4ubuntu0.6) ... Setting up libpoppler58:amd64 (0.41.0-0ubuntu1.10) ... Setting up poppler-utils (0.41.0-0ubuntu1.10) ... Setting up libgs9-common (9.26~dfsg+0-0ubuntu0.16.04.3) ... update-alternatives: warning: alternative /usr/share/ghostscript/9.25 (part of link group ghostscript-current) doesn't exist; removing from list of alternatives update-alternatives: warning: /etc/alternatives/ghostscript-current is dangling; it will be updated with best choice update-alternatives: using /usr/share/ghostscript/9.26 to provide /usr/share/ghostscript/current (ghostscript-current) in auto mode Setting up libgs9:amd64 (9.26~dfsg+0-0ubuntu0.16.04.3) ... Setting up ghostscript (9.26~dfsg+0-0ubuntu0.16.04.3) ... Setting up cups-ppdc (2.1.3-4ubuntu0.6) ... Setting up cups (2.1.3-4ubuntu0.6) ... Updating PPD files for cups ... Updating PPD files for cups-filters ... Updating PPD files for foomatic-db-compressed-ppds ... PPD for printer Lexmark-MX611dhe updated Updating PPD files for openprinting-ppds ... Updating PPD files for brlaser ... Updating PPD files for c2esp ... Updating PPD files for foo2zjs-common ... Updating PPD files for gutenprint ... Updating PPD files for hpcups ... Updating PPD files for postscript-hp ... Updating PPD files for ptouch ... Updating PPD files for pxljr ... Updating PPD files for sag-gdi ... Updating PPD files for splix ... Setting up libcc1-0:amd64 (5.4.0-6ubuntu1~16.04.11) ... Setting up libgomp1:amd64 (5.4.0-6ubuntu1~16.04.11) ... Setting up libitm1:amd64 (5.4.0-6ubuntu1~16.04.11) ... Setting up libatomic1:amd64 (5.4.0-6ubuntu1~16.04.11) ... Setting up libasan2:amd64 (5.4.0-6ubuntu1~16.04.11) ... Setting up liblsan0:amd64 (5.4.0-6ubuntu1~16.04.11) ... Setting up libtsan0:amd64 (5.4.0-6ubuntu1~16.04.11) ... Setting up libubsan0:amd64 (5.4.0-6ubuntu1~16.04.11) ... Setting up libcilkrts5:amd64 (5.4.0-6ubuntu1~16.04.11) ... Setting up libmpx0:amd64 (5.4.0-6ubuntu1~16.04.11) ... Setting up libquadmath0:amd64 (5.4.0-6ubuntu1~16.04.11) ... Setting up cpp-5 (5.4.0-6ubuntu1~16.04.11) ... Setting up libgcc-5-dev:amd64 (5.4.0-6ubuntu1~16.04.11) ... Setting up gcc-5 (5.4.0-6ubuntu1~16.04.11) ... Setting up libstdc++-5-dev:amd64 (5.4.0-6ubuntu1~16.04.11) ... Setting up g++-5 (5.4.0-6ubuntu1~16.04.11) ... Setting up libgfortran3:amd64 (5.4.0-6ubuntu1~16.04.11) ... Setting up libgfortran-5-dev:amd64 (5.4.0-6ubuntu1~16.04.11) ... Setting up gfortran-5 (5.4.0-6ubuntu1~16.04.11) ... Setting up ghostscript-x (9.26~dfsg+0-0ubuntu0.16.04.3) ... Setting up libwbclient0:amd64 (2:4.3.11+dfsg-0ubuntu0.16.04.18) ... Setting up samba-libs:amd64 (2:4.3.11+dfsg-0ubuntu0.16.04.18) ... Setting up samba-vfs-modules (2:4.3.11+dfsg-0ubuntu0.16.04.18) ... Setting up samba-dsdb-modules (2:4.3.11+dfsg-0ubuntu0.16.04.18) ... Setting up python-samba (2:4.3.11+dfsg-0ubuntu0.16.04.18) ... Setting up samba-common (2:4.3.11+dfsg-0ubuntu0.16.04.18) ... Setting up samba-common-bin (2:4.3.11+dfsg-0ubuntu0.16.04.18) ... Setting up samba (2:4.3.11+dfsg-0ubuntu0.16.04.18) ... Setting up libsmbclient:amd64 (2:4.3.11+dfsg-0ubuntu0.16.04.18) ... Setting up winbind (2:4.3.11+dfsg-0ubuntu0.16.04.18) ... Setting up grub-common (2.02~beta2-36ubuntu3.20) ... update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults Setting up grub2-common (2.02~beta2-36ubuntu3.20) ... Setting up grub-efi-amd64-bin (2.02~beta2-36ubuntu3.20) ... Setting up grub-efi-amd64 (2.02~beta2-36ubuntu3.20) ... Installing for x86_64-efi platform. Installation finished. No error reported. Generating grub configuration file ... Found linux image: /boot/vmlinuz-4.15.0-39-generic Found initrd image: /boot/initrd.img-4.15.0-39-generic Found linux image: /boot/vmlinuz-4.15.0-38-generic Found initrd image: /boot/initrd.img-4.15.0-38-generic Found linux image: /boot/vmlinuz-4.15.0-29-generic Found initrd image: /boot/initrd.img-4.15.0-29-generic Adding boot menu entry for EFI firmware configuration done Setting up grub-efi-amd64-signed (1.66.20+2.02~beta2-36ubuntu3.20) ... Installing for x86_64-efi platform. Installation finished. No error reported. Setting up libssl1.0.0:amd64 (1.0.2g-1ubuntu4.14) ... Setting up libssl1.0.0:i386 (1.0.2g-1ubuntu4.14) ... Setting up openssl (1.0.2g-1ubuntu4.14) ... Setting up python3-distupgrade (1:16.04.26) ... Setting up ubuntu-release-upgrader-core (1:16.04.26) ... Setting up ubuntu-release-upgrader-gtk (1:16.04.26) ... Setting up firefox (64.0+build3-0ubuntu0.16.04.1) ... Please restart all running instances of firefox, or you will experience problems. Setting up firefox-locale-en (64.0+build3-0ubuntu0.16.04.1) ... Setting up flashplugin-installer (32.0.0.101ubuntu0.16.04.1) ... Setting up git-man (1:2.7.4-0ubuntu1.6) ... Setting up git (1:2.7.4-0ubuntu1.6) ... Setting up hwdata (0.267-1ubuntu2) ... Setting up libwinpr-sysinfo0.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-5ubuntu1.3) ... Setting up libfreerdp-primitives1.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-5ubuntu1.3) ... Setting up libwinpr-handle0.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-5ubuntu1.3) ... Setting up libwinpr-interlocked0.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-5ubuntu1.3) ... Setting up libwinpr-thread0.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-5ubuntu1.3) ... Setting up libwinpr-synch0.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-5ubuntu1.3) ... Setting up libwinpr-crt0.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-5ubuntu1.3) ... Setting up libwinpr-utils0.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-5ubuntu1.3) ... Setting up libwinpr-pool0.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-5ubuntu1.3) ... Setting up libwinpr-registry0.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-5ubuntu1.3) ... Setting up libfreerdp-codec1.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-5ubuntu1.3) ... Setting up libwinpr-library0.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-5ubuntu1.3) ... Setting up libwinpr-environment0.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-5ubuntu1.3) ... Setting up libwinpr-heap0.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-5ubuntu1.3) ... Setting up libwinpr-path0.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-5ubuntu1.3) ... Setting up libfreerdp-common1.1.0:amd64 (1.1.0~git20140921.1.440916e+dfsg1-5ubuntu1.3) ... Setting up libfreerdp-utils1.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-5ubuntu1.3) ... Setting up libwinpr-file0.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-5ubuntu1.3) ... Setting up libfreerdp-crypto1.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-5ubuntu1.3) ... Setting up libwinpr-input0.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-5ubuntu1.3) ... Setting up libfreerdp-locale1.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-5ubuntu1.3) ... Setting up libwinpr-dsparse0.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-5ubuntu1.3) ... Setting up libwinpr-rpc0.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-5ubuntu1.3) ... Setting up libwinpr-sspi0.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-5ubuntu1.3) ... Setting up libfreerdp-core1.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-5ubuntu1.3) ... Setting up libfreerdp-cache1.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-5ubuntu1.3) ... Setting up libfreerdp-client1.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-5ubuntu1.3) ... Setting up libfreerdp-gdi1.1:amd64 (1.1.0~git20140921.1.440916e+dfsg1-5ubuntu1.3) ... Setting up libfreerdp-plugins-standard:amd64 (1.1.0~git20140921.1.440916e+dfsg1-5ubuntu1.3) ... Setting up libpoppler-glib8:amd64 (0.41.0-0ubuntu1.10) ... Setting up libraw15:amd64 (0.17.1-1ubuntu0.4) ... Setting up libssh-4:amd64 (0.6.3-4.3ubuntu0.2) ... Setting up libssh-gcrypt-4:amd64 (0.6.3-4.3ubuntu0.2) ... Setting up libunity-settings-daemon1:amd64 (15.04.1+16.04.20160701-0ubuntu3) ... Setting up libwavpack1:amd64 (4.75.2-2ubuntu0.2) ... Setting up linux-libc-dev:amd64 (4.4.0-140.166) ... Setting up linux-signed-generic-hwe-16.04 (4.15.0.42.63) ... Setting up openjdk-8-jre-headless:amd64 (8u191-b12-0ubuntu0.16.04.1) ... Installing new version of config file /etc/java-8-openjdk/security/java.security ... Setting up openjdk-8-jre:amd64 (8u191-b12-0ubuntu0.16.04.1) ... Setting up perl-doc (5.22.1-9ubuntu0.6) ... Setting up python-lxml (3.5.0-1ubuntu0.1) ... Setting up python3-lxml (3.5.0-1ubuntu0.1) ... Setting up unity-settings-daemon (15.04.1+16.04.20160701-0ubuntu3) ... Setting up numix-icon-theme (0.3+935~201812050003~ubuntu16.04.1) ... gtk-update-icon-cache: Cache file created successfully. Setting up numix-icon-theme-square (18.12.01+201812011517~ubuntu16.04.1) ... gtk-update-icon-cache: Cache file created successfully. Processing triggers for libc-bin (2.23-0ubuntu10) ... Processing triggers for initramfs-tools (0.122ubuntu8.13) ... update-initramfs: Generating /boot/initrd.img-4.15.0-39-generic Processing triggers for shim-signed (1.33.1~16.04.1+13-0ubuntu2) ... No DKMS packages installed: not changing Secure Boot validation state.