Operating System

Table of Contents

Ubuntu

Overview

The operating system is a layer that stands between the hardware and applications that operate on them. On desktops, the operating system is used via a desktop environment that offers an intuitive interface to the computer’s functionality. Many developers also use the command line to interact with the computer. When used correctly, a well-designed operating system and desktop environment improve cognitive ergonomics, which means decreased mental clutter and decision-making fatigue, and enhanced productivity.

We recommend using Ubuntu desktop, an intuitive and easy-to-use Linux distribution. It’s an open-source, efficient, and knowledge-worker-friendly operating system, with access to the command line and a well-designed desktop environment. By default, Ubuntu 20.04 Desktop uses the GNOME desktop environment, which allows managing workspaces (virtual desktops) and windows, filesystem navigation, keyboard shortcuts, and searching for applications and files. Furthermore, installing and managing applications is convenient with a package manager. Ubuntu is also a common operating system for running servers, IoT devices, and cloud software. The rest of this section covers installing Ubuntu, configuring settings, and how to use it effectively.

Read more about Ubuntu from their website.

Installation

Installing a new operating system may feel intimidating or even scary. However, the creators of Ubuntu have made the installation process simple and require minimal technical knowledge. We can try Ubuntu and install it using a startup disk. We can create a startup disk to a USB drive by following the instructions on Create a bootable USB stick on Windows or MacOS. If you are already using Ubuntu and want to upgrade your distribution, you can use the tutorial for Ubuntu. Then, we can follow the instructions in the Install Ubuntu Desktop tutorial from the Boot from USB flash drive section.

Before installing Ubuntu, back up important files from your hard drives. The installation process will format the hard drive in which it installs Ubuntu, wiping all data on it.

We can boot Ubuntu from the startup disk (USB stick) by inserting it into the computer and restarting it. The startup disk should automatically start Ubuntu. If not, open the boot menu by pressing F12, F2, or ESC (depending on your machine) on system startup, and then select the startup disk as the disk for booting your operating system.

Once Ubuntu has booted from the startup disk, it opens an install menu. By following the instructions, the installation is straightforward. If you are unsure, you can follow a video walkthrough of the installation process by searching with the “Install Ubuntu 20.04” query on a search engine and following it on your smartphone or tablet while installing Ubuntu.

For example, Ubuntu 20.04 Full Installation Walkthrough by LearnLinuxTV is helpful.

Command Line

In the early days of computers, the only way to interact with the computer was the command line. The command line allows the users to interact with a computer using plain text commands instead of a graphical interface. Each command may accept arguments and options that determine its behavior. In this book, we will be writing commands as follows:

command [options] [arguments]

You can access the documentation of command with the --help option.

command --help

You can also read the reference manual of command with the man command.

man command

These days command line is useful for using a computer programmatically. For example, it is common to install applications using the command line or access remote servers. Also, most instructions and tutorials rely on the command line to interact with the computer instead of a graphical user interface.

In Ubuntu, we can access the command line using the Terminal application. We can open the terminal with the Ctrl + Alt + T shortcut and close it using Ctrl + D. We recommend reading The Linux command line for beginners for an introduction to the Linux command line. It explains how to use the filesystem from the command line, including creating, deleting, and moving files and directories, reading and manipulating text, joining commands with pipes |, and executing commands as superuser using sudo.

Mounting Disks on Startup

From Disks, select your hard disk and open the Additional partition options menu. If you have never used the hard disk or want to wipe it clean, you should format the disk to Ext4 filesystem format. Next, we should give the filesystem a human-readable name by setting the label parameter in Edit Filesystem to storage.

We can automount the hard disk on startup, by navigating to Edit Mount Options, and setting the Mount at system startup option on. We should also set the Indentify As parameter to LABEL=storage, which makes the disk is available at /mnt/storage/

Default User Directories

We can change the default directory locations such as Documents, Downloads, Music, Pictures, and Videos to a separate hard disk by creating symbolic links from the hard disk to the home directory (denote by tilde ~ in the command line).

First, remove the chosen default directory, such as Documents, from your home directory.

rm -r ~/Documents

Then, create the default directory to your hard disk mount path.

mkdir /mnt/storage/Documents

Finally, create a symbolic from the hard disk default directory location to your home directory.

ln -s /mnt/storage/Documents ~/

Repeat the process for the other default directories.

Using symbolic links, we do not have to change the default settings on ~/.config/.user-dirs.dirs configuration file.

Graphics Drivers

From Software & Updates > Additional Drivers, select suitable proprietary NVIDIA drivers for your graphics card.

Livepatch

From Software & Updates > Livepatch enable the Livepatch, which automatically installs updates that do not require a restart. Livepath requires an Ubuntu account.

Appearance

From Settings > Appearance, enable the Dark window colors. A dark theme reduces eye strain, especially in the evenings.

From Settings > Displays > Night Light enable the Night Light to decrease the screen’s adverse effects on sleep. You can set the schedule to manual and times according to your preferences. I have set my Night Light from 19.00 to 9.00.

Focus

To improve our focus on tasks when using a computer, we should reduce mental clutter by hiding unnecessary information from our screen. For example, we can use the full-screen mode by pressing F11, which maximizes a window and hides menus and other elements that could distract us.

Also, from Settings > Appearance, we should enable the Auto-hide Dock option, which hides to Dock when windows overlap with the Dock. Furthermore, let’s remove all favorites from the Dock since we will be using search to find applications and files instead of navigating menus. If you don’t remember the name of some application, you can always open the Show Applications menu in the Dock to see all of your applications.

Search and Keyboard Shortcuts

Using search and keyboard shortcuts, we can open applications and find files without wasting time navigating through menus.

From Settings > Keyboard Shortcuts, you can see all keyboard shortcuts. We recommend setting the shortcut for the search to Ctrl + Q.

Sound

From Settings > Sound, set your audio Output and Input devices correctly.

Online Accounts

From Settings > Online Accounts, you can connect your Google account to synchronize your Google calendar and drive to your desktop.

Installing Applications

We can install applications either using a package manager or installing them manually. A package manager is a software that automates installing, upgrading, configuring, and removing applications. Package managers make it easier to maintain up-to-date versions of applications. Ubuntu has two package managers; the newer Snapcraft and older Advanced Package Tool (APT).

When possible, we should use a package manager instead of manually installing applications. However, some applications are not available via a package manager, or the available application version is old. In these cases, we have to resort to manual installation.

Snapcraft

We will primarily use Snapcraft, the current default package manager for Ubuntu. We usually refer to Snapcraft simply as Snap. Snap manages and maintains packages automatically in the background. It has a security model of least privilege and containerizes its application. We can also publish our applications on Snapcraft. Also, we will use Snapcraft to install applications later in the book.

Snap has a command-line interface called snap. We can install applications using the install argument with superuser privileges.

sudo snap install <pkg>

Snap installs applications to ~/snap/ directory. We can list all installed applications using the list argument.

snap list

Due to Snap’s security model, we sometimes need to manage interfaces manually. For example, if we want to give Snap package rights to write files to a disk other than $HOME, we need to connect the package to removable-media.

sudo snap connect <pkg>:removable-media

The Snap documentation discusses all of its different features and commands.

Sometimes Snap’s security model does not give enough privileges for applications, which may hinder their capabilities. In that case, we may have to use APT or manual installation instead.

Advanced Package Tool

Advanced Package Tool (APT) is an older package manager for Ubuntu. It installs packages to the /usr/bin/ directory. It works with the apt command using the install argument and superuser privileges.

sudo apt install <pkg>

A common problem with APT is that the maintained package versions are often old, which we should prefer Snap or install the application manually.

Debian Packages

We also come across Debian package files in the format <pkg>.deb. Double-clicking them opens the Ubuntu software center, where we can click install to install the package.

Tarball

Application vendors usually distribute binary executables as Gzip compressed tarball file, <pkg>.tar.gz. After obtaining a tarball, we must extract it to the directory where we store manually installed applications. For example, you can create ~/software/ directory to store the applications. We can remove the tarball after extraction. You can perform these step either using the graphical interface or the following commands:

mkdir ~/software/<pkg>
tar -xzvf <pkg>.tar.gz --directory ~/software/<pkg>
rm <pkg>.tar.gz

Next, we must make the binaries findable to other applications and the command-line by extending the $PATH variable with the directory path that contains the package’s binary executables. By opening the ~/.bashrc configuration file and appending it with the export below, the operating system will extend the path automatically on system startup.

export PATH="$HOME/software/<pkg>/<path-to-binaries>:$PATH"

Now, you should be able to use the application. We should also notice that installing tarball does not require superuser privileges.

Previous
Next