• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

Ubuntu nvidia guide(explanation how to install)

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

Enablingwolf

Senior Member overclocking at t
Joined
Jun 14, 2004
I wanted to give an easy but long winded explanation how to install the nVidia drivers manually on a generic Ubuntu system. This is not an end all guide. It may open the understanding up how to install the manual nVidia driver to those who need it on an Ubuntu setup.


It might sound long and hard, but it goes pretty fast the second time around.
Simple as:
backup xorg
install kernel headers and build-essential
have driver installer ready
go out of display manger
then stop the display manager
navigate to driver.run file
restart display manager
startx... Log in and watch the new splashscren for nVidia


It is not overly difficult or will it take long. The key here is to have everything in place and a basic understanding why things happen and how to recover. In the event of a boo boo. First I will go through and hopefully get anyone who does not know, up to speed.
The advantages of not using automated driver install. Is that you have more control over what goes into your system. Your not reliant on trying to fix things with another script and what went wrong. Doing it manually, also gives some perks of trying out new drivers or reverting to ones that may work to your needs. A manual install once your used to it. Takes about 20 minutes. Not including getting the files you need to do it.


First thing first.
You should be able to do backup of the xorg. This is important and is really fast. Don't be afraid to talk to your machine via the Cli or Command Line interface. Plus make sure the old driver is removed.

To do a backup of the xorg.Open the terminal up. Then type :
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup

To revert the file back. It is simple as :
sudo cp /etc/X11/xorg.conf.backup /etc/X11/xorg.conf


Simple as pie. One thing to keep in mind. Case sensitive is important. Also making sure the space bar is used when needed. Here is the basic of what you just did.
The sudo tells the system you would like to be boss for a short time. So it lets you be so, after you finish asking it. Linux lets you speak your peace before it bugs you asking for passwords.
The cp tells the system to copy.. hence the cp.
You can send the copy as a new name if you like or keep the original file name. You can also send it to wherever you like. really versatile if you have specific needs.
Simpler explanation: You you become boss, then tell the system. I would like to make a copy. Then what you would like to copy. Then to where the copy shall go. Does this make sense?


Next up. That you understand how to do a simple backup and make copies. We need to get the files for the action. First off. We are going to need the kernel header.


Lets get the kernel header. there is two ways to do so. The longer method is to just use synaptic. One thing. Your going to probably want to use the terminal anyways. So unless you know which specific kernel you use. Open that up... But I know some folks are dependent on the GUI.. Not a bash, just sometimes text is much faster.

Type: uname -r
My output was:
enablingwolf@freewheel:~$ uname -r
2.6.22-15-generic

So I would look for 2.6.22-15-generic. You have to make sure of your specific version. Now I know which kernel I have. I can install the proper header for my install..

I would go into synaptic and type in the find dialog.:
linux-header
Then look for my specific header.
Mine is properly checked as: linux-headers-generic.

If it is not checked, you have some pretty big issues on your machine, or are not allowed to work with the header. Ok now you know you have the headers in place and they are correct. We need to be able to build on the header file. So lets install one more thing while when are there. Locate build-essential. Which will enable the system to build stuff for you. this is one thing most overlook and end up installing anyways. So it is easier to get that in now.


Now the easy way...


Let's open the terminal up. This is much faster and works so much smoother. I will simply give the commands. Since if you already read above. You got a basic understanding where we are going.
sudo apt-get install linux-<insert your version here> build-essential

Ok notice how I asked it to install both packages at once? Just make sure you got the right header. The rest is like eating pie. Tastes good don't it? You could do a uname -r prior , just so you know what kernel you have. I kind of suggest that..
For most installs. Simply using this will work:
sudo apt-get install linux-generic build-essential


Yes the command line is that easy and fast. Unless you only type with one finger and it is in a box someplace.


Lets move on to the next part. The nVidia driver itself. We need to download the driver from the website. Or if you have it stored locally, woot, your one up. I would suggest putting in a spot that is easy to type to. Using, /home would be an good pick. If you put it in your user 's home folder. Just make sure you know that it will then be. /home/your_user_name/driver_name.sh. So simple works wonders here. It would then look like: /home/driver_name.sh


Ok now for some insight and to make it easier to understand things. We are going to be deeper in the system that your used to. So knowing some basic commands and why they are used will help some. As for most operating systems. The cd is used. It stands for change directory. Another one is ls (ell ess). I think it stands for list stuff.. Good enough and makes it easy to remember.


So why do you need to know these things? Well moving around to directories and knowing what is inside them helps a bunch. As for example. When your not in the user interface. Your going to be in the root folder. So being able to skip around will help a bunch.. Plus seeing if your actually in the right folder(actually directory) and if you spelled it right.


So a sample usage would be.
cd /home/user_name
To see what is inside there...
simple type ls That should show you what is in there, plus it is colorized too.


If the file was really deep inside the file structure. Heck how about I just copy and paste me looking for the xorg...
enablingwolf@freewheel:~$ ls
dad Desktop frame_vin.gap innotek.asc sony temp Themes triplea
enablingwolf@freewheel:~$ cd /etc/X11
enablingwolf@freewheel:/etc/X11$ ls
app-defaults rgb.txt xorg.conf Xsession.d
cursors X Xresources Xsession.options
default-display-manager xinit xserver XvMCConfig
fonts xkb Xsession Xwrapper.config
enablingwolf@freewheel:/etc/X11$



Now that you have the file and know where it is and how to get to it, or in the case hunt for it... Even remember how the heck it is spelled... We can move to the next part... This is where it gets sort of hard.... You won't have you fancy smanchy visuals.. Just text.. So the driver will not install in the GUI.. or graphic user interface. It needs a higher runtime to do that. Technical stuff alert. You need runlvl-3.
So we pop out of the GUI... and ask the system to let us have what we need. This is not all that hard, but most might be uncomfortable using only the text thing. Don't worry.. If you can post on a forum, do email.. or IM/PM folks. You can do just fine typing and ask your computer to do your bidding.


Here is how we do this.
Ctrl+Alt+Backspace, you will be in the login window
Then hit Ctrl+Alt+F2
This will pop you out of the GUI. Now you got text only. So type:
sudo ect/init.d/gdm stop
(replace gdm with kdm if you use KDE.. this is you using your nogging here.. Xubuntu will use xdm)


What you just did. Was stop the gnome display manager. Hence why replacing the g for k or x is needed for KDE or other display managers.. This gives you a higher level run time. You can now navigate to the driver file... I am going to assume. That it is in your /home/user_name folder. So lets go on over...
Type:
cd /home/user_name
Then lets see if we are in the right spot. So do a list stuff thing, which if you recall is ls. You will see the driver package. Keep in mind what is in caps and what is not.. Plus any spaces..
In my case I see:
dad frame_vin.gap NVIDIA-Linux-x86-173.14.12-pkg1.run temp triplea
Desktop innotek.asc sony Themes


How about we remove the old driver. Since we are not using it right now plus replacing it. No reason to have it muck up the new one.
Sudo apt-get uninstall <version of driver>

Or simply:
sudo rm /etc/init.d/<version of driver>
To find out which driver your running, type in the terminal:
nvidia-settings.
(You might of not known that was there did ya?)


So, lets start to install this.... type:
sudo sh NVIDIA-Linux-x86-173.14.12-pkg1.run


Ok it should fire off the installer. Follow the prompts and it should go smooth. When it is done... Back in the command line. Just restart the display manager.


sudo /etc/init.d/gdm start
Then use:
startx
Log in as usual... Your done...

To uninstall.. I just grabbed this off of linuxquestons.org.
Did something in your installation go terribly, terrible wrong? No problem! Start your box up in console-only mode, navigate to where you have the nvidia driver installation file saved, and run it with the --uninstall option. sh filename.run --uninstall, and it uninstalls everything it put in.

Then reset the xorg file. or revert to your backup.
How to reset the oxrg:
sudo dpgk-reconfigure --phigh xserver-xorg
 
Last edited:
interesting guide for those not using things like Envy that does it for you

Try cleaning up your post a bit using the [ code ] [ /code] tags whenever you are demonstrating cli stuff it makes it way easier to read
for example
Code:
 sudo apt-get install envy-ng

which gives you a nice GUI tool that does everything for you.

also from my experience
Code:
 sudo startx
is not needed as
Code:
sudo /etc/init.d/gdm start
always brings my desktop back up. However its good to have it in there in case gdm doesnt bring the GUI back
 
While Ubuntu makes it about the easiest thing to get graphic drivers in. Sometimes a user might need to go past a version what is in the repos.

I tried to make it generic enough to cover from 6.10 builds to current.
 
I updated my kernel and it totally borked my drivers in Ubuntu 8.04. After about an hour of trying dpkg-reconfigure and using all the gui stuff, I just gave up, went to the CLI, manually installed and built the drivers, and wrote my own xorg.conf by hand. Done in 10 minutes.
 
While Ubuntu makes it about the easiest thing to get graphic drivers in. Sometimes a user might need to go past a version what is in the repos.

I tried to make it generic enough to cover from 6.10 builds to current.

I updated my kernel and it totally borked my drivers in Ubuntu 8.04. After about an hour of trying dpkg-reconfigure and using all the gui stuff, I just gave up, went to the CLI, manually installed and built the drivers, and wrote my own xorg.conf by hand. Done in 10 minutes.

Im working towards gettting to the point where writing configs arent going to involve Google and copypasta.
 
Well, to be fair, I started by just scp'ing it from a working gentoo box with nvidia drivers set up, then modified as needed. No need to reinvent the wheel. dpkg-reconfigure wrote a completely useless, nearly empty xorg.conf which wouldn't even start x, and was so generic it could be the same on every box. Crappy installer really...

Then again, being a Gentoo guy really, it's just so much more familiar to me than Ubuntu.
 
That is the using cp on tje xorg works so well. Plus I addressed it early.


Lol copypatsta.. Rather funny. Is google a sauce now?
 
im having problems following this guide.

sudo apt-get uninstall doesnt work. it spits out invalid operation.
sudo rm /etc/init.d/173.14.09 (my driver version) says no such file or directory.
 
Try:
sudo rm /etc/init.d/nvidia-*

If your not using any other restricted drivers. You could purge more out.

sudo apt-get --purge remove nvidia-* nvidia-settings nvidia-kernel-common
 
Last edited:
like i said before (in the folding thread) i installed these drivers via envy. it was automated. im not using the restricted drivers
 
also the nvidia-settings command did not work. it told me there was a usage error. i tried nvidia-settings --help, there was no flags to append to make it output driver version. i had to load the GUI back up so that i could see in the nvidia settings GUI what my version was.
 
like i said before (in the folding thread) i installed these drivers via envy. it was automated. im not using the restricted drivers

This may be besides the point now that you have the new drivers installed but if the other ones were installed with envy then you should have uninstalled them with envy then removed the envy package. I really wouldn't now unless you also re-install the new driver afterward because envy may mess with the new driver.
 
This may be besides the point now that you have the new drivers installed but if the other ones were installed with envy then you should have uninstalled them with envy then removed the envy package. I really wouldn't now unless you also re-install the new driver afterward because envy may mess with the new driver.

you bring up a good point. i dont think envy will mess with the drivers, but ubuntu will. every since i installed the nvidia drivers outside of ubuntu's proprietary driver thats in the repos. it has given me an update telling me to update and install the latest vid driver thats officially supported. well it wont seem to let me decline the install and i just have to ignore the update icon on the panel. the only way i can get the panel to go away is to turn off recommended updates (missing out on updates i may want in the future. so is there anyway to decline an update and have it never ask you again and take away the update icon?
 
I do admit I gave redundant commands. Just in case there is more installed. All it does it spit out 'not here' stuff.
You can pin packages. Actually holding packages.
https://help.ubuntu.com/community/PinningHowto

This should get rid of the updater bugging you. Since I am using 7.10, and it wants to get me into 8.04. I just pin that out. You can alternatley tell it to go after newer versions of packages also. Pinning is a great thing under Debian variants..
 
New Linux user here :(

Man if only I had read this before I tried to install my drivers for 2+ hours with no success. In addition to getting frustrated, I ****ed up my xorg too because I had to boot up in 640x480 and find the solution with font the size of my fist on Firefox.

Luckily eventually I stumbled on envy and literally pushed 2 buttons.
 
well im following this again, and its not working again.

it goes through the install. says its finished but when i start gdm back up i get 640x480 graphics and no way to fix :(

how do i undo EVERYTHING and start over.

copying the x11.conf file from the backup did not work, and didnt seem to do anything.
 
My Linux box is down right now. :(

I did do a search to make it as easy as possible to help you.
http://ubuntuforums.org/showthread.php?t=731036&highlight=unistall+nvidia+drivers

Once you uninstall the drivers.. Let bulletproofX rebuild the xorg for you. Just make sure you get the version difference correct when you type out sudo sh NVIDIA-Linux-x86-169.07-pkg1.run --uninstall Change the bold part to what your using.

If this don't work. We can get something else going that will.
 
Back