Arch Installation Guide

| 7 min read | Joy Biswas

Table of Contents

This is a minimal guide to install Arch Linux. I used these steps to install Arch Linux on my device. I hope this guide will help you guys. So, let's begin right away!

If you are reading this guide, then I assume you are already booted into Arch and following these steps. I've used nano as a text editor during the installation, but you can use any text editor you like: nano, vim, vi etc.

ToC


No. Topic
1 Pre-installation
2 Verify signature
3 Connect to the internet
4 Update the system clock
5 Partition the disks
6 Format the partitions
7 Mount the file systems
8 Installation
9 Install essential packages
10 Configure the system
11 Chroot
12 Time zone
13 Localization
14 Network configuration
15 Initramfs
16 Root password
17 Post-installation

Pre-installation

Grab the Arch Linux ISO file from their Download page and boot your USB drive with any bootable software you like. I've used Balena Etcher in this tutorial.

Verify signature

It is recommended to verify the image signature before use, especially when downloading from an HTTP mirror, where downloads are generally prone to be intercepted to serve malicious images

gpg --keyserver-options auto-key-retrieve --verify archlinux-version-x86_64.iso.sig

Alternatively, from an existing Arch Linux installation run:

pacman-key -v archlinux-version-x86_64.iso.sig

Connect to the internet

Ensure your network interface is listed and enabled, for example with ip-link(8)

ip link

Verify the connection with ping

ping archlinux.org

Or make sure your device is connected to the Internet with Ethernet Cable.

Update the system clock

Use timedatectl(1) to ensure the system clock is accurate:

timedatectl set-ntp true

To check the service status, use:

timedatectl status

Partition the disks

Use cfdisk to partition the disk. We'll be using cfdisk in this guide. It's super easy to partition the disks with cfdisk. Seriously! Try it once.

Format the partitions

As you are done making partitions, now let's format them to make them usable.

mkfs.ext4 /dev/root_partition
mkfs.fat -F32 /dev/efi_system_partition

If you created an EFI system partition, format it to FAT32 using mkfs.fat(8).

mkswap /dev/swap_partition

Mount the file systems

mount /dev/root_partition /mnt

Now let's create some directory inside the /mnt partition to mount the efi system.

mkdir -p /mnt/boot/efi
mkdir /mnt/home

And now mount the EFI system:

mount /dev/sda1 /mnt/boot/efi

If you created a swap volume, enable it with swapon(8):

swapon /dev/swap_partition

Select the mirrors

Packages to be installed must be downloaded from mirror servers, which are defined in /etc/pacman.d/mirrorlist. On the live system, after connecting to the internet, reflector updates the mirror list by choosing 20 most recently synchronized HTTPS mirrors and sorting them by download rate.

The higher a mirror is placed in the list, the more priority it is given when downloading a package. You may want to inspect the file to see if it is satisfactory. If it is not, edit the file accordingly, and move the geographically closest mirrors to the top of the list, although other criteria should be taken into account.

This file will later be copied to the new system by pacstrap, so it is worth getting right.

Install essential packages

Use the pacstrap(8) script to install the base package, Linux kernel and firmware for common hardware:

pacstrap /mnt base linux linux-firmware vim nano linux-headers base-devel

Tip:
You can substitute linux for a kernel package of your choice, or you could omit it entirely when installing in a container.

You could omit the installation of the firmware package when installing in a virtual machine or container.

The base package does not include all tools from the live installation, so installing other packages may be necessary for a fully functional base system. In particular, consider installing:

Configure the system

Generate an fstab file (use -U or -L to define by UUID or labels, respectively):

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

Check the resulting /mnt/etc/fstab file, and edit it in case of errors.

Chroot

Change root into the new system:

arch-chroot /mnt
  • Now let's install some necessary packages which we need to complete the install process
pacman -S grub efibootmgr efivar networkmanager intel-ucode amd-ucode

if you device is support Intel microcode then install intel-ucode or if you device support AMD micorcode then install amd-ucode.

Time zone

Set the time zone:

ln -sf /usr/share/zoneinfo/Region/City /etc/localtime

Change the Region & City according to your location.

ln -sf /usr/share/zoneinfo/Asia/Dhaka /etc/localtime

Or check all the available regions

cd /usr/share/zoneinfo && ls

Select the one you need.

Run hwclock(8) to generate /etc/adjtime:

hwclock --systohc

Localization

nano /etc/locale.conf 

Enter the followings in locale.conf file

LANG=en_US.UTF-8

Edit /etc/locale.gen and uncomment en_US.UTF-8 UTF-8 and other needed locales. Generate the locales by running:

locale-gen

Network configuration

  • Create the hostname file:
nano /etc/hostname

Edit /etc/hostname and add this line:

myhostname

Alternatively, Using hostnamectl(1):

hostnamectl set-hostname myhostname
  • Some software may however still read /etc/hosts directly. To prevent them from potentially breaking or delaying operation, configure the hosts(5) file:
nano /etc/hosts
127.0.0.1	localhost
::1		localhost
127.0.1.1	myhostname

Complete the network configuration for the newly installed environment. That may include installing suitable network management software.

Initramfs

Creating a new initramfs is usually not required, because mkinitcpio is run automatically during the kernel package installation.

For LVM, system encryption, or RAID, modify mkinitcpio.conf(5) and regenerate the initramfs image:

mkinitcpio -P

Root password

Set the root password:

passwd

Install GRUB bootloader

Install GRUB in the EFI directory:

grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB

Generate the GRUB configuration file:

grub-mkconfig -o /boot/grub/grub.cfg

Enable NetworkManager

systemctl enable NetworkManager

Exit chroot

exit

Unmount

Unmount all partitions:

umount -R /mnt

Optionally, use fuser to identify any busy partitions before unmounting.

Reboot

reboot

If you see the login screen, congratulations—you've successfully installed Arch Linux!

Username: root

Password: YourRootPassword


Post-installation

A new installation only includes the root account. It is best to create an unprivileged user account for daily use.

Create a new user:

useradd --create-home myuser
passwd myuser

Add the user to common groups:

usermod -aG wheel,users,power,storage myuser

Enable sudo access for your user:

nano /etc/sudoers

Uncomment the following line:

%wheel ALL=(ALL) ALL

Install GUI

Xorg (Display Server)

Install Xorg:

pacman -S xorg

Install some basic fonts:

pacman -S ttf-dejavu ttf-droid ttf-font-awesome otf-font-awesome ttf-lato ttf-liberation ttf-opensans ttf-ubuntu-font-family

Edit FreeType configuration:

nano /etc/profile.d/freetype2.sh

Uncomment this line:

export FREETYPE_PROPERTIES="truetype:interpreter-version=40"

KDE Desktop Environment

Install KDE and SDDM (Display Manager):

pacman -S sddm plasma

(Optional) Install all KDE applications:

pacman -S kde-applications

Enable and start the display manager:

systemctl enable sddm.service
systemctl start sddm.service

And you're done! Enjoy your Arch Linux setup.

Here is the Official Arch Linux Install Guide.