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
  • 2
  • 5
  • 7

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
Wolfgang Noichl
  • 379
  • 3
  • 7
  • 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](https://askubuntu.com/q/882385/157358) situation). In that case use the command provided by Nirmik [here](https://askubuntu.com/a/139020/157358) 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
  • 8
Florian Diesch
  • 86,013
  • 17
  • 224
  • 214
  • thank you! By the way, I found [profiles draft for upstart](http://upstart.ubuntu.com/wiki/Profiles), but it is not implemented so far... – Samat May 21 '12 at 04: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 04 '12 at 17:50
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,748
  • 16
  • 58
  • 88
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
  • 1
  • 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.
Trunet
  • 1