I tried to install a driver for my GeForce 7025 graphics card by following the answers to these questions: 1 2, but none of them worked in Xubuntu 18.04. I left the logs of my attempt with 2 (the last few lines where the error seems to be) that the Nvidia installer left.
-> Driver file installation is complete. -> Installing DKMS kernel module: ERROR: Failed to run /usr/sbin/dkms build -m nvidia -v 304.137 -k 5.0.0-37-generic: Kernel preparation unnecessary for this kernel. Skipping... Building module: cleaning build area... make -j1 KERNELRELEASE=5.0.0-37-generic module SYSSRC=/lib/modules/5.0.0-37-generic/build.............(bad exit status: 2) ERROR (dkms apport): binary package for nvidia: 304.137 not found Error! Bad return status for module build on kernel: 5.0.0-37-generic (x86_64) Consult /var/lib/dkms/nvidia/304.137/build/make.log for more information. -> error. ERROR: Failed to install the kernel module through DKMS. No kernel module was installed; please try installing again without DKMS, or check the DKMS logs for more information. ERROR: Installation has failed. Please see the file '/var/log/nvidia-installer.log' for details. You may find suggestions on fixing installation problems in the README available on the Linux driver download page at www.nvidia.com.
efi_gettimeofday cc1: some warnings being treated as errors scripts/Makefile.build:284: recipe for target '/var/lib/dkms/nvidia/304.137/build/os-interface.o' failed make: *** [/var/lib/dkms/nvidia/304.137/build/os-interface.o] Error 1 Makefile:1614: recipe for target 'module/var/lib/dkms/nvidia/304.137/build' failed make: *** [module/var/lib/dkms/nvidia/304.137/build] Error 2 NVIDIA: left KBUILD. nvidia.ko failed to build! Makefile:262: recipe for target 'module' failed make: *** [module] Error 1 makefile:59: recipe for target 'module' failed make: *** [module] Error 2