<-- Back
Arch Linux - base installation

This post will assume the following partition layout (UEFI installation):

Format partitions

Issue lsblk to identify the partitions that you will need. In my case, since I only have one hard drive it will be:

mkfs.fat -F32 /dev/sda1 -I
mkfs.ext4 /dev/sda2
mkfs.ext4 /dev/sda3
mkfs.ext4 /dev/sda4

Mount partitions

mount /dev/sda2 /mnt
mkdir -p /mnt/home
mkdir -p /mnt/data
mount /dev/sda3 /mnt/home
mount /dev/sda4 /mnt/data

Connect to the Internet

There are few ways of doing it, but the most convinient for me is to execute the below, and just choose the network and type in the password

wifi-menu -o

Setup mirrors

I tend to use vi to edit text files, but you can also use nano. Just uncomment the closest mirror to you, and save file.

vi /etc/pacman.d/mirrorlist

Install the system

I also install base-devel group, to include some additional packages

pacstrap /mnt base base-devel

Export partition table

We need to export the current partition table to /etc/fstab so when we reboot, the newely installed system can boot up. This will take the existing partition table and will append it to the system we just installed.

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

Chroot into new install

We need to chroot into new installation to setup some basics before we reboot.

arch-chroot /mnt

Install basic packages

pacman -S grub efibootmgr linux-lts linux-lts-headers networkmanager linux-firmware

Prepare locales

Uncheck the required locale based on your language, and save file.

nano /etc/locale.gen

Generate locales

locale-gen

Additional tweaks

Set LANG variable and UK keymap layout.

echo LANG=en_GB.UTF-8 > /etc/locale.conf
echo KEYMAP=uk > /etc/vconsole.conf

Timezone setup

ln -s /usr/share/zoneinfo/Europe/London /etc/localtime
hwclock --systohc --utc

Set hostname

echo arch > /etc/hostname

Set root password

passwd

Install boot manager

mkdir /boot/EFI
mount /dev/sda1 /boot/EFI
grub-install --target=x86_64-efi --bootloader-id=grub_uefi --recheck

Install unicodes if you need to

pacman -S intel-ucode

Configure boot manager

grub-mkconfig -o /boot/grub/grub.cfg

Exit chroot

We can now exit chroot, unmount all partitions and reboot to our new installation.

exit
umount -R /mnt
reboot

Login

In the following steps we will add system user and grant them with the administrative permissions. Login as root (as it’s currently the only system user) and execute following commands, replacing any USERNAME with your actuall username:

useradd -m -G wheel,users -s /bin/bash USERNAME
passwd USERNAME

This user was added to the wheel group. We will now allow any users in that group to perform any administrative system operations. Uncomment the following in visudo

%wheel ALL=(ALL) NOPASSWD: ALL

Add 32-bit packages support

If you will be installing programs that will require 32-bit package versions like Steam, enable them by uncommenting in /etc/pacman.conf

[multilib]
Include = /etc/pacman.d/mirrorlist

Connect to the Internet

List available networks

nmcli device wifi list

Connect to the network

nmcli device wifi connect SSID password password

Update the system and enable 32-bit packages

pacman -Syu

At this point we have base installation complete. In next parts, we will install graphical environment i3


^ Top