I just installed Ubuntu 12.10 today, and had this issue with nvidia driver.
I tried to follow above instructions, but all these failed because of two words that are quite important: "generic" and "-17".
I eventually found that the best way of installing NVidia driver is to actually use installer privided by nvidia. So I went to:
and downloaded version for Linux-64bit
sudo apt-get install synaptic and look in the menu Settings -> Repository -> Additional Drivers to find out the exact name of your nvidia card)
Then you run the tool and it says you need kernel headers, however read carefully because it requires "generic" headers.
You need to verify your kernel version, mine was 3.5.0-17 (this "-17" at the end matters), so in my case I did:
sudo apt-get install linux-headers-3.5.0-17-generic
(find out your kernel version by typing ina terminal
You need to kill GUI login daemon:
and after that you may run:
sudo sh NVIDIA-Linux-x86_64-310.19.run
Installer will probably tell you that Noveau kernel module is loaded and will suggest adding modprobe script. You should say Ok/Yes to all whatever it tells you and then reboot and run NVIDIA-Linux-x86_64-310.19.run again.
Not sure if other approach would work as well, but this one does for sure.