32,39 €
Gain access to all the information you need to get started with this exciting, cutting-edge operating system
Linux kernel development is perhaps the world's largest collaborative project to date. With Fedora 31 Essentials, you'll be given easily accessible information to install, use, and administer the Fedora 31 distribution.
The book begins with a concise history of the Linux operating system and the Fedora project. You'll learn how to install Fedora 31 using the dual boot configuration so that it can coexist with Windows on the same drive. After installing Fedora 31, you'll learn how to use GNOME 3 — the desktop environment included with Fedora 31 that helps you navigate through the distribution. As you progress, you'll explore the Cockpit web interface that enables you to perform tasks via a web browser instead of using the command-line. You'll also learn how to manage user access and roles on the Fedora 31 system by adding, removing, and managing users and groups. While learning advanced topics, you'll discover how to use Fedora Modularity to list, install, and remove the software packages that make up a functioning Fedora 31 system.
By the end of the book, you'll have all the information you need to confidently start working with Fedora 31.
Fedora 31 Essentials is the ideal book if you're looking for essential information on getting started using the Fedora 31 distribution. Whether you are a developer, a system administrator, or a tech lover with no previous Linux administration background, you'll be able to start your adventure with this book.
Sie lesen das E-Book in den Legimi-Apps auf:
Seitenzahl: 331
Veröffentlichungsjahr: 2020
Fedora 31 Essentials
Fedora 31 Essentials
ISBN-13: 978-1-951442-11-8
© 2020 Neil Smyth / Payload Media, Inc. All Rights Reserved.
This book is provided for personal use only. Unauthorized use, reproduction and/or distribution strictly prohibited. All rights reserved.
The content of this book is provided for informational purposes only. Neither the publisher nor the author offers any warranties or representation, express or implied, with regard to the accuracy of information contained in this book, nor do they accept any liability for any loss or damage arising from any errors or omissions.
This book contains trademarked terms that are used solely for editorial purposes and to the benefit of the respective trademark owner. The terms used within this book are not intended as infringement of any trademarks.
Rev: 2.0
Table of Contents
1. Introduction
1.1 Superuser Conventions
1.2 Feedback
1.3 Errata
2. A Brief History of Linux
2.1 What exactly is Linux?
2.2 UNIX Origins
2.3 Who Created Linux?
2.4 The Early Days of Red Hat
2.5 Red Hat Support
2.6 Open Source
2.7 The Fedora Project
2.8 CentOS - The Free Alternative
2.9 Summary
3. Installing Fedora 31 on a Clean Disk Drive
3.1 Fedora Installation Options
3.2 Choosing an Installation Option
3.3 Obtaining the Fedora 31 Installation Media
3.4 Writing the ISO Installation Image to a USB Drive
3.4.1 Linux
3.4.2 macOS
3.4.3 Windows
3.5 Installing Fedora 31
3.6 Partitioning a Disk for Fedora 31
3.7 Adding a User and Root Access
3.8 The Physical Installation
3.9 Final Configuration Steps
3.10 Installing Updates
3.11 Displaying Boot Messages
3.12 Summary
4. Dual Booting Fedora 31 with Windows
4.1 Partition Resizing
4.2 Changing the Default Boot Option
4.3 Accessing the Windows Partition from Fedora 31
4.4 Summary
5. Allocating Windows Disk Partitions to Fedora 31
5.1 Unmounting the Windows Partition
5.2 Deleting the Windows Partitions from the Disk
5.3 Formatting the Unallocated Disk Partition
5.4 Mounting the New Partition
5.5 Editing the Boot Menu
5.6 Summary
6. A Guided Tour of the GNOME 3 Desktop
6.1 Installing the GNOME Desktop
6.2 An Overview of the GNOME 3 Desktop
6.3 Launching Activities
6.4 Managing Windows
6.5 Using Workspaces
6.6 Calendar and Notifications
6.7 Desktop Settings
6.8 Summary
7. An Overview of the Fedora 31 Cockpit Web Interface
7.1 An Overview of Cockpit
7.2 Installing and Enabling Cockpit
7.3 Accessing Cockpit
7.4 System
7.5 Logs
7.6 Storage
7.7 Networking
7.8 Accounts
7.9 Services
7.10 Applications
7.11 Virtual Machines
7.12 Podman Containers
7.13 Diagnostic Reports
7.14 Kernel Dump
7.15 SELinux
7.16 Software Updates
7.17 Terminal
7.18 Connecting to Multiple Servers
7.19 Enabling Stored Metrics
7.20 Summary
8. Using the Bash Shell on Fedora 31
8.1 What is a Shell?
8.2 Gaining Access to the Shell
8.3 Entering Commands at the Prompt
8.4 Getting Information about a Command
8.5 Bash Command-line Editing
8.6 Working with the Shell History
8.7 Filename Shorthand
8.8 Filename and Path Completion
8.9 Input and Output Redirection
8.10 Working with Pipes in the Bash Shell
8.11 Configuring Aliases
8.12 Environment Variables
8.13 Writing Shell Scripts
8.14 Summary
9. Managing Fedora 31 Users and Groups
9.1 User Management from the Command-line
9.2 User Management with Cockpit
9.3 Summary
10. Understanding Fedora 31 Software Installation and Management
10.1 Repositories
10.2 The fedora Repository
10.3 The fedora-modular Repository
10.4 Summary
11. Configuring Fedora 31 systemd Units
11.1 Understanding Fedora 31 systemd Targets
11.2 Understanding Fedora 31 systemd Services
11.3 Fedora 31 systemd Target Descriptions
11.4 Identifying and Configuring the Default Target
11.5 Understanding systemd Units and Unit Types
11.6 Dynamically Changing the Current Target
11.7 Enabling, Disabling and Masking systemd Units
11.8 Working with systemd Units in Cockpit
11.9 Summary
12. Fedora 31 Network Management
12.1 An Introduction to NetworkManager
12.2 Installing and Enabling NetworkManager
12.3 Basic nmcli Commands
12.4 Working with Connection Profiles
12.5 Interactive Editing
12.6 Configuring NetworkManager Permissions
12.7 Summary
13. Basic Fedora 31 Firewall Configuration with firewalld
13.1 An Introduction to firewalld
13.1.1 Zones
13.1.2 Interfaces
13.1.3 Services
13.1.4 Ports
13.2 Checking firewalld Status
13.3 Configuring Firewall Rules with firewall-cmd
13.3.1 Identifying and Changing the Default Zone
13.3.2 Displaying Zone Information
13.3.3 Adding and Removing Zone Services
13.3.4 Working with Port-based Rules
13.3.5 Creating a New Zone
13.3.6 Changing Zone/Interface Assignments
13.3.7 Masquerading
13.3.8 Adding ICMP Rules
13.3.9 Implementing Port Forwarding
13.4 Managing firewalld from the Cockpit Interface
13.5 Managing firewalld using firewall-config
13.6 Summary
14. Configuring SSH Key-based Authentication on Fedora 31
14.1 An Overview of Secure Shell (SSH)
14.2 SSH Key-based Authentication
14.3 Setting Up Key-based Authentication
14.4 Installing and Starting the SSH Service
14.5 SSH Key-based Authentication from Linux and macOS Clients
14.6 Managing Multiple Keys
14.7 SSH Key-based Authentication from Windows 10 Clients
14.8 SSH Key-based Authentication using PuTTY
14.9 Generating a Private Key with PuTTYgen
14.10 Installing the Public Key for a Google Cloud Instance
14.11 Summary
15. Fedora 31 Remote Desktop Access with VNC
15.1 Secure and Insecure Remote Desktop Access
15.2 Installing the GNOME Desktop Environment
15.3 Installing VNC on Fedora 31
15.4 Configuring the VNC Server
15.5 Connecting to a VNC Server
15.6 Establishing a Secure Remote Desktop Session
15.7 Establishing a Secure Tunnel on Windows using PuTTY
15.8 Shutting Down a Desktop Session
15.9 Troubleshooting a VNC Connection
15.10 Summary
16. Displaying Fedora 31 Applications Remotely (X11 Forwarding)
16.1 Requirements for Remotely Displaying Fedora 31 Applications
16.2 Remotely Displaying a Fedora 31 Application
16.3 Trusted X11 Forwarding
16.4 Compressed X11 Forwarding
16.5 Displaying Remote Fedora 31 Apps on Windows
16.6 Summary
17. Using NFS to Share Fedora 31 Files with Remote Systems
17.1 Ensuring NFS Services are running on Fedora 31
17.2 Configuring the Fedora 31 Firewall to Allow NFS Traffic
17.3 Specifying the Folders to be Shared
17.4 Accessing Shared Fedora 31 Folders
17.5 Mounting an NFS Filesystem on System Startup
17.6 Unmounting an NFS Mount Point
17.7 Accessing NFS Filesystems in Cockpit
17.8 Summary
18. Sharing Files between Fedora 31 and Windows Systems with Samba
18.1 Samba and Samba Client
18.2 Installing Samba on a Fedora 31 System
18.3 Configuring the Fedora 31 Firewall to Enable Samba
18.4 Configuring the smb.conf File
18.4.1 Configuring the [global] Section
18.4.2 Configuring a Shared Resource
18.4.3 Removing Unnecessary Shares
18.5 Configuring SELinux for Samba
18.6 Creating a Samba User
18.7 Testing the smb.conf File
18.8 Starting the Samba and NetBIOS Name Services
18.9 Accessing Samba Shares
18.10 Accessing Windows Shares from Fedora 31
18.11 Summary
19. An Overview of Virtualization Techniques
19.1 Guest Operating System Virtualization
19.2 Hypervisor Virtualization
19.2.1 Paravirtualization
19.2.2 Full Virtualization
19.2.3 Hardware Virtualization
19.3 Virtual Machine Networking
19.4 Summary
20. Installing KVM Virtualization on Fedora 31
20.1 An Overview of KVM
20.2 KVM Hardware Requirements
20.3 Preparing Fedora 31 for KVM Virtualization
20.4 Verifying the KVM Installation
20.5 Summary
21. Creating KVM Virtual Machines using Cockpit and virt-manager
21.1 Installing the Cockpit Virtual Machines Module
21.2 Creating a Virtual Machine in Cockpit
21.3 Starting the Installation
21.4 Working with Storage Volumes and Storage Pools
21.5 Creating a Virtual Machine using virt-manager
21.6 Starting the Virtual Machine Manager
21.7 Configuring the KVM Virtual System
21.8 Starting the KVM Virtual Machine
21.9 Summary
22. Creating KVM Virtual Machines with virt-install and virsh
22.1 Running virt-install to build a KVM Guest System
22.2 An Example Fedora 31 virt-install Command
22.3 Starting and Stopping a Virtual Machine from the Command-Line
22.4 Creating a Virtual Machine from a Configuration File
22.5 Summary
23. Creating a Fedora 31 KVM Networked Bridge Interface
23.1 Getting the Current Network Settings
23.2 Creating a Network Bridge from the Command-Line
23.3 Declaring the KVM Bridged Network
23.4 Using a Bridge Network in a Virtual Machine
23.5 Creating a Bridge Network using nm-connection-editor
23.6 Summary
24. Managing KVM using the virsh Command-Line Tool
24.1 The virsh Shell and Command-Line
24.2 Listing Guest System Status
24.3 Starting a Guest System
24.4 Shutting Down a Guest System
24.5 Suspending and Resuming a Guest System
24.6 Saving and Restoring Guest Systems
24.7 Rebooting a Guest System
24.8 Configuring the Memory Assigned to a Guest OS
24.9 Summary
25. An Introduction to Linux Containers
25.1 Linux Containers and Kernel Sharing
25.2 Container Uses and Advantages
25.3 Fedora 31 Container Tools
25.4 The Docker Registry
25.5 Container Networking
25.6 Summary
26. Working with Containers on Fedora 31
26.1 Installing the Container Tools
26.2 Pulling a Container Image
26.3 Running the Image in a Container
26.4 Managing a Container
26.5 Saving a Container to an Image
26.6 Removing an Image from Local Storage
26.7 Removing Containers
26.8 Building a Container with Buildah
26.9 Building a Container from Scratch
26.10 Container Bridge Networking
26.11 Managing Containers in Cockpit
26.12 Summary
27. Setting Up a Fedora 31 Web Server
27.1 Requirements for Configuring a Fedora 31 Web Server
27.2 Installing the Apache Web Server Packages
27.3 Configuring the Firewall
27.4 Port Forwarding
27.5 Starting the Apache Web Server
27.6 Testing the Web Server
27.7 Configuring the Apache Web Server for Your Domain
27.8 The Basics of a Secure Web Site
27.9 Configuring Apache for HTTPS
27.10 Obtaining an SSL Certificate
27.11 Summary
28. Configuring a Fedora 31 Postfix Email Server
28.1 The structure of the Email System
28.1.1 Mail User Agent
28.1.2 Mail Transfer Agent
28.1.3 Mail Delivery Agent
28.1.4 SMTP
28.1.5 SMTP Relay
28.2 Configuring a Fedora 31 Email Server
28.3 Postfix Pre-Installation Steps
28.4 Firewall/Router Configuration
28.5 Installing Postfix on Fedora 31
28.6 Configuring Postfix
28.7 Configuring DNS MX Records
28.8 Starting Postfix on a Fedora 31 System
28.9 Testing Postfix
28.10 Sending Mail via an SMTP Relay Server
28.11 Summary
29. Adding a New Disk Drive to a Fedora 31 System
29.1 Mounted File Systems or Logical Volumes
29.2 Finding the New Hard Drive
29.3 Creating Linux Partitions
29.4 Creating a File System on a Fedora 31 Disk Partition
29.5 An Overview of Journaled File Systems
29.6 Mounting a File System
29.7 Configuring Fedora 31 to Automatically Mount a File System
29.8 Adding a Disk Using Cockpit
29.9 Summary
30. Adding a New Disk to a Fedora 31 Volume Group and Logical Volume
30.1 An Overview of Logical Volume Management (LVM)
30.1.1 Volume Group (VG)
30.1.2 Physical Volume (PV)
30.1.3 Logical Volume (LV)
30.1.4 Physical Extent (PE)
30.1.5 Logical Extent (LE)
30.2 Getting Information about Logical Volumes
30.3 Adding Additional Space to a Volume Group from the Command-Line
30.4 Adding Additional Space to a Volume Group using Cockpit
30.5 Summary
31. Adding and Managing Fedora 31 Swap Space
31.1 What is Swap Space?
31.2 Recommended Swap Space for Fedora 31
31.3 Identifying Current Swap Space Usage
31.4 Adding a Swap File to a Fedora 31 System
31.5 Adding Swap as a Partition
31.6 Adding Space to a Fedora 31 LVM Swap Volume
31.7 Adding Swap Space to the Volume Group
31.8 Summary
Index
1. Introduction
Backed by Red Hat, Inc. and developed by the Fedora Project, the Fedora Linux distribution is an open source operating system intended to field test the latest Linux developments and technologies before they are adopted by the Red Hat Enterprise Linux distribution (typically shortened to RHEL and pronounced rell). This makes Fedora an exciting, cutting-edge operating system that is ideal for gaining experience with the latest Linux developments and features before they appear in enterprise and mission critical environments. Fedora 31 Essentials is designed to provide detailed information on the installation, use and administration of the Fedora 31 distribution. For beginners, the book covers topics such as operating system installation, the basics of the GNOME desktop environment, configuring email and web servers and installing packages and system updates using App Streams. Additional installation topics such as dual booting with Microsoft Windows are also covered, together with all important security topics such as configuring a firewall and user and group administration.
For the experienced user, topics such as remote desktop access, the Cockpit web interface, logical volume management (LVM), disk partitioning, swap management, KVM virtualization, Secure Shell (SSH), Linux Containers and file sharing using both Samba and NFS are covered in detail to provide a thorough overview of this enterprise class operating system.
1.1 Superuser Conventions
Fedora, in common with Linux in general, has two types of user account, one being a standard user account with restricted access to many of the administrative files and features of the operating system, and the other a superuser (root) account with elevated privileges. Typically, a user can gain root access either by logging in as the root user, or using the su - command and entering the root password. In the following example, a user is gaining root access via the su - command:
[neil@demo-server ~]$ su -
Password:
[root@demo-server ~]#
Note that the command prompt for a regular user ends with a $ sign while the root user has a # character. When working with the command-line, this is a useful indication as to whether or not you are currently issuing commands as the root user.
If the su - command fails, the root account on the system has most likely been disabled for security reasons. In this case, the sudo command can be used instead as outlined below.
Alternatively, a single command requiring root privileges may be executed by a non-root user via the sudo command. Consider the following attempt to update the operating system with the latest patches and packages:
[neil@demo-server ~]$ dnf update
Not root, Subscription Management repositories not updated
Error: This command has to be run under the root user.
Optionally, user accounts may be configured so that they have access to root level privileges. Instead of using the su - command to first gain root access, user accounts with administration privileges are able to run otherwise restricted commands using sudo.
[neil@demo-server]$ sudo dnf update
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
[sudo] password for neil:
Updating Subscription Management repositories.
.
.
To perform multiple commands without repeatedly using the sudo command, a command prompt with persistent super-user privileges may be accessed as follows:
[neil@demo-server]$ sudo su -
[neil@demo-server]#
The reason for raising this issue so early in the book is that many of the command-line examples outlined in this book will require root privileges. Rather than repetitively preface every command-line example with directions to run the command as root, the command prompt at the start of the line will be used to indicate whether or not the command needs to be performed as root. If the command can be run as a regular user, the command will be prefixed with a $ command prompt as follows:
$ date
If, on the other hand, the command requires root privileges, the command will be preceded by a # command prompt:
# dnf install openssh
1.2 Feedback
We want you to be satisfied with your purchase of this book. If you find any errors in the book, or have any comments, questions or concerns please contact us at [email protected].
1.3 Errata
While we make every effort to ensure the accuracy of the content of this book, it is inevitable that a book covering a subject area of this size and complexity may include some errors and oversights. Any known issues with the book will be outlined, together with solutions, at the following URL:
https://www.ebookfrenzy.com/errata/fedora31.html
In the event that you find an error not listed in the errata, please let us know by emailing our support team at [email protected].
2. A Brief History of Linux
Fedora is one of a number of variants (also referred to as distributions) of the Linux operating system. It is community developed by the Fedora Project and sponsored by a U.S. company named Red Hat, Inc., based in Raleigh, North Carolina. The company was founded in the mid-1990s through the merger of two companies owned at the time by Marc Ewing and Bob Young. The origins of Linux, however, go back even further. This chapter will outline the history of both the Linux operating system and Red Hat, Inc. before explaining how Fedora fits into this picture.
2.1 What exactly is Linux?
Linux is an operating system in much the same way that Windows is an operating system (and there any similarities between Linux and Windows end). The term operating system is used to describe the software that acts as a layer between the hardware in a computer and the applications that we all run on a daily basis. When programmers write applications, they interface with the operating system to perform such tasks as writing files to the hard disk drive and displaying information on the screen. Without an operating system, every programmer would have to write code to directly access the hardware of the system. In addition, the programmer would have to be able to support every single piece of hardware ever created to be sure the application would work on every possible hardware configuration. Because the operating system handles all of this hardware complexity, application development becomes a much easier task. Linux is just one of a number of different operating systems available today.
2.2 UNIX Origins
To understand the history of Linux, we first have to go back to AT&T Bell Laboratories in the late 1960s. During this time AT&T had discontinued involvement in the development of a new operating system named Multics. Two AT&T engineers, Ken Thompson and Dennis Ritchie, decided to take what they had learned from the Multics project and create a new operating system named UNIX which quickly gained popularity and wide adoption both with corporations and academic institutions.
A variety of proprietary UNIX implementations eventually came to market including those created by IBM (AIX), Hewlett-Packard (HP-UX) and Sun Microsystems (SunOS and Solaris). In addition, a UNIX-like operating system named MINIX was created by Andrew S. Tanenbaum designed for educational use with source code access provided to universities.
2.3 Who Created Linux?
The origins of Linux can be traced back to the work and philosophies of two people. At the heart of the Linux operating system is something called the kernel. This is the core set of features necessary for the operating system to function. The kernel manages the system’s resources and handles communication between the hardware and the applications. The Linux kernel was developed by Linus Torvalds who, taking a dislike to MS-DOS, and impatient for the availability of MINIX for the new Intel 80386 microprocessor, decided to write his own UNIX-like kernel. When he had finished the first version of the kernel, he released it under an open source license that enabled anyone to download the source code and freely use and modify it without having to pay Linus any money.
Around the same time, Richard Stallman at the Free Software Foundation, a strong advocate of free and open source software, was working on an open source operating system of his own. Rather than focusing initially on the kernel, however, Stallman decided to begin by developing open source versions of all the UNIX tools, utilities and compilers necessary to use and maintain an operating system. By the time he had finished developing this infrastructure it seemed like the obvious solution was to combine his work with the kernel Linus had written to create a full operating system. This combination became known as GNU/Linux. Purists insist that Linux always be referred to as GNU/Linux (in fact, at one time, Richard Stallman refused to give press interviews to any publication which failed to refer to Linux as GNU/Linux). This is not unreasonable given that the GNU tools developed by the Free Software Foundation make up a significant and vital part of GNU/Linux. Unfortunately, most people and publications simply refer to Linux as Linux and this will probably always continue to be the case.
2.4 The Early Days of Red Hat
In 1993 Bob Young created a company named ACC Corporation which, according to Young, he ran from his “wife’s sewing closet”. The name ACC was intended to represent a catalog business but was also an abbreviation of a small business his wife ran called “Antiques and Collectibles of Connecticut”. Among the items sold through the ACC catalog business were Linux CDs and related open source software.
Around the same time, Marc Ewing had created his own Linux distribution company which he named Red Hat Linux (after his propensity to wear a red baseball cap while at Carnegie Mellon University).
In 1995, ACC acquired Red Hat, adopted the name Red Hat, Inc. and experienced rapid and significant growth. Bob Young stepped down as CEO shortly after the company went public in August of 1999 and has since pursued a number of business and philanthropic efforts including a print-on-demand book publishing company named Lulu and ownership of two Canadian professional sports teams. In 2018, IBM announced plans to acquire Red Hat, Inc. in a deal valued at $34 billion.
2.5 Red Hat Support
Early releases of Red Hat Linux were shipped to customers on floppy disks and CDs (this, of course, predated the widespread availability of broadband internet connections). When users encountered problems with the software they were only able to contact Red Hat by email. In fact, Bob Young often jokes that this was effective in limiting support requests since, by the time a customer realized they needed help, their computer was usually inoperative and therefore unavailable to be used to send an email message seeking assistance from Red Hat’s support team. In later years Red Hat provided better levels of support tied to paid subscriptions and now provides a variety of support levels ranging from “self help” (no support) up to premium support.
2.6 Open Source
Red Hat Enterprise Linux 8 is the current commercial offering from Red Hat and is primarily targeted at corporate, mission critical installations. It is also the cornerstone of an expanding ecosystem of products and services offered by Red Hat. RHEL is an open source product in that you can download the source code free of charge and build the software yourself if you wish to do so (a task not to be undertaken lightly). If, however, you wish to download a pre-built, ready to install binary version of the software (either with or without support), you have to pay for it.
2.7 The Fedora Project
Red Hat also sponsors the Fedora Project, the goal of which is to provide access to a free Linux operating system (in both source and binary distributions) in the form of Fedora Linux. Fedora Linux also serves as a proving ground for many of the new features that are eventually adopted into the Red Hat Enterprise Linux operating system family. Red Hat Enterprise Linux 8.0, for example, was based to a large extent on Fedora 29.
2.8 CentOS - The Free Alternative
For users unable to afford a Red Hat Enterprise Linux subscription, another option is provided in the form of the CentOS operating system. The CentOS project, originally a community driven effort but now a collaboration with Red Hat, takes the Red Hat Enterprise Linux source code, removes the Red Hat branding and subscription requirements, compiles it and provides the distribution for download. Of course, while CentOS provides an operating system that is identical to RHEL in many ways, it does not include access to Red Hat technical support.
2.9 Summary
The origins of the Linux operating system can be traced back to the work of Linus Torvalds and Richard Stallman in the form of the Linux kernel combined with the tools and compilers built by the GNU project.
Over the years, the open source nature of Linux has resulted in the release of a wide range of different Linux distributions. One such distribution is Red Hat Enterprise Linux, created by Red Hat, Inc., a company founded by Bob Young and Mark Ewing. Red Hat specializes in providing enterprise level Linux software solutions combined with extensive technical support services. Fedora is developed by the Fedora Project in close collaboration with Red Hat, Inc. and serves as a proving ground for the new features that will eventually be included in future Red Hat Enterprise Linux releases.
3. Installing Fedora 31 on a Clean Disk Drive
There are now two ways in which a Fedora 31 system can be deployed. One method is to either purchase new hardware or re-purpose an existing computer system on which to install and run the operating system. Another option is to create a cloud-based operating system instance using services such as Amazon AWS, Google Cloud or Microsoft Azure (to name but a few). Since cloud-based instances are typically created by selecting a pre-configured, ready to run operating system image that is already optimized for the cloud platform, and using that as the basis for the Fedora system, there is no need to perform a manual operating system installation in this situation.
If, on the other hand, you plan to install Fedora 31 on your own hardware, the first step on the path to learning about Fedora involves installing the operating system.
Fedora can be installed either in a clean disk environment (where an entire disk is cleared of any existing partitions and dedicated entirely to Fedora) or in a dual boot environment where Fedora co-exists with another operating system on the disk (typically a member of the Microsoft Windows family of operating systems).
In this chapter we will be covering the clean disk approach to installation from local or remote installation media. Dual boot installation with a Windows 10 system will be covered in “Dual Booting Fedora 31 with Windows”.
3.1 Fedora Installation Options
Fedora can be downloaded free of charge from the following web page:
https://getfedora.org/
This page provides a number of download options depending on how the operating system is to be installed and used:
•Fedora Workstation - Downloads the installation media for the workstation edition of the operating system. This edition is intended for use on desktop and laptop systems where a graphical desktop environment is needed and is only available for 64-bit x86 systems. The workstation edition can be downloaded in the form of an ISO image which you can then write to a USB drive using the steps outlined later in this chapter. If you are performing the download on a Windows or macOS system, however, the easiest option is to download the Fedora Media Writer tool. This can be used to download the required Fedora edition and write it to a USB drive. Regardless of the download option chosen, the workstation media will allow you to test out Fedora by running a Live Fedora session prior to performing the installation.
•Fedora Server - Downloads the installation media for the server edition of the operating system. This image is intended for performing an installation on servers on which the graphical desktop environment is not required and is available for both x86 and ARM aarch64 64-bit systems. Although the server option only offers links to download the ISO images, the Fedora Media Writer available from the workstation page may also be used to download server images and write them to a USB drive.
When downloading the server edition, the following options are available:
•Standard ISO Image - Contains everything to install Fedora Server edition. This allows the installation to be performed without needing a network or internet connection.
•Netinstall ISO Image - Contains the minimum needed to begin the installation process during which additional packages are downloaded based on choices made during the configuration phase.
3.2 Choosing an Installation Option
Clearly a decision between the Workstation and the two Server Edition images needs to be made before installation can begin. If you would like to try Fedora 31 before installing it, then the Fedora Workstation option is the best solution since it allows you to boot Fedora from the installation media without first installing it on a disk drive. As shown in Figure 3-1, this option also provides the option to initiate the installation from within the live session:
Figure 3-1
If the graphical desktop environment is not required, and the destination system does not have internet access then the Server Edition Standard ISO image is recommended since this allows a fully functional server to be built without the need to download any additional packages.
For installations where the system has internet access and a trial run of Fedora 31 is not required prior to installation, the Server Edition Netinstall ISO image provides the greatest flexibility. This image is much smaller than the other options and allows selections to be made from a wide range of pre-defined configurations (including both Server and Workstation options as well as a Minimal Install configuration).
The examples in this chapter will be based on installing Fedora 31 from the Fedora Server Netinstall image, selecting the option during the installation process to install the full Fedora Workstation edition. If you prefer to install from the Fedora Workstation live session or the Standard Server Edition image, the steps in this chapter are still relevant, though only a subset of the configuration options will be available.
3.3 Obtaining the Fedora 31 Installation Media
For the purposes of this book, download the Fedora 31 Netinstall ISO image from the following URL:
https://download.fedoraproject.org/pub/fedora/linux/releases/31/Server/x86_64/iso/Fedora-Server-netinst-x86_64-31-1.9.iso
The DVD ISO image is self-contained including all of the packages necessary to install a Fedora 31 system and is named using the following convention:
Fedora-Server-netinst-<architecture>-<version>.iso
For example, the Fedora 31 DVD image for 64-bit Intel systems is named as follows:
Fedora-Server-netinst-x86_64-31-1.9.iso
Having downloaded the image, either burn it to disk or use the steps in the next section to write the media to a USB drive, configure your virtualization environment to treat it as a DVD drive or use the steps outlined later in this chapter to access the installation image over a network connection.
3.4 Writing the ISO Installation Image to a USB Drive
These days it is more likely that an operating system installation will be performed from a USB drive than from a DVD. Having downloaded the ISO installation image for Fedora 31, the steps to write that image to a USB drive will differ depending on whether the drive is attached to a Linux, macOS or Windows system. The steps outlined in the remainder of this section assume that the USB drive is new, or has been reformatted to remove any existing data or partitions:
3.4.1 Linux
The first step in writing an ISO image to a USB drive on Linux is to identify the device name. Before inserting the USB drive, identify the storage devices already detected on the system by listing the devices in /dev as follows:
# ls /dev/sd*
/dev/sda /dev/sda1 /dev/sda2
Attach the USB drive to the Linux system and run the dmesg command to get a list of recent system messages, one of which will be a report that the USB drive was detected and will be similar to the following:
[445597.988045] sd 6:0:0:0: [sdb] Attached SCSI removable disk
This output tells us that we should expect the device name to include “sdb” which we can confirm by listing device names in /dev again:
# ls /dev/sd*
/dev/sda /dev/sda1 /dev/sda2 /dev/sdb
From this output we can tell that the USB drive has been assigned to /dev/sdb. The next step before writing the ISO image to the device is to run the findmnt command to make sure it has not been auto-mounted:
# findmnt /dev/sdb
TARGET SOURCE FSTYPE OPTIONS
/run/media/neil/d6bf9574-7e31-4f54-88b1 /dev/sdb ext3 rw,nosuid,no
If the findmnt command indicates that the USB drive has been mounted, unmount it before continuing:
# umount /run/media/neil/d6bf9574-7e31-4f54-88b1
Once the filesystem has been unmounted, use the dd command as follows to write the ISO image to the drive:
# dd if=/path/to/iso/<image name>.iso of=/dev/sdb bs=512k
The writing process can take some time (as long as 10 - 15 minutes) to complete depending on the image size and speed of the system on which it is running. Once the image has been written, output similar to the following will appear and the USB drive is ready to be used to install Fedora 31:
5956+0 records in
5956+0 records out
3122659328 bytes (3.1 GB, 2.9 GiB) copied, 426.234 s, 7.3 MB/s
3.4.2 macOS
The first step in writing an ISO image to a USB drive attached to a macOS system is to identify the device using the diskutil tool. Before attaching the USB device, open a Terminal window and run the following command:
$ diskutil list
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *1.0 TB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_APFS Container disk2 1000.0 GB disk0s2
/dev/disk1 (internal):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme 28.0 GB disk1
1: EFI EFI 314.6 MB disk1s1
2: Apple_APFS Container disk2 27.7 GB disk1s2
/dev/disk2 (synthesized):
#: TYPE NAME SIZE IDENTIFIER
0: APFS Container Scheme - +1.0 TB disk2
Physical Stores disk1s2, disk0s2
1: APFS Volume Macintosh HD 473.6 GB disk2s1
2: APFS Volume Preboot 42.1 MB disk2s2
3: APFS Volume Recovery 517.0 MB disk2s3
4: APFS Volume VM 1.1 GB disk2s4
Having established a baseline of detected devices, insert the USB drive into a port on the macOS system and run the command again. The same results should appear with one additional entry for the USB drive resembling the following:
/dev/disk3 (external, physical):
#: TYPE NAME SIZE IDENTIFIER
0: *16.0 GB disk3
In the above example, the USB drive has been assigned to /dev/disk3. Before proceeding, unmount the disk as follows:
$ diskutil unmountDisk /dev/disk3
Unmount of all volumes on disk3 was successful
Finally, use the dd command to write the ISO image to the device, taking care to reference the raw disk device (/dev/rdisk3) and entering your user password when prompted:
$ sudo dd if=/path/to/iso/image.iso of=/dev/rdisk3 bs=1m
Once the image has been written, the USB drive is ready.
3.4.3 Windows
A number of free tools are available for Windows that will write an ISO image to a USB drive, but one written specifically for writing Linux ISO images is the Fedora Media Writer tool which can be downloaded from the following URL:
https://getfedora.org/en/workstation/download/
Once installed, launch the writer tool and select the Custom image option as highlighted in Figure 3-2. Alternatively, if you have chosen to use the Fedora Workstation media to try Fedora before installing, simply click in the Fedora Workstation 31 option to download and write the image to the USB drive.
Figure 3-2
In the resulting file selection dialog, navigate to and select the Fedora 31 installation ISO image and click on the Open button. After selecting the image, a dialog will appear within which the image can be written to the USB drive. Select the target USB drive from the device menu before clicking on the Write to Disk button:
Figure 3-3
Once the image has been written to the device, the device is ready to be used to perform the installation.
3.5 Installing Fedora 31
Insert the Fedora 31 installation media into the appropriate drive and power on the system. If the system tries to boot from the hard disk drive you will need to enter the BIOS set up for your computer and change the boot order so that it boots from the installation media drive first. Once the system has booted you will be presented with the following screen:
Figure 3-4
Use the arrow keys to navigate between the options and make a selection with the <Enter> key. If the Troubleshooting option is selected the screen shown in Figure 3-5 will appear including options to boot from the current operating system on the local drive (if one is installed), test the system memory, or rescue an installed Fedora 31 system. An option is also available to perform the installation in basic graphics mode for systems without a graphical console:
Figure 3-5
Select the option on the main screen to install and, after a short delay, the first screen of the graphical installer will appear:
Figure 3-6
Select your preferred language on the first screen before clicking Continue to proceed to the main installation screen as shown in Figure 3-7:
Figure 3-7
Begin by selecting the Network & Host Name option, enable a network device on your system and enter a host name before clicking the Apply button:
Figure 3-8
If your network connection requires additional settings, click on the Configure... button to access the advanced network settings screen illustrated in Figure 3-9:
Figure 3-9
Once the host name has been defined and a network connection enabled, click Done to return to the main screen.
If you wish to change the keyboard, language or time and date settings, select the corresponding option from the Localization column of the main screen. On the Time & Date screen, make a selection corresponding to your geographical location. The option is also provided to use Network Time which automatically synchronizes the system with external Network Time Protocol servers.
Changes to the Installation Source settings should not be necessary since the installation is being performed from local media. To perform the installation from media located on a remote server, select Installation Source, enable the On the network option and then specify the location of the installation media and the type of URL being used. The installation media can, for example, be an ISO image installed either on a remote web server or on a system on the local network using NFS (the topic of NFS file sharing is covered in detail in the chapter entitled “Using NFS to Share Fedora 31 Files with Remote Systems”), or the URL of a remote repository (repositories are essentially online collections of the software, packages and applications that make up the operating system from which installations onto the local system can be performed).
By default, a Server Edition installation of Fedora 31 will be performed by the installer. To select a different installation configuration, choose the Software Selection option to display the screen shown below:
Figure 3-10
Use the left-hand panel to select a basic configuration and the right-hand panel to add any additional packages you know you will need after the system starts up. If the Fedora 31 system is intended to be used with a graphical desktop environment, choose the Fedora Workstation option. If the desktop environment is not required and you are unsure which packages to install on the system, use the Minimal install option and install additional packages as needed once the system has booted. This avoids installing any packages that may never be needed.
Having configured the basic settings, the next step is to decide how the hard disk drive will be partitioned to accommodate the operating system.
3.6 Partitioning a Disk for Fedora 31
When the Installation Destination option is selected, the installer will present a screen similar to the one illustrated in Figure 3-11 below:
Figure 3-11
By default, the installer is configured to automatically install the operating system using the available space on the currently selected disk drive and to configure standard partition sizes. If the disk previously contained another operating system, these existing partitions will not be deleted, potentially leaving unused space on the drive after Fedora 31 has been installed. To remove any existing partitions so that they can be reclaimed and used by Fedora 31, enable the I would like to make additional space available option and click on the Done button to display the dialog shown in Figure 3-12.
Figure 3-12
To reclaim space, select a partition that is no longer needed and mark it for removal by clicking the Delete button. Once all the partitions that are to be removed have been selected, click on the Reclaim Space button to perform the deletion. The reclaimed space will now be used automatically by the Fedora 31 installer.
To manually configure the layout of the disk in terms of how the available space will be allocated, change the Storage Allocation setting from Automatic to Custom and click Done to display the Manual Partitioning screen (Figure 3-13):
Figure 3-13
The manual partitioning screen provides the option to configure the disk using Logical Volume Management (