Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Linux Administration

You're reading from   Mastering Linux Administration A comprehensive guide to installing, configuring, and maintaining Linux systems in the modern data center

Arrow left icon
Product type Paperback
Published in Jun 2021
Publisher Packt
ISBN-13 9781789954272
Length 772 pages
Edition 1st Edition
Tools
Arrow right icon
Authors (2):
Arrow left icon
Alexandru Calcatinge Alexandru Calcatinge
Author Profile Icon Alexandru Calcatinge
Alexandru Calcatinge
Julian Balog Julian Balog
Author Profile Icon Julian Balog
Julian Balog
Arrow right icon
View More author details
Toc

Table of Contents (20) Chapters Close

Preface 1. Section 1: Linux Basic Administration
2. Chapter 1: Installing Linux FREE CHAPTER 3. Chapter 2: The Linux Filesystem 4. Chapter 3: Linux Software Management 5. Chapter 4: Managing Users and Groups 6. Chapter 5: Working with Processes, Daemons, and Signals 7. Section 2: Advanced Linux Server Administration
8. Chapter 6: Working with Disks and Filesystems 9. Chapter 7: Networking with Linux 10. Chapter 8: Configuring Linux Servers 11. Chapter 9: Securing Linux 12. Chapter 10: Disaster Recovery, Diagnostics, and Troubleshooting 13. Section 3: Cloud Administration
14. Chapter 11: Working with Containers and Virtual Machines 15. Chapter 12: Cloud Computing Essentials 16. Chapter 13: Deploying to the Cloud with AWS and Azure 17. Chapter 14: Deploying Applications with Kubernetes 18. Chapter 15: Automating Workflows with Ansible 19. Other Books You May Enjoy

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:

I installed the latest version of Ubuntu Server LTS (20.04), and it looks like the GUI desktop is missing. How do I install the GNOME desktop on my Ubuntu Server?

Let's look at how to install it on Ubuntu:

  1. 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
  2. To browse all the available ubuntu-desktop packages, run this:
    apt-cache search ubuntu-desktop
  3. We choose to install the ubuntu-desktop package (the first option in the preceding list):
    sudo apt-get install ubuntu-desktop -y
  4. 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:

Figure 1.22 – Checking the status of GDM

Figure 1.22 – Checking the status of GDM

The GNOME 3 desktop is now installed and active on Ubuntu Server (Figure 1.23):

Figure 1.23 – The Ubuntu GNOME desktop login screen

Figure 1.23 – The Ubuntu GNOME desktop login screen

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:

I installed the latest version of CentOS 8, choosing the "Server with GUI" option during setup. It looks like the CentOS 8 GUI runs the GNOME desktop. How do I install the KDE desktop on my CentOS 8 server?

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):

Figure 1.24 – The default CentOS 8 GNOME login screen

Figure 1.24 – The default CentOS 8 GNOME login screen

Let's add the KDE Plasma desktop to our CentOS 8 server:

  1. 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:
    Figure 1.25 – Opening the terminal in CentOS

    Figure 1.25 – Opening the terminal in CentOS

  2. 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 the sudoers group. We need to switch to root to run the required command:
    su
  3. 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 the sudoers group, run this:
    usermod -aG wheel packt
  4. When the command finishes, switch to our newly minted sudoer account:
    su - packt
  5. Verify that our packt account does indeed have sudoer privileges:
    sudo whoami

    The command should prompt for the packt user password and then yield root.

  6. 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
  7. Follow that by enabling the CentOS PowerTools repository (needed by KDE). We use dnf (Dandified YUM), a package manager CLI for RPM-based Linux distributions:
    sudo dnf -y config-manager --enable PowerTools
  8. 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 a Complete! message prompt.

  9. 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
  10. 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):

    Figure 1.26 – Choosing the KDE Plasma desktop

    Figure 1.26 – Choosing the KDE Plasma desktop

  11. Once we're logged in, we can customize the KDE Plasma desktop to our preference (Figure 1.27):
Figure 1.27 – Customizing the KDE Plasma desktop

Figure 1.27 – Customizing the KDE Plasma desktop

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.

You have been reading a chapter from
Mastering Linux Administration
Published in: Jun 2021
Publisher: Packt
ISBN-13: 9781789954272
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime