I am trying to change the default display-manager on a Ubuntu 18.04.1 in a non-interactive way to do this in a script.
Everything works as expected when using
dpkg-reconfigure gdm3
dpkg-reconfigure lightdm
I tried setting shared/default-x-display-manager
to a valid display-manager and run dpkg-reconfigure
, but that did not do the trick.
First check which display-manager is set.
root@host:~# cat /etc/X11/default-display-manager/usr/sbin/gdm3root@host:~# cat /etc/X11/default-display-manager/usr/sbin/gdm3
Then set shared/default-x-display-manager
to lightdm
and validate it.
root@host:~# echo set shared/default-x-display-manager lightdm | debconf-communicate 0 value setroot@host:~# echo get shared/default-x-display-manager | debconf-communicate 0 lightdm
Finally run dpkg-reconfigure --frontend noninteractive lightdm
and check which display-manager is active. Which unfortunately is gdm3
again.
root@host:~# dpkg-reconfigure --frontend noninteractive lightdmroot@host:~# echo get shared/default-x-display-manager | debconf-communicate 0 gdm3root@host:~# cat /etc/X11/default-display-manager /usr/sbin/gdm3root@host:~# ll /etc/systemd/system/display-manager.servicelrwxrwxrwx 1 root root 32 Jan 31 20:03 /etc/systemd/system/display-manager.service -> /lib/systemd/system/gdm3.service
The same happens if I want to switch from lightdm
to gdm3
.
Anything I am missing here or is this not intended to work at all?
I have seen in the scripts for gdm3
that if there is a /etc/X11/default-display-manager.debconf-update file, the systemd
unit and the /etc/X11/default-display-manager are updated accordingly.
Unfortunately this does not work for lightdm
as this one uses some other method(s) to do the work.
Hope someone else can shed some light on this and knows a convenient way to configure the display-manager non-interactively.