How To Install Arch

How To Install Arch

Reading time1 min
#Linux#OpenSource#Technology#ArchLinux#Installation#Tutorial

Mastering Arch Installation: Trimmed-Down Linux With Full System Ownership

Some environments demand precision—embedded R&D, custom CI agents, infosec appliances. Prepackaged distributions introduce unwanted variables. Arch Linux, installed manually, becomes a controlled baseline: no surprise daemons, no bloat, every binary accounted for. Here’s the procedural workflow for a ground-up installation.


Baseline Requirements

  • Supported hardware or a hypervisor VM (UEFI strongly recommended; BIOS approach differs).
  • Reliable wired internet.
  • At least 2GB USB flash drive for boot media.
  • Existing Linux/macOS box for imaging, or Windows workstation with Rufus.
  • Comfort with terminal command execution. Unexpected kernel panics are not unheard of.

Flashing Installation Media

Get the ISO

wget https://mirror.rackspace.com/archlinux/iso/2024.06.01/archlinux-2024.06.01-x86_64.iso

Use sha256sum to verify. Errors here suggest a bad mirror or interrupted download.

Write image (Linux shown):

sudo dd if=archlinux-2024.06.01-x86_64.iso of=/dev/sdX bs=4M status=progress oflag=sync

Warning: double-check of=. Data loss is instant and irreversible if the wrong device is chosen. On Windows, Rufus is less error-prone for new users.


PXE Boot—Confirming Networking Early

Boot device, interrupt firmware selection menu, and choose your USB drive. Arch’s live environment drops you to a shell promptly.

Check network:

ip a
ping -c2 archlinux.org

Wi-Fi requires iwctl:

iwctl
> device list
> station wlan0 scan
> station wlan0 connect <SSID>

If ping fails, check rfkill or driver module loading (lsmod | grep iwlwifi).


Time Sync—Avoid Split-Brain

timedatectl set-ntp true

Drift here breaks pacman signatures and TLS handshakes later.


Partitioning: UEFI Example

Choose target (lsblk shows disks). Wipe & partition via fdisk /dev/nvme0n1:

  • g (new GPT)
  • n (EFI, +512M, type 1)
  • n (root, rest of disk)
  • Optional: n (swap, if needed; for most desktops with SSD, use no swap or zram later)

Example table:

PartitionSizeTypeDevice
EFI512MEFI System/dev/nvme0n1p1
root~restLinux FS/dev/nvme0n1p2
swap (opt)2-4GBLinux swap/dev/nvme0n1p3

Note: On older hardware or BIOS boot, requirements change; see Arch Wiki.


Filesystem Creation

Format partitions:

mkfs.fat -F32 /dev/nvme0n1p1
mkfs.ext4 -L root /dev/nvme0n1p2
mkswap /dev/nvme0n1p3   # Only if swap partition used
swapon /dev/nvme0n1p3

Side note: For SSDs, consider mkfs.ext4 -O^has_journal -L root to reduce write wear. Not universally recommended; journaling is a trade-off.


Mount and Bootstrap

mount /dev/nvme0n1p2 /mnt
mkdir /mnt/boot
mount /dev/nvme0n1p1 /mnt/boot

For complex partitioning, create /mnt/home, /mnt/var as needed.


Minimal Base System Install

Arch packaging is rolling-release; mismatch in versions can cause breakage. Install base, kernel, editors:

pacstrap -K /mnt base linux linux-firmware vim nano

-K avoids redundant keyring downloads.


Generate fstab

genfstab -U /mnt >> /mnt/etc/fstab
less /mnt/etc/fstab   # Confirm UUIDs, especially if using LVM or encryption.

If you edit partitioning mid-install, regenerate this file.


Enter Chroot

arch-chroot /mnt

You’re now operating inside the new root. Standard bash tools available.


System Timezone and Clock

Example—US Eastern:

ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime
hwclock --systohc

Without this, timestamps break logging and cron.


Locale & Keyboard

Edit /etc/locale.gen:

nano /etc/locale.gen
# Uncomment: en_US.UTF-8 UTF-8

Apply changes:

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

If using a non-US keyboard, edit /etc/vconsole.conf:

KEYMAP=de-latin1

Host Identity

Set hostname:

echo "myarch" > /etc/hostname

Configure /etc/hosts:

127.0.0.1   localhost
::1         localhost
127.0.1.1   myarch.localdomain myarch

Basic Networking

Enable DHCP or install NetworkManager:

pacman -Sy networkmanager
systemctl enable NetworkManager

For headless servers or scripting, systemd-networkd is lighter; choose to match operational model.


Set Administrative Credentials

passwd

Good passwords save time later.


Bootloader: UEFI GRUB

Install and configure:

pacman -S grub efibootmgr
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
grub-mkconfig -o /boot/grub/grub.cfg

Check for “Installation finished. No error reported”. If efibootmgr fails, firmware is misconfigured or Secure Boot is enabled.


Finalize and Reboot

Unmount carefully:

exit
umount -R /mnt
reboot

Remove install media. Boot failures—often caused by forgotten UEFI/Legacy toggles, or missing microcode packages for AMD/Intel CPUs.


First Boot—Securing and Diversifying

Create user with sudo; restrict root SSH if network-exposed.

useradd -m -G wheel johndoe
passwd johndoe
pacman -S sudo
EDITOR=nano visudo    # allow '%wheel ALL=(ALL) ALL'

Practical difference:

  • Sudo privilege group is explicit.
  • Safer than daily root use.

Next: Install Xorg, Wayland, graphical environments per use-case. For hardened or production deployments, skip desktop.


Non-Obvious Optimization: Filesystem Trimming

On SSD-equipped installs, enable fstrim via timer:

systemctl enable fstrim.timer

Keeps performance up, extends drive life—often neglected in quick guides.


Troubleshooting

Failed boots:

  • lsblk vs. /etc/fstab—look for mismatches.
  • journalctl -xb—diagnose kernel/init errors.
  • Incomplete initramfs generation: re-run mkinitcpio -P.

Known gotcha:
On some laptops, wireless interfaces may not show until linux-firmware is updated. Manufacturer hardware quirks are not rare.


Summary

By installing Arch Linux manually, you gain fine-grained knowledge of your system’s internals and a reproducible environment, ready for tight integration into automation, security contexts, or custom platforms. While automation scripts exist, understanding each manual step exposes where errors propagate—and how to recover. For reference and edge cases, keep the Arch Wiki open.

Minimalist doesn’t mean minimal effort. The investment pays off in situational awareness and maintainability.


Not everything has to be automated. Sometimes, manual control is the right call.