Since I have begun using Linux, it never fails for someone to ask me how to install NVIDIA drivers on their machine. When someone asks how to do it in an IRC chatroom, it never fails for someone to mention either Envy or using the drivers made available with Ubuntu. Supposedly, the reasoning is that it is easier. Bullocks, I say. So here is how you install your NVIDIA driver for Ubuntu.
This routine has been tested successfully on the following Ubuntu releases:
- Dapper Drake (6.06)
- Gutsy Gibbon (7.10)
- Hardy Heron (8.04.x)
Update: Intrepid Release Notes
The latest Ubuntu release (8.10 - Intrepid Ibex) does NOT support "legacy" graphics cards. If you have a TNT, TNT2, TNT Ultra, GeForce, GeForce2, GeForce3, or GeForce4 card, you will have to use the "nv" driver included with the distribution and will NOT have 3D Acceleration.
I have been researching this issue and have found rumors that the latest beta drivers should fix this problem. I will have more information as I receive it. I would highly suggest staying put with the latest Long-Term Support release (8.04 - Hardy Heron) for graphics support.
Preparation
This guide is for use with a 32-bit version of a Debian-based Linux distribution with the GNOME desktop. Ubuntu users, this includes you. Fair warning though, there will be commands issued via the command line. For those of you that don't feel comfortable without a GUI, I would suggest using Envy.
Step 1: Obtain the driver from NVIDIA.com
Head on over to NVIDIA.com and navigate to the "Download Drivers" section. Choose your proper graphics card family and your version of Linux (32-bit or 64-bit). Download the *.run file to your computer.
Step 2: Installing the required packages
In order for your driver to work correctly with your system, it has to be generated specifically for your system. To do this, the *.run file you downloaded above needs some packages to work correctly.
In a terminal, issue the following command.
sudo apt-get install libc6 libc6-dev xorg-dev linux-headers-`uname -r` make
This will install all of the needed packages.
Step 3: Shutting down X
I'm not going to lie to you. This part may seem a little intimidating, but bear with me.
For the driver to install correctly, your GUI (aka. the X server) needs to be shut off. You need to use a special command in order to do this. Since the server is going to shut down, you will need to log out and switch to a virtual terminal by pressing CTRL+ALT+F5. (You can use any of the function keys so long as the number is less than 7.)
With administrative privileges, (aka. sudo or root), issue the following command:
sudo /etc/init.d/gdm stop
This will stop the program keeping the GUI turned on.
Now we can install the driver.
Step 4: Installing the Driver
Once you have logged into the virtual terminal and shut down the GUI, we need to navigate to the location where we downloaded the *.run file from NVIDIA.com. Use the command cd to navigate to the appropriate directory.
Once there, run the following command.
sudo sh ./NVIDIA-{TAB}.run
The {TAB} is where you press the Tab key on your keyboard. If you only have the one *.run file in your current directory, the terminal will auto-complete your command.
When you issue this command, the installer will begin. Confirm all prompts in the installer. The installer will generate the required driver for your system and configure your display settings automatically.
Step 5: Restart the GUI
Once complete, you can issue the following command to restart the GUI.
sudo /etc/init.d/gdm restart
You will most likely see an NVIDIA splash screen before you reach the login window.
Step 6: Test the Driver
Once you have logged in, open the screensaver preferences and test the "Hufo's Tunnel" screensaver to see if it runs smoothly. If it does, you have just installed the NVIDA drivers.
A few notes
- There may be an issue with the driver you've downloaded. If so, follow the onscreen instructions to obtain the proper driver.
- This tutorial has NOT been tested with 64-bit systems.
- This tutorial has NOT been tested with KDE distributions.
- This will NOT work for Red Hat derivatives.
- This will NOT work WITHOUT apt-get
- You will need to reinstall the driver EVERY TIME you update kernel versions.
Conclusion
There you go. With a few installations under your belt, you'll feel more and more comfortable installing your driver. Unfortunate as it is, you will need to reinstall the driver when you update your kernel, so this is a fair warning.
Thanks for reading. Please leave any questions or comments. I'm always willing to improve my tutorials.
-CITguy