CentOS 7: Remove Gnome From GDM Options

Home » CentOS » CentOS 7: Remove Gnome From GDM Options
CentOS 6 Comments

When you click on the gear icon on the GDM login screen, it provides a list of the available desktop environments so you can pick between them.

Since I exclusively use Mate on this computer, how can I remove the other options from that menu? Earlier today when I logged in the machine decided on its own that what I really wanted was Gnome Classic, so I had to log out to change it back to Mate, then log in again.

I would like to tell it to use Mate exclusively, with no other options to select by mistake.

6 thoughts on - CentOS 7: Remove Gnome From GDM Options

  • The best way to achieve your end is to delete the unused desktop installations from your machine. Software not installed is the best defence against attack directed at that software.


    _
    °v°
    /(_)\
    ^ ^ Mark LaPierre Registered Linux user No #267004
    https://linuxcounter.net/
    ****

  • I agree, but I don’t know what packages I can remove without blowing up something that I do want to be able to use. I wouldn’t mind removing Gnome and Gnome Classic, but I still want to be able to use evince and Gnome Terminal, for example.

  • Well, I haven’t tried it, but I believe the available session types are stored in desktop files in /usr/share/xsessions. You could move the ones you don’t want to a different location and see how the picker in GDM behaves… a bit like swatting a fly with a hammer, but as long as you can move them back it should be OK. I found mention of this in an Ubuntu-oriented forum somewhere, don’t recall where.

    Here’s what that directory on my C7 box, with MATE installed, looks like:

    I would try moving all of the .desktop files elsewhere temporarily and see if that changes the available desktop list.

    YMMV!

  • That works perfectly. I moved all of the gnome* files out of that directory and restarted gdm. The gear icon that appeared beside the sign in button is now gone completely, I guess because there is only one choice available now. And when I log in it takes me straight to Mate, even when I log in as a brand new user that hasn’t ever logged in before.

    So, problem solved. That’s the solution.

  • You could find out what packages the .desktop files belong to (when they are back in their original location):

    rpm -qf /usr/share/xsessions/gnome*

    Then remove the corresponding package(s) using yum. Obviously, check for the removal of packages which are important to you before you commmit.

  • Someone give that man a cigar!

    yum remove gnome-classic-session gnome-session-xsession

    That removes the gnome-classic.desktop, gnome-custom-session.desktop and gnome.desktop files from the /usr/share/xsessions directory without affecting any gnome or gtk programs. All that’s left in that directory now is mate.desktop, no choices show up on the gdm login screen, mate is the default and only available desktop, and that’s the result that I wanted.

    Thanks!