Artix Installation

This guide presumes your computer is x86_64 & has UEFI, but details on what to do for BIOS are given.

UEFI was made to try (& failed) to prevent people from installing GNU/Linux.

Preparation

Download Artix Linux (runit), then download Rufus. Artix is an Arch-based Linux distro but without systemd. This means it will boot faster. Rufus can flash the install image to a USB drive, which we will then boot from to actually install Artix onto the computer.

Partitions

Make the partitions:

fdisk /dev/sda

Then:

d	# Deletes prior partition. No going back. Do this until no partitions are left.
n	# Creates new partition. Press enter three times, then enter:
+1G
n	# Creates second partition. Just press enter through the rest.
w	# Write changes.

If there’s no previous partition on the disk, ignore entering d.

Format the first partition, encrypt & format the second. If the password is lost, so is all the data (it can be changed later):

mkfs.fat -F32 /dev/sda1
fatlabel /dev/sda1 ESP
cryptsetup luksFormat /dev/sda2
cryptsetup open /dev/sda2 main
mkfs.btrfs /dev/mapper/main

Change mkfs.fat -F32 to mkfs.ext4 & skip fatlabel if using BIOS instead of UEFI.

Mount partitions:

mount /dev/mapper/main /mnt
mkdir -p /mnt/boot
mount /dev/sda1 /mnt/boot

Installation

Connect to the internet, then install the base packages:

basestrap /mnt base runit elogind-runit linux linux-firmware grub networkmanager networkmanager-runit cryptsetup lvm2 lvm2-runit neovim efibootmgr

Omit efibootmgr if using BIOS instead of UEFI.

Configuration

Change root into the new system:

artix-chroot /mnt bash

Set time zone. Replace Region/City with your region & city (i.e America/New_York):

ln -s /usr/share/zoneinfo/Region/City /etc/localtime
hwclock --systohc

Open locale.gen in nvim:

nvim /etc/locale.gen

Then uncomment (delete the #) for your locale, e.g. en_US.UTF-8.

The basics of vim are: i to enter insert (typing) mode, : to run commands, in this case :w to write (save), & :q to quit (exit). ESC to escape any mode (insert, command, visual) to enter another or input a command (i.e. :wq).

You can press / to search for your locale.

Generate the locale:

locale-gen

Open /etc/locale.conf in nvim:

nvim /etc/locale.conf

Then type in:

export LANG="en_US.UTF-8"	# Change this to your locale.
export LC_COLLATE="C"

Name the computer. Replace "name" with what you want to name it:

echo "name" > /etc/hostname

Open /etc/hosts with nvim:

nvim /etc/hosts

Input the following. Replace name with the previous name:

127.0.0.1	localhost
::1			localhost
127.0.1.1	name.localdomain name

Enable the network manager at boot:

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

Set a system password. You can make it the same as the encryption password, or different:

passwd

Autodecrypt

Open /etc/mkinitcpio.conf in nvim:

nvim /etc/mkinitcpio.conf

Edit the HOOKS= line at the bottom (press G) to read:

HOOKS=(base udev autodetect modconf kms keyboard keymap consolefont block encrypt lvm2 filesystems fsck)

Re-run mkinitcpio, exit the system, output the mount points, & generate the filesystem table:

mkinitcpio -p linux
exit
lsblk -f >> /mnt/etc/default/grub
fstabgen -U /mnt >> /mnt/etc/fstab

Change root into the system again & open /etc/default/grub in nvim:

artix-chroot /mnt bash
nvim /etc/default/grub

Delete the mess at the bottom (G), except for the UUIDs. Copy those (yy) & paste them (p) at the top (gg) below the line GRUB_CMDLINE_LINUX_DEFAULT=. Then change it to read, sda2 here standing for its UUID, & main for its UUID:

GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 quiet cryptdevice=UUID=sda2:cryptlvm root=UUID=main"

Set the bootloader:

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

Run grub-install --recheck /dev/sda if using BIOS instead of UEFI.

Completion

Shutdown, remove the USB drive, & on reboot you should be at a login prompt for a new Artix Linux installation:

exit
reboot

Post-Installation

Login as root & run:

curl -LO larbs.xyz/larbs.sh
sh larbs.sh

This will automate making a user, &c.

Related
Linux · Desktop · Technology