Skip to content

Arch Installation

Matthew Stiles edited this page Jan 5, 2024 · 12 revisions

Arch Linux is installed by booting the target computer to an Arch livecd image (typically on a flash drive), which includes all of the needed utilities to install the operating system onto the target drive. Note that these steps are tailored toward UEFI systems, and would need to be adjusted to boot on systems running in BIOS or CSM mode.

Useful Links

Installation Steps

Booting the Arch installer media

Internet access is required during installation. If using a wired connection, connect the ethernet cable to the machine before booting, and the machine will automatically receive an IP address via DHCP. If using wireless, see below for steps to connect once booted into the live media.

Connect the flash drive to the machine, and boot to the live media. Once booted, check that the system is booted in 64-bit UEFI mode using cat /sys/firmware/efi/fw_platform_size, which should return 64.

Connect to Wi-Fi

Run iwctl to configure Wi-Fi networks during setup.

List all devices:

[iwd]# device list

Scan for networks:

[iwd]# station <device> scan

List all available networks:

[iwd]# station <device> get-networks

Connect to a network:

[iwd]# station <device> connect <ssid>

Verify internet connectivity by pinging any site before proceeding.

Partition the drive

Display detected drives using fdisk -l.

With a standard SATA drive, the disk will typically be listed as /dev/sda, while NVME drives will typically be listed as /dev/nvme0n1. The steps below will use /dev/sda as an example, so adjust the following commands as needed.

Once finished, the drive should have four partitions with the following layout:

/dev/sda1  EFI System           1 GiB
/dev/sda2  Linux root (x86-64)  25 GiB (or more if enough space on drive)
/dev/sda3  Linux home           Remaining space
/dev/sda4  Linux swap           Variable - see below

Note that a swap partiton is optional. It is really only needed when the memory usage of the system is expected to exceed the amount of physical memory installed in the system. On systems with very little physical memory, 1-2 times the amount of memory is a typical recommendation. On systems with ample physical memory, this partition can be omitted from the following steps.

Use fdisk to create the partitions interactively:

fdisk /dev/sda

For each partition:

  • Enter n to create a new partition, then follow the prompts to define the size of the partition.
  • Enter t to change the partition type, then enter the number for the desired partition type: (verify numbers as these can change over time)
    • EFI System: 1
    • Linux root (x86-64): 23
    • Linux var: 45
    • Linux home: 42
    • Linux swap: 19

Once finished, enter p to list the partition table and confirm that everything looks correct, then enter w to write changes to the disk and exit.

Format the partitions

mkfs.fat -F 32 /dev/sda1
mkfs.ext4 /dev/sda2
mkfs.ext4 /dev/sda3
mkswap /dev/sda4

Mount the partitions

mount /dev/sda2 /mnt
mount --mkdir /dev/sda1 /mnt/boot
mount --mkdir /dev/sda3 /mnt/home
swapon /dev/sda4

Run the first setup script

cd <repo>/.bootstrap/system-install
./1-after-creating-partitions.sh

Chroot into the new system

arch-chroot /mnt

Enable 32-bit packages

Edit /etc/pacman.conf and uncomment the multilib section.

Run the second setup script

/root/2-chroot-as-root.sh

Reboot into the installed system

exit
umount -R /mnt
reboot

Set up networking

If using a wired connection, copy one of the example profiles from /etc/netctl/examples to /etc/netctl and modify it as needed.

If using a wireless connection, run wifi-menu -o and follow the prompts to connect to the network and create the profile.

To connect to the configured network on startup, run:

netctl enable <profile>
netctl start <profile>
systemctl enable --now dhcpcd.service
resolvconf -u

Enable NTP service

timedatectl set-ntp true

Desktop environment setup

Type exit to log out of the root account, then log in as the user that was just created. Follow the instructions in the Post-Installation Setup to install the remaining packages and finish setting up the desktop environment.