This page looks best with JavaScript enabled

Linux - Arch Installation

 ·  ☕ 5 min read  ·  🐺 Devoalda
archlinux

Introduction

This is an installation guide for Arch Linux. This is NOT a generic guide on installing Arch Linux, it is customized towards my preferences.

The Arch Linux installation guide can be found on the Arch Linux website here

Dependencies

Arch can be installed in a Virtual Machine or bare metal, installations on bare metal devices may include extra steps. Here are the dependencies

  • Arch Linux ISO
  • USB Thumbdrive (8GB) - Bare Metal Installations
  • Separate Workstation to create USB Bootable Devices

Software to create USB Bootable Devices

Linux

dd
1
dd if=/path/to/image/file.iso of=/dev/sdX status=progress

Windows

balenaEtcher
Rufus
win32DiskImager

Virtual Machine managers

Any Virtual Machine managers can be used. Here are some popular ones:

VirtualBox

VMWare Workstation/Player

Installation

Hardware Configurations

Here are the hardware configurations I will be using for the virtual machine

  • 2GB Ram (2048MB)
  • 2 Processors

Arch Installation

Boot Selection

Power on the Virtual/Physical machine. Select the first option

Arch Boot Menu
Arch Boot: Boot Menu

Internet Conectivity

Ethernet connection is recommended. If on WI-FI use iwctl

Arch Internet Connectivity
Arch Boot: Internet Connectivity

NTP

Sync the system time to NTP with timedatectl

1
timedatectl set-ntp true

Partitioning Drives

Use lsblk to find out your device name

Use this command to create a new partition table on your device

1
cfdisk /dev/sda

Select dos label type

Arch Partition
Partition: Partition type label

Using the arrow keys and Enter, navigate and create these partitions

Single Drive

Partition Space Remarks
/dev/sda1 512MB boot
/dev/sda2 >=10GB root(/)
/dev/sda3 Leftover home

>1 Drive

Partition Space Remarks
/dev/sda1 512MB boot
/dev/sda2 Leftover root(/)
/dev/sdb1 All home
Arch Partition
Partition: Partition table

Write the changes and Quit

Formatting Partitions

Do a lsblk again, /dev/sda should have 3 partitions

/dev/sda1

This is the boot partition, formatted to fat32

1
mkfs.fat -F32 /dev/sda1

/dev/sda2 and others

Other partitions are formatted to ext4

1
2
mkfs.ext4 /dev/sda2
mkfs.ext4 /dev/sda3

Mount partitions

Mount the root partition

1
mount /dev/sda2 /mnt

Create a folder and mount the home partition

1
2
mkdir /mnt/home
mount /dev/sda3 /mnt/home

Check the mount points with lsblk

Arch Partition Mount
Partition: Partition Mount

Pacstrap

Start the installation of arch with the Pacstrap script

1
pacstrap /mnt base linux linux-firmware sudo vim git base-devel

Select all and yes and wait for the installation to complete.

Fstab

Generate the fstab file

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

Chroot

Chroot into the system with BASH shell

1
arch-chroot /mnt /bin/bash

Locale

1
vim /etc/locale.gen

Find the languages you are going to use
I am going to install

  • en_us both UTF and ISO
  • zh_SG.UTF-8
  • ko_KR.UTF-8

Save and exit the editor and generate locale

1
locale-gen

Create locale.conf with the corrosponding languages

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

Timezone

1
ln -sf /usr/share/zoneinfo/Asia/Singapore /etc/localtime

Set local time

1
hwclock --systohc --utc

Check the date with

1
date

Hostname

Set the Hostname of your system

1
echo arch > /etc/hostname

Edit your /etc/hosts file with vim /etc/hosts

Enter the following line

1
127.0.1.1 localhost.localdomain arch

Save and exit the editor

Network

Install and enable NetworkManager

1
2
pacman -S networkmanager
systemctl enable NetworkManager

Bootloader

Install grub and efibootmanager

1
pacman -S grub efibootmgr

Install the Bootmanager into the system

1
2
3
4
5
6
mkdir /boot/efi
mount /dev/sda1 /boot/efi
lsblk # to check if everything is mounted correctly
grub-install /dev/sda # Worked for me
# grub-install --target=x86_64-efi --bootloader-id=GRUB --efi-directory=/boot/efi --removable
grub-mkconfig -o /boot/grub/grub.cfg

Root Password

Change the root password with passwd

Reboot

Exit and reboot your system

1
2
3
exit
umount -R /mnt
reboot

You should see GRUB screen on boot, with Arch installed

Login with root and the password previously set

Post-Installation

Arch is now installed, these are post installation processes like creating swap, user and installing a GUI

Swap

Create a swapfile with the same size as your RAM

1
2
3
4
5
dd if=/dev/zero of=/swapfile bs=1M count=2048 status=progress
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo '/swapfile none swap defaults 0 0' >> /etc/fstab

Check that your swapfile is working with free -h

User

Create a user and group

1
2
3
groupadd sudo
groupadd username 
useradd -m -g username -G sudo -s /bin/bash username

Edit sudoers file

1
EDITOR=vim visudo

Uncomment the line and add a line

1
2
Defaults insult
# %sudo ALL=(ALL) ALL

Change the password of the user with passwd username

Reboot/Logout and login as user

DotFiles

Clone and ‘install’ Dotfiles from GitLab

1
2
3
git clone --recurse-submodules https://gitlab.com/devoalda/dotdrop-dotfiles.git
pip3 install --user -r ./dotdrop-dotfiles/dotdrop/requirements.txt
./dotdrop-dotfiles/dotdrop.sh install -p carnage

Install yay

1
2
3
4
cd /opt
sudo git clone https://aur.archlinux.org/yay-git.git
cd yay-git
makepkg -si

Install and change shell utilities

1
2
yay -S zsh starship st-luke-git
chsh -s /usr/bin/zsh username

Display

Xorg must be installed to be able to display a WM/DE

1
yay -S pulseaudio pulseaudio-alsa xorg xorg-xinit xorg-server

Install i3 (Optional) - More Stable

1
yay -S i3-gaps i3blocks i3exit

Install Xmonad & Xmobar (Optional)

1
2
yay -S xmonad xmonad-contrib xmobar-git
xmonad --recompile

Read more about my xmonad configurations here

Summary

Arch is installed successfully!

Installed Arch Linux
Arch: Installed

Here are some programs I would install

Program Function
Firefox Web Browser
Dmenu & Utilities Application Launcher
Neovim Editor
VSCodium Editor
Pywal Themeing
Flameshot Screenshot Utility
Fcitx Multi-language Keyboard
Trayer Tray Application Support
Dunst Notification Manager
Mpd & Ncmpcpp Music Player
Mpv Video Player
Zathura PDF Reader

Have fun with your arch installation!

i use arch btw

Share on

Devoalda
WRITTEN BY
Devoalda
Technophile