Installation of Fedora 25 through cli

Fedora 25 is one version behind the current release at the moment of writing this, however, it is wise to keep using a version behind since it is considered more stable. With a little struggle you will be able to install newer Fedora versions.

This installation guide is based in my improvised installation that I posted in real-time in Twitter. How ever I deleted my account I used in the 2017.

Requeriments:

    1. Boot up a Linux distro (a LiveCD or your current system)
    2. A free partition available.
    3. Download the Fedora Server Netinstall iso

Procedure:

1. Create a directory to chroot in it later

mkdir /mnt/Fedora

2. Mount the Fedora netinstall iso into it

mount -t iso9660 Downloads/Fedora-Server-netinst-x86_64-25-1.3.iso /mnt/Fedora/

3. Copy the install.img file to /tmp

cp /mnt/Fedora/images/install.img /tmp

4. Install squashfs-tools

apt-get install squashfs-tools

5. Extract the install.img file

cd /tmp && unquashfs /tmp/install.img

6. Mv the rootfs.img to tmp

mv squashfs-root/LiveOS/rootfs.img .

7. Create /mnt/img and mount rootfs.img into it.

mkdir /mnt/img/ && mount rootfs.img /mnt/img/

8. Umount /mnt/Fedora and mount a blank partition into /mnt/Fedora

umount /mnt/Fedora && mount /dev/amu/fedora /mnt/Fedora/

9. Copy all contains from /mnt/img to /mnt/Fedora

rsync -aAXv /mnt/img/ /mnt/Fedora/

10. Mount sys, dev, proc and run in the actual directory

cd /mnt/Fedora && mount --bind /sys/ sys/ && mount --bind /dev/ dev/ && mount --bind /proc/ proc/ && mount --bind /run/ run/

11. Chroot in the actual directory

chroot .

12. Download the rpm package with the repo list.

wget ftp://195.220.108.108/linux/fedora/linux/updates/25/x86_64/f/fedora-repos-25-4.noarch.rpm

13. Download the Fedora release rpm

wget ftp://rpmfind.net/linux/fedora/linux/updates/25/x86_64/f/fedora-release-25-2.noarch.rpm

14. Install both rpm packages

rpm -i *.rpm

15. Update the package manager

dnf update

16. Install kernel
dnf -y install kernel

17. Install LVM

dnf -y install lvm2

18. Reinstall RPM

dnf -y install rpm

19. Reinstall DNF

dnf -y install dnf

20. Install wget, vim, and nano

dnf -y install vim wget nano

21. Install the KDE Desktop

dnf install @kde-desktop-environment

22. Remove anaconda

yum remove anaconda-core

23. Add user to the groups lp, wheel and games
useradd -G lp,games,wheel USER

24. Create a password
passwd USER

25. Exit the chroot
exit

26. Umount filesystems
umount sys && umount proc && umount dev && umount run

27. Chroot into your new installed Fedora using systemd Nspawn:

systemd-nspawn -bD /mnt/Fedora/

28. Remove services

dnf remove abrt satyr gssproxy

29. Disable services
systemctl disable avahi-daemon
systemctl disable ModemManager
systemctl disable bluetooth
systemctl disable sshd
systemctl disable rpcbind
systemctl disable firewalld
systemctl mask plymouth
systemctl mask plymouth-read-write
systemctl mask plymouth-start

30. List locales
localectl list-locales

31. Set a locale
localectl set-locale LANG=locale

32. Create a swap file
dd if=/dev/zero of=/mnt/1GB.swap bs=1024 count=1048576
mkswap /mnt/1GB.swap

33. Configure grub

34. edit fstab and do not forget to add the swap entry if you want to use it:
/mnt/1GB.swap none swap sw 0 0

35. Enable the magic reboot keys
echo "kernel.sysrq = 1" >> /etc/sysctl.d/99-sysctl.conf

These bottons respect your privacy

Leave a Reply

Your email address will not be published. Required fields are marked *