There is an updated version of this guide for newer Fedora versions.

Fedora 32 Installation and Configuration

This guide covers the steps I perform when installing Fedora Workstation or Silverblue editions on my computers. I am using the x86_64 version of Fedora 32 in this guide. My computers use UEFI, some of them have Secure Boot enabled.

Created
March 30, 2020
Updated
April 25, 2020

I believe everyone will find these notes valuable. I have originally written this guide to suit my needs, but anyone else can learn from it. Be careful with the commands presented in this document if you don't know what they mean, especially commands that begin with sudo. Fedora is usable out-of-the-box, so there is a chance that you don't need to run any of these commands at all. You proceed at your own risk.

Decision: Clean Install or an Upgrade

If you run a previous version of Fedora that is still supported, you can directly upgrade to the latest version. Gnome Software or dnf can be used to upgrade. In that case, find the official documentation.

I prefer performing a clean installation each time a new version of Fedora is released, and this guide reflects this approach.

Backup Files and Configuration from the Previously-Installed Operating System

If you intend to replace an existing installation of the operating system, consider backing up all important data and collecting as much information about the installed software as possible.

The following instructions apply to Fedora, and you can skip them if you have nothing to backup.

Backup Personal Files

Personal files of each user are located primarily in the /home folder.

List Installed Packages and Programs

List user-installed packages installed by DNF (this may not include packages installed through PackageKit or Gnome Software):

$ sudo dnf history list
$ sudo dnf history info ID
$ sudo dnf history userinstalled

Programs installed by Flatpak:

$ flatpak list --app

There may also be some software installed outside of the package manager (from a script, etc.). This may include Mathematica or Matlab. Check other possible locations (/opt) to identify these programs.

Backup Virtual Machines

If you use virtual machines, consider backing up their configuration and data.

List virtual machines installed through virsh (virt-manager):

$ sudo virsh list --all

Get the configuration of a virtual machine:

$ sudo virsh dumpxml VMNAME > VMNAME.xml

Backup all files mentioned in the exported configuration file. These might include:

To restore the virtual machine later, put the backed-up files in their correct location, and define the virtual machine from the configuration file:

$ sudo virsh define VMNAME.xml

Backup Podman and Toolbox Containers

Make sure you don't have any important files stored in containers. These commands may be helpful:

$ podman container list --all
$ podman image list
$ toolbox

Download Installation Media

After making sure all important data is backed up, we can move to the installation of the new Fedora. Download the installation image of Fedora Workstation from https://getfedora.org, verify the SHA checksum, and follow their instructions to successfully create an installation drive from the image. More information on how to create the installation media can be found at a Fedora Docs page.

I usually use the dd tool to write the downloaded image to a USB flash drive. This command will overwrite data on the target drive, be careful!

$ sudo dd if="Fedora-Workstation-Live-x86_64-32_Beta-1.2.iso" of="/dev/USBDRIVE" bs=8M status=progress oflag=direct

It might also be helpful to see Release Notes and Installation Guide, both links are provided at the Fedora download page.

(Optional) Erase All Contents of the Hard Drive

Boot up from the previously downloaded live media.

Make sure LVM is not active and that no partitions on the target drive are mounted:

$ lsblk

Delete the partitions:

$ sudo gdisk /dev/DRIVE

Get to the Expert mode, and zap all partition tables:

  1. x
  2. z (y to both questions)

If installing on an SSD, it might also be a good idea to TRIM all of its space. This is an opportunity to trim all space, including the space that will later not be occupied by a file system that supports TRIM. Just issue one blkdiscard command, there's no extra need to Secure-Erase the drive.

$ sudo blkdiscard -v /dev/DRIVE

Installation

The installation is pretty straightforward. During partitioning, you may need to leave some free space for SSD over-provisioning. Note: On my Samsung 840 Evo it looks like partition reserved space is used instead of free space, though. Don't bother with leaving unpartitioned free space for SSD over-provisioning. Just make sure TRIM is enabled on the installed system. See my Fedora Configuration Notes page for more details.

If you want to install Fedora as the secondary operating system (dual boot), you may want to back up the contents of /boot/efi/EFI/Boot/ directory on your hard drive. It usually contains default boot files, which may be overwritten during Fedora installation.

Fedora Workstation live media, by default, configures LVM and uses the current "live" hostname as the name. To change it, use:

$ hostnamectl set-hostname david-pc-fedora.localhost

After Installation

These are my recommended steps to do after the installation. Neither of them is required for Fedora to work, but they can simplify your life.

Disable PackageKit

PackageKit and DNF apply only to Fedora Workstation and Server (and other Spins). Fedora Silverblue uses rpm-ostree and Flatpak instead.

My biggest annoyance with Fedora Workstation is its implementation of PackageKit, which is also used by Gnome Software. The situation is better today compared to the past when the DNF package manager recognized all software installed via Gnome Software us unneeded and wanted to remove it. But even today, Gnome Software (PackageKit) leaves unused dependencies upon package removal and seems to not share all of its information with DNF. At the very least, PackageKit wastes disk space by keeping its own separate cache for downloaded packages.

Free the package cache of PackageKit:

$ pkcon get-transactions
$ sudo pkcon refresh force -c -1
$ du -sh /var/cache/PackageKit/

Prevent PackageKit from ever starting again:

$ systemctl status packagekit.service
$ systemctl stop packagekit.service
$ systemctl disable packagekit.service
$ systemctl mask packagekit.service

From now on, use DNF instead:

$ sudo dnf --refresh upgrade
$ sudo dnf install PACKAGE
$ sudo dnf remove PACKAGE
$ sudo dnf needs-restarting
$ rpm -Va

Install Updates

Install all available updates and reboot.

On Fedora Workstation (WARNING: better to do it in a console or a screen session as it modifies the running system):

$ sudo dnf --refresh upgrade

On Fedora Silverblue (safe to run anytime):

$ rpm-ostree upgrade

Finally, reboot to relaod all software components (Workstation) or to boot to the new image (Silverblue):

$ systemctl reboot

Install Additional Packages

This is a list of some of the useful packages. This list does not contain regular apps like GIMP or Audacity (these apps have their own dedicated page on this website), but small system packages.

First, I will mention GUI system configuration tools. They are not necessary, but they provide a nice interface to already installed command-line tools.

And finally, these are console programs that I install the most often.

Useful package groups

There does not seem to be a way to install package groups on Silverblue yet. A Toolbox instance can be used to list the group packages and then use rpm-ostree to install these individual packages.

To list available package groups, use the following command.

$ sudo dnf group list

The following command shows all possible groups.

$ sudo dnf group list -v hidden

I found the following package group useful for C/C++ programming and debugging.

$ sudo dnf group install 'C Development Tools and Libraries'

If you want to use virtualization, see Fedora docs.

$ sudo dnf install @virtualization

RPM Fusion Repositories

Besides some low-level firmware, Fedora doesn't ship with any other proprietary or non-free software. This includes some of the popular multimedia codecs, such as H.264 (Fedora used to ship even without MP3 music format support before the patents expired). RPM Fusion repository provides some of this software instead.

The up-to-date instructions to enable the RPM Fusion repository are on the RPM Fusion website.

Flatpak and Flathub Repository

Flatpak is the recommended way to install software on Fedora Silverblue. It is also a good idea to use it on Fedora Workstation. By default, Fedora comes with its own Flatpak repository enabled. But the main source for Flatpak apps, including proprietary software, is Flathub. The latest official instructions can be found on Flatpak website. Note that there are also many other Flatpak repositories in existence.

The last time, I used:

$ flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
$ flatpak remote-add --if-not-exists flathub-beta https://flathub.org/beta-repo/flathub-beta.flatpakrepo
$ flatpak remote-add --if-not-exists gnome-nightly https://nightly.gnome.org/gnome-nightly.flatpakrepo

Snap

Snap is Ubuntu's alternative to Flatpak. The biggest difference from Flatpak is that there is only one repository which contains all Snaps, and that Snap may miss some important security features when used on other Linux distributions than Ubuntu. Here are official docs on how to setup Snap on Fedora.

Codecs

Fedora doesn't ship with non-free software. This includes many multimedia codecs. These are instructions to install the most important codecs for the usual video and audio playback. Up-to-date information can be found at RPM Fusion FAQ. RPM Fusion repositories must be enabled for this to work.

$ sudo dnf groupinstall multimedia
$ sudo dnf groupupdate multimedia

To install only OpenH264 codec without RPM Fusion, follow Fedora Wiki.

Better font rendering

Default font rendering on Fedora is now much better than it used to be a few years ago. Also, some software patents regarding subpixel font rendering have expired, so there is no longer a need to download the freetype-freeworld package from RPM Fusion. By default, Fedora uses Slight hinting and grayscale sub-pixel rendering.

To further improve the rendering, RGB sub-pixel rendering can be used. It improves the font readability on low-DPI screens, but it may cause colorful edges. It also looks terrible when the screen is rotated (when the sub-pixel RGB order changes).

$ gsettings set org.gnome.settings-daemon.plugins.xsettings antialiasing 'rgba'
$ gsettings set org.gnome.settings-daemon.plugins.xsettings hinting 'slight'
$ gsettings set org.gnome.settings-daemon.plugins.xsettings rgba-order 'rgb'
$ sudo ln -s /usr/share/fontconfig/conf.avail/10-hinting-slight.conf /etc/fonts/conf.d/
$ sudo ln -s /usr/share/fontconfig/conf.avail/10-sub-pixel-rgb.conf /etc/fonts/conf.d/
$ sudo ln -s /usr/share/fontconfig/conf.avail/11-lcdfilter-default.conf /etc/fonts/conf.d/

I verified that the result exactly matches Ubuntu 20.04. Patches like freetype-freeworld are thus no longer needed. Pop!_OS 19.10 uses different settings than Ubuntu (grayscale).

Tips and Tricks

Some tips and hardware-specific problems are mentioned here.

Make Sure SSD TRIM is Enabled

Prior to Fedora 32, TRIM was not enabled by default. The user had to run one of the following commands to trim the free space on mounted SSD storage devices:

$ sudo fstrim -v --fstab
$ sudo fstrim -a -v

Fedora 32 enables the fstrim.timer service, which performs this operation automatically every week (other distributions have been doing this for years). To verify that TRIM is being issued automatically, run:

$ systemctl status fstrim.service

To check which storage devices support the TRIM (discard) operation, run:

$ lsblk -D

Disable Gnome automount

I don't like having all my unmounted drives automatically remounted after unlocking my screen after some time of inactivity. This may have been fixed, but it was super-annoying when I was doing a bitwise copy of a storage device, and it was automatically getting mounted mid-process.

$ gsettings set org.gnome.desktop.media-handling automount false

How to Update GRUB parameters (If Needed)

My old Sandy Bridge laptop has a strange feature: there is a non-existent monitor connected to one of the GPUs (probably the Nvidia one). This monitor can be disabled by passing a parameter to the GRUB command line. But Fedora seems to change the way to permanently modify these parameters with each new release.

Probably in Fedora 31, I used this command to add the video=VGA-2:d parameter:

# grub2-editenv - set "$(grub2-editenv - list | grep kernelopts) NEW_PARAMETER"
sudo grub2-editenv - set "$(sudo grub2-editenv - list | grep kernelopts) video=VGA-2:d"

On Fedora 32, I did a bit of research into this topic. It appears that there are at least three ways how to add an additional parameter to the GRUB command line.

The first option uses grubby-bls in the background (older, this may copy the cmdline arguments instead of using the kernel args variable):

$ sudo grubby --update-kernel=ALL --args="video=VGA-2:d"

The second option modifies the variable directly (probably preferred?):

$ sudo grub2-editenv - set "$(sudo grub2-editenv - list | grep '^kernelopts') video=VGA-2:d"

The third option should be equivalent to the second option, although I haven't tried it:

$ vi /etc/defaults/grub
$ grub2-mkconfig

The situation is very simple on Silverblue:

$ rpm-ostree kargs video=VGA-2:d

Enable TRIM on Silverblue when using LUKS

Fedora Workstation is configured to pass TRIM commands to the underlying device if full-disk encryption (LUKS) is used. This does not seem to be the case in Silverblue. I don't know whether this is a feature or a bug, but it can be enabled anyway.

$ rpm-ostree initramfs --enable --arg=-I --arg=/etc/crypttab

Verify:

$ lsinitrd /boot/ostree/fedora-885446f122734a39e9b9e600ce8fb0532d93d874c17db48c6676c55f3c447bd3/initramfs-5.3.7-301.fc31.x86_64.img | fgrep crypttab

An alternative, without having to re-generate initramfs on every rpm-ostree transaction:

$ rpm-ostree kargs --append rd.luks.options=c28fdfe4-ba7d-49bf-896f-5ffca011c39a=discard