Ubuntu – Can’t install Nvidia drivers on Ubuntu 18.04

dependenciesdriversnvidiapackage-managementsoftware installation

I have tried purging the nouveau driver, putting it in blacklist, using ppa:graphics-drivers, (I tried one such oibaf:graphics-drivers), downloaded the 304.137 driver from Nvidia, tried ubuntu-drivers autoinstall and neither of them worked. The only result was that I saw the screen at 640×480.

Using the command sudo apt install, the following results appear:

$ sudo apt install nvidia-304
Reading package list... Done
Creating Dependencies Tree
Reading status information... Done
Some packages could not be installed.
This may mean that you have requested an impossible situation or if  
you are using the unstable distribution that some required packages  
have not yet been created or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
nvidia-304 : Depends: xorg-video-abi-11 but is not installable or
xorg-video-abi-12 but not installable or
xorg-video-abi-13 but not installable or
xorg-video-abi-14 but not installable or
xorg-video-abi-15 but is not installable or
xorg-video-abi-18 but is not installable or
xorg-video-abi-19 but is not installable or
xorg-video-abi-20 but is not installable or
xorg-video-abi-23
 Depends: xserver-xorg-core but it will not be installed
 Recommends: nvidia-settings (>= 331.20) but it will not be installed
E: Unable to correct problems, you have held broken packages.

I don't know which tutorial to follow anymore. Can anyone fix this? It's a motherboard with an Nvidia nForce 430 chipset and IGP GeForce 6150LE.

Best Answer

I have a pc with an old Geforce 6800 card and I have managed to successfully install the 32bit Nvidia 304.137 driver for it on Lubuntu 18.04; all thanks to a community patch. Here is the procedure.

Install build tools

$ sudo apt install gcc make build-essential gcc-multilib dkms mesa-utils

Download driver from https://www.nvidia.com/Download/driverResults.aspx/123708/en-us

Download patch from https://adufray.com/nvidia-304.137-bionic-18.04.patch

Extract archive, place patch into extracted folder and apply patch

$ ./NVIDIA-Linux-x86_64-304.137.run -x
$ cd ./NVIDIA-Linux-x86_64-304.137
$ patch -p1 < nvidia-304.137-bionic-18.04.patch

Disable nouveau driver and reboot

$ sudo -i
# cat << END > /etc/modprobe.d/disable-nouveau.conf
blacklist nouveau
blacklist vga16fb
blacklist rivafb
blacklist nvidiafb
blacklist rivatv
blacklist amd76_edac
options nouveau modeset=0
END
# update-initramfs -u
# reboot

Stop x-server
Logout
Bring up terminal with Ctrl-Alt-F1, login

$ sudo -i
# service lightdm stop
# init 3

Install NVidia driver
Ignore the first warning about preinstall failing, agree to driver recompilation on kernel update and to configuration files update. Reboot.

# ./nvidia-installer
# reboot

Driver should be working now. Check with the following:

$ lshw -c video 2>&1 | grep driver

Should output "configuration: driver=nvidia"

There is one small problem though. Apparently Nvidia driver installs it's own version of libvdpau, which does not work with mplayer. That's why we need to forcefully reinstall libvdpau (and possibly need to do this on kernel update, because driver will recompile and reinstall it's own, non-functioning version for this library?)

$ sudo apt --reinstall install libvdpau1

References: Compiling nVidia 304.137 on Ubuntu 18.04: https://adufray.com/blog/2018/06/02/nvidia-304-127-on-bionic
How to install NVIDIA.run?: How to install NVIDIA.run?

PS: This post is basically a duplicate of my post at ubuntu-mate.community, but since installing 304 Nvidia driver on Lubuntu 18.04 is a very common problem, I have decided to make additional post on askubuntu.