Writing About

Install Archlinux from zero

First, download the ISO file from the Archlinux webpage and create a bootable USB drive with Rufus. When finished, reboot your computer and wait for your motherboard logo on screen. Press F11 key and choose to boot from your attached USB drive. After loading, a root prompt will be displayed.

Archlinux welcome screen from live ISO
Figure 1 Archlinux welcome screen from live ISO

Set the console keyboard layout.

loadkeys es

Verify connection with ping.

ping -c 3 archlinux.org

Partition the disk into boot and root.

fdisk -l
fdisk /dev/sda

Create a new empty GPT partition table with g and then add the following partitions with n. Then write the table to disk and exit with w.

Mount point Partition Partition type Size
/mnt/boot /dev/sda1 1 (EFI System) 512M
/mnt /dev/sda2 23 (Linux x86-64 root) Remainder

Format the newly created partitions.

mkfs.fat -F 32 /dev/sda1
mkfs.ext4 /dev/sda2

Mount the file system.

mount /dev/sda2 /mnt
mount --mkdir /dev/sda1 /mnt/boot

Install esential packages onto the mounted drive.

pacstrap -K /mnt \
	base \
	base-devel \
	linux \
	linux-firmware \
	amd-ucode \ # for amd cpus
	efibootmgr \
	neovim \
	man-db \
	networkmanager \
	sudo \
	zsh

Generate fstab file.

genfstab -U /mnt >> /mnt/etc/fstab

Change root into the new system.

arch-chroot /mnt

Set the time zone.

ln -sf /usr/share/zoneinfo/Europe/Madrid /etc/localtime

Generate /etc/adjtime.

hwclock --systohc

Generate UTF-8locales uncommenting the desired line.

nvim /etc/locale.gen
locale-gen

Set LANG variable.

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

Set console keyboard layout

echo "KEYMAP=es" >> /etc/vconsole.conf

Set hostname

echo "archie" >> /etc/hostname

Enable network management

systemctl enable NetworkManager.service

Update  initramfs

mkinitcpio -P

Set root password

passwd

Create unprivileged user

useradd -m -G wheel -s /usr/bin/zsh me

Set password for unprivileged user

passwd me

Allow members of group wheel sudo access

EDITOR=nvim visudo

Check UUID of root partition /dev/sda2

blkid -s UUID -o value /dev/sda2

Create a boot entry

efibootmgr \
	--create \
	--disk /dev/sda \
	--part 1 \
	--label "Archlinux" \
	--loader /vmlinuz-linux \
	--unicode 'root=UUID=01a40dd8-28f0-4636-be1e-aeed60c98095 rw initrd=\amd-ucode.img initrd=\initramfs-linux.img'

Delete previous entries

efibootmgr -v 
efibootmgr -b 000X -B

Exit mounted system

exit
umount -R /mnt
reboot

Comentarios