Installation Guide

Installation Guide covers the installation of the operating system, Arch Linux.

Boot into the live Arch Linux using the bootable installation media that you created earlier in chapter Pre-Installation Guide and wait for a terminal to appear. When a terminal is ready to use, continue with the next steps.

Ensure that you have a bootable installation media ready prior to following this chapter. If you don’t have one, hop on to Pre-Installation Guide and follow the steps.

Check Internet Connection

ping www.google.com

Ensure that you have a working internet connection. Without it, you will not be able to follow this document from here onward.

Destination Disk

fdisk -l

Above command, fdisk -l, will list all available devices and its partitions (if any). You need to choose the device on which you want to install the Arch Linux. In my case, I have chosen the /dev/sda.

Disk Preparation

If you need a full disk encryption then follow How to install Arch Linux with Full Disk Encryption. Otherwise, continue with the next steps.

cfdisk /dev/<DEVICE>

Don’t forget to change the <DEVICE> with the device that you have chosen in previous step. In my case, it was sda.

Using the cfdisk, create partitions as you like. In my configuration, I have created three partitions; first one is the root partition, the second one is the boot partition and the third and the last one is used as a swap. Below commands are using the same configuration so if your differs, you need to change the below commands accordingly.

mkfs.ext4 /dev/<DEVICE>1
mkfs.ext4 /dev/<DEVICE>2
mkswap /dev/<DEVICE>3
swapon /dev/<DEVICE>3
mount -t ext4 /dev/<DEVICE>1 /mnt
mkdir /mnt/boot
mount -t ext4 /dev/<DEVICE>2 /mnt/boot

Don’t forget to change the <DEVICE> with the device that you have chosen in previous step. In my case, it was sda.

Mirror List

vi /etc/pacman.d/mirrorlist

File /etc/pacman.d/mirrorlist contains the list of all available mirrors. The one at the top will be used as your mirror. If you want to choose another one, you need to move it all the way to the top. For example, I have chosen the mirror called “Croatia” as it is closest to my physical location.

System Files Installation

pacstrap -i /mnt base base-devel zsh zsh-completions polkit

Filesystem Information Generation

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

Change Root

arch-chroot /mnt /bin/bash

Locale Configuration

vi /etc/locale.gen

Find and un-comment your language. In my case it is en_US.UTF-8. Save and exit.

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

Timezone Configuration

ln -fs /usr/share/zoneinfo/<ZONE>/<SUBZONE> /etc/localtime
hwclock --systohc

Don’t forget to change the <ZONE> and <SUBZONE> with your zone information. In my case, <ZONE> is set to “Europe” and <SUBZONE> is set to “Zagreb”.

Time Configuration

pacman -S ntp
systemctl enable ntpd.service

Boot Manager

pacman -S grub
grub-install --recheck /dev/<DEVICE>
grub-mkconfig -o /boot/grub/grub.cfg

Replace <DEVICE> with your device chosen at the beginning of the installation guide. In my case, it was sda.

If you want to use a full disk encryption then you need to make an additional changes to the GRUB. For details, see How to install Arch Linux with Full Disk Encryption.

Hostname Configuration

echo <HOSTNAME> > /etc/hostname

Replace <HOSTNAME> with the value of your choice. I prefer to use hrle-desktop for the hostname of my desktop machine.

Root Password

passwd

Non-Administrative User Setup

useradd -m -G wheel,users -s /bin/zsh <USERNAME>
passwd <USERNAME>
visudo

Don’t forget to replace <USERNAME> in above command with your user name.

In the newly opened editor, un-comment line %wheel ALL=(ALL) ALL, save and exit the editor.

Exit Live Boot Environment

exit
umount -R /mnt
reboot