How to install my NVidia driver?

I am a Ubuntu user for over 15 years now and love it except for the difficultly in installing display drivers sometimes. This year I have been unable to install one on my Desktop successfully which has a Nvidia Geforce 9800GT card. I can get it to install without errors but every time I reboot it will not boot to the desktop and stops at starting x. It looks like its trying as the screen flashes and some graphical characters flash up and then it tries all over again getting stuck in a continuous loop. I have tried booting to a shell and removing and purging the Nvidia driver but it refuses saying filesystem is read only. It's impossible to get out off unless I do a re-install. I've tried every tutorial online and tried both of the drivers offered by Nvidia & Ubuntu. I always end up having to use the nouveau driver which refuses to play videos without being very jerky.

Any help to get it working?


Solution 1:

I will recommend you to do the most and eficient secure recommended method since you just finished installing Ubuntu from the Live CD.

First update your new system

sudo apt-get update
sudo apt-get dist-upgrade

Read carefully the packages you will install and update the linux-headers if prompt, now
For making sure what graphics driver your system needs.

ubuntu-drivers devices

That command will tell you what packages you will need for using graphics drivers.
Then just make sure to install first the intel driver and then the NVIDIA one.

sudo apt-get install intel-microcode
sudo apt-get install nvidia-xxx

And that's all, note that I told you nvidia-xxx because you must enter the recommended driver version displayed in ubuntu-drivers devices and I must warn you. Updating the kernel may cause you problems, so once you installed that NVIDIA driver, please don't upgrade with this commands (sudo apt dist-upgrade or sudo apt upgrade and sudo apt-get dist-upgrade), please use sudo apt-get upgrade that command will hold new kernel releases.

Solution 2:

Recommended by this gist, the following steps will install NVIDIA drivers on your system:

For ubuntu 14.04.5 LTS, the latest version is 352. To install the driver, excute sudo apt-get install nvidia-352 nvidia-modprobe, and then reboot the machine.

For ubuntu 16.04.3 LTS, the latest version is 375. To install the driver, excute sudo apt-get install nvidia-375 nvidia-modprobe, and then reboot the machine.

The nvidia-modprobe utility is used to load NVIDIA kernel modules and create NVIDIA character device files automatically everytime your machine boots up.