Unlike 17.04, sudo service stop gdm or sudo service stop lightdm will return stop: unrecognized service, so my question being how to stop the GUI process in this bleeding edge version?

  • 1
    There is an error in the command you are using: You must use sudo service gdm stop (stop gdm is a mistake) – Jaime May 7 '18 at 13:17

Instead of killing the gdm, you can change the systemd target.

Changing the systemd target

As mentioned here, starting from 16.04, Ubuntu uses systemd and the boot process relies on a set of targets. Each target defines the system software that Ubuntu must run.

This is a list of targets for Ubuntu:

   │ Target            │
   │ poweroff.target   │ turn off the computer
   │ rescue.target     │ minimal for admin/rescue tasks
   │ multi-user.target │ multi-user, no GUI
   │ graphical.target  │ multi-user, GUI
   │ reboot.target     │ reboot the computer

To stop the GUI, you can change the target. The system checks all the running system software and kills those not included in the specified target. In consequence, if you change to the multi-user.target target, the GUI will be killed.

To change the "target" and kill the GUI:

sudo systemctl isolate multi-user.target

To make this the default "target" (and start booting your computer without GUI), you can use:

sudo systemctl enable multi-user.target
sudo systemctl set-default multi-user.target

To stop it:

sudo systemctl gdm stop

To disable it completely:

sudo systemctl gdm disable

To start it:

sudo systemctl gdm start

and to re-enable it:

sudo systemctl gdm enable

To see the actually running services

systemctl --state running
  • I had problems after stoping the graphical user interface in this way. In my computer I was not able to get a console to log in. Instead of, I am changing the systemd target. That command stops all the GUI without restarting the computer. – Jaime May 7 '18 at 13:29

To stop:

sudo telinit 3

To start:

sudo telinit 5

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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