Skip to content
Abdul Kareem's Blog
Go back

How to install Arch Linux

Introduction

This is an opinionated Arch Linux installation guide designed according to my preferences. I want to preface this guide by stating that the official Arch Linux installation guide is amazing and this guide derives directly from that. This is specifically written according to my preferences and also expands on the installation guide by doing some basic configuration of the system such as creating the first user and installing packages.

This guide also assumes that you have already booted into the live archiso and are running on a UEFI system. Let’s start.

Setting keyboard layout and font

Terminal window
loadkeys us
setfont ter-132b

Connect to the internet

Terminal window
iwctl
[iwd]# station wlan0 scan
[iwd]# station wlan0 connect <network-name>
[iwd]# exit
Verify the connection
Terminal window
ping -c 5 archlinux.org

Partitioning and Formatting

I like to use the cfdisk for partitioning my disk. It’s an interactive terminal interface. I prefer the following partition layout for my disk.

Disk Layout
NAME SIZE FS
/dev/sda1 1G FAT32
/dev/sda2 20G [SWAP]
/dev/sda3 455G ext4
Formatting
mkfs.fat -F 32 /dev/sda1
mkfs.ext4 /dev/sda3
mkswap /dev/sda2

I like to have both root and home on one partition. I also prefer a dedicated swap partition.

Mounting the file system

Terminal window
mount /dev/sda3 /mnt
mkdir -p /mnt/boot/efi
mount /dev/sda1 /mnt/boot/efi
swapon /dev/sda2

Updaing pacman mirrors

Terminal window
reflector --country Singapore,China, --age 24 --protocol https --sort rate --fastest 5 --save /etc/pacman.d/mirrorlist

Note the extra comma after China and a blank space. That enables global mirrors which includes the Fastly CDN based arch linux mirror.

Installing the base system

Terminal window
pacstrap -K /mnt base base-devel linux linux-firmware sof-firmware intel-ucode grub efibootmgr networkmanager neovim man-db git zsh docker gdm hyprland kitty

Generate fstab

Terminal window
genfstab -U /mnt >> /mnt/etc/fstab

Configuring the system

Terminal window
arch-chroot /mnt

Timezone

Terminal window
ln -sf /usr/share/zoneinfo/Asia/Karachi /etc/localtime
hwclock --systohc
systemctl enable systemd-timesyncd

Localization

Terminal window
echo "en_US.UTF-8 UTF-8" >>/etc/locale.gen
locale-gen
echo "LANG=en_US.UTF-8" >/etc/locale.conf
echo "KEYMAP=us" >/etc/vconsole.conf

Hostname

Terminal window
echo bytecave > /etc/hostname

Bootloader

Terminal window
grub-install
grub-mkconfig -o /boot/grub/grub.cfg

Enabling Services

Terminal window
systemctl enable NetworkManager
systemctl enable bluetooth
systemctl enable fstrim.timer
systemctl enable gdm

Account Setup

Password for root account
Terminal window
passwd

Creating a new user

Terminal window
useradd -m -G wheel docker -s $(which zsh) username
passwd username

Reboot

At this point, I like to reboot my system and switch to the proper installation on the disk.

Terminal window
exit
systemctl reboot

After the reboot, I use gdm to login to my hyprland session where the remaining configuration continues.

Installing an AUR helper

My preferred AUR helper is yay.

Terminal window
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
cd ..
rm -rf yay

Installing my packages

Terminal window
git clone https://github.com/abdulkareemakn/dotfiles.git
cd dotfiles
yay -Syu --needed --noconfirm - < pkglist

Configuring my applications

From the previous step, I have already cloned my dotfiles repository from GitHub and will now apply the configuration to all the applications I use.

Terminal window
stow bat btop dunst eza hyprland kitty lazygit nvim oh-my-posh rofi waybar yazi zsh

Conclusion

That’s it. My Arch Linux system is now ready and configured and I can begin using it. I hope this guide was useful for you and provides an insight into an opinionated Arch Linux install. Thanks for reading. Goodbye.


Share this post:

Previous Post
A guide to installing Grimmory: Your self hosted digital library