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

Fedora Linux 38 Installation and Configuration

This guide covers the steps I perform when installing Fedora Workstation or Fedora Silverblue editions on my computers. My computers have an x86_64 or AArch64 CPU and use UEFI, often with Secure Boot enabled.

The information on this page has been updated for Fedora version 38.

Updated
April 25, 2023

Although I originally wrote this guide to suit my needs, anyone else can find these notes useful. Be careful with the commands presented in this document if you don't know what they mean, especially commands that begin with sudo. You proceed at your own risk.

Recent versions of Fedora Linux are user-friendly out-of-the-box, so there is a chance that you won't need to apply any configuration mentioned in this document.

When Upgrading: Clean Install vs. Upgrade

If you run a previous version of Fedora that is still supported, you can upgrade to the latest version directly. Gnome Software or dnf can be used to upgrade. In that case, find the official documentation. The Fedora Linux download page is a good starting point to get more information.

I prefer performing a clean installation each time a new version of Fedora is released, and this guide reflects this approach. Because I tend to store only the necessary minimum of data on my computers, it is not a problem for me to copy all my files to external storage, perform a clean installation, and copy my files back.

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 instructions in this section assume the previously installed operating system was Fedora Workstation, and you can skip these steps if you don't have anything to backup.

Backup Personal Files

Personal files of each user are located primarily in the /home/$USER directory (which is /home/david in my case).

Sometimes, I store shared files in /srv/ too.

List Installed Packages and Programs

List packages that were installed manually using DNF:

sudo dnf history list
sudo dnf history userinstalled

List programs installed with Flatpak:

flatpak list --app

List Flatpak repositories:

flatpak remotes --show-details --show-disabled

Some software may have been installed outside of the package manager (from a script, etc.). This may include Mathematica or Matlab. Therefore, also check other possible locations (e.g., /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 (or the virt-manager GUI):

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, I recommend creating and then deleting a new virtual machine so that QEMU sets the correct permissions and BTRFS attributes on the relevant file system locations. Then, 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

Also 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

Backup EFI Partition

If you want to install Fedora as a 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.

Download the Installation Media

After making sure all important data is backed up, we can move on to the installation of the new Fedora. Download the installation image of Fedora Workstation from the official Fedora download page, 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.

If you want an immutable system where the operating system is read-only and all regular applications are installed via Flatpak, you can try Fedora Silverblue instead of Fedora Workstation. Fedora Silverblue has a separate download page.

For a universal netinstall medium, download the Everything image from Fedora Alternative Downloads page.

Lastly, if a new release is scheduled, it is possible to download it from https://dl.fedoraproject.org/pub/alt/stage/ about a week before it officially shows up on the Fedora website.

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-38-1.6.iso" of="/dev/USBDRIVE" bs=8M status=progress oflag=direct

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

(Optional) Erase All Contents of the Hard Drive Prior to Installation

First, boot up from the previously downloaded live media.

If you want to erase the contents of the computer's hard drive, make sure that LVM or Luks don't use the drive and that no partitions on the target drive are mounted:

lsblk

If installing on an SSD, it is a good idea to TRIM all of its space. The TRIM operation tells the SSD that all of the SSD capacity is unused. After this step, the SSD drive will most likely appear as empty with no partitions. Just issue one blkdiscard command, there's no need to Secure-Erase the drive under normal circumstances.

sudo blkdiscard -vf /dev/DRIVE

If the drive doesn't support TRIM, or if the partition table is still visible after the TRIM command finished executing, delete the partitions using gdisk. Get to the Expert mode (x), and zap (z) all partition tables.

sudo gdisk /dev/DRIVE
x
z

After the hard drive is erased, I reboot the computer in order to start the installer from a fresh state.

Installation

The installation is straightforward. Use the default options so that the installer formats the whole storage drive and installs the Fedora Linux operating system.

Back when Fedora Workstation used LVM instead of BTRFS, the live media, by default, configured LVM and used the current "live" hostname as the name. To change LVM name, one could change the hostname just before proceeding with the installation:

hostnamectl hostname pc4.localgroup

When installing Fedora over serial console without a monitor connected, the Anaconda installer can be accessed via VNC by adding this boot parameter when booting from the installation media:

inst.vnc inst.vncpassword=PASSWORD

In the parameter above, the PASSWORD can be a string of six to eight characters. Once the installer starts, it is accessible via VNC on port 5901.

After Installation

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

Disable PackageKit

PackageKit and DNF apply only to Fedora Workstation and Fedora Server (and other Fedora 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 the Gnome Software app. 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 after a package removal and seems to not share all of its metadata information with DNF. At the very least, PackageKit uses disk space by keeping its own cache for downloaded packages, which is separate from the cache used by DNF.

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. The following commands upgrade installed packages, install new packages, uninstall packages, check whether some system services need to be restarted after an update, and verify the integrity of installed packages.

sudo dnf --refresh upgrade
sudo dnf search PACKAGENAME
sudo dnf provides BINARYNAME
sudo dnf install PACKAGE
sudo dnf remove PACKAGE
sudo dnf needs-restarting
rpm -Va

Note that it is recommended to boot into a minimal environment, or at least log out of GNOME and switch to a non-graphical console (e.g., CTRL+ALT+F3), before running the dnf upgrade command to avoid possible program crashes caused by modifications to the running system.

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

If using Fedora Workstation Beta, run this command before installing updates:

sudo dnf --refresh upgrade 'fedora-repos*'

Beta versions of Fedora have the updates-testing repository enabled by default. Shortly before the final release, fedora-repos and fedora-repos-modular packages are updated to disable the testing repositories. Running the command above minimizes the chance of installing unwanted testing updates into the stable release.

To synchronize the installed beta version of Fedora with the stable version once it is released, one can run:

sudo dnf --refresh distro-sync

On Fedora Silverblue (safe to run anytime):

rpm-ostree upgrade

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

systemctl reboot

Install Additional Packages

This is a list of some useful packages that I often install.

GUI system configuration tools. They usually provide a simple user interface to already installed command-line tools.

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

Useful package groups

There does not seem to be a way to install package groups on Fedora 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
sudo usermod -a -G libvirt "$USER"

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. They also have useful howto guides.

Enable RPM Fusion free and non-free repositories:

sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm

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 the Flatpak website. Note that there are also many other Flatpak repositories in existence.

Note that latest Fedora versions already come with Flathub remote installed, but not enabled by default. To see already defined Flatpak remotes, run:

flatpak remote-list --show-disabled

I usually enable these Flatpak remotes:

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
flatpak remote-add --if-not-exists kdeapps https://distribute.kde.org/kdeapps.flatpakrepo
flatpak remote-add --if-not-exists rhel https://flatpaks.redhat.io/rhel.flatpakrepo

Snap (I Don't Use It)

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

I don't use Snap.

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 and RPM Fusion Howtos. RPM Fusion repositories must be enabled for this to work.

Install multimedia codecs:

sudo dnf groupupdate core
sudo dnf groupinstall multimedia
sudo dnf groupupdate multimedia
sudo dnf groupupdate sound-and-video

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

I also use some additional codecs for HEIF/HEVC, H.264, and H.265.

Enable HW video acceleration on Intel GPUs:

sudo dnf install libva libva-utils
sudo dnf install intel-media-driver
sudo dnf install libva-intel-driver # For older GPUs

Better Font Rendering (Not Needed Anymore)

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

I now use 4k monitors, and font rendering is not an issue anymore. Also, GTK 4 changed the default font rendering to look better on high pixel density displays.

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 the following command and check that the DISC-GRAN and DISC-MAX columns of the drive contain non-zero values.

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

Other Gnome Tweaks

I usually change these settings in Gnome Settings:

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