Which desktop environment you prefer is very personal. Each of them has its advantages and, unfortunately, also its disadvantages.
Recently, I started to like MATE since it’s lightweight and customizable in a way I personally like. Before, I was a fan of XFCE for similar reasons but somehow I got a little tired and irritated of it’s shortcomings.
This post covers how to install any of those on top of a minimal install since this means it can be installed on top of almost every type of installation in regards to package selection and dependencies.
Installation is quite simple since both Desktop environments are available in the EPEL repository. Basically, it comes down to installing the repo, installing the X-window system and then install the desktop environment of your choice. If you want to, you can install multiple environments to decide which one you like less/more.
This post has been completely reviewed and updated where needed on 08/2017 to make sure everything is still working and is correct.
Installing EPEL and the X window system:
Both XFCE and MATE can be found in the EPEL-repositories. So before we take any action, we need to install the repository. More information and a recent download-link can be found here: http://fedora.cu.be/epel/7/x86_64/repoview/epel-release.html
To install the EPEL repository and make the packages available:
[jensd@cen7 ~]$ sudo yum install epel-release -y ... Complete!
Before we start, we need to install the X-window system. These packages do not require EPEL. Of course it doesn’t bother if it’s already installed.
[jensd@cen7 ~]$ sudo yum groupinstall "X Window system" -y ... Complete!
Now you have a minimally installed X without any desktop environment so let’s change that.
Since we already installed the EPEL-repo, the only thing that’s left to do is a groupinstall for MATE.
To first have a look at what exactly will be installed, we can execute yum with the groupinfo-command:
[jensd@cen7 ~]$ yum groupinfo "MATE Desktop" Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.noction.com * elrepo: elrepo.org * epel: fedora-mirror01.rbc.ru * extras: mirrors.supportex.net * updates: mirrors.supportex.net Environment Group: MATE Desktop Environment-Id: mate-desktop-environment Description: MATE Desktop is based on GNOME 2 and provides a powerful graphical user interface for users who seek a simple easy to use traditional desktop interface. Mandatory Groups: +admin-tools +base-x +core +dial-up +fonts +guest-desktop-agents +hardware-support +input-methods +mate-desktop +multimedia +printing +standard Optional Groups: +3d-printing +libreoffice
When you are happy with the result, you can install the group as follows:
[jensd@cen7 ~]$ sudo yum groupinstall "MATE Desktop" -y ... Complete!
Similar to installing MATE, we can install XFCE. MATE and XFCE are alternatives to each other so most likely you will only use one of these in practice. To get familiar with both or just to try it out, there is no problem in installing them both.
[jensd@cen7 ~]$ sudo yum groupinstall xfce -y
Starting the graphical environment
After the installation of one or more desktop environments, you need to tell your system to start the graphical components (X window-system and display manager). Since CentOS version 7, this is done by systemd and it’s targets. In the past, this was done by switching runlevels. The target for a graphical system is conveniently called graphical.target and is similar to what runlevel 5 was in the past.
To switch to graphical target, do the following:
[jensd@cen7 ~]$ sudo systemctl isolate graphical.target
This should start all what is needed in order to present you with a GUI on the system. Depending on which display manager was installed (lightdm for MATE and gdm for XFCE), you are presented with one of the following login screens:
After login, you should get your familiar desktop and you can start working with the GUI:
Start the GUI on boot
After a reboot, the system will start with it’s default target (multi-user) so in order to make the change permanent and always start your system with a GUI, you can change the default target to the graphical one:
[jensd@cen7 ~]$ sudo systemctl set-default graphical.target rm '/etc/systemd/system/default.target' ln -s '/usr/lib/systemd/system/graphical.target' '/etc/systemd/system/default.target'
Change the default display manager
When you installed both XFCE and MATE on one system, you can choose which one of them to start for your desktop session on the login screen.
For GDM, this can be done here:
For LightDM, this can be done here:
Depending on which one of them you installed first, your default display manager (lightdm or gdm) is started with the graphical.target. This basically means that you will be presented with a different login screen and some other options.
To see which display manager is started with the grahpical target or the system, do the following:
[jensd@cen7 ~]$ ls -l /etc/systemd/system/display-manager.service
When lightdm is the default one, you should get something like this:
[jensd@cen7 ~]$ ls -l /etc/systemd/system/display-manager.service lrwxrwxrwx. 1 root root 39 Aug 1 09:38 /etc/systemd/system/display-manager.service -> /usr/lib/systemd/system/lightdm.service
When gdm is the default one, it should look like this:
[jensd@cen7 ~]$ ls -l /etc/systemd/system/display-manager.service lrwxrwxrwx. 1 root root 35 Jul 22 10:32 /etc/systemd/system/display-manager.service -> /usr/lib/systemd/system/gdm.service
To change from one to another, simply disable the current default and enable the one you would like to set as the new default. With systemd, you can do that with the following commands:
[jensd@cen7 ~]$ sudo systemctl disable lightdm && sudo systemctl enable gdm Removed symlink /etc/systemd/system/display-manager.service. Created symlink from /etc/systemd/system/display-manager.service to /usr/lib/systemd/system/gdm.service.
To reload the graphical target and activate your changes:
[jensd@cen7 ~]$ sudo systemctl isolate graphical.target
That should be all you need to get going with XFCE or MATE on a fresh CentOS 7 system. As with most of the CEntOS-related stuff, this should work on RHEL 7 as well.