22

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

update-rc.d doesnt help

Samat
  • 585

5 Answers5

23

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 01 '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 02 '18 at 15:36
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
orrymr
  • 195
5

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

Nirmik
  • 7,868
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

John
  • 11
  • 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
1

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.
Trunet
  • 11