This guide will show you how to install Fedora Linux from the terminal in UEFI mode. You will need two memory instances: one as the destination and one as the Fedora donor. The donor can be either an installation ISO from the Fedora Project or an already installed instance. this guide start as a textual version of Install Fedora Linux the Arch Way: Ultimate Customization , but can be modify in the future.
- The real system occupies a little more than 5 GB, but Fedora recommends 40 GB of disk space. If you need only the system without any modification or want a Chrome OS-like experience (browser, a lightweight desktop environment, and web app-based experience), you can use a 16 GB or 8 GB disk, although this may not be supported by the Fedora Project.
- Either a Fedora installation ISO or an existing Fedora installation.
In my system, I installed:
- NVIDIA drivers
- Brave browser
- Steam (to try running games from my hard disk)
- The following group packages: "KDE Plasma Workspaces", "Fedora Server", "Web Server"
I installed my system on a Chinese SP 64 GB USB 3.0 drive, and it works well.
Commands that require root privileges are indicated with '#>', while commands that can be run as a standard user are indicated with '$>'.
It is recommended to enter root mode. All commands can be launched in root mode, but not all in the standard mode.
$> sudo -i
Start your Fedora donor system and set SELinux to permissive mode to not interfere with the procedure.
#> setenforce 0
is reccomended to use 'lsblk' to see all the partitions
$> lsblk
erase your destination disk
#> sgdisk --zap-all <destination disk>
for any error reconnect the device and retry the command
now you use gdisk to setup all partitions
#> gdisk <destination disk>
Create 3 partitions:
- A 600M EFI partition renamed SYS
- A 1G partition renamed BOOT
- A final partition as large as the entire disk or as much space as you want to dedicate
Write all changes with 'w'.
Format all 3 partitions:
#> mkfs.fat -F 32 -n SYS <destination part1>
#> mkfs.ext4 -F -L BOOT <destination part2>
#> mkfs.btrfs -f -L ROOT <destination part3>
Mount <destination part3> on /mnt and change directory into it.
#> mount <destination part3> /mnt
Create Btrfs subvolumes.
#> btrfs subvolume create @
#> btrfs subvolume create @home
#> btrfs subvolume create @cache
#> btrfs subvolume create @images
#> btrfs subvolume create @log
#> btrfs subvolume create @snapshots
Unmount '/mnt'.
#> umount /mnt
#> mount -o compress=zstd,noatime,subvol=@ <destination part3> /mnt
$> mkdir -p /mnt/{boot/efi,home,.snapshots,var/{log,cache,lib/libvirt/images},proc,sys,dev/pts}
#> mount -o compress=zstd,noatime,subvol=@home <destination part3> /mnt/home
#> mount -o compress=zstd,noatime,subvol=@cache <destination part3> /mnt/var/cache
#> mount -o compress=zstd,noatime,subvol=@log <destination part3> /mnt/var/log
#???> mount -o compress=zstd,noatime,subvol=@images <destination part3> /mnt/var/images
#> mount -o compress=zstd,noatime,subvol=@snapshots <destination part3> /mnt/.snapshots
#> mount <destination part2> /mnt/boot
#> mount <destination part1> /mnt/boot/efi
Trigger udev
#> udevadm trigger
Mount necessary filesystems.
#> mount -t proc proc /mnt/proc
#> mount -t sysfs sys /mnt/sys
#> mount -B /dev /mnt/dev
#> mount -t devpts pts /mnt/dev/pts
If you don't wont make this point, you can substitute $VERSION_ID with the desired version.
#> source /etc/os-release
#> export VERSION_ID="$VERSION_ID"
Check version ID.
$env | grep -i version
install fedora basic packages
#> dnf --installroot=/mnt --releasever=$VERSION_ID groupinstall -y Core
#> dnf --installroot=/mnt install -y glibc-langpack-<your> #(for me is it , but you can need us, de, or any else)
copy 'resolv.conf' from donor system
#> mv /mnt/etc/resolv.conf /mnt/etc/resolv.conf.orig
#> cp -L /etc/resolv.conf /mnt/etc
install Arch install scripts on donor system; we need it for 'genfstab' program.
#> dnf install arch-install-scripts
#> genfstab -U /mnt >> /mnt/etc/fstab
Delete '/dev/zram0' and any non-destination partition elements from '/mnt/etc/fstab'.
Enter the chroot environment.
#> chroot /mnt /bin/bash
Test your chroot with:
#> mount -a
Mount EFI variables.
#> mount -t efivarfs efivarfs /sys/firmware/efi/efivars
#> fixfiles -F onboot
Install GRUB and bootloader utilities.
#> dnf install btrfs-progs efi-filesystem efibootmgr fwupd grub2-common grub2-tools-efi
#> dnf install grub2-efi-ia32 grub2-efi-x64 grub2-pc grub2-pc-modules grub2-tools kernel
#> dnf install grub2-tools-extra grub2-tools-minimal grubby mokutil shim-ia32 shim-x64
Regenerate GRUB files.
#> rm -rf /boot/efi/EFI/fedora/grub.cfg /boot/grub2/grub.cfg
#> dnf reinstall shim-* grub2-efi-* grub2-common
Edit '/etc/default/grub'
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="rhgb quiet"
GRUB_DISABLE_RECOVERY="true"
GRUB_ENABLE_BLSCFG=true
Set up Fedora entry. You can change "Archdora" to any EFI boot name you prefer.
#> efibootmgr -c -d <destination disk> -p 1 -L "Archdora" -l \\EFI\\FEDORA\\SHIMX64.EFI
#> grub2-mkconfig -o /boot/grub2/grub.cfg
Reset localtime.
#> rm -rf /etc/localtime
#> systemd-firstboot --prompt
If you Need WiFi configuration on booted system, install iwd
#> dnf install iwd
Set the root password and exit chroot.
#> passwd
#> exit
Umount '/mnt'.
#> umount -n -R /mnt
Reboot the system.
Enter root user with your root password.
Create your normal user with wheel permissions.
#> useradd -mG wheel <user>
#> passwd <user>
Reset SELinux (you may need to reset it on the donor if the donor isn't a live USB).
#> setenforce 1
Show all group list you can install
#> dnf group list
Install all groups you are interested in. For example, I installed "KDE Plasma Workspaces", "Fedora Server", and "Web Server".
#> dnf groupinstall "KDE Plasma Workspaces" "Fedora Server" "Web Server"
It is reccomended to install RPM fusion.
#> dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
#> dnf install https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
Install all packages you need. I installed Timeshift, Steam, and NVIDIA drivers.
#> dnf install steam timeshift akmod-nvidia xorg-x11-drv-nvidia-cuda
For brave browser, follow this steps:
#> dnf install dnf-plugins-core
#> dnf config-manager --add-repo https://brave-browser-rpm-release.s3.brave.com/brave-browser.repo
#> rpm --import https://brave-browser-rpm-release.s3.brave.com/brave-core.asc
#> dnf install brave-browser
For the common CODEC formats follow this lines of commands
#> dnf install gstreamer1-libav gstreamer1-plugins-bad-free
#> dnf install gstreamer1-plugins-bad-free gstreamer1-plugins-bad-free-extras
#> dnf install gstreamer1-plugins-bad-freeworld gstreamer1-plugins-bad-nonfree
#> dnf install gstreamer1-plugins-good gstreamer1-plugins-ugly lame-libs
Is reccomended start dnf update with optional multimedia packages
#> dnf group upgrade --with-optional Multimedia
Restart your system
You have successfully installed Fedora Linux using the terminal. Enjoy your new system!