Ubuntu 16.04 LTS 64bits - I cannot install the drivers for GeForce 210. (340-102)

When I try to install the archive .run as root, it say:
Unable to load: nvidia-installer ncurses v6 user interface

Using: nvidia-installer ncurses user interface
-> The file ‘/tmp/.X0-lock’ exists and appears to contain the process ID ‘963’ of a runnning X server.
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.
ERROR: Installation has failed. Please see the file ‘/var/log/nvidia-installer.log’ for details. You may find suggestions on fixing installation problems in the README available on the Linux driver download page at www.nvidia.com.}

I dont know what I should do… I have been trying to install all the night. So, i need some help. Thanks.

It seems the Xserver is running:

Have you tried to stop the Xserver and run the installer?

Or maybe the easy solution is to use the nvidia package in Ubuntu.

I’d try to “unistall” the X-server but it cannot delete. In the drivers, this appears.

[i][s]== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 ==
vendor : NVIDIA Corporation
model : GT218 [GeForce 210]
modalias : pci:v000010DEd00000A65sv00003842sd00001313bc03sc00i00
driver : nvidia-304-updates - distro non-free
driver : nvidia-304 - distro non-free
driver : xserver-xorg-video-nouveau - distro free builtin
driver : nvidia-340 - third-party non-free recommended

== cpu-microcode.py ==
driver : intel-microcode - distro non-free

I followed the steps of the links that you sent me, but they don’t give me a solution, however, the console tells me that X-server isn’t active.

You don’t need to uninstall the Xserver, you only has to stop the server if you try to install the nvidia .run file from nvidia. But it is easier to use the Ubuntu nvidia package.

Can you run

sudo apt-get update
sudo apt-get install nvidia-340

and post the output if something went wrong?