How change the default desktop manager in debian?

Solution 1:

I have found the solution by editing the file default-display-manager in the path /etc/X11/:

#vim /etc/X11/default-display-manager

For Gnome, edit as:

/usr/sbin/gdm

For KDE, edit as below:

/usr/lib/kde4/bin/kdm

Once updated, reboot the computer. You can find it updated the display manager.

You can also do it by executing the below command:

$ sudo dpkg-reconfigure gdm

Solution 2:

Run sudo update-alternatives --config x-window-manager

This uses Debian's built-in mechanisms to choose "alternatives" for default commands.

Solution 3:

The correct answer is likely:

sudo update-alternatives --config x-session-manager

assuming that "desktop manager" (which is not a meaningful term under X11) refers to the desktop environment (both KDE and GNOME are desktop environments, not window managers nor display managers).

Only when x-session-manager doesn't exist does Debian GNU/Linux fall back to x-window-manager or even x-terminal-emulator.

Historical note: What Debian GNU/Linux refers to as session manager is not actually a session manager in the X11 sense, but it's the term used by most modern GNU/Linux distributions to refer to a desktop environment, which typically includes a window manager, file manager, compositing manager, panels and other amenities.