Introduction

These are my notes on installing Arch Linux. This is not meant to be a universal guide, but only how I like to setup Arch Linux on my workstations. Since other people might find it useful, I decided to publish it.

Here is the setup I use:

  • UEFI
  • systemd-boot
  • LVM on LUKS, plain /boot
  • NetworkManager
  • Xorg
  • KDE / Plasma
  • SDDM

This is mostly based on the installation guide. I kept what I needed and added other parts. I made sure to put the links to all the wiki pages that I used. (❤️ Arch Wiki)

Download the ISO

First, download the ISO here https://www.archlinux.org/download/ and burn to a drive or insert it to your VM, and boot on it.

Burn it to Flash Drive

# most common way to flash iso to usb
dd bs=4M if=path/to/archlinux-version-x86_64.iso of=/dev/[disk] conv=fsync oflag=direct status=progress

Initial setup

Check if system is under UEFI:

ls /sys/firmware/efi/efivars

Connect to wifi if needed Run iwctl to enter the iwd utility and connect to WiFi.

device list
 
station [device] scan
station [device] get-networks
station [device] connect [ssid]
# enter wifi password at the subsequent prompt
 
quit

Run ping -c 3 archlinux.org to test that connection is valid.

Enable NTP and set timezone

timedatectl set-ntp true
timedatectl set-timezone Africa/Cairo

Disk management

cfdisk is my favorite partitioning ncurses tool.

you can launch the tool with:

cfdisk /dev/sda

Replace sda with your drive. Choose GPT if asked. Create the partitions and label them. Then write and quit.

The tutorial will assume /dev/sda is your drive for the rest of the tutorial

Partitions

PartitionSpaceType
/dev/sda1512MEFI System
/dev/sda2xGLinux Filesystem
/dev/sda3xGLinux swap

File systems

/ partition:

mkfs.ext4 /dev/sda2
mount /dev/sda2 /mnt

/boot partition:

mkfs.fat -F32 /dev/sda1
mkdir /mnt/boot
mount /dev/sda1 /mnt/boot

swap:

mkswap /dev/sda3
swapon /dev/sda3

Install system

Install the base packages:

pacstrap /mnt base base-devel linux linux-firmware

System setup

Generate partition table:

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

Enter the chroot:

arch-chroot /mnt

Set timezone and sync clock:

ln -sf /usr/share/zoneinfo/Europe/Paris /etc/localtime
hwclock --systohc

See https://wiki.archlinux.org/index.php/Locale

Uncomment en_US.UTF-8 UTF-8 (and en_EG.UTF-8 UTF-8 if needed) in /etc/locale.gen.

Generate locales:

locale-gen

Set default locale:

echo "LANG=en_US.UTF-8
LC_COLLATE=C" > /etc/locale.conf

Set keymap to French (if needed):

echo "KEYMAP=fr-latin9" > /etc/vconsole.conf

Set hostname:

echo "arch" > /etc/hostname

Set hosts file:

echo "127.0.0.1 localhost
::1 localhost
127.0.1.1 arch.localdomain arch" >> /etc/hosts

Set root password:

passwd

Initial ramdisk

The HOOKS line might need to be updated in /etc/mkinitcpio.conf depending on the disk method you used:

  • Method 1: nothing to change
  • Method 2: base systemd udev autodetect modconf block sd-lvm2 filesystems keyboard fsck
  • Method 3: base systemd udev autodetect keyboard sd-vconsole modconf block sd-encrypt filesystems fsck
  • Method 4: base systemd udev autodetect keyboard sd-vconsole modconf block sd-encrypt sd-lvm2 filesystems fsck

Generate the ramdisks using the presets:

mkinitcpio -P

Bootloader: systemd-boot

Since we’re using /boot/, no need to use --path option.

bootctl install

/boot/loader/entries/arch.conf :

title Arch Linux
linux /vmlinuz-linux
initrd /initramfs-linux.img
options ...

The options line depends on the disk method you used.

  • Method 1: options root=UUID=$(blkid -s UUID -o value /dev/sda2) rw
  • Method 2: options root=/dev/vg0/root rw
  • Method 3: options rd.luks.name=$(blkid -s UUID -o value /dev/sda3)=cryptroot root=/dev/mapper/cryptroot rw
  • Method 4: options rd.luks.name=$(blkid -s UUID -o value /dev/sda3)=cryptlvm root=/dev/vg0/root rw

Intel Microcode

pacman -S intel-ucode

Add initrd /intel-ucode.img above initrd /initramfs-linux.img in /boot/loader/entries/arch.conf.

Check after reboot:

dmesg -T | grep microcode

Use amd-ucode for an AMD CPU.

Networking: NetworkManager

pacman -S networkmanager
systemctl enable NetworkManager
systemctl start NetworkManager

If wired with DHCP, nothing more to do.

Reboot! (if you want)

As this point, the system should be working and usable, you can reboot. You can also stay in the chroot.

exit
umount -R /mnt
# cryptsetup close {cryptroot,crptlvm}
reboot

User account

To enable sudo access, uncomment this line in /etc/sudoers:

%wheel ALL=(ALL) ALL

The sudo group does not exit by default so we’ll use wheel.

Add user:

useradd -m -g wheel -c 'Stanislas' -s /bin/bash stanislas
passwd stanislas

Xorg

pacman -S xorg-server
pacman -S xf86-video-intel

Desktop environment: GNOME

pacman -S gnome

Display manager: SDDM

pacman -S gdm
systemctl enable gdm
systemctl start gdm

Fonts

pacman -S ttf-{bitstream-vera,liberation,freefont,dejavu} freetype2

yay

yay is my current AUR helper.

git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
yay -S yay

Now what?

See https://wiki.archlinux.org/index.php/General_recommendations