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-keyringIf 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-keyringcat /sys/firmware/efi/fw_platform_sizetimedatectl
timedatectl set-ntp truelsblkFastest 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
cgdiskCode for EFI
ef00Code for swap
8200Code for Linux x86-64 root
8304Boot (EFI)
mkfs.fat -F 32 /dev/nvme0n1p1Swap
mkswap /dev/nvme0n1p2
swapon /dev/nvme0n1p2Root
mkfs.ext4 /dev/sda3Boot (EFI)
mount --mkdir /dev/nvme0n1p1 /mnt/bootRoot
root = mount /dev/sda3 /mntreflector --country India --latest 5 --protocol http --protocol https --sort rate --save /etc/pacman.d/mirrorlist
pacman -SyyWarning
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.
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
linuxwith the kernel of your choice. - You can exclude the
linux-firmwareandsof-firmwarepackages if installing in a VM.sof-firmareis usually only needed for audio support in laptops. - Replace
intel-ucodewithamd-ucodeif you have an AMD CPU. - If you chose file systems other than "ext4" and "VFAT", then replace
e2fsprogsanddosfstoolswith the packages needed for your chosen file system. See File systems - Exclude
os-proberif not dual booting. - Replace
refindwith the bootloader of your choice. - Replace
nanoandneovimwith text editor(s) of your choice
genfstab -U /mnt >> /mnt/etc/fstabarch-chroot /mntpasswdln -sf /usr/share/zoneinfo/Asia/Karachi /etc/localtime
hwclock --systohcnano /etc/locale.genuncomment the locale
locale-gen
echo LANG=en_US.UTF-8 > /etc/locale.conf
export LANG=en_US.UTF-8echo arch > /etc/hostname
nano /etc/hostsadd these lines:
127.0.0.1 localhost
::1 localhost
127.0.0.1 arch.localdomain archEnabled by default now.
nano /etc/pacman.confAdd eye candy in pacman:
nano /etc/pacman.confUnder the Misc options section, uncomment ParallelDownloads, VerbosePkgLists and Color
and add ILoveCandy
nano /etc/pacman.confuncomment these two lines:
[multilib]
Include = /etc/pacman.d/mirrorlistThen refresh the repos
pacman -SyuInstall 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.confremove first two lines
nano /boot/EFI/BOOT/refind.confgo to archlinux section and replace UUID with path to efi partition (e.g. /dev/nvme0n1p1)
useradd -m -G wheel,sys,log,rfkill,lp,adm -s /bin/bash userSet password for user (replace "user" with your username)
passwd userEDITOR=nano visudouncomment %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
systemctl enable fstrim.timersystemctl enable NetworkManager- The Arch Wiki
- Arch install guide by D3SOX (By far the best arch install guide for beginners I've ever come across.)
- Modern Arch linux installation guide
- A whoooole lot of youtube videos
- My own experience of reinstalling arch a bunch of times since I first started using Linux (November 2024).
- 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.