A Helpful Arch Installation Guide

an arch install has several phases:

as the arch installation process changes every so often, be sure to check out
the official up-to-date guide:

there's also a guided install process for arch called `archinstall`.
it's especially useful for when you have a fresh complete hard drive to boot from.
$ pacman -S archinstall
$ archinstall


0. general advisory


there are some things that make installing linux easier.

the first is having linux-compatible parts.

the second is having a fresh computer to work with.

the third is having backups.

the fourth is having an ethernet cable.


1. preparing the installation medium


i usually prepare the install medium from windows.
i go to the arch website and click the magnet link for the torrent.

once i have the arch .iso downloaded, i put it onto a flash drive.
arch itself is only a gig-ish, so you don't need a very big flash drive.
if you have a laptop with only usb-c ports (macbook pro or xps), you might need a dongle.
usb install is the one i'm familiar with and i believe it's easier than the others.

i use rufus on windows to put the arch .iso on the flash drive.
i think it prompts you whether you want to make your flash drive rewritable
i've not noticed a difference with either option, so i just keep it rewritable.
make sure you wait for rufus to finish, as far as i remember it says "START" when it's done,

once it's done, reboot your computer and go to step 2


2. booting from the installation medium


a windows computer, especially laptops, will have annoying boot stuff,

here are the official notes for installation when dualbooting with windows

on boot, do a piano scale on the function keys to see which one gives you your boot menu.
choose the USB you plugged in with arch on it.

from the arch live install boot menu, i pick

once we've booted the arch install medium, it should show a command line with the user "root".
now we actually begin installing.

if you've experience with other unix/linux installations,
arch's installation medium is like that: it literally runs arch.

right now, as you've booted from the USB, the USB itself is the filesystem root or "/".

to make another disk a child/subfolder of this one, we can use the "mount" command.

there are some files and folders on linux that represent the system's view of its devices and the

let's run pre-setup commands to get us started.
the arch wiki tells us to set the console keyboard layout and to verify the boot mode.
$ ls /usr/share/kbd/keymaps/**/*.map.gz  # see available layouts
$ loadkeys de-latin1                     # if you've a german keyboard, i guess
$ ls /sys/firmware/efi/efivars           # to check that we've booted using EUFI,
$                                        # has better DPI, but not sure why else we'd care

so by now, we've actually booted.
here are the things we have to do:

2.1. ethernet or iwctl: connect to the internet


if you have an ethernet cable plugged in, skip this step. check that your internet works with
$ ping google.com

otherwise, you'll need to connect to wifi.
arch linux used to have wifi-menu, which i preferred a bit,
but they have iwctl now.

TODO maybe explain how to use iwctl, but i need to figure it out first.

once we've connected to the internet, we can also fix the time
$ timedatectl set-ntp true   # sync the time with the internet
$ timedatectl status         # check status
$ date                       # check date

2.2. genfstab: format filesystem and disk layout


so what we're going to do is clear out some space, chop up the space we have,

to figure out what disks and devices you have, run
$ fdisk -l

if you have an nvme ssd, it'll say something like "/dev/nvme0n1"
if you have a traditional hard disk, it'll say something like "/dev/sda" or "/dev/sdb"

to clear out some space and chop it up,

the way we deal with partition will be to:

we'll require two partitions, and i recommend adding a home partition and a swap partition as well:

i recommend having a home partition so

to make the partitions, use `cfdisk`.

TODO explanation for how to use cfdisk

once we have partitions of the correct size,

let's assume we have a completely clear disk on a computer with
let's say that the result of partitioning with `cfdisk` is like so:
# /dev/nvme0n1p1  512  megs  "EFI System"
# /dev/nvme0n1p2  40.5 gigs  "Linux root" or "Linux filesystem"
# /dev/nvme0n1p3  the rest   "Linux home"
# /dev/nvme0n1p4  [SWAP]     "Linux swap"

we can verify the paritions using "fdisk -l"

let's format them with the right filesystems.
$ mkfs.fat -F32 /dev/nvmen1p1  # for the EFI System
$ mkswap /dev/nvme0n1p4        # for the swap file
$ mkfs.ext4 /dev/nvme0n1p2     # for linux root
$ mkfs.ext4 /dev/nvme0n1p3     # and home

for creating and mounting filesystems
for `mkfs.fat -F32`

now let's mount them up:
$ mount /dev/nvme0n1p2 /mnt
$ mkdir /mnt/boot
$ mount /dev/nvme0n1p1 /mnt/boot
$ mkdir /mnt/home
$ mount /dev/nvme0n0p3 /mnt/home

now we're going to save that filesystem
$ mkdir /mnt/etc
$ genfstab -U /mnt >> /mnt/etc/fstab

2.3. pacstrap: bootstrap the package manager


we're gonna provide our system with a primitive set of packages to let it boot
the "pacstrap" command not only provides the linux kernel to boot the system,

$ pacstrap /mnt 

so here are the packages you need:

here are the packages i normally install:

i use gnome as a "safe" backup and then i pull my fork of dwm using git later.

you also need a bootloader:

if i'm just booting arch linux, i use systemd-boot.
if i'm dual booting or booting multiple linuxes, i use refind-efi.

to set up refind-efi, run:
$ refind-install --usedefault /dev/nvme0n1p1

2.4. configure the system


we're going to change our root from the USB to the disk,
$ arch-chroot /mnt

set timezone, e.g.
$ timedatectl set-timezone US/Central
$ timedatectl set-ntp true
$ ln -sf /usr/share/zoneinfo/US/Central /etc/localtime

sync hardware clock to system
$ hwclock --systohc

set the locale to en_US.UTF-8
$ nano /etc/locale.gen
$ locale-gen
$ echo 'LANG=en_US.UTF-8' >> /etc/locale.conf

for some reason, we need this
$ echo 'LANG=en_US.UTF-8' >> /etc/default/locale

pick your computer's name
$ echo 'arkaz-prime' >> /etc/hostname

$ nano /etc/hosts
| 127.0.0.1  localhost
| ::1        localhost
| 127.0.1.1  arkaz-prime.localdomain arkaz-prime
+-------------------------------------------------

set the password for the root user
$ passwd

i've had an issue with internet when i boot for the first time,
feel free to skip this and just boot from the USB again,

$ nano /etc/systemd/network/enp0s3.network
| [Match]
| name=en*
| [Network]
| DHCP=yes
+--------------

$ systemctl restart systemd-networkd
$ systemctl enable systemd-networkd

$ nano /etc/resolv.conf
| nameserver 8.8.8.8
| nameserver 8.8.4.4
+--------------------


3. first reboot: booting from the computer's hard disk for the first time


moment of truth.
make sure you're not booting from the installation media.

you'll wanna do the piano roll on the function keys again.
if you set it to default boot from USB in your BIOS,

once we've selected the right OS from our bootloader, log in with:
"user: root"
and the password you made with `passwd`

let's check the internet works
$ ping 8.8.8.8
$ dhcpcd
$ ping google.com

the live system uses reflector to sort the mirrors by download speed.
we can do that too:
$ pacman -S reflector
$ reflector

the old method uses something from pacman-contrib
$ pacman -S pacman-contrib
$ pushd /etc/pacman.d/
$   cp mirrorlist mirrorlist.backup
$   rankmirrors -n 6 mirrorlist.backup > mirrorlist
$ popd

once we've got the computer working fair and square, let's do some:

3.1. user setup


add the user "kasra" and make him an admin user
$ groupadd wheel
$ useradd -m -G wheel -c "Kasra Sadeghi" kasra
$ passwd kasra

look for a line that looks like this, and uncomment it
$ visudo
| # %wheel  ALL=(ALL)   ALL
+------v- uncomment -v-------
| %wheel  ALL=(ALL)   ALL
+----------------------------

3.2. graphics driver setup


for an AMD gpu:
$ pacman -S mesa glu xf86-video-amdgpu

FAQ what are xf86-video-amdgpu and mesa?

for vulkan and video encoding support, install:
$ pacman -S vulkan-radeon libva-mesa-driver mesa-vdpau

mesa is "An open-source implementation of the OpenGL specification"

FAQ a reddit thread that says you don't need amdgpu, mesa is fine

FAQ a reddit thread that says to use xf86-video-vesa as a fallback

to check that the right graphics driver is loaded:
$ lspci -k | grep -EA3 'VGA|3D|Display'

for an Nvidia gpu that's more recent that the GTX 930:
$ pacman -S nvidia

3.3. aur helper


there are some tools that automatically search and install stuff

i use one called `yay`.

$ git clone https://aur.archlinux.org/yay-bin.git
$ cd yay-bin
$ makepkg -si
$ cd ..
$ rm -rf yay-bin        # optional, may want it to repull and fix yay if it breaks
$ yay                   # system update/upgrade
$ yay -S google-chrome  # proprietary web browser

get a colorful yay output, uncomment these lines
$ nano /etc/pacman.conf
| Color
| ILoveCandy
+---------------------

download some final packages, like
$ yay -S gnome-tweaks mlocate

download dotfiles
$ git clone git@github.com:user/.emacs.d


closing thoughts


installing arch is kinda hard, but it's (in my experience) the easiest to use
it's fairly stable, easy to update, easy

i've never had my computer become inoperable or had a service i was running