Archup

A straight to the point Arch Linux installation guide for beginners.

Preface

The goal of this guide is to reiterate what has already been provided by the official Arch Linux installation guide, alongside a few things I've learned along the way.

If you want, you can practice installing Arch in a virtual machine, such as VirtualBox (for Windows) or virt-manager (for Linux).

Follow this guide carefully, as the Arch installer is powerful, but unforgiving. It does not care about your data. Its job is to do exactly what you tell it.

Step 1: Preparing the installation medium

To start, you will need to create an Arch Linux installation medium.

Because this guide is for the installation only, I will delve into how to format an installation medium. There are countless resources online.

Visit the Arch Linux download page to grab an ISO image.

If you are on Windows, I'd recommend using the Rufus formatting utility.

Make sure you set the file system to GPT to enable UEFI.

If you are on Linux, you can use the dd command.

lsblk # identify the correct drive
sudo dd if=/path/to/your/iso of=/dev/<YOUR DRIVE> bs=1M status=progress # WARNING: this command is EXTREMELY dangerous, please ensure you specify the correct drive

lsblk | List disks, their partitions, alongside other useful information.

dd | Low-level copying command.

if | Input file.

of | Output file/location.

bs | Block size, 1M is usually good enough by default. This determines how much data to copy in each pass.

status | Enable live output of the progress.


You are now ready to start the installation process. Restart your computer and boot into the installation drive.

Step 2: Partitioning

Once you have booted into the Arch installer, you will need to partition your disks.

Identify the correct drive:

lsblk

Here is an example output:

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS nvme0n1 259:0 0 931.5G 0 disk

Ensure you are using the correct drive for your setup, common names are: nvme0n1, sda, sdb, or something else.

If you are NOT planning on dual booting, I recommend cleaning your disks beforehand:

wipefs -a /dev/<YOUR DRIVE> # this will only clear partition information and it will not clear data, usually this is good enough

If you want to fully wipe the drive:

dd if=/dev/zero of=/dev/<YOUR DRIVE> bs=1M count=<COUNT> status=progress # remove count if you want to do a full reset, this value will determine how far into the drive to zero, I recommend setting this between 100 - 1000

Open cfdisk to start partitioning your drive:

cfdisk # we will use cfdisk to partition our drives, as it offers a friendly GUI environment

Use New to create a partition. You will create three:

Partition 1 | Make this 100M in size. You will use this as your EFI boot partition. Which will contain the files that tell your system how to boot.

Partition 2 | Make this 4G in size. You will use this as your swap partition. Which will store excess memory/ram in the case that it overflows.

Partition 3 | Make this the remaining size. You will use this as your root partition. (where your files will be stored)

When you are done, use Write to apply the changes. Again, please ensure you are using the proper drive because this will overwrite partition tables. (data loss)

Now you will make the filesystem.

mkfs.ext4 /dev/<YOUR THIRD PARTITION> # creates the root partition, you will be using ext4
mkfs.fat -F 32 /dev/<YOUR FIRST PARTITION> # creates the EFI partition, you will be using the FAT32 filesystem, as it is required by UEFI
mkswap /dev/<YOUR SECOND PARTITION> # creates the swap partition

Next, you need to mount the partitions in order to be accessed:

mount /dev/<YOUR THIRD PARTITION> /mnt # /mnt (mount) is where your root drive will be mounted
mount --mkdir /dev/<YOUR FIRST PARTITION> /mnt/boot/efi
swapon /dev/<YOUR SECOND PARTITION> # enable the swap partition

--mkdir | Creates directories recursively to ensure they exist.

If you followed everything correctly, run lsblk again. It should look something like this:

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS nvme0n1 259:0 0 931.5G 0 disk ├─nvme0n1p1 259:1 0 100M 0 part /boot/efi ├─nvme0n1p2 259:2 0 4G 0 part [SWAP] └─nvme0n1p3 259:3 0 927.4G 0 part /

Step 3: Installing the system

pacstrap will be used to install the system with the following packages:

pacstrap /mnt base linux linux-firmware base-devel grub efibootmgr nano networkmanager

pacstrap | Package manager used for installing the system.

/mnt | Specify to install to the "/mnt" directory, which is your root system.

base | Core packages.

base-devel | Essential packages for development, required for AUR packages. This is optional.

linux | The Linux Kernel.

linux-firmware | Firmware for various hardware devices.

grub | A bootloader.

efibootmgr | A tool to manage UEFI boot entries.

networkmanager | A networking utility.

nano | A text editor that runs in the terminal.

Step 4: Configuring the system

You are now ready to configure the system.

First, you must tell Arch which drives you want to boot to. You will use genfstab for this:

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

genfstab | Generates an fstab configuration, which will tell your system which drives to mount at boot.

-U | Tells the generator to use UUID's to identify drives, which is more reliable then just using drive names, as they can change.

>> | Append the data to the fstab configuration.

At the moment, you are still running commands on the installation medium. To access and modify the system further, you need to root into the system.

arch-chroot /mnt

Configuring the timezone

Now you will configure your locale information, first you will setup your timezone.

You can use the ls (list directories) command to find your region. For example:

ls /usr/share/zoneinfo

To see the regions in, for example: America. You would do:

ls /usr/share/zoneinfo/America

Once you find your region, you can assign it to your system:

ln -sf /usr/share/zoneinfo/<REGION>/<ZONE> /etc/localtime
hwclock --systohc

ln | The link command.

-sf | Force a symbolic link.

hwclock | Set the hardware clock.

--systohc | Write the system clock to the hardware clock.

You can verify if your timezone was properly set by running:

date

Configuring the system-wide locale

Next you will need to configure the system locale. This will tell your system your language, how to encode characters/time formats, etc.

nano /etc/locale.gen

nano | The text editor you installed earlier, this will be used to edit configurations in the terminal.

The basic controls of nano are as follows:

Up/Down Arrows | Navigate up and down.

Ctrl + O | Write/save a file.

Ctrl + X | Exit nano.

Find the locale that fits your language/region, then uncomment it by removing the #.

For US English, you can use en_US.UTF-8 UTF-8.

Generate your selected locales:

locale-gen

Setting the hostname

You can set the hostname here:

nano /etc/hostname

Your hostname may only contain a-z, 0-9, and -'s, and it may not start or end with a -.

Setting the root password

passwd

Enabling NetworkManager

systemctl enable NetworkManager

systemctl | The system service manager.

Step 5: Configuring the user

Create a user:

useradd -m -G wheel -s /bin/bash <USERNAME>

-m | Create the home directory. (/home/<USERNAME>)

-G wheel | Set the group to wheel, this will be used for sudo.

-s /bin/bash | Set the login shell.

Setting the user password:

passwd <USERNAME>

Enabling sudo

EDITOR=nano visudo

Look for a line near the bottom that looks something like:

%wheel ALL=(ALL:ALL) ALL

Then uncomment it by removing the #.

Step 6: Configuring the bootloader

grub-install /dev/<YOUR DRIVE> grub-mkconfig -o /boot/grub/grub.cfg exit reboot

Step 7: Installing the desktop manager

There are tons of desktop managers to choose, for the sake of this guide and for beginners, I highly recommend using KDE Plasma:

sudo pacman -Syu plasma sddm
sudo systemctl enable --now sddm

After this, you should be placed directly inside sddm. You can login with the password you set in step 5.

If you followed the steps properly, you should now have a functional KDE Plasma desktop environment. No apps will be installed by default, follow the next step for recommendations.

Recommendations

There are a few important extra things to install and configure:

NVIDIA drivers

If you have an NVIDIA graphics card, you should install the appropriate drivers.

sudo pacman -Syu nvidia
sudo reboot now

Drive auto-mounting

By default, extra drives will not be automatically mounted on boot.

Start by creating a mount folder:

sudo mkdir /mnt/<MOUNT DIRECTORY>
sudo chown -R <USER>:<USER> /mnt/<MOUNT DIRECTORY>

chown | Change the ownership of /mnt/<MOUNT DIRECTORY>.

-R | Recursively change each entry. (if you have stuff in that directory)

<USER>:<USER> | Set the user and group owner.

Get the UUID of the drive you want to auto-mount:

sudo blkid

Add an entry for the drive in fstab:

sudo nano /etc/fstab

Add the following line:

UUID=<DRIVE UUID> /mnt/<MOUNT DIRECTORY> ext4 defaults 0 2

ext4 | ext4 is a common filesystem type. You can change it to your needs.

defaults | Default mount options.

0 | Disable obsolete dump backup tool.

2 | Enable the filesystem check after the root.

SSD trimming

If you have an SSD, it is important you enable trimming to improve the longevity and efficiency of your drive.

Before following this step, check to see if your drive supports trimming:

lsblk --discard # look at the DISC-GRAN and DISC-MAX values, non-zero values indicate the drive supports trimming.

--discard | Displays discard information for all drives.

If you drive supports trimming, enable the trimming service:

sudo systemctl enable fstrim.timer
sudo systemctl start fstrim.timer

You can check its status with:

sudo systemctl status fstrim.timer

If you want to manually start a trim:

sudo fstrim -v / # '/' species the root directory

-v | Enable verbose logging.

Useful Packages

I've curated a list of common packages I tend to install on my own system:

You can find them here