Arch Linux Install Guide
This distro is toted by some to be up there with the most difficult to get running. It's really not that bad especially when compared to the likes of Gentoo/Linux from Scratch. Once you have this up and running, you can fine tune it exactly to your requirements. Think of it as being given a box of assorted lego pieces instead of a pre-built model to play with, it's so much more fun to build what you like than mess with something someone else has created, right? I think so anyway...
The AUR (Arch User Repository) is unmatched when it comes to easy access to bleeding-edge software. If it's not in the AUR, it doesn't exist! In this guide you will be partitioning your drive manually and installing all of the base packages required for a core Arch Linux install. After this, it's totally up to you what you install, whether this is going to be your home computer or just a server for tinkering.
I personally use a keyboard driven window manager i3 with Arch as my main OS. For personal home computing I have not experienced anything that comes close to this in terms of total user control and customisation.
Let's get started...
Download iso from Arch Linux website
Flash to USB drive using Etcher
Boot into the USB, you should now see:
root@archiso~#_
Check you are running an EFI system (directory should exist):
ls /sys/firmware/efi/efivars
Check disk partitions:
lsblk
Identify the drive you would like to install Arch, typically sda or sdb.
cgdisk /dev/sda
In the free space create a new EFI boot partition:
New
First sector: default (return)
Size: 600M
Hex code or GUID: ef00
Partition name: boot
In the remaining free space create the swap partition:
New
First sector: default (return)
Size: 8G (typically the same as your ram, here 8gb)
Hex code or GUID: 8200
Partition name: swap
In the remaining free space create the file system partition:
New
First sector: default (return)
Size: default (return)
Hex code or GUID: 8300
Partition name: system
Write this to the drive:
Write
yes
Quit
Now check new partitions sda1(boot) sda2(swap) sda3(system):
lsblk
Format the EFI partition:
mkfs.fat -F32 /dev/sda1
Initialize swap partition:
mkswap /dev/sda2
swapon /dev/sda2
Format system partition:
mkfs.ext4 /dev/sda3
Mount system partition:
mount /dev/sda3 /mnt
Mount EFI partition to /mnt/boot
mkdir /mnt/boot
mount /dev/sda1 /mnt/boot
Check mounts:
df
Edit mirrorlist:
vi /etc/pacman.d/mirrorlist
Put a mirror local to you at the top of this file for example:
## Sweden
Server = https://archlinux.dynamict.se/$repo/os/$arch
Install base packages:
pacstrap /mnt base base-devel
Generate a filesystem table file:
genfstab -U /mnt >> /mnt/etc/fstab
chroot into your new Arch install:
arch-chroot /mnt
Configure local time:
ln -sf /usr/share/zoneinfo/Europe/London /etc/localtime
Set system to hardware clock:
hwclock --systohc
Edit locale.gen:
vi /etc/local.gen
Uncomment this line:
en_US.UTF-8 UTF-8
Generate locale:
locale-gen
Create local.conf:
echo "LANG=en_US.UTF-8" > /etc/locale.conf
Set hostname:
vi /etc/hostname
Put your hostname here:
pc
Make password for root account:
passwd
Create user:
useradd -g users -G wheel,storage,power -m user
Fetch bootloader packages:
pacman -S grub efibootmgr
Install grub:
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
Install os-prober:
pacman -S os-prober
Generate grub config file:
grub-mkconfig -o /boot/grub/grub.cfg
Exit chroot and reboot:
exit
reboot
Log in to root
Check network adapter name e.g. ens18:
ip addr show
Enable dhcpc:
systemctl enable dhcpcd@ens18 --now
Check connection:
ip addr show
Install ssh:
pacman -S openssh
Give user sudo privileges:
visudo
Uncomment this line:
%wheel ALL=(ALL) NOPASSWD: ALL
Give user a password:
passwd user
Install ssh and start service:
pacman -S openssh
systemctl enable sshd --now
That's it! You have a base Arch Linux install ready to go. You might wonder, where is my desktop? My programs? The next step is to install a desktop environment, perhaps check out Distrowatch to find one one to your liking and then install the appropriate packages through pacman.
Also, it is likely you will need to install some proprietary drivers for things such as graphics cards or network adapters. This is where I will direct you to the 'bible' of Arch Linux, their wiki! It is so extensive and full of information that even other OSs use it as a reference. If in doubt RTFM... Goodluck!