I am currently running Ubuntu 16.04 operating system. In order to experiment, I had asked for the way to login to Ubuntu CLI mode only (i.e. the GUI version must not start at all). In response to my question, I was suggested something like

sudo systemctl start lightdm.services

when I entered this command and restarted the system, it indeed worked and I was given a command line interface to login (No GUI element whatsoever; even the browser was not opening when I typed firefox www.google.co.in).

Now, I want to go back to the GUI version again.

I typed the following command

sudo systemctl stop lightdm.services

and then restarted the system. The OS still opens in the CLI mode only. Is there anything wrong with my commands?

Kindly guide me.


The commands you mentioned have effect only on the current boot. The stop one can temporarly disable your GUI, but at the next reboot you'll be back to the graphical interface. I assume you meant sudo systemctl disable lightdm and systemctl enable lightdm, that would respectively disable and enable your GUI (thus were a solution to your previous problem)

As you probably were trying different solutions for your previous problem, i suggest executing the following commands in sequence:

  1. sudo systemctl unmask lightdm (if you mask lightdm, it won't start even if you enable it)
  2. sudo systemctl enable lightdm (if you enable it, you'll still have to boot in "graphical.target" mode to have GUI)
  3. sudo systemctl set-default graphical.target Then sudo reboot to restart your machine, and you should be back to your GUI.
  • actually i had used the words stop and start...the commands that u have mentioned, should be executed in CLI right? do i need to reboot also
    – Upendra01
    Nov 27 '16 at 14:19
  • "start" and "stop" will take you to/from the GUI to the CLI right away, but they have no persistent effect (so if you get to CLI with sudo systemctl stop lightdm, and then reboot, you will be in the GUI again).You can execute the three commands i listed in the CLI, and then execute "sudo reboot" to restart your PC Nov 27 '16 at 14:46

sudo systemctl set-default graphical.target Then sudo reboot to restart your machine. Works fine on my system, I am redirected to my GUI immediately after rebooting.


sudo systemctl start lightdm.service should start the display manager . A display manager is the screen that prompts you to enter the username and password of a user, so you can log in to the system. On Ubuntu, it is enabled by default, i.e. it starts on boot.

That command shouldn't make you enter tty (i.e. CLI mode). If you want to go into tty, you can just run sudo systemctl stop lightdm.service but the easiest way is to press Ctrl + Alt + one of the function keys (e.g. F3 for tty3).

Since lightdm.service is probably enabled, you should boot into it whenever you boot up he OS. If it's disabled for some reason, try enabling it with sudo systemctl enable lightdm.service and then either start it with sudo systemctl start lightdm.service or just reboot.

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.