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.
With the new release of CentOS 7, it’s interesting to look 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.
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 repo with the link as it was at the time of writing:
1 | [ jensd@cen ~]$ sudo yum install epel-release |
---|
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.
1 | [ jensd@cen ~]$ sudo yum groupinstall "X Window system" |
---|
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:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | [ jensd@cen ~]$ yum groupinfo "MATE Desktop" Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: be.mirror.eurid.eu * epel: be.mirror.eurid.eu * extras: be.mirror.eurid.eu * updates: be.mirror.eurid.eu 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:
1 | [ jensd@cen ~]$ sudo yum groupinstall "MATE Desktop" |
---|
Similar to installing MATE, we can install XFCE:
1 | [ jensd@cen ~]$ sudo yum groupinstall xfce |
---|
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:
1 | [ jensd@cen ~]$ 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:
GDM:
LightDM:
After login, you should get your familiar desktop and you can start working with the GUI:
MATE:
XFCE:
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:
1 2 3 | [ jensd@cen ~]$ 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' |
---|
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:
1 | [ jensd@cen ~]$ ls -l /etc/systemd/system/display-manager.service |
---|
When lightdm is the default one, you should get something like this:
1 2 | [ jensd@cen ~]$ ls -l /etc/systemd/system/display-manager.service lrwxrwxrwx. 1 root root 39 Jul 22 10:30 /etc/systemd/system/display-manager.service -> /usr/lib/systemd/system/lightdm.service |
---|
When gdm is the default one, it should look like this:
1 2 | [ jensd@cen ~]$ 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:
1 2 3 4 | [ jensd@cen ~]$ sudo systemctl disable gdm && sudo systemctl enable lightdm [sudo] password for jensd: rm '/etc/systemd/system/display-manager.service' ln -s '/usr/lib/systemd/system/lightdm.service' '/etc/systemd/system/display-manager.service' |
---|
To reload the graphical target and activate your changes:
1 | [ jensd@cen ~]$ 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.
Recommended Posts