NVIDIA Driver Install
Table of Contents
- Introduction
- How To Use This Document
- Requirements
- Install the driver
- Step 01 – Create a backup directory
- Step 02 – Back up your xorg.conf file
- Step 03 – Check your kernel name and version
- Step 04 – Make sure you have these packages
- Step 05 – Make sure you don’t have the nvidia-glx package
- Step 06 – Make sure you don’t have the nvidia-glx-new package
- Step 07 – Make sure you don’t have the nvidia-glx file
- Step 08 – Make sure you don’t have the nvidia-kernel file
- Step 09 – Make sure you don’t have the nvidia_new_installed file
- Step 10 – Edit the linux-restricted-modules file
- Step 11 – Edit the linux-restricted-modules-common file
- Step 12 – Download the driver
- Step 13 – Edit your xorg.conf file
- Step 14 – Restart the computer in recovery mode
- Step 15 – Run the installer
- Step 16 – Let the installer run nvidia-xconfig
- Step 17 – Restart the computer
- Step 18 – Configure the driver
- Appendix
- Obligatory Happy Ending
Introduction
This guide will take you through the steps needed to install the NVIDIA display driver in Ubuntu or Kubuntu.
- These instructions are known to work for:
- Kubuntu or Ubuntu 8.04 Hardy Heron LTS or earlier.
- NVIDIA display driver version 169.07 for Linux x86.
- NVIDIA display driver version 173.14.12 for Linux x86.
- NVIDIA display driver version 180.51 for Linux x86.
- They may work for other versions of the NVIDIA display driver as well.
- They will not work for Kubuntu with KDE4.
How To Use This Document
- Make sure you meet the requirements in the Requirements section of this document.
- Use the Install The Driver section to install the driver.
- Make notes on paper or in a text file to remind you of which files you did or did not have on your system before installing the driver.
- See the Appendix for Maintenance, Further Information, Questions and Answers, Troubleshooting, Recovery, and Getting Help.
Requirements
- Ubuntu or Kubuntu 8.04 LTS or earlier.
- An understanding of the difference between sudo, gksudo and kdesu. For more information, see the Further Information section.
- An NVIDIA graphics card that uses the NVIDIA display driver for Linux x86.
| IMPORTANT | |
|---|---|
| These instructions were tested with NVIDIA display driver version 169.07 for Linux x86 and version 173.14.12 for Linux x86. See “Will these instructions work for other NVIDIA drivers?” in the Questions & Answers section if you’re installing a different version. |
|
Install the driver
Step 01 – Create a backup directory
- Type this command in a terminal window to create the mynvidiabackups directory in your /home/username directory:
mkdir ~/mynvidiabackups
Press the Enter key.
Step 02 – Back up your xorg.conf file
- Type this command in a terminal window to copy your xorg.conf file to the mynividiabackups directory you just created:
sudo cp /etc/X11/xorg.conf ~/mynvidiabackups/xorg.conf
Press the Enter key.
Step 03 – Check your kernel name and version
- Type this command in a terminal window to view the kernel release (kernel name and version):
- Example output of the command:
uname -r
Press the Enter key.
2.6.24-21-generic
Step 04 – Make sure you have these packages
Open your package manager (Synaptic in GNOME and Adept Manager in KDE) and do a search for each of these packages to make sure they’re installed, installing any that aren’t:
- build-essential
- linux-kernel-devel
- pkg-config
- xserver-xorg-dev
- linux-source-2.6.24
- The version number must match the output from Step 03.
- linux-headers-2.6.24-21
- The version number must match the output from Step 03.
- linux-headers-2.6.24-21-generic
- The version number and name must match the output from Step 03.
Step 05 – Make sure you don’t have the nvidia-glx package
Open your package manager (Synaptic in GNOME and Adept Manager in KDE) and do a search for this package:
- nvidia-glx
If the package isn’t installed, go to Step 06. If the package is installed, remove it thoroughly:
- In Adept Manager:
- Right-click the package name.
- Choose Request Purging.
- Click Apply Changes at the top of the screen.
- In Synaptic:
- Right-click the package name.
- Select Mark for Complete Removal.
- Click the Apply button.
- In a terminal window:
- Type this command:
sudo apt-get --purge remove nvidia-glx
Press the Enter key.
Step 06 – Make sure you don’t have the nvidia-glx-new package
Open your package manager (Synaptic in GNOME and Adept Manager in KDE) and do a search for this package:
- nvidia-glx-new
If the package isn’t installed, go to Step 07. If the package is installed, remove it thoroughly:
- In Adept Manager:
- Right-click the package name.
- Choose Request Purging.
- Click Apply Changes at the top of the screen.
- In Synaptic:
- Right-click the package name.
- Select Mark for Complete Removal.
- Click the Apply button.
- In a terminal window:
- Type this command:
sudo apt-get --purge remove nvidia-glx-new
Press the Enter key.
Step 07 – Make sure you don’t have the nvidia-glx file
- Type this command in a terminal window:
- If you don’t have it, go to Step 08. If you have it, back it up by typing this command:
- Then remove it by typing this command:
ls /etc/init.d/nvidia-glx
Press the Enter key.
sudo cp /etc/init.d/nvidia-glx ~/mynvidiabackups/nvidia-glx
Press the Enter key.
sudo rm /etc/init.d/nvidia-glx
Press the Enter key.
Step 08 – Make sure you don’t have the nvidia-kernel file
- Type this command in a terminal window:
- If you don’t have it, go to Step 09. If you have it, back it up by typing this command:
- Then remove it by typing this command:
ls /etc/init.d/nvidia-kernel
Press the Enter key.
sudo cp /etc/init.d/nvidia-kernel ~/mynvidiabackups/nvidia-kernel
Press the Enter key.
sudo rm /etc/init.d/nvidia-kernel
Press the Enter key.
Step 09 – Make sure you don’t have the nvidia_new_installed file
- Type this command in a terminal window:
- If you don’t have it, go to Step 10. If you have it, back it up by typing this command:
- Then remove it by typing this command:
ls /lib/linux-restricted-modules/.nvidia_new_installed
Press the Enter key.
sudo cp /lib/linux-restricted-modules/.nvidia_new_installed ~/mynvidiabackups/.nvidia_new_installed
Press the Enter key.
sudo rm /lib/linux-restricted-modules/.nvidia_new_installed
Press the Enter key.
Step 10 – Edit the linux-restricted-modules file
- Type this command in a terminal to check if you have the file:
- If you don’t have it, go to Step 11. If you have it, back it up by typing this command:
- Then open the file with one of these commands:
- Kubuntu users type this command:
kdesu kate /etc/default/linux-restricted-modules
Press the Enter key.
- Ubuntu users type this command:
- Add the information in quotes in this line to the DISABLED_MODULES line:
- Save the file and exit the editor.
ls /etc/default/linux-restricted-modules
Press the Enter key.
sudo cp /etc/default/linux-restricted-modules ~/mynvidiabackups/linux-restricted-modules
gksudo gedit /etc/default/linux-restricted-modules
Press the Enter key.
DISABLED_MODULES="nv nvidia_new"
Step 11 – Edit the linux-restricted-modules-common file
- Type this command in a terminal window to check if you have the file:
- If you don’t have it, go to Step 12. If you have it, back it up by typing this command:
- Then open the file with one of these commands:
- Kubuntu users type this command:
kdesu kate /etc/default/linux-restricted-modules-common
Press the Enter key.
- Ubuntu users type this command:
- Add the information in quotes in this line to your DISABLED_MODULES line:
- Save the file and exit the editor.
ls /etc/default/linux-restricted-modules-common
Press the Enter key.
sudo cp /etc/default/linux-restricted-modules-common ~/mynvidiabackups/linux-restricted-modules-common
gksudo gedit /etc/default/linux-restricted-modules-common
Press the Enter key.
DISABLED_MODULES="nv nvidia_new"
Step 12 – Download the driver
- Use Option 1 on the NVIDIA Driver Downloads page to manually find the driver for your card.
- Download the driver to your /home/username/Desktop directory.
- If it downloads to some other location, please move it to your /home/username/Desktop directory.
- It’s also a good idea to make a backup copy of the file.
Step 13 – Edit your xorg.conf file
This step is just a precaution, but I highly recommend that you follow it. Since you’ve removed your display driver, your xorg.conf file now has incorrect information in it. If you run into any issues in the remaining steps, you’ll have trouble rebooting because your computer will try to load the drivers you no longer have installed. To prevent any possible issues, you’ll want to temporarily use a generic display driver.
- Open the xorg.conf file with one of these commands:
- Kubuntu users type this command:
kdesu kate /etc/X11/xorg.conf
Press the Enter key.
- Ubuntu users type this command:
- Look through the file and find a section called Section “Device”. There will likely be several sections called Section “Device”, but the one you’re looking for will be one that has an Identifier of “Configured Video Device“. It will look something like this example (your driver may have a different name or there may be more lines of information in the section in your file):
- Edit the Driver line, changing it to “vesa” as in this example:
- Save the file and exit the editor.
- Copy the edited file to the backup directory under a new name you’ll recognize by typing this command:
gksudo gedit /etc/X11/xorg.conf
Press the Enter key.
Section "Device"
Identifier "Configured Video Device"
Driver "nvidia"
EndSection
Section "Device"
Identifier "Configured Video Device"
Driver "vesa"
EndSection
sudo cp xorg.conf ~/mynvidiabackups/xorg.conf.safegraphics
Press the Enter key.
Step 14 – Restart the computer in recovery mode
- Restart the computer:
- Kubuntu users:
- Open the K menu.
- Select Log Out…. from the menu.
- Left-click the Restart icon.
- Ubuntu users:
- Open the Main Menu
- Select Quit… from the menu.
- Left-click the Restart icon.
- Press the Esc key when the GRUB menu comes up.
- Use your arrow keys to select your kernel’s recovery mode.
- The Recovery Menu will open.
- Use your arrow keys to highlight the line that says:
- Type this command to get to your Desktop, replacing USERNAME with your username.
root drop to a root shell prompt
Press the Enter key to get to a root shell prompt.
cd /home/USERNAME/Desktop
Step 15 – Run the installer
- Type this command to install the driver:
sh NVIDIA*.run --kernel-name=`uname -r`
Press the Enter key.
| IMPORTANT | |
|---|---|
| Those are backticks (`) and not apostrophes (‘) in the above command. | |
Step 16 – Let the installer run nvidia-xconfig
The installer will ask if you’d like to let it run nvidia-xconfig. Say yes by typing the letter y and pressing the Enter key. It will run automatically.
Step 17 – Restart the computer
- Type this command to leave the recovery mode:
exit
Step 18 – Configure the driver
If you’d like to configure the driver or check your card’s temperature, etc., look in your System menu for an entry named NVIDIA X Server Settings.
Appendix
Maintenance
- If your operating system’s kernel gets updated, you will need to reinstall the NVIDIA driver:
- Copy your backed up NVIDIA driver to the Desktop.
- follow Step 13 through Step 20 from the Install the driver section.
- If NVIDIA releases a new driver, you may want to install it:
- Follow Step 01 through Step 06 from my NvidiaRecovery page to remove the current driver.
- Follow Step 12 through Step 20 from the Install the driver section of this page.
Recovery
See my NvidiaRecovery page to undo your installation of the NVIDIA driver.
Further Information
- NVIDIA Corporation has an excellent README at http://us.download.nvidia.com/XFree86/Linux-x86/180.51/README/index.html
- zander has written a thorough post in the nV News Forums at http://www.nvnews.net/vbulletin/showthread.php?s=1c09a8a8cd89b76c51eef0e72e10e569&t=72490
- To learn more about configuring the NVIDIA driver, open a terminal window and type:
man nvidia-xconfig
man nvidia-settings
Questions and Answers
- How do I know which NVIDIA driver I should use?
- Go to the page at http://www.nvidia.com/Download/index.aspx?lang=en-us and either fill out the form or opt to have the driver automatically detected for you.
- Will these instructions work for other NVIDIA drivers?
- They should work for any NVIDIA graphics drivers, but if the driver version numbers aren’t listed on this page, they haven’t been tested by me.
- When NVIDIA releases a new driver, do I have to uninstall the old version before I can install the new one?
- I don’t believe it’s necessary, but in the interest of thoroughness, the instructions in the Maintenance section include instructions on removal of the outdated driver.
- I have a question that hasn’t been asked here. How do I ask it?
- If you use the contact address at the top of this document, you will receive a reply via email and your question may be added to this section.
Troubleshooting
- Make sure that you meet the requirements in the Requirements section.
- Check out these pages to see if your issue is covered:
- http://us.download.nvidia.com/XFree86/Linux-x86/173.14.12/README/index.html
- http://www.nvnews.net/vbulletin/showthread.php?s=1c09a8a8cd89b76c51eef0e72e10e569&t=72490
- http://www.nvnews.net/vbulletin/showthread.php?t=46678
- If you need more help, see my GettingHelp page.
Obligatory Happy Ending
And they all lived happily ever after. The end.

Step 04: I found that it wasn’t sufficient to install linux-source2.6.24: that just downloads a tarball. I also had to cd to /usr/src and then
sudo tar xvif linux-source-2.6.24.tar.bz2 . Found this instruction at https://help.ubuntu.com/community/NvidiaManual.
Yours is a brilliant how-to, as usual.
Comment by Jim Anderson — June 13, 2009 @ 9:03 pm
Thanks for the heads-up! Was it only linux-source that you had trouble with, or also linux-headers? I’ll add a note to Step 04 for anyone who has this problem.
Another thing I want to do with this guide is figure out once and for all how to put Ubuntu/Kubuntu into a specific runlevel. When this guide is followed, the NVIDIA installer issues a warning about the runlevel. The warning can be ignored, but I’d like to figure out how to specify the correct runlevel so there is no warning, and – most importantly – so that the installer is happy. (:
Comment by mostlylinux — June 14, 2009 @ 5:20 pm