This guide explains how to install Arch Linux from scratch, from disk partitioning and base system installation to essential system configuration. This approach suits users who want a minimal, fully customizable environment with maximum control, performance, and long-term maintainability.
1. Preparation
1.1 Installation USB
Write the Arch Linux ISO to a USB drive:
sudo dd if=archlinux-2025.iso of=/dev/sdX bs=4M status=progress oflag=sync
Tip:
if→ input ISO fileof→ target USB device (e.g.,/dev/sdb)bs=4M→ block sizestatus=progress→ show progressoflag=sync→ ensure all data is written
Warning: Double-check
of=/dev/sdX. The wrong device will cause data loss.
1.2 Network Connection
- Wired: plug in the Ethernet cable; DHCP should work automatically.
- Wireless (live environment):
iwctl
station wlan0 connect yourssid
ping archlinux.org
Tip: Ensure the network works before continuing.
1.3 Disk Partitioning
Partition the disk using fdisk (GPT):
sudo fdisk /dev/nvme0n1
Inside fdisk:
g→ create GPT partition table- Create an EFI partition (~512 MB)
- Create a root partition using the remaining space
w→ write changes
Tip: After partitioning, verify:
sudo fdisk -l /dev/nvme0n1
2. Formatting and Mounting
Format partitions:
mkfs.fat -F32 /dev/nvme0n1p1
mkfs.ext4 /dev/nvme0n1p2
Mount partitions:
mount /dev/nvme0n1p2 /mnt
mkdir /mnt/boot
mount /dev/nvme0n1p1 /mnt/boot
Tip: The EFI partition must be mounted at
/boot.
3. Package Mirrors
Select faster mirrors for package downloads:
reflector -c China -l 5 -f 5 --sort rate --save /etc/pacman.d/mirrorlist
Tip: Use the fastest mirrors to speed up installation and updates.
4. Base System Installation
Install base packages:
pacstrap /mnt base base-devel linux linux-firmware vim sudo
Optional packages:
pacstrap /mnt wpa_supplicant # for wireless
pacstrap /mnt grub efibootmgr # for bootloader
Generate fstab:
genfstab -U /mnt >> /mnt/etc/fstab
Tip:
fstabis essential for mounting partitions.
5. System Configuration
Enter the new system:
arch-chroot /mnt
5.1 Timezone
ln -sf /usr/share/zoneinfo/Asia/Taipei /etc/localtime
hwclock --systohc
5.2 Localization
Edit /etc/locale.gen and uncomment:
en_US.UTF-8 UTF-8
zh_CN.UTF-8 UTF-8
Generate locales:
locale-gen
echo "LANG=en_US.UTF-8" > /etc/locale.conf
5.3 Hostname and Hosts
echo arch > /etc/hostname
cat <<EOF > /etc/hosts
127.0.0.1 localhost
::1 localhost
127.0.1.1 arch.localdomain arch
EOF
5.4 Root Password and User Account
passwd # set root password
useradd -m -G wheel -s /bin/bash yourname
passwd yourname
Enable sudo for the wheel group:
visudo
# uncomment: %wheel ALL=(ALL) ALL
Tip: Avoid using root for daily operations.
6. Bootloader Installation
Install GRUB for UEFI:
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
grub-mkconfig -o /boot/grub/grub.cfg
Exit and unmount:
exit
umount -R /mnt
reboot
Tip: The EFI partition must be mounted at
/boot.
7. Network Configuration
7.1 Wireless Configuration
sudo wpa_passphrase "yourssid" "yourpassword" | sudo tee /etc/wpa_supplicant/wpa_supplicant-wlp2s0.conf
sudo systemctl enable --now wpa_supplicant@wlp2s0.service
sudo systemctl enable --now systemd-networkd
7.2 Wired Configuration
Create /etc/systemd/network/20-dhcp.network:
[Match]
Name=*
[Network]
DHCP=yes
LinkLocalAddressing=no
IPv6AcceptRA=no
Enable:
sudo systemctl enable --now systemd-networkd
7.3 DNS
sudo systemctl enable --now systemd-resolved
sudo ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
resolvectl status
Tip: Make sure
resolv.confpoints tosystemd-resolved.
8. Backup and Restore
8.1 Configuration Backup
sudo mkdir -p /root/backup
sudo cp /etc/fstab /root/backup/fstab.bak
sudo cp -r /etc/systemd/network /root/backup/network-config/
sudo cp /etc/hostname /root/backup/hostname.bak
sudo cp /etc/locale.conf /root/backup/locale.bak
8.2 Configuration Restore
sudo cp /root/backup/fstab.bak /etc/fstab
sudo cp /root/backup/hostname.bak /etc/hostname
sudo cp -r /root/backup/network-config/* /etc/systemd/network/
sudo systemctl restart systemd-networkd
Tip: Back up files before modifying critical configurations.
9. Troubleshooting
9.1 Network Issues
sudo systemctl status systemd-networkd
sudo systemctl status wpa_supplicant@wlp2s0.service
resolvectl status
9.2 GRUB Boot Failure
- Check that the EFI partition is mounted at
/boot - Verify GRUB installation:
ls /boot/EFI/GRUB
9.3 fstab Issues
- Test mount:
sudo mount -a
- Check UUIDs with
blkid
9.4 Wireless Failure
- Verify the
wpa_supplicantconfiguration - Check logs:
journalctl -xe
Tip: Network setup must be configured correctly after the first boot.