Software & AppsOperating SystemLinux

How To Automatically Start LightDM After Disabling it in Ubuntu MATE

Ubuntu 19

In this article, we will guide you through the process of automatically starting the LightDM display manager after it has been disabled in Ubuntu MATE. This can be useful if you have accidentally disabled LightDM or if you have switched to another display manager and want to switch back.

Quick Answer

To automatically start LightDM after disabling it in Ubuntu MATE, you can check and recreate the symlink to the LightDM service, reconfigure LightDM using the dpkg-reconfigure command, or set the default target to graphical.target using the systemctl command.

What is LightDM?

LightDM is a cross-platform X display manager that aims to be fast, extensible, lightweight and with a beautiful user interface. It’s the default display manager for Ubuntu MATE, Xubuntu and Lubuntu.

Checking the Symlink

The first step is to check if the symlink to the LightDM service exists in the /etc/systemd/system directory. This can be done by running the following command in the terminal:

$ ll /etc/systemd/system/display-manager.service

This command lists the details of the display-manager.service file. If the symlink exists and is correct, it should point to /lib/systemd/system/lightdm.service.

Recreating the Symlink

If the symlink does not exist or is incorrect, you can recreate it by running the following command:

sudo ln -s /lib/systemd/system/lightdm.service /etc/systemd/system/display-manager.service

In this command, ln is the command to create a link, -s is the option to create a symbolic link, and the two paths are the source file and the destination file. This command creates a symbolic link to the LightDM service in the systemd directory, which ensures that LightDM is started automatically at boot.

Reconfiguring LightDM

If recreating the symlink does not solve the problem, you can try reconfiguring LightDM using the dpkg-reconfigure command. This command reconfigures packages after they have already been installed. Run the following command:

sudo dpkg-reconfigure lightdm

This command will prompt you to select the display manager. You can choose LightDM from the list. This should set LightDM as the default display manager and start it automatically at boot.

Setting the Default Target

If none of the above solutions work, you can try setting the default target to graphical.target using the systemctl command. This command is used to control the systemd system and service manager. Run the following command:

sudo systemctl set-default graphical.target

This command sets the default target to graphical.target, which ensures that the graphical target is started at boot. This allows LightDM to start automatically.

Conclusion

In this article, we have covered several methods to automatically start LightDM after disabling it in Ubuntu MATE. These methods include checking and recreating the symlink to the LightDM service, reconfiguring LightDM using the dpkg-reconfigure command, and setting the default target to graphical.target using the systemctl command.

Please note that these solutions are specific to Ubuntu MATE and may not work for other distributions or versions. If you encounter any problems, please refer to the Ubuntu MATE community for further assistance.

How can I disable LightDM in Ubuntu MATE?

To disable LightDM in Ubuntu MATE, you can use the command sudo systemctl disable lightdm. This will prevent LightDM from starting automatically at boot.

Can I switch to a different display manager in Ubuntu MATE?

Yes, you can switch to a different display manager in Ubuntu MATE. You can install a different display manager, such as GDM or SDDM, using the package manager. After installing the new display manager, you can use the sudo dpkg-reconfigure [display-manager] command to set it as the default display manager.

How can I check which display manager is currently running?

You can check which display manager is currently running by using the systemctl status [display-manager] command. For example, to check the status of LightDM, you can use systemctl status lightdm.

Can I switch back to LightDM if I have switched to a different display manager?

Yes, you can switch back to LightDM if you have switched to a different display manager. You can use the sudo dpkg-reconfigure lightdm command to select LightDM as the default display manager and start it automatically at boot.

Will these methods work for other Ubuntu flavors or distributions?

These methods are specifically tailored for Ubuntu MATE. While they may work for other Ubuntu flavors, distributions, or Debian-based systems, it is recommended to refer to the documentation or community support of the specific distribution for accurate instructions.

Leave a Comment

Your email address will not be published. Required fields are marked *