
Mastering Linux Administration
By :

In this section, we will learn how to set up and use a Linux platform as our primary workstation for day-to-day work. We choose the Ubuntu Desktop LTS distribution, but any other modern-day Linux distribution would fit the bill. We aim to showcase some basic user operations and workflows for building and using a general-purpose Linux desktop.
As we did in the previous sections about installing a Linux distribution, we start with a brief installation guide of Ubuntu Desktop LTS.
If we plan to install Ubuntu Desktop on a VM, there are some preliminary steps required for provisioning the VM environment. Otherwise, we proceed directly with the Installation section.
The VM provisioning procedure is very similar to the procedure described in the Installing Ubuntu section, with Ubuntu Server LTS.
We have to pay attention to the minimum system requirements of our Linux distribution and size the VM accordingly. In our case, Ubuntu Desktop requires a dual-core CPU, at least 4 GB RAM, and a minimum hard disk capacity of 25 GB. Since we plan to install a handful of additional software packages, we set the hard disk capacity to 60 GB (at least).
Ubuntu Desktop installation is relatively straightforward and requires very few user actions:
a) Keyboard layout
b) Installation type (normal versus minimal)
c) Localization and time zone
d) User configuration (account credentials) (Figure 1.28):
Figure 1.28 – Setting up the hostname and user credentials
After the installation completes, the system reboot takes us to the Ubuntu Desktop login screen. At this point, we have completed the Ubuntu Desktop installation.
The default Ubuntu Desktop installation gets us a handful of software packages and productivity tools, enough for our general-purpose, day-to-day work. Here are just a few examples:
To view all currently installed applications, we click on the Ubuntu Software icon in the taskbar and then on the Installed tab. We could choose to remove (uninstall) any of these applications if we wanted to save disk space (Figure 1.29):
Figure 1.29 – Adding or removing Ubuntu applications
To browse or open any of these applications, click the grid icon (Show applications) at the bottom of the taskbar and then search for our application by beginning to type its name (Figure 1.30):
Figure 1.30 – Searching for installed applications
Next, let's take a look at how to install additional applications on our Ubuntu Linux workstation.
A power user may need additional software, tools, or utilities beyond the ones provisioned with the default Ubuntu Desktop installation. To add new applications, we click on the Ubuntu Software icon in the taskbar, followed by Explore, and then on the search icon. In the example illustrated in the following figure, we look for Visual Studio Code, a powerful code editor.
In general, when we decide on a particular application we want to install, we select the application, and this opens up a window for installing the related Ubuntu software package. Once we have completed the installation, the application shows up in the Installed section, where we can later uninstall it, if we choose to do so (Figure 1.31):
Figure 1.31 – Installing new applications
Different power users may look for a particular category of applications, tools, or utilities. Here are just a few of the most common types of productivity tools and applications used by the Linux user community. Some of them are readily available for download via the Ubuntu Software package management interface. Others can be downloaded from their related vendor websites.
Here are some commonly used applications for email and collaboration available for Ubuntu and other major Linux distributions:
Image editing tools abound for Linux. Here are just a few:
Most software development IDEs and tools are cross-platform these days. Ubuntu and many other Linux distros are not an exception in offering a vast array of such applications:
Virtualization and containerized workflows are in high demand now more than ever. All major hypervisors and container orchestration platforms are available for Linux as well:
Small-factor Linux PCs and appliances are often the ideal platforms for media servers. These are the most common media server applications generally available for almost any Linux distribution:
In our highly collaborative world, screen capture and recording tools always come in handy. Here are just a few:
Some of these applications may require a CLI for installation. Other applications are available either as a software package installer in the Ubuntu Software management user interface or via the APT package manager CLI (apt-get
).
As we have previously shown, installing an application via the Ubuntu Software management interface is straightforward. Next, we take a look at Ubuntu's APT package manager platform and CLI.
APT is the default package manager in Ubuntu, and it's a platform interface for installing and removing software packages. As a core system library of Ubuntu, APT is a collection of tools and CLI programs helping with package and repository management: apt
, apt-cache
, and apt-get
.
Important note
APT and DPKG: In essence, APT is a shim (frontend) to DPKG – the package manager of Debian Linux distributions. The apt
CLI invokes the dpkg
CLI under the hood.
Let's look at a few examples of using the apt-get
and dpkg
CLI tools for installing and managing software packages.
This scenario is from the perspective of a Java developer:
We assume an Ubuntu Desktop platform and OpenJDK version 14 for our case study.
Let's look at how to install OpenJDK (Java Development Kit):
sudo apt-get update -y
Next, proceed with the upgrade:
sudo apt-get upgrade -y
The preceding commands require superuser (sudo) privileges. We have to enter the password for our privileged (administrator) account. The -y
option runs the apt-get
command without requiring further user interaction.
sudo apt-get install -y openjdk-14-jre-headless
java --version
This command should yield the following response for our freshly installed OpenJDK (Figure 1.32):
Figure 1.32 – Testing the OpenJDK installation
dpkg --list openjdk-14-jre-headless
The preceding command yields a response similar to Figure 1.33:
Figure 1.33 – Querying the OpenJDK package using dpkg
Alternatively, we can use the apt-cache
CLI to verify the status of the OpenJDK package:
apt-cache policy openjdk-14-jre-headless
The output is similar to Figure 1.34:
Figure 1.34 – Querying the OpenJDK package using apt-cache
sudo apt-get remove openjdk-14-jre-headless
Or, you can use dpkg
:
sudo dpkg --remove openjdk-14-jre-headless
To find out more about the dpkg
CLI options, run dpkg --help
. To get more information on the apt
CLI tools, run man apt
.
This scenario is from the perspective of a home theater enthusiast:
To install Plex Media Server (PMS) on Ubuntu, follow these steps:
sudo apt-get update -y
Next, run the upgrade:
sudo apt-get upgrade -y
According to the vendor's website, there are specific prerequisites regarding enabling the related repository, which we don't detail here.
dpkg
CLI for installing PMS; use the following command:sudo dpkg -i plexmediaserver_1.19.4.2935-79e214ead_amd64.deb
plexmediaserver
installation with the following:dpkg --list plexmediaserver
The preceding command results in a response similar to Figure 1.35:
Figure 1.35 – Querying the PMS package using dpkg
plexmediaserver
package, run this:sudo dpkg --remove plexmediaserver
To find out more about the dpkg
CLI options, run dpkg --help
.
Change the font size
Change margin width
Change background colour