20

I want to disable lightdm from autostart. Currenty, I run service lightdm disable from terminal, then run startx.

update-rc.d doesnt help

19

lightdm is started by Upstart, not SysV Init. So update-rc.d doesn't work.

Use

 echo  "manual" | sudo tee -a /etc/init/lightdm.override
  • thank you! By the way, I found profiles draft for upstart, but it is not implemented so far... – Samat May 21 '12 at 4:25
  • 1
    With this setting I get a black screen when I exit the GUI (after having started it with the startx command). – August Karlstrom Jun 4 '12 at 17:50
21

Note that the method described above doesn't work anymore since 15.04 and later, since Upstart was replaced by Systemd. As described here, one can now disable lightdm like this:

16.04 upward

systemctl disable lightdm.service

15.04, 15.10

systemctl disable lightdm
  • Unfortunately, this method doesn't work in 16.04. – Alexander Obersht May 13 '16 at 23:19
  • @AlexanderObersht you're right, see correction. – Wolfgang Noichl Aug 16 '16 at 16:26
  • mind that if you do this the system may not boot afterwards (ending up in this situation). In that case use the command provided by Nirmik here to reconfigure a display manager – glS Mar 1 '18 at 14:53
  • @glS No, this won't prevent the system from booting. It just disables the display manager ;) so you find a perfectly running shell at ctrl+alt+f2. Here, you can login, and do sudo service lightdm start to start lightdm once, or systemctl enable lightdm.service to have it start automatically again... – Wolfgang Noichl Mar 2 '18 at 15:36
4

If you want to disable lightdm to enable gdm or kdm or any other display manager, enter the following command in the terminal:

sudo dpkg-reconfigure lightdm

Then enter on ok and then select from the list your desired display manager.

The same answer with screenshots is given here: Reset to Default Unity Login

1

I just remove the execution bit on the lightdm binary.

chmod -x /usr/sbin/lightdm

Then to re-enable it:

chmod +x /usr/sbin/lightdm

  • This method doesn't work adequately in 16.04. Although LightDM fails to start, the system also gets stuck at startup splash animation indefinitely. TTYs never become available which makes it impossible to log on locally. – Alexander Obersht May 13 '16 at 23:30
  • Doing a "sudo systemctl disable lightdm" on a fresh install of Ubuntu Desktop 16.04 AMD64 worked fine for me. – John May 15 '16 at 15:12
0

This is handled by display-manager... Disable on systemd and you're done.

# systemctl disable display-manager        
Removed symlink /etc/systemd/system/display-manager.service.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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