Installing Linux graphical user interfaces
The Linux GUI is the desktop environment that allows users to interact with system-level components via windows, icons, menus, or other visual elements. For Linux users who look beyond the CLI, the choice of a Linux distribution may start with the desktop environment. Choosing a desktop environment is ultimately a matter of taste. And for some, the ultimate GUI represents the very extension of their eyes and hands at work.
Among the multitude of Linux desktop environments, there are two that stand out. Let's take a brief look at them.
GNOME
With its current GNOME 3 (or GNOME Shell) iteration, this GUI platform is one of the most common Linux desktop environments. Nowadays, almost every major Linux distribution comes with GNOME as the default GUI. The Linux open source community also created GNOME Extensions, which overcomes some of the infamous shortcomings of GNOME and extends the desktop functionality to suit a variety of needs. When it's not the default desktop environment (such as with Linux Mint's Cinnamon desktop), GNOME can easily be installed and adapted.
At the time of writing, the latest distributions of Ubuntu (20.04 LTS) and CentOS (8) have GNOME as their default GUI.
Installing the GNOME desktop
Let's look at a real-world scenario requiring the installation of the latest GNOME desktop.
Ubuntu Server administrator:
Let's look at how to install it on Ubuntu:
- We start by making sure the current package lists and installed software packages are up to date. The following command updates the local package repository metadata for all configured sources:
sudo apt-get update -y
Now, we can upgrade with this:
sudo apt-get upgrade -y
- To browse all the available
ubuntu-desktop
packages, run this:apt-cache search ubuntu-desktop
- We choose to install the
ubuntu-desktop
package (the first option in the preceding list):sudo apt-get install ubuntu-desktop -y
- The command will take a few minutes to complete. When done, we need to check the status of the GNOME Display Manager (GDM) service and make sure it shows an
active (running)
status:systemctl status gdm
The expected response should be similar to Figure 1.22:
The GNOME 3 desktop is now installed and active on Ubuntu Server (Figure 1.23):
Next, let's take a look at the KDE desktop and a similar case study of enabling it on a Linux server platform.
KDE
Linux administrators usually look for a desktop environment that is relatively easy to use, lightweight, and efficient. KDE combines all of these attributes into a reliable and speedy desktop interface. Users familiar with Windows (up to version 7) would feel very much at home with KDE.
KDE has become a very robust desktop environment over the last few iterations, and versions of KDE have been released for almost every major Linux distribution.
If there's one ideal desktop for Linux administrators, KDE comes very close.
Installing the KDE desktop
In this section, we take a fresh CentOS 8 installation with the default GNOME desktop enabled and replace it with KDE.
CentOS 8 administrator:
When we click the cogwheel in the CentOS 8 login screen, we get a list of the currently installed display servers. The default is Standard, a GNOME implementation of the Wayland compositor protocol for Linux desktop management. Wayland also has a KDE implementation in its latest KDE Plasma iteration at the time of writing (Figure 1.24):
Let's add the KDE Plasma desktop to our CentOS 8 server:
- We log in to the CentOS 8 GUI and open the terminal, as suggested in the following illustration (Figure 1.25). Alternatively, we can simply SSH into the CentOS 8 server and run the commands in a similar CLI:
- The following commands have to be executed either as root or by a user account with sudoer privileges. Let's add our administrator user account (
packt
) to thesudoers
group. We need to switch to root to run the required command:su
- We get prompted for the root password (specified during the CentOS installation). See the Installing CentOS section for the related information. To add our
packt
user to thesudoers
group, run this:usermod -aG wheel packt
- When the command finishes, switch to our newly minted
sudoer
account:su - packt
- Verify that our
packt
account does indeed have sudoer privileges:sudo whoami
The command should prompt for the
packt
user password and then yieldroot
. - Next, proceed with the installation of the EPEL configuration files, enabling the related repositories:
sudo rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
- Follow that by enabling the CentOS
PowerTools
repository (needed by KDE). We usednf
(Dandified YUM), a package manager CLI for RPM-based Linux distributions:sudo dnf -y config-manager --enable PowerTools
- Finally, we install the KDE Plasma desktop package group. The next command downloads a relatively large number of files (approximately 400 MB), and it may take a while:
sudo dnf -y group install kde-desktop
When the
kde-desktop
installation completes successfully, the output ends with aComplete!
message prompt. - Now that the KDE Plasma desktop has been installed, we can either reload the GNOME Desktop Manager (
gdm
) to account for the changes or simply reboot:sudo systemctl reload gdm
- If we have a CentOS 8 VM environment, a reboot is recommended:
reboot
We are now able to log in to CentOS 8 using the KDE Plasma desktop. Clicking the cogwheel in the login window, we can see the Plasma desktop available (Figure 1.26):
- Once we're logged in, we can customize the KDE Plasma desktop to our preference (Figure 1.27):
In this section, we briefly looked at the Linux GUI and showcased the installation of the GNOME and KDE desktop environments on Ubuntu Server and CentOS, respectively. Next, we provide a quick guide on setting up a Linux workstation with some insight into various software packages and applications that could benefit our everyday work.