Prerequisite
- USB Drive (at least 1.2GB) with archiso
- From Windows: Use
rufusto flash ISO to drive - From Linux:
- Using
rpi-imager(AUR) via custom image - MultiWriter
gnome-multi-writer
- Using
- From Windows: Use
Network Configuration
- Using wired connection is preferable
archisohas iwctl built-in. It can connect to regular IEEE 802.11x wifi, i.e., Wifi with SSID and passphrase.
Booting & Partition
- Update system clock
timedatectl set-ntp true
- Using
fdiskfor partitioning
fdisk -l # list all partitions
fdisk /dev/device # e.g.: /dev/sda, /dev/nvme0n1
- Now you're inside
fdiskCLI:mfor help menu 0. If fresh install, or disk not GPT, dogto create new empty GPT tablen: new partition- Partition number: go by default or your preferred order
- First sector: rcm go by default
- Last sector: use
+SIZEto set partition size (e.g.: +500MiB, +2G)
t: change partition type- Partition number: remember from previously determined
Lfor option menu,Qto quit menu- Recommend GPT table:
Partition # Type ( toption)Size EFI System 1 EFI (1) +600MiB Swap (optional) 2 Linux swap (19) +4GiB Root 3 Linux root (23) +50GiB Home 4 Linux home (42) the rest
Partition a swap if the PC has low RAM (swap's size should be 2x RAM)
3. `w`: write table to disk and exit
4. `q`: quit without saving changes
- Format partitions
mkfs.fat -F 32 /dev/EFI_Partition
mkswap /dev/SWAP_Partition
mkfs.ext4 /dev/ROOT_and_HOME
- Mounting & activate partitions
swapon /dev/SWAP_Partition
mount /dev/ROOT /mnt
mount /dev/HOME /mnt/home
mount --mkdir /dev/EFI /mnt/boot // for the EFI file system
- Edit
/etc/pacman.confand enableParallelDownloads = ...for faster download - Install essential packages (see CorePackages.md for more).
pacstrapalso have flags like-Kto initialize empty pacman keyring
pacstrap /mnt base linux linux-firmware base base-devel # ...
- Generate file system table
fstab
genfstab -U /mnt >> /mnt/etc/fstab
- Now,
arch-chrootto/mntand go to next steps!
arch-chroot and root configuration
I highly recommend install
fishshell of out-of-the-box suggestions.
pacman -S fish
chsh root
# New shell: /usr/bin/fish
- Set timezone
ln -sf /usr/share/zoneinfo/REGION/CITY /etc/localtime
- Set system clock to hardware (or vice versa, do
man hwclock)
hwclock --systohc
Get text editor of choice:
nano,vim,neovim, etc.Localization: uncomment locale in
/etc/locale.gen- e.g.: en_CA.UTF-8, fr_CA.UTF-8
locale-gen
- Create
locale.confto set up LANG
LANG=en_CA.UTF-8
Network Configuration
- In
/etc/hostname:
myHostName- In
/etc/hosts:
127.0.0.1 localhost ::1 localhost 127.0.1.1 myHostName- In
mkinitcpio
mkinitcpio -P # using all presets, see `man mkinitcpio` for more
- Root password using
passwd - Add non-root user
useradd -m myUser # `-m` create a folder in /home/myUser
passwd myUser # to set password
- Add user to access/privilege groups:
usermod -aG wheel,audio,video,optical,storage myUser
later on, groups like
dockerfor Docker dev, oruucpfor embedded (Arduino) are also required
- Install
sudoand editvisudo.
pacman -S sudo
EDITOR=nvim visudo # visudo uses vi by default, but you can specify your preferred text editor
- Here, root user can determine how users should have access to sudo. It's good to have password whenever
sudois called, but users can opt-out
%wheel ALL = (ALL) ALL
# %wheel ALL = (ALL) NOPASSWD: ALL
- Install GRUB and Dual-boot stuffs
pacman -S efitbootmgr os-prober grub
- Install
grubto EFI menu (boot menu) && Generate GRUB config:
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB –recheck
grub-mkconfig -o /boot/grub/grub.cfg
- Exit, unmount everything, and you're done!
exit # Ctrl + D
umount -a /mnt # unmount all