Skip to content

Instantly share code, notes, and snippets.

@Salman7236
Last active February 14, 2026 17:49
Show Gist options
  • Select an option

  • Save Salman7236/400d006d4bc6200f7231a8b164c36942 to your computer and use it in GitHub Desktop.

Select an option

Save Salman7236/400d006d4bc6200f7231a8b164c36942 to your computer and use it in GitHub Desktop.
Arch installation guide for myself

Arch Installation

Instructions for myself.

Update keyring (Sometimes (especially if the ISO is older), the keyring is outdated and installation might not work. Very rare tho, but never hurts to update it.)

pacman -Sy archlinux-keyring

If using archinstall, then updating archinstall can sometimes cause issues, (2) so only update it if it doesn't work properly without updating, or if the latest version has a feature you need. If you do update, and run into issues, you might need to update more packages. See the issues linked above for help. Also see Issue

pacman -Sy archinstall archlinux-keyring

Verify boot mode

cat /sys/firmware/efi/fw_platform_size

Time

timedatectl
timedatectl set-ntp true

List partition table

lsblk

Start partitioning

Fastest way is to use to sgdisk

sgdisk -n1:0:+1G -t1:ef00 -c1:EFI -N2 -t2:8304 -c2:ROOT /dev/nvme0n1
  • n(n) = partition number n with start and end sector (1gb in my case)
  • N(n) = partition number n with largest available size
  • t(n) = type for partition number n (ef00 for EFI and 8304 for linux x86-64 in my case)
  • c(n) = name of partition number n. (Not necessary to name a partition.)

cgdisk method

cgdisk

Code for EFI

ef00

Code for swap

8200

Code for Linux x86-64 root

8304

Formatting

Boot (EFI)

mkfs.fat -F 32 /dev/nvme0n1p1

Swap

mkswap /dev/nvme0n1p2
swapon /dev/nvme0n1p2

Root

mkfs.ext4 /dev/sda3

Mounting

Boot (EFI)

mount --mkdir /dev/nvme0n1p1 /mnt/boot

Root

root = mount /dev/sda3 /mnt

Mirrors

reflector --country India --latest 5 --protocol http --protocol https --sort rate --save /etc/pacman.d/mirrorlist
pacman -Syy

Warning

There's no need to include the "u" after the "syy" in the above command because we are in a live ISO and can't upgrade the system. But on an already installed system, you MUST include the "u" in every "Syu" or "Syyu" command. Read more here on why you should never do partial upgrades.

Base installation

pacstrap -K /mnt base linux linux-firmware sof-firmware base-devel intel-ucode e2fsprogs dosfstools nano neovim less man-db man-pages fastfetch networkmanager openssh os-prober refind git bash-completion mtools efibootmgr gptfdisk dkms reflector expac pacman-contrib
  • Replace linux with the kernel of your choice.
  • You can exclude the linux-firmware and sof-firmware packages if installing in a VM. sof-firmare is usually only needed for audio support in laptops.
  • Replace intel-ucode with amd-ucode if you have an AMD CPU.
  • If you chose file systems other than "ext4" and "VFAT", then replace e2fsprogs and dosfstools with the packages needed for your chosen file system. See File systems
  • Exclude os-prober if not dual booting.
  • Replace refind with the bootloader of your choice.
  • Replace nano and neovim with text editor(s) of your choice

. Generate filesystem table

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

Change root into the installation

arch-chroot /mnt

Set root password

passwd

Set time

ln -sf /usr/share/zoneinfo/Asia/Karachi /etc/localtime
hwclock --systohc

Set local

nano /etc/locale.gen

uncomment the locale

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

Setup Host (Computer) name (Replace "arch" with your desired hostname)

echo arch > /etc/hostname
nano /etc/hosts

add these lines:

127.0.0.1 localhost
::1  localhost
127.0.0.1 arch.localdomain arch

Enable parallel downloads

Enabled by default now.

nano /etc/pacman.conf

Add eye candy in pacman:

nano /etc/pacman.conf

Under the Misc options section, uncomment ParallelDownloads, VerbosePkgLists and Color and add ILoveCandy

Setup multilib repos (32 bit libs needed for games and stuff)

nano /etc/pacman.conf

uncomment these two lines:

[multilib]
Include = /etc/pacman.d/mirrorlist

Then refresh the repos

pacman -Syu

Install bootloader (I'm using refind, these installation instructions are modified because when installing refind from chroot, it adds kernel parameters of the iso instead of our installed system. )

refind-install --usedefault /dev/nvme0n1p1 --alldrivers
mkrlconf
nano /boot/refind_linux.conf

remove first two lines

nano /boot/EFI/BOOT/refind.conf

go to archlinux section and replace UUID with path to efi partition (e.g. /dev/nvme0n1p1)

Add users (replace "user" with your username)

useradd -m -G wheel,sys,log,rfkill,lp,adm -s /bin/bash user

Set password for user (replace "user" with your username)

passwd user

Give sudo privileges to user

EDITOR=nano visudo

uncomment %wheel ALL=(ALL) ALL or uncomment this for no password: %wheel ALL=(ALL) NOPASSWD: ALL add this line to disable repeated password prompts: Defaults !tty_tickets

Enable SSD trimer (ignore if you have HDD)

systemctl enable fstrim.timer

Enable networkmanager

systemctl enable NetworkManager

end


Credits


To-do

  • instructions for VirtualBox and VMWare
  • fixing resolution in VMs using bootloader kernel parameters
  • instructions for zram generator instead of swap partition
  • btrfs + timeshift/snapper
  • writing automated script and maybe ask the user for somethings so other people can also use this script, give it a cool name like archfi, archery and other great scripts lol.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment