2

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.

4

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 – Upendra Pratap Singh 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 – Mario Vitale Nov 27 '16 at 14:46
0

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.

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.