Installing Arch Linux Cheatsheet

8 Apr 2019

I tend to use Arch Linux at home for server-y stuff, but I don’t do it often enough to remember the rough comannds. You can use the wiki but I just need a reminder so here’s the one I use.

There’s minimal explanation here, as I’m assuming you know your way around Linux. If not, go read the Installation guide.

$ loadkeys uk
$ ping archlinux.org
$ timedatectl set-ntp true
$ cfdisk /dev/sda
    > Pick gpt
    > Create a 100M EFI partition
    > Make the rest ext4
$ mkfs.msdox -n BOOT /dev/sda1
$ mkfs.ext4 -L root /dev/sda2
$ mount /dev/sda2 /mnt
$ mkdir /mnt/boot
$ mount /dev/sda1 /mnt/boot

$ nano -w /etc/pacman.d/mirrorlist
Edit /etc/pacman.d/mirrorlist to bring your cloest mirror near the top.

$ pacstrap /mnt base
$ genfstab -U /mnt >> /mnt/etc/fstab
$ arch-chroot /mnt
$ ln -sf /usr/share/zoneinfo/Europe/London /etc/localtime
$ hwclock --systohc

$ nano -w /etc/locale.gen
Uncomment the lines in /etc/locale.gen you want (en_GB.UTF-8, en_GB.ISO for me)
$ locale-gen

$ echo "LANG=en_GB.UTF-8" > /etc/locale.conf

$ echo "KEYMAP=uk" > /etc/vconsole.conf

$ echo "arch" >> /etc/hostname

$ echo "127.0.0.1 arch localhost" >> /etc/hosts

Assuming DHCP:
$ cd /etc/netctl
$ cp examples/ethernet-dhcp localnet
Edit the device that the config is trying to use
$ netctl enable localnet

$ mkinitcpio -p linux
$ passwd

$ bootctl install --path=/boot
$ cd /boot/loader

$ nano -w loader.conf
Remove the current default line and add:
default arch

$ blkid -o value -s PARTUUID /dev/sda2 >> entries/arch.conf

$ nano -w entries/arch.conf
Edit the base boot entry we just made to make it valid, LONG_GUID_HERE should be the
value the previous command added to the file:
title	Arch Linux
linux	/vmlinuz-linux
initrd	/initramfs-linux.img
options	root=PARTUUID=LONG_GUID_HERE rw

$ exit
$ sync
$ umount /mnt/boot /mnt
$ reboot

To get a useable server desktop environment, assuming you count i3 as useable, you can do this:

pacman -S adobe-source-sans-pro-fonts dmenu gtk3 i3 mc p7zip papirus-icon-theme \
qterminal tigervnc ttf-anonymous-pro ttf-bitstream-vera ttf-croscore ttf-dejavu \
ttf-inconsolata

I tend to put a lot of fonts on as not having good ones just makes things painful to look at.