Artix Linux Installation Guide

2024-12-08

The USB Drive

Downloading the ISO

  1. Get the ISO from the Artix Website

Burning the ISO

On linux, connect your usb drive and run lsblk. Assuming your usb drive is /dev/sdb, run

dd if=<path-to-iso> of=/dev/sdb status=progress bs=4M

as root.

WARNING: dd is the famous disk destroyer! Don't get the output file wrong or you could lose all your data.

The Installation

Connecting to WiFi

  1. See if you're connected to the internet. Try

    ping almela.io
    

    If this works for you, you can skip this section.

  2. Get the name of your interface using

    ip link
    

    Ignoring lo, which is the loopback address. Usually it looks like wlan0 or wlp2s0 for WiFi.

  3. Create a config file to connect to your WiFi:

    wpa_passphrase "<SSID>" "<password>" > /etc/wpa_supplicant.conf
    

    Where <SSID> is the name of your WiFi, and <password> is... its password.

    If you don't have the required permissions to run this, try it as root using sudo su.

  4. Start wpa_supplicant

    sudo wpa_supplicant -B -i <interface> -c /etc/wpa_supplicant.conf
    

    Where <interface> is the interface you found in step 1.

  5. Obtain an IP Address: After wpa_supplicant is connected, you need to request an IP address using dhclient

    sudo dhclient <interface>
    

    If this fails with message RTNETLINK answers: Operation not possible due to RF-kill, try running rfkill unblock <interface*> where <interface*> is just <interface> without the numbered suffix. For instance if your interface is wlan0, <interface*> is just wlan.

  6. Attempt step 0 again.

Paritioning your drive

On a 1Tb drive, I would do

PartitionSizeNotes
BOOT1G
ROOT99GIncludes swap file
HOME900G

At this stage, I like to use fdisk.

sudo fdisk /dev/<blk>

TODO: elaborate

Mounting filesystems

Checking for EFI

Modern systems use EFI, to check if you do, run

ls /sys/firmware/efi/efivars

If this returns anything, you're using EFI.

This impacts how we make the root parition. EFI systems should format the root as FAT32 instead of the usual Linux ext4.

Assuming <blk> is your block device, I do:

mkfs.fat -F 32    /dev/<blk>X       # BOOT partition for EFI
fatlabel          /dev/<blk>X ESP

mkfs.ext4 -L ROOT /dev/<blk>Y       # ROOT partition
mkfs.ext4 -L HOME /dev/<blk>Z       # HOME partition

Most often, <blk> will be sda and X, Y, Z will be 1, 2, and 3 respectively. Though on nvme ssds it's usually nvme0n1, with X, Y, and Z as p1, p2, and p3.

Mounting the Partitions

Mount the ROOT partition

mount /dev/disk/by-label/ROOT /mnt

Create the BOOT and HOME directories

mkdir /mnt/boot
mkdir /mnt/home

Mount HOME

mount /dev/disk/by-label/HOME /mnt/home

Mount the EFI partition

mkdir /mnt/boot/efi
mount /dev/disk/by-label/ESP /mnt/boot/efi

Misc

NOTE: skip? ntpd is not installed by default

Set up the system clock. I use runit, so

sv up ntpd

Installing the base system & kernel

Before we install the basic programs and kernel, there are a few steps we can take which will help us download these faster.

  1. You can edit your mirrorlist at /etc/pacman.d/mirrorlist and put mirrors closer to you at the top. This should help you download things faster

  2. You can also edit the ParallelDownloads flag in /etc/pacman.conf. I usually set it to 20.

Once this is done,

basestrap /mnt base base-devel linux linux-firmware networkmanager networkmanager-runit vim runit elogind-runit grub os-prober efibootmgr

Everything after /mnt is programs that will be installed on the base system. I like to keep it simple at this stage as most packages will be installed later on.

Generating the fstab

Verify the output of

fstabgen -U /mnt

If happy, write it for real using

fstabgen -U /mnt >> /mnt/etc/fstab

Note: You may need to be root for this, use sudo su, and exit when done.

Jumping into the real system

artix-chroot /mnt # formerly artools-chroot

Configuring the base system

Setting the timezone

For example, if you're in the EST timezone,

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

Update the hardware clock

hwclock --systohc

Setting the locale

Create a file at /etc/locale.conf with contents

export LANG="en_US.UTF-8"
export LC_COLLATE="C"

Next, in /etc/locale.gen, uncomment your locale of choice. For me that's usually

en_US.UTF-8 UTF-8
en_US ISO-8859-1

Once done, update your locale info by running

locale-gen

Configuring the Boot Loader

For EFI systems, this is

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

Set the root password

passwd

Network Configs

  1. Create a hostname

    vim /etc/hostname
    

    Pick a good name for your computer. Write it in the file, save, and exit.

  2. Write hosts

    vim /etc/hosts
    

    And write

    127.0.0.1        localhost
    ::1              localhost
    127.0.1.1        <hostname>.localdomain  <hostname>
    

    Where <hostname> is the hostname you picked in step 1.

    Note: There are 3 columns in the above file, separating each of them are tabs, not spaces. It's unclear to me if this matters, but I've always done it that way.

Enable WiFi on boot

ln -s /etc/runit/sv/NetworkManager /etc/runit/runsvdir/current

Reboot the system

Exit the chroot environment

exit
umount -R /mnt
reboot