Bienvenido! - Willkommen! - Welcome!

Bitácora Técnica de Tux&Cía., Santa Cruz de la Sierra, BO
Bitácora Central: Tux&Cía.
Bitácora de Información Avanzada: Tux&Cía.-Información
May the source be with you!

Wednesday, April 14, 2010

Install Official Nvidia Linux Drivers

To purge all nvidia packages
$sudo apt-get remove --purge nvidia*


Source
Installing graphics drivers can be a real pain on Linux. Luckily, things have gradually gotten simpler over time. If you are an Nvidia user running Linux (or in my case, a Linux user running Nvidia), then you are in luck. Installing the official Nvidia drivers is pretty simple.
NOTE: I’m running Ubuntu here on my desktop, but I’ll try to keep things as universal as possible.
Step 1. Download the Drivers
The easiest method to downloading the latest drivers is by following the directions on Nvidia’s own driver download page. If you are in the mood to try out beta or older versions of the drivers, check out this page.
Step 2. Kill the X Server
The Nvidia installer will complain if you try to install new drivers while the X server (a.k.a. all the graphic user interface stuff) is running. So, you’ll have to jump to a new session by hitting Ctrl+Alt+F1. This will bring you down to a text-only terminal. Login if it asks you to.
Now, GNOME (which uses gdm) users will usually enter this to stop the X Server:
1
sudo /etc/init.d/gdm stop
As for KDE (kdm) users:

sudo /etc/init.d/kdm stop
Step 3. Start the Driver Installer
Navigate to the directory where the driver installer downloaded to. For me, this was /home/eddie/Downloads:
cd ~/Downloads
Now, you must have root permissions to install new drivers (because it ties itself in with the kernel), so make sure you either switch to the root user or use sudo (recommended) before running the installer:

sudo sh ./NVIDIA-Linux-x86_64-195.36.15-pkg2.run
NOTE: Remember to use the name of the driver file you downloaded, not the one above.
Step 4. Follow the Installer’s Instructions
The installer should ask you a few questions as it installs the new drivers. It is usually safe (and recommended by myself) to say yes to all of the questions asked (install 32-bit OpenGL libraries, create a fresh Xorg.conf, etc.). After the questions, sit back and let the installer finish.
Step 5. Reboot and Enjoy
And now you are done! Reboot and enjoy the up-to-date drivers:

sudo reboot
Troubleshooting and How to Handle Errors In this section, I will describe the methods I used to work around a few of the issues I have encountered when installing new drivers. (I will update this section whenever a new problem arises!) 1. “Provided install script failed”
If you run Ubuntu, then you will see this everytime you try to install a new driver. Just ignore it, the install script provided by the Ubuntu developers fails on purpose.
2. Error locating kernel source
If you are like me and have compiled your own custom kernel, this problem will probably affect you. If you do not run a custom kernel, and use the default, distribution provided kernel, then you probably do not the kernel headers installed. On Ubuntu, this is simple to fix:

sudo apt-get install kernel-source
But if you ARE on a custom kernel, or you have the correct kernel headers installed but it still cannot find them, append the –kernel-source-path option on to the installer command. Kernel headers are usually located in the /usr/src directory. In my case, the command I use to start the 195.36.15 driver installer is:

sudo sh ./NVIDIA-Linux-x86_64-195.36.15-pkg2.run --kernel-source-path=/usr/src/linux-headers-2.6.32-bfs311-idlesoft-desktop-amd64/

No comments: