How to install the driver on Ubuntu or Fedora how to exit X?

When I try to install the cuda driver on Ubuntu 9.04 or Fedora 11, it tells me to exit X server first.
How to exit the X server and install the driver?

Thank you,

As root, type:
init 3

Not that easy. In Ubuntu, Alt+Ctrl+F1, and stop X first with
sudo /etc/init.d/gdm stop
install cuda driver etc.

sudo reboot

On Ubuntu it is important firstly doing a proper uninstallation of older NVIDIA drivers

I was able to install nvidia driver 190.18 on Ubuntu 9.04 on my Levono T61p with FX570M without any problem.
But when I tried to install it on my desktop Dell Precision T7400 with GTX 280, the driver 190.18 is not working properly. After I installed the driver and reboot, it fails to run the X server and I was prompted to restart to the generic driver or back to the orginal configuration, otherwise X window won’t work.
Is there any hint on what the problems might be?
Thank you,

You are right. The reason was the mixed files between several versions of the driver.

On Fedora - I mean that one should give the full path of the init command. Try a

su - /sbin/init 3