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