How to get LightDM automatically started at startup after disabling it (in Ubuntu MATE)?
I am working with Ubuntu MATE (16.04) on a Raspberry Pi 3. I disabled LightDM with
sudo systemctl disable lightdm
On the next boot LightDM did not show up again and instead I just got a terminal asking me for my credentials, what was exactly what I wanted. When I am log in and type
startx
the grapical sessions shows up, so far so good.
Now I want to get LightDM back after boot and so I tried reenabling it with
sudo systemctl enable lightdm
The output is:
Synchronizing state of lightdm.service with SysV init with /lib/systemd/systemd-sysv-install...
Executing /lib/systemd/systemd-sysv-install enable lightdm
But when I now reboot my system, LightDM does not show up again. What went wrong?
In addition to that, when I just log in in terminal and type
sudo systemctl start lightdm
LightDM is started normally, i.e. the graphical session is started and the login screen is shown. How can I get LightDM started automatically after boot again?
Solution 1:
An enabled service should have a symlink to the unit file in /lib/systemd/system
in /etc/systemd/system
. The systemctl enable
command should create that symlink, but in this case it fails for some reason. The correct symlink is:
$ ll /etc/systemd/system/display-manager.service
lrwxrwxrwx 1 root root 35 okt 7 00:20 /etc/systemd/system/display-manager.service -> /lib/systemd/system/lightdm.service
You can fix it by recreating the symlink yourself:
sudo ln -s /lib/systemd/system/lightdm.service /etc/systemd/system/display-manager.service
Tested in Ubuntu MATE 16.04.
Solution 2:
Reconfiguring LightDM worked for me (xubuntu 18.04):
sudo dpkg-reconfigure lightdm
Solution 3:
You have to run sudo systemctl set-default graphical.target
because if multi-user.target
is set as default you can not use the GUI.