How to remove session entries from LightDM?

Solution 1:

The list of sessions is defined by the .desktop files in the folder /usr/share/xsessions

enter image description here

Lets remove GNOME Classic

In a terminal:

cd /usr/share/xsessions
sudo mv gnome-classic.desktop gnome-classic.desktop.backup

This renames the gnome-classic desktop file

Logout - the new list of sessions will look like:

enter image description here

Solution 2:

Your package maintainers will be proud of you if you do it as follows:

sudo mkdir /usr/share/xsessions/hidden
sudo dpkg-divert --rename \
      --divert /usr/share/xsessions/hidden/gnome-classic.desktop \
      --add /usr/share/xsessions/gnome-classic.desktop

What this does is to instruct the package manager to remember a new location for the file. This has several advantages over the other answers:

  • It guarantees a future package install/upgrade won't revert your change
  • It works with other display managers (lxdm for example lists .backup entries)
  • You can revert it easily if you change your mind with:

    sudo dpkg-divert --rename --remove /usr/share/xsessions/gnome-classic.desktop

Solution 3:

  • Open terminal with Ctrl-Alt-T
  • cd /usr/share/xsessions
  • ls will show you, for example:

    awesome.desktop  gnome-shell.desktop  ubuntu.desktop
    gnome.desktop    ubuntu-2d.desktop
  • Use sudo rm lubuntu.desktop (or whatever) to remove the ones you don't need any longer.

  • Logout and you should see the changes -- if not, reboot and you will see them.