Install Arch Linux
This is my personal step-by-step guide for installing Arch Linux on x86-64 UEFI based machines. This guide is a slimmed down and simplified version of the Installation guide on ArchWiki.
Pre-installation
Keyboard layout
loadkeys sv-latin1More info: console keymap
Pacman mirrors
Edit /etc/pacman.d/mirrorlist and uncomment a couple of nearby mirrors.
More info: mirrorlist
Verify the boot mode
ls /sys/firmware/efi/efivars“Stuff” should show up.
More info: efivars
Test internet connection
ping -c 3 archlinux.orgMore info: ping
Update the system clock
timedatectl set-ntp trueMore info: timedatectl(1)
Create and format partitions
Find your drive
fdisk -lMore info: fdisk
Wipe the drive
shred --verbose --random-source=/dev/urandom --iterations=1 /dev/`yourdrive`yourdrive should be replaced with your storage device, e.g. sda.
More info: shred
Create a boot and root partition
cfdisk /dev/`yourdrive`More info: fdisk | cfdisk | partitioning
- Partition table: GPT
- New → Partition Size: 512 MiB → EFI System
- New → Partition Size: xxxG → Linux Filesystem
List your partitions
fdisk -l `yourdrive`Format the partitions
mkfs.fat -F32 /dev/`efipartition`mkfs.ext4 /dev/`rootpartition`More info: filesystems | mkfs.fat | mkfs.ext4
Mount the partitions
mount /dev/`rootpartition` /mntmkdir /mnt/bootmount /dev/`efipartition` /mnt/bootMore info: mount
Installation
pacstrap /mnt base base-devel linux linux-firmware dhcpcd efibootmgr grub inetutils lvm2 man-db man-pages nano netctl sudo sysfsutils texinfo usbutils vi whichMore info: pacstrap | base | base-devel
Configure the system
Fstab
genfstab -U /mnt >> /mnt/etc/fstabMore info: fstab
Chroot
This will change the root directory to our new installation.
arch-chroot /mntMore info: chroot
Time
Set time zone
ln -sf /usr/share/zoneinfo/Europe/Stockholm /etc/localtimeMore info: time zone
Set the hardware clock
hwclock --systohc --utcMore info: hwclock
Localization
Generate locales
Edit /etc/locale.gen and uncomment en_US.UTF-8 UTF-8.
locale-genMore info: localizations
Set system language
LANG=en_US.UTF-8More info: locale.conf
Set keyboard layout
For a Swedish keyboard layout, the file should contain: KEYMAP=sv-latin1.
KEYMAP=sv-latin1More info: vconsole.conf
Network
Hostname
This file should only contain the hostname for this device
yourhostnameMore info: hostname
Hosts
127.0.0.1 localhost::1 localhost127.0.1.1 myhostname.localdomain myhostname- Change
hostnameto your hostname - If this system has a public IP address, it should be used instead of
127.0.1.1
More info: hosts(5)
DHCP
To get network access we need to enable dhcpcd.service.
systemctl enable dhcpcd.serviceMore info: network managers | dhcpcd
Root password
passwdMore info: password
Bootloader
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=arch_grubMore info: GRUB | UEFI | grub | efibootmgr
Microcode
Depending on your CPU you need to install the latest microcode.
pacman -S <intel-ucode or amd-ucode>More info: Microcode | intel-ucode | amd-ucode
GRUB
grub-mkconfig -o /boot/grub/grub.cfgMore info: GRUB
Exit chroot
exitFinish
Reboot
Reboot your system and remove your installation media.
reboot