My Arch Install Guide


home / blogs
In this guide, we will learn how to install Arch Linux. This takes into assumption that you already have an Arch ISO file in your pen drive and you booted into it using your boot menu.

Just follow the commands below, and you should be good to go. I will be explaining what those commands do, as we go.

  1. iwctl

    You can skip this step if you have ethernet. If you don't, using this command you can connect to wi-fi.
    Use this syntax: station [device ID] connect [SSID]

  2. cfdisk

    This command is used to partition your disk. We will make 3 partitions - a boot partition, a home partition and a swap partition.

    Now select 'write', and type yes to confirm. Now select 'quit'.

  3. lsblk

    You can use this command to list your block devices/partitions. You can see the names of your partitions here. We will use these names in the next steps.

  4. mkfs.btrfs /dev/sda3

    Verify that this partition is the one with the most size. Using this command, it will create a btrfs filesystem on the home partition.

  5. mkfs.fat -F 32 /dev/sda1

    Verify that this partition is the one with 100M size. Using this command, it will create a FAT32 filesystem on the boot partition.

  6. mkswap /dev/sda2

    Verify that this partition is the one with 4G size. Using this command, it will create a swap filesystem on the swap partition.

  7. lsblk

    You can check if your block devices are set up correctly. Now we will mount these partitions. Before that, let's see what disk paritions we have:

  8. mount /dev/sda3 /mnt

    This command will mount the home partition to the /mnt directory.

  9. mkdir -p /mnt/boot/efi

    This command creates the directory that we will mount the boot partition into.

  10. mount /dev/sda1 /mnt/boot/efi

    This command will mount the boot partition to the /mnt/boot/efi directory.

  11. swapon /dev/sda2

    This command will enable the swap partition. We don't need to "mount" this anywhere.

  12. lsblk

    We can finally check all of our mounted paritions.

  13. pacstrap /mnt base linux linux-firmware sof-firmware base-devel grub efibootmgr nano networkmanager

    This command will install the base system, the linux kernel, linux firmware, sound firmware, base development tools, grub (boot manager), efibootmgr, nano (text editor) and networkmanager (wifi and ethernet manager).

    If your PC is old and struggling, you can use the 'linux-zen' kernel. Just replace linux with linux-zen.

  14. This will take some time. So, go grab a coffee or something.

  15. genfstab /mnt > /mnt/etc/fstab

    This command will generate the fstab file, which contains information about your partitions, and send it over to /mnt/etc.

  16. arch-chroot /mnt

    This command will change the root directory to /mnt. Now we will configure the system.

  17. ln -sf /usr/share/zoneinfo/[your/location] /etc/localtime

    This command will set the timezone. Replace [your/location] with your location. For example, if you are in India, you will type Asia/Kolkata. If you don't know your time zone, just press [TAB] and you'll get something.

  18. date

    This command will show you the current date and time. If you set the correct timezone, this should be right.

  19. hwclock --systohc

    This command will set the hardware clock.

  20. nano /etc/locale.gen

    This command will open the locale.gen file. Uncomment the line that corresponds to your language. For example, if you want to use English (US) you will uncomment en_US.UTF-8 UTF-8. Save and exit.

  21. locale-gen

    This command will generate the locale.

  22. echo LANG=en_US.UTF-8 > /etc/locale.conf

    This command will set the language. Alternatively, you can do it manually by editing/creating the file. Just do nano /etc/locale.conf.

  23. echo [hostname] > /etc/hostname

    This command will set the hostname. Replace [hostname] with your desired hostname. If you don't know what hostname is, it's basically your computer's name. Mine's called 'nerv'!

  24. passwd root

    This command will set the root password. You will be prompted to enter the password twice. MAKE SURE YOU SET A STRONG PASSWORD FOR THE ROOT PARTITION.

  25. useradd -m -G wheel -s /bin/bash [name]

    This command will add a user. Replace [name] with your desired username. This will also create a home directory for the user. We have added the user to the 'wheel' group, which will make it easier for us to set them as a 'sudoer'.

  26. passwd [name]

    This command will set the user's password. You will be prompted to enter the password twice.

  27. EDITOR=nano visudo

    This command will open the sudoers file.

  28. systemctl enable NetworkManager

    This command will enable the NetworkManager service, which will manage your network connections. Make sure 'N' and 'M' are capitalised.

  29. grub-install /dev/sda

    This command will install the grub bootloader to the disk. Make sure you install it to the disk (sda, sdb, etc), not the partition (sda1, sda2, etc).

  30. grub-mkconfig -o /boot/grub/grub.cfg

    This command will generate the grub configuration file. DO NOT FORGET THE "-o" PART, OR YOU WILL NOT BE ABLE TO BOOT INTO YOUR SYSTEM. I have forgotten it an embarassing amount of times.

  31. exit

    This command will exit the chroot environment and come back to the ISO user.

  32. umount -a

    This command will unmount all the unused partitions. It is normal to see "target is busy" messages here.

  33. reboot

    This command will reboot your system. Remove the pen drive and boot into your new Arch Linux system!

This way, you can install Arch into your system. After booting and logging in, make sure to connect to wi-fi usinng nmtui (if you don't have ethernet).

If you would like a desktop environment, this is how to do it:

We will be using GNOME desktop environment for this tutorial.