How to install NVIDIA.run?

821,610

Solution 1

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.

  1. Hit Ctrl+Alt+F1 and login using your credentials.
  2. kill your current X server session by typing sudo service lightdm stop or sudo lightdm stop
  3. Enter runlevel 3 by typing sudo init 3
  4. Install your *.run file.
    1. you change to the directory where you have downloaded the file by typing for instance cd Downloads. If it is in another directory, go there. Check if you see the file when you type ls NVIDIA*
    2. Make the file executable with chmod +x ./your-nvidia-file.run
    3. Execute the file with sudo ./your-nvidia-file.run
  5. You might be required to reboot when the installation finishes. If not, run sudo service lightdm start or sudo start lightdm to start your X server again.
  6. It's worth mentioning, that when installed this way, you'd have to redo the steps after each kernel update.

Solution 2

I installed latest nvidia drivers by this method:

sudo add-apt-repository ppa:ubuntu-x-swat/x-updates
sudo apt-get update
sudo apt-get install nvidia-current

It is working fine with unity 3d. Thanks to all.

Solution 3

Add the --no-x-check flag when you run this in the terminal:

sudo ./NVIDIAxxxx.run --no-x-check

Solution 4

I had the same problem installing the driver for an old GeForce 9800 GT in Ubuntu 14.04-2. It was the NVIDIA-Linux-x86_64-340.76.run

I switched to the the tty1 using Ctrl+Alt+F1 and also stopped the service lightdm and when running the executable got the same error .

What I did to solve the problem was navigate to the /tmp folder and erase the .X0-lock file.

You will only see it listed if you use ls -la as it is a hidden folder by default(that is why it has a dot in front of the name)

cd /tmp
rm -rf .X0-lock

After erasing that folder and executing the NVIDIA-Linux-x86_64-340.76.run it installed just fine.

Solution 5

Ubuntu 16.04 with Quadro 4000 confirmed that this method work:

sudo apt-get update
sudo apt-get install nvidia-375

Note that I don't use nvidia-current as I downloaded the run file from NVIDIA and its version is 375.66

Share:
821,610

Related videos on Youtube

Kiranraj
Author by

Kiranraj

Updated on September 18, 2022

Comments

  • Kiranraj
    Kiranraj over 1 year

    I have a Nvidia Ge force Ge6150 SE graphics card. I am running ubuntu 12.04. When I try to install the .run file it fails. It shows the message like this:

    I tried to install it after uninstalling the old driver.still same message. Here is the log file:

    nvidia-installer log file '/var/log/nvidia-installer.log'
    creation time: Mon Jun 11 05:46:17 2012
    installer version: 295.53
    
    PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
    
    nvidia-installer command line:
        ./nvidia-installer
    
    Using: nvidia-installer ncurses user interface
    -> The file '/tmp/.X0-lock' exists and appears to contain the process ID '1062' 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.
    

    but no such file is shown in the process manager.

    • dobey
      dobey almost 12 years
      Does installing the nvidia-current package in ubuntu with apt-get not work with your card? Why are you trying to install that version of the driver, rather than the supported version packaged for ubuntu 12.04?
    • Kiranraj
      Kiranraj almost 12 years
      It has problems with my card.It conflicts with unity.Glitches in video playback .Nvidia Current is still 295.40!It do not give me the resolution 1440*900
    • Dominic Cerisano
      Dominic Cerisano over 6 years
      Don't use the .run file. Just sudo add-apt-repository ppa:graphics-drivers/ppa. The latest drivers will appear in "Software & Updates --> Additional Drivers".
    • Giang Nguyễn
      Giang Nguyễn over 3 years
      Following this link surely helps you: unix.stackexchange.com/a/524151/365545
    • Admin
      Admin almost 2 years
      @DominicCerisano , this add option to software and update but further did not work for me. e.g., I could see driver v510 using nvidia-smi, but this command add v515. but next it says ...couldn't communicate with driver
    • Admin
      Admin almost 2 years
      You really need to give the command lines you are using. Eg. the errors you gave indicate you need likely need to be root (sudo).
    • Admin
      Admin almost 2 years
      My bad, it is working perfectly now. the error message was because I did not restart the machine.
  • amc
    amc almost 11 years
    it's not clear if this gets around the problem of trying to install the driver while an X server is running.
  • amc
    amc almost 11 years
    please provide a summary of the steps required in addition to posting a link
  • Felby
    Felby over 9 years
    This doesn't fix the X server issue when trying to install the .run file, but it does offer another way to install/update to the latest nvidia drivers packaged for the unbuntu distro.
  • Nathan Schwermann
    Nathan Schwermann about 9 years
    The driver this serves up is many versions outdated. Is there a way to get the actual current version through apt-get?
  • Aracthor
    Aracthor over 8 years
    I strongly not recommend this method. It made my X server to refuse to start on system start, I had to remove it on console mode. It seems that those drivers are now very outdated and not updated anymore.
  • user1111929
    user1111929 over 8 years
    This made my laptop unusable. I boot successfully into the login screen, but when I login to any account, I see a black screen for a second and I am back at the login screen... any idea what's going on or how to resolve it? :(
  • Jack Tong
    Jack Tong over 8 years
    This happened to me on my GT220 card, updating to nvidia 340. Apparently, the card is not supported by the latest driver. You may try going down a version or two until you have a usable desktop. Good luck!
  • Kalamalka Kid
    Kalamalka Kid almost 8 years
    "Enter runlevel 3 by typing sudo init 3 and install your *.run file" can you please clarify how to install the .run file?
  • Jack Tong
    Jack Tong almost 8 years
    Once you've managed to enter runlevel 3, you can simply type <path to your *.run file> and execute. The installer will guide you through the process.
  • Dor
    Dor over 7 years
    Notice that runlevel 3 is the same as runlevel 2-5 in all Debian distros (including Ubuntu), see: Debian and Ubuntu Linux Run Levels. This means that you need to sudo service lightdm stop after that you enter to runlevel 3. In our case, it seems redundant to enter to runlevel 3, isn't it?
  • Jack Tong
    Jack Tong over 7 years
    They are not the same. More like similar because they are all multi-user modes. #2 has a graphical display manager, whereas #3 does not. Read the part about `#telinit 3' somewhere near the bottom.
  • Mona Jalal
    Mona Jalal over 7 years
    jalal@klein:~/Downloads$ sudo ./cuda_8.0.44_linux.run --no-x-check Unknown option: no-x-check
  • khaverim
    khaverim about 7 years
    This doesn't resolve the issue on 16.04 for me. Driver installation still detects X server running and fails.
  • khaverim
    khaverim about 7 years
    I have 15.04 and the same graphics card. x-updates is apparently now just updates. Also I had to install nvidia-304 before nvidia-current as a prerequisite. And now, alas, accessing tty1 is perpetually stuck saying Scanning for Btrfs filesystems, so I am sad. I can't issue commands in tty1, and so I can't access my computer anymore, until I find a way
  • MasterHD
    MasterHD about 7 years
    I strongly recommend this console method (don't use the website or .run files at all) as confirmed here: askubuntu.com/a/624967/662072
  • Shautieh
    Shautieh about 7 years
    Great advice to kill your machine...
  • Andrea Thacker
    Andrea Thacker almost 7 years
    If you have a black screen you might have a terminal prompt out of view, type enter a handful of times to make sure you still don't have a terminal session open but you just can't see it.
  • Jabberwockey
    Jabberwockey almost 7 years
    This killed my Ubuntu installation after stopping the lightdm service. Now I have another problem to solve. Why is this the most upvoted answer?
  • web.learner
    web.learner almost 7 years
    @Jabberwockey A few things have changed since this answer was posted but this is still the correct process. More likely you installed the wrong Nvidia driver for your card or a corrupted file. Ask a new question with the specifics.
  • XavM
    XavM over 6 years
    @Jabberwockey, how did you solved your installation issue? I follow these instructions and it crashed my installation too.
  • karel
    karel over 6 years
  • crypdick
    crypdick over 6 years
    You can restart from terminal with shutdown -r 0
  • Sarz
    Sarz about 6 years
    Kill [ID] killing process ID is logging me out and have to login again. Is X server related to logged in UI?
  • thirtydot
    thirtydot about 6 years
    I couldn't get any of the .run files from Nvidia's site to work (they would install but driver was broken). Using the graphics-drivers PPA instantly worked for me, as detailed in this answer: askubuntu.com/questions/61396/…. nvidia-390.
  • thang
    thang almost 6 years
    for some reason service lightdm stop doesn't stop it. had to manually kill it.
  • user2979044
    user2979044 over 5 years
    If your install for some reason has lightdm permanently disabled on reboot (causing login issues), edit the conf at bootup with 'e', find the line starting with 'linux', and append a '3' to the end of the line. This should start you up straight into terminal, where you can then restart the lightdm.
  • B Furtado
    B Furtado about 5 years
    Did this work? Why the answer everyone complains in the comments is the most upvoted?
  • Mr. Unnormalized Posterior
    Mr. Unnormalized Posterior about 5 years
    Works on Ubuntu 18.10. Thanks! Additionally, I used this link askubuntu.com/questions/842256/… and during installation say yes to all installation steps (nvidia-xconfig utility, 32-bit OpenGL libraries, DKMS support)
  • Brana
    Brana almost 5 years
    I do not undestand, how do I do anything when I am not logged in
  • Yossarian42
    Yossarian42 almost 5 years
    Although this method works with unity, it will crash when installing driver with a gnome desktop
  • rahul
    rahul almost 5 years
    This even worked for linuxlite 4.4
  • Hossein
    Hossein over 4 years
    @user1111929 I also the same problem. Did you find any way to resolve it? Or just reinstall Ubuntu?
  • user1111929
    user1111929 over 4 years
    @Hossein This was 3.5 years ago, I do not remember sorry. But given the 18 upvotes on my comment, I suspect we're not the only ones.
  • marcelocra
    marcelocra over 4 years
    From the docs: --no-x-check Do not abort the installation if nvidia-installer detects that an X server is running. Only under very rare circumstances should this option be used.
  • IgNite
    IgNite about 4 years
    @marcelocra , Where did you find such document? Could you attach the link?
  • marcelocra
    marcelocra about 4 years
    The ./NVIDIAxxxx.run command is a bash script. I believe the documentation was inside of it. If that's really the case, try vim ./NVIDIAxxxx.run (sorry, I don't remember anymore, but since I didn't link it, that is probably correct).
  • Giang Nguyễn
    Giang Nguyễn over 3 years
    It killed my pc awwwwwwwwwwwwwwwwwww
  • Giang Nguyễn
    Giang Nguyễn over 3 years
    Alright! This is how I solved the problem: sudo add-apt-repository ppa:graphics-drivers/ppa sudo apt update sudo apt install nvidia-367 sudo reboot
  • Giang Nguyễn
    Giang Nguyễn over 3 years
    Also, follow this link to install cuda driver: unix.stackexchange.com/a/524151/365545
  • Admin
    Admin almost 2 years
    Worked for me Debian 10 Buster, Nvidia Driver 460.91.03.
  • Admin
    Admin almost 2 years
    this solution does not work and destroyed my graphics and ubuntu. now nothing is working.
  • Admin
    Admin almost 2 years
    +1 for the sudo - other answers did not mention this, but the error in the OP indicates root is required.