Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I tried to update my nvidia driver but i got an error when i ran the driver installation.

See the error:

  ERROR: You appear to be running an X server; please exit X before            
         installing.  For further details, please see the section INSTALLING   
         THE NVIDIA DRIVER in the README available on the Linux driver         
         download page at www.nvidia.com.

Note: I tried following a guide by typing init 3 but still nothing changed.. How to close the X server?

So i can update the driver

share|improve this question
did you try my service suggestion? – Kevin Nov 29 '11 at 16:57
what distro is this? – Patrick Nov 30 '11 at 4:18

I don't think I've ever gotten that installing/updating nvidia, but here:

# To stop:
sudo init 3
# To resume:
sudo init 5

Though I'm not 100% sure that'll work on Ubuntu, IIRC they moved away from init. On Ubuntu, try this (replace gdm with kdm/slim/whatever display manager you use):

# To stop:
sudo service gdm stop
# To start:
sudo service gdm start

I'm pretty sure that stops the whole X session

Less cleanly, you could just kill them:

sudo killall /usr/bin/X

But they might respawn.

share|improve this answer
I tried your first solution and didn't work, then I tried your second solution it says unrecognised service(I tried all of them) I also tried your last solution and it says no proccess found – Rev3rse Nov 29 '11 at 17:15
Under Ubuntu, the basic display manager isn't GDM but LightDM. service lightdm stop. – John WH Smith Nov 3 '14 at 12:54
@JohnWHSmith maybe it is now, but it wasn't 3 years ago when I wrote this. – Kevin Nov 3 '14 at 17:22

Depending on your version the way of stopping the X server varies. You have to exit the graphic mode (by typing alt+ctrl+F1, for example), login, and then type one of the following commands to stop the X server:

sudo service lightdm stop

sudo service gdm stop

sudo service kdm stop  //this is the one that worked for mi as I use kdm and Linux mint

Now you can install the drivers and then type

sudo reboot

When you write sudo service press tab to see the options you have (gdm, kdm,...)

share|improve this answer

from my experience i am try this :

  • Alt+F1 then login, sudo telinit 3 (if that isn't work try /sbin/telinit 3), and check that it is changed to level 3 with runlevel that should output something like 5 3 which means that the current run level is 3 and before it was 5.

In case that isn't work, do:

  • ps ax | grep X, and in the output you would see teh PID number of the process X, so you should kill it with sudo kill -9 number where number is the PID number of the process.
share|improve this answer

As the error states, you are still running an X server. This error occurs when you try to install the Nvidia .run files while logged in.

Make sure you are logged out.

  • Hit CTRL+ALT+F1 and login using your credentials.
  • kill your current X server session by typing sudo service lightdm stop or sudo stop lightdm
  • Enter runlevel 3 (or 5) by typing sudo init 3 (or sudo init 5) and install your .run file.
  • You might be required to reboot when the installation finishes. If not, run sudo service start lightdm or sudo start lightdm to start your X server again.
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.