40

I installed gdm for a while as my display manager, and after removing it, lightdm does not start by itself. I instead have to login to a tty, and run sudo start lightdm.

Running dpkg-reconfigure lightdm does not work either:

dpkg-maintscript-helper: warning: environment variable DPKG_MAINTSCRIPT_NAME missing
dpkg-maintscript-helper: warning: environment variable DPKG_MAINTSCRIPT_PACKAGE missing

I've also tried reinstalling lightdm completely, but it does not work as well

My /var/log/boot.log has the following lines:

* Starting LightDM Display Manager                                                                                                                  
* Starting ACPI daemon                                                                                                                              
* Starting anac(h)ronistic cron                                                                                                                     
* Starting save kernel messages                                                                                                                      
* Stopping LightDM Display Manager         
Nemo
  • 9,460

6 Answers6

34

Run a terminal and enter cat /etc/X11/default-display-manager. Probably says lightdm if you recently uninstalled GDM. /etc/init/lightdm.conf doesn't accept lightdm as a setting - however, /usr/bin/lightdm or /usr/sbin/lightdm work. So open /etc/X11/default-display-manager in your favorite text editor and replace whatever is there with the following line:

/usr/bin/lightdm

or

/usr/sbin/lightdm

Reboot and lightdm should start and bring you to the logon screen as usual.

  • It works. The content in /etc/X11/default-display-manager was /user/sbin/gdm. I installed GNOME Shell then uninstalled it days ago, I guess that's the problem. – hajimuz Sep 25 '17 at 00:39
19

My solution was to run:

rm /etc/systemd/system/default.target
systemctl set-default graphical.target

This will replace the default target file, which in my case must have prevented systemd from reaching the graphical target, with a symlink to the graphical target. After this, lightdm (and gdm when selected with dpkg-reconfigure) starts automatically.

/etc/X11/default-display-manager was already set to the correct value so this appears to be a different root cause from OP's.

More information on systemd targets here.

apteryx
  • 303
  • 2
    Heads up! For those who are planning to install PacketFence or have already installed, this is the solution. I have no idea, but PacketFence overwrites this file with his own configuration and after a reboot, no graphical login interface will be available to you, unless you recreate this file. Thanks for your contribution, @apteryx! – ivanleoncz Aug 22 '17 at 18:40
  • 1
    OK...so apteryx is a hero. I have been struggling with the total loss of the display manager on Mint 18.1 (and 18.2) after some upgrades and this solution totally worked for me! lightdm is still not functional, but I can at least log in now. Thanks! – cirrusio Oct 02 '17 at 05:35
  • Thanks! This did the trick for me after installing LightDM on a fresh Arch install. – Opifex Sep 14 '22 at 17:02
11

It happens for me when removing gnome apps including gdm,and moving to kde.

I fixed it by running:

sudo dpkg-reconfigure lightdm

and choosing kdm as default instead of lightdm

BigOther
  • 249
  • 3
  • 9
6

Alright, I think I finally figured it out! Everyone's suggestion in response to this problem is to get the right legacy nVidia card. Easier said than done. I had a really hard time tracking down the right driver, since it seemed to have disappeared from repositories (at least Ubuntu's). Here's what worked for me. Depending on your nVidia card, you might need to download a different file, but they're all listed at http://www.nvidia.com/object/unix.html. I needed the legacy 96xx driver for my GeForce 2 MX 400. So, after weeks of trying to fix this, I just ran these commands and it finally worked! The URL used in the wget command is just the URL of the file that the nVidia website wanted me to download.

wget http://us.download.nvidia.com/XFree86/Linux-x86/96.43.23/NVIDIA-Linux-x86-96.43.23-pkg1.run
sudo sh NVIDIA-Linux-x86-96.43.23-pkg1.run
sudo reboot
LakeHMM
  • 161
1

In my case, I have to reinstall ubuntu-desktop to get it to work again.

sudo apt install xorg
sudo apt-get install --reinstall ubuntu-desktop
1

If the system seems not to boot up, you can try switch tty with CTRL+FX Buttons, with X being a number from 1 to 7. Usually, the lightdm does not start completely, but systemd is able to start all services needed, as their own login manager. Changing tty will let you purge and reinstall the login manager packages and let your distribuition configure It to you automatically. On Ubuntu after the tty change:

sudo apt-get purge lightdm && sudo apt-get install lightdm

R. W. Prado
  • 111
  • 3