Skip to content

Instantly share code, notes, and snippets.

@PEPPEsant01
Last active September 6, 2024 16:12
Show Gist options
  • Select an option

  • Save PEPPEsant01/91e79ffac3cc017ffa4177272f444400 to your computer and use it in GitHub Desktop.

Select an option

Save PEPPEsant01/91e79ffac3cc017ffa4177272f444400 to your computer and use it in GitHub Desktop.

archdora project

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.

Requirements

Destination Storage:

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

Donor:

  • Either a Fedora installation ISO or an existing Fedora installation.

System Configuration Example

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

Initial step::

Start your Fedora donor system and set SELinux to permissive mode to not interfere with the procedure.

#> setenforce 0

Step 1 , Partition the disk::

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:

  1. A 600M EFI partition renamed SYS
  2. A 1G partition renamed BOOT
  3. 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>

Step 2 , Prepare the system folders::

2.1

Mount <destination part3> on /mnt and change directory into it.

#> mount <destination part3> /mnt

2.2

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

2.3

Unmount '/mnt'.

#> umount /mnt

2.4

#> 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

2.5

Trigger udev

#> udevadm trigger

Step 3 , Prepare the system packages::

3.1

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

3.2 (optional)

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

3.3

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)

3.4

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


Step 4 , Chroot::

4.1

Enter the chroot environment.

#> chroot /mnt /bin/bash

Test your chroot with:

#> mount -a

4.2

Mount EFI variables.

#> mount -t efivarfs efivarfs /sys/firmware/efi/efivars
#> fixfiles -F onboot

4.3

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

4.4

Regenerate GRUB files.

#> rm -rf /boot/efi/EFI/fedora/grub.cfg /boot/grub2/grub.cfg 
#> dnf reinstall shim-* grub2-efi-* grub2-common

4.5

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

4.6

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

4.7

Reset localtime.

#> rm -rf /etc/localtime
#> systemd-firstboot --prompt

4.8

If you Need WiFi configuration on booted system, install iwd

#> dnf install iwd

4.9

Set the root password and exit chroot.

#> passwd
#> exit

Umount '/mnt'.

#> umount -n -R /mnt

Reboot the system.


Step 5 , In the system::

5.1

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

5.2

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

5.3 (optional)

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

5.4 Setup Media CODEC (raccomended optional)

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

5.5

Restart your system


Step 6 , Enjoy your system

You have successfully installed Fedora Linux using the terminal. Enjoy your new system!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment