5

I wan't command line only server machine. So, I wish to remover GUI from server, which was installed automatically during upgrade.

Simultaneously, I don't want to remove X because I still wish to be able to run X Window applications on VNC or XServer.

How to do that?

UPDATE

sudo apt-get remove ubuntustudio-desktop

didn't help

UPDATE 2

Changing

#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash console=tty1"
GRUB_CMDLINE_LINUX_DEFAULT="text"

in etc/default/grub didn't help (it only affected graphics during boot phase)

UPDATE 3

Changing to

env DEFAULT_RUNLEVEL=3

in /etc/init/rc-sysinit.conf didn't help.

UPDATE 4

$ ls /usr/share/xsessions
ubuntustudio.desktop  xfce.desktop

UPDATE 5

Adding "manual" to lightdm.override

$ cat /etc/init/lightdm.override
manual

didn't help, although stopping lightdm service

sudo service lightdm stop

closes desktop. How to make this service never run?

UPDATE 6

$ sudo update-rc.d lightdm disable
insserv: warning: current start runlevel(s) (empty) of script `lightdm' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `lightdm' overrides LSB defaults (0 1 6).

didn't help

SOLUTION

systemctl disable lightdm.service

helped, thanks @steeldriver

  • What GUI was installed, exactly? What are the contents of /usr/share/xsessions? – steeldriver Sep 10 '16 at 23:01
  • See my update 4 pls! – Dims Sep 11 '16 at 11:50
  • 1
    Please post the solution as an answer rather than a part of the question. – Melebius Sep 12 '16 at 8:28
  • It looks like L. D. James' answer below (askubuntu.com/a/823501/593945) is correct, so please accept it. – David J. Sep 14 '16 at 14:32
  • I would notice that this disable but do not remove GUI, which can be reenabled with: systemctl enable lightdm.service or started once with systemctl start lightdm.service – Cirelli94 Apr 12 '17 at 22:19
6

From the tested comments discussion this is done use systemd disable argument:

$ systemctl disable lightdm.service
  • What is lightdm.conf and how can it help? – Dims Sep 11 '16 at 11:54
  • "manual" way didn't work – Dims Sep 11 '16 at 11:57
  • @Dims You're right. I did research and gave you the results that was reported working. I just tested some of the steps and find Ubuntu apparently is not using any of it's published methods for disabling the GUI. I'll continue to research how to disable it and update my answer with a working solution for Ubuntu 16.04. – L. D. James Sep 11 '16 at 12:20
  • Incredible. They are making less and less controllable linux. – Dims Sep 11 '16 at 12:24
  • 1
    16.04 uses systemd rather than upstart - the equivalent command (I think) would be sudo systemctl disable lightdm.service or more generally sudo systemctl disable display-manager.service which should work regardless of which DM is providing the service. – steeldriver Sep 11 '16 at 13:33

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.