0

Here is my issue: Ubuntu starts perfectly, but when I get to the login screen and try to log in, I get a black screen and a few seconds later I'm back to the login screen.

I believe the problem comes from the graphic card driver since I had just switched from the alternative driver to the proprietary one before I got the issue. (I used the Software and Updates app to do so.)

I have an Asus with i7 and a dual-boot with Windows and Ubuntu 18.04 (Grub starts fine). My graphic card is Nvidia Geforce 920M.

Thank you!

PS: I'm a beginner Ubuntu user, don't hesitate to ask if I forgot essential info.

EDIT: following @JoshuaBesneatte answer, I did the following :

  1. sudo apt-get purge nvidia and reboot. I can now log in, but the window is now "zoomed in". (Weirdly, the "zoomed in" problem wasn't there the first time I did step 1).

  2. I added the graphics drivers repository: sudo add-apt-repository ppa:graphics-drivers. Checking Software and Updates a bit later (not sure the change comes from this command), I now have 4 possibilities : 3 Nvidia drivers (390, 400 and 415) and Nouveau display driver (I only had one Nvidia possibility before).

  3. I Updated (sudo apt update) :

    leo@leo:~$ sudo apt-get update
    [sudo] password for leo: 
    Hit:1 http://uk-mirrors.evowise.com/ubuntu bionic InRelease
    Hit:2 http://archive.canonical.com/ubuntu bionic InRelease                     
    Hit:3 http://uk-mirrors.evowise.com/ubuntu bionic-backports InRelease          
    Hit:4 http://uk-mirrors.evowise.com/ubuntu bionic-security InRelease           
    Hit:5 http://ppa.launchpad.net/bluetooth/bluez/ubuntu bionic InRelease       
    Hit:6 http://uk-mirrors.evowise.com/ubuntu bionic-updates InRelease
    Hit:7 http://ppa.launchpad.net/daniruiz/flat-remix/ubuntu bionic InRelease   
    Hit:8 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic InRelease  
    Hit:9 http://ppa.launchpad.net/linrunner/tlp/ubuntu bionic InRelease
    Hit:10 http://ppa.launchpad.net/nathan-renniewaldock/flux/ubuntu bionic InRelease
    Reading package lists... Done   
    
  4. I tried installing Nvidia drivers :

    • nvidia-current didn't work (sudo apt install nvidia-current) :

      leo@leo:~$ sudo apt install nvidia-current
      Reading package lists... Done
      Building dependency tree       
      Reading state information... Done
      Some packages could not be installed. This may mean that you have
      requested an impossible situation or if you are using the unstable
      distribution that some required packages have not yet been created
      or been moved out of Incoming.
      The following information may help to resolve the situation:
      
      The following packages have unmet dependencies:
      nvidia-current : Depends: nvidia-304 but it is not going to be installed
      E: Unable to correct problems, you have held broken packages.
      
    • After doing step 1 again, I tried installing 390 (sudo apt install nvidia-driver-390). It seemed to work, and the sudo nvidia-xconfig gave the following result :

      sudo nvidia-xconfig
      
      Using X configuration file: "/etc/X11/xorg.conf".
      Backed up file '/etc/X11/xorg.conf' as '/etc/X11/xorg.conf.backup'
      New X configuration file written to '/etc/X11/xorg.conf'
      

    But after rebooting, my computer freezes when I try to log in. I had the same result when I tried with sudo apt install nvidia-driver-415 and sudo ubuntu-drivers autoinstall.

    • When I try to install nvidia 400 (sudo apt install nvidia-driver-400), I get the following :

      Reading package lists... Done
      Building dependency tree       
      Reading state information... Done
      E: Unable to locate package nvidia-driver-400
      

NB: weirdly, Firefox doesn't work anymore, while Chrome does.

SOLUTION: After purging Nvidia, simply remove the xorg.conf file in /etc/X11. It doesn't make the Nvidia driver works, but at least Nouveau works.

4
  • there are multiple pro drivers avail... this happened to me when I installed the wrong one... you can drop to command line with ctrl+alt+F2 and run ubuntu-drivers list and then install an older or newer driver than previous... see this..askubuntu.com/questions/22118/… Aug 1, 2019 at 17:50
  • try doing sudo apt-get install nvidia-driver-390 I have had issues with the 400 series ones... so what you should do is (after purging everything) install the 390 driver instead and see if that works... updating answer now... be sure to follow all steps of answer, in order... Aug 2, 2019 at 1:28
  • Unfortunately it didn't work. I have updated my question. Seeing the result of sudo nvidia-xconfig, maybe my configuration file is not correct ?
    – Léo S.
    Aug 2, 2019 at 11:19
  • 1
    Possible duplicate of Can't start ubuntu-desktop after upgrade to 18.04
    – karel
    Aug 3, 2019 at 6:32

3 Answers 3

1

You are using a driver that is not compatible with your card. You will need to install one of the other pro drivers that are available (or revert to nouveau).

1. Drop to a command shell:

Press ctrl+alt+f2 and log in.

2. Purge out NVIDIA

sudo apt-get purge nvidia*

Now you can reboot and you will be running on Nouveau and we can make sure you have the right NVIDIA drivers.

3. Make sure you have Correct Nvidia

sudo add-apt-repository ppa:graphics-drivers
sudo apt update
sudo apt install nvidia-driver-390
sudo nvidia-xconfig

Then reboot and you should be good to go. If you need functionality from the 400 series drivers, try installing the 400 (not 415 or autoinstall) and see if it works. Otherwise stick with 390 as I personally find it less buggy.

4. If you want to test other drivers or see what's available:

As outlined in this post, you can do the following:

sudo ubuntu-drivers list

Will show all the driver packages which apply to your current system. You can then

sudo ubuntu-drivers autoinstall 

to install all the packages you need, or you can do:

sudo ubuntu-drivers devices

to show you which devices need drivers, and their corresponding package names.

5. Rename old xorg.conf file and regenerate it

If you have bad configuration in your xorg.conf file you may need a new one. So rename the old one:

sudo mv /etc/X11/xorg.conf /etc/x11/xorg.conf.bak

And run nvidia-xconfig again:

sudo nvidia-xconfig
5
  • Thanks for your answer. I followed your instructions, but it worked only partially. I added an edit to my question since a comment is too small.
    – Léo S.
    Aug 1, 2019 at 23:28
  • OK, I have updated the answer... follow ALL steps from beginning and install the 390 driver... should fix it for you Aug 2, 2019 at 1:34
  • Unfortunately it didn't work. I have updated my question. I'm trying to reset the etc/X11/xorg.conf file for Nouveau driver, so I have at least a working driver (I'm guessing the "zoom" problem comes from the fact that nvidia xconfig has changed the xorg.conf file so it now works badly with Nouveau). I have tried sudo dpkg-reconfigure -phigh xserver-xorg and sudo dpkg-reconfigure xserver-xorg, but none worked. I can't find a file sample that I could simply copy-paste either. Any idea ?
    – Léo S.
    Aug 2, 2019 at 15:28
  • Try renaming your xorg.conf file before reconfiguring... this will generate a new configuration file as well as retaining your old one in case you need anything from it Aug 2, 2019 at 16:54
  • Thanks a lot it did the trick ! Actually it didn't create any file, but simply removing xorg.conf worked
    – Léo S.
    Aug 2, 2019 at 21:24
0

Get into terminal. There is a login option to do this. You just need the terminal for this. You could try to get into a terminal by pressing ctrl-alt-f1 or ctrl-alt-f2.

Anyway, once you are in a terminal type:

sudo ubuntu-drivers autoinstall

Then reboot.

0

So thanks to @JoshuaBesneatte, I found the solution to get back to the original driver (Nouveau) :

  1. Purge Nvidia and reboot (see @JoshuaBesneatte answer) ;
  2. If you have tried to install Nvidia drivers before, you may need to get the original configuration file back (especially if you have used sudo nvidia-xconfig). To do so, remove the xorg.conf file in /etc/11/.

I still can't make the Nvidia drivers work, but at least I have a working driver so I'm fine.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .