Skip to main content
โšก Calmops

Arch Linux: The Do-It-Yourself Linux Distribution

Introduction

Arch Linux is a lightweight, flexible Linux distribution that follows a do-it-yourself philosophy. Known for its rolling release model and minimalist approach, Arch Linux puts users in complete control of their systems. The distribution emphasizes simplicity, code correctness, and user-centric design above all else.

In 2026, Arch Linux remains the choice for users who want the latest software, understand their system deeply, and prefer manual configuration over automated tools. This comprehensive guide covers installation, configuration, package management, and advanced system administration.

Understanding Arch Philosophy

Core Principles

Arch Linux operates on these principles:

  • Simplicity: Minimal modifications to upstream software
  • Code Correctness: Bug reports should be upstream-first
  • User Centrality: Documentation is user-driven
  • Rolling Release: Continuous model, no version jumps

What Makes Arch Different

  • Rolling Release: Update anytime, always current
  • Minimal Base: Start with CLI, build what you need
  • Pacman: Fast, reliable package manager
  • AUR: Community-maintained package repository
  • Wiki: Excellent Arch Wiki documentation
  • Systemd: Standard init system

Installation

Preparing Installation Media

# Download ISO
# https://archlinux.org/download/

# Verify checksum
sha256sum archlinux-*.iso

# Write to USB
sudo dd if=archlinux-*.iso of=/dev/sdX bs=4M status=progress

Base Installation

# Set keyboard layout
loadkeys us

# Verify boot mode
ls /sys/firmware/efi/efivars

# Connect to internet
wifi-menu
# or
dhcpcd

# Update system clock
timedatectl set-ntp true

# Partition disks
cfdisk /dev/sda
# Create: boot (1G), swap (4G), root (remaining)
# Format partitions
mkfs.ext4 /dev/sda1
mkfs.ext4 /dev/sda3
mkswap /dev/sda2
swapon /dev/sda2

# Mount partitions
mount /dev/sda3 /mnt
mount --mkdir /dev/sda1 /mnt/boot

# Install base system
pacstrap -K /mnt base linux linux-firmware

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

# Chroot into system
arch-chroot /mnt

# Set timezone
ln -sf /usr/share/zoneinfo/Region/City /etc/localtime
hwclock --systohc

# Localization
vim /etc/locale.gen
# Uncomment en_US.UTF-8 UTF-8
locale-gen

# Hostname
echo archserver > /etc/hostname

# Configure network
systemctl enable systemd-networkd
systemctl enable systemd-resolved

# Set root password
passwd

# Install bootloader
pacman -S grub
grub-install /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg

# Exit and reboot
exit
umount -R /mnt
reboot

Post-Installation

# Create user
useradd -m -G wheel username
passwd username

# Install sudo
pacman -S sudo
visudo
# Uncomment %wheel ALL=(ALL) ALL

# Install essential packages
pacman -S base-devel git vim wget curl

# Install desktop (optional)
pacman -S xorg xorg-server plasma plasma-wayland-session

Package Management

Pacman Basics

# Sync databases
sudo pacman -Sy

# Update system
sudo pacman -Syu

# Install package
sudo pacman -S nginx

# Remove package
sudo pacman -R nginx

# Remove with dependencies
sudo pacman -Rsc nginx

# Search packages
pacman -Ss nginx
pacman -Qs nginx

# Package information
pacman -Qi nginx
pacman -Ql nginx

# List orphans
pacman -Qdt

# Clean cache
sudo pacman -Scc

Package Groups

# List groups
pacman -Sg

# Install group
sudo pacman -S base-devel

Repositories

# Configure repositories
sudo vim /etc/pacman.conf
[core]
Include = /etc/pacman.d/mirrorlist

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

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

Mirrors

# Generate mirror list
sudo pacman-mirrors --fasttrack

# Or edit manually
sudo vim /etc/pacman.d/mirrorlist

AUR (Arch User Repository)

Using AUR

# Install base-devel first
sudo pacman -S base-devel

# Clone AUR package
git clone https://aur.archlinux.org/package-name.git
cd package-name

# Build and install
makepkg -si

# Update AUR packages
git pull
makepkg -si

Using AUR Helpers

# Install yay (AUR helper)
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si

# Using yay
yay -S package-name
yay -Ss search-term
yay -Yc  # Clean orphans
yay -Syu  # Update all
# Chrome
yay -S google-chrome

# Visual Studio Code
yay -S code

# Discord
yay -S discord

# Docker (AUR version with latest features)
yay -S docker-git

# VirtualBox
yay -S virtualbox-ext-oracle

System Configuration

Systemd Services

# Enable service
sudo systemctl enable nginx

# Start service
sudo systemctl start nginx

# Check status
systemctl status nginx

# Disable service
sudo systemctl disable nginx

Network Configuration

# Install network tools
sudo pacman -S iproute2

# Using systemd-networkd
sudo vim /etc/systemd/network/ethernet.network
[Match]
Name=eth0

[Network]
Address=192.168.1.100/24
Gateway=192.168.1.1
DNS=8.8.8.8
sudo systemctl enable systemd-networkd
sudo systemctl start systemd-networkd

# Using wpa_supplicant for WiFi
sudo pacman -S wpa_supplicant
sudo wifi-menu

Time and Locale

# Set timezone
sudo timedatectl set-timezone America/New_York

# Sync time
sudo timedatectl set-ntp true

# Set locale
sudo vim /etc/locale.gen
locale-gen

Desktop Environment

Installing KDE Plasma

# Install KDE
sudo pacman -S plasma kde-applications

# Install SDDM display manager
sudo pacman -S sddm
sudo systemctl enable sddm

# Start desktop
startx
# or
sudo systemctl start sddm

Installing GNOME

# Install GNOME
sudo pacman -S gnome gnome-extra

# Install GDM
sudo pacman -S gdm
sudo systemctl enable gdm

Installing i3wm

# Install i3
sudo pacman -S i3 dmenu i3status i3lock

# Install fonts
sudo pacman -S ttf-firacode ttf-font-awesome

# Configure ~/.config/i3/config
# Basic i3 config
set $mod Mod4

# Start terminal
bindsym $mod+Return exec i3-sensible-terminal

# Kill focused window
bindsym $mod+q kill

# Start dmenu
bindsym $mod+d exec dmenu_run

# Reload config
bindsym $mod+Shift+r reload

Server Setup

LAMP Stack

# Install Apache
sudo pacman -S apache

# Install MariaDB
sudo pacman -S mariadb
sudo mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
sudo systemctl enable mariadb
sudo systemctl start mariadb
sudo mysql_secure_installation

# Install PHP
sudo pacman -S php php-apache

# Configure Apache
sudo vim /etc/httpd/conf/httpd.conf
# Load PHP module
LoadModule php_module modules/libphp.so
Include "conf/extra/php_module.conf"

# Install extensions
sudo pacman -S php-gd php-mcrypt php-intl php-pgsql php-sqlite

Nginx

# Install Nginx
sudo pacman -S nginx

# Configure
sudo vim /etc/nginx/nginx.conf

# Test and reload
sudo nginx -t
sudo systemctl reload nginx

Docker

# Install Docker
sudo pacman -S docker

# Enable and start
sudo systemctl enable docker
sudo systemctl start docker

# Add user to docker group
sudo usermod -aG docker $USER

# Install Docker Compose
sudo pacman -S docker-compose

Database

# PostgreSQL
sudo pacman -S postgresql
sudo systemctl enable postgresql
sudo systemctl start postgresql
sudo -u postgres createuser -s myuser
sudo -u postgres createdb mydb

# Redis
sudo pacman -S redis
sudo systemctl enable redis
sudo systemctl start redis

System Maintenance

Updating System

# Full system upgrade
sudo pacman -Syu

# After kernel update, reboot
sudo reboot

Package Cleanup

# Remove unneeded packages
sudo pacman -R $(pacman -Qtdq)

# Clean cache
sudo pacman -Scc

Backups

#!/bin/bash
# backup.sh

DATE=$(date +%Y%m%d)
BACKUP_DIR="/backup"

# Backup pacman packages
pacman -Qqe > $BACKUP_DIR/pkglist.txt

# Backup config files
tar -czf $BACKUP_DIR/configs-$DATE.tar.gz /etc/

# Backup /home
tar -czf $BACKUP_DIR/home-$DATE.tar.gz /home/

Performance Tuning

Early KMS

# /etc/mkinitcpio.conf
MODULES="i915 amdgpu radeon nouveau"

# Rebuild initramfs
sudo mkinitcpio -P

SSD Optimization

# /etc/fstab
# Add noatime,nodiratime
/dev/sda1 / ext4 defaults,noatime,nodiratime,discard 0 1

Swappiness

# Reduce swappiness
sudo sysctl vm.swappiness=10
echo "vm.swappiness=10" | sudo tee /etc/sysctl.d/99-swappiness.conf

Security

Firewall

# Install firewalld
sudo pacman -S firewalld

sudo systemctl enable firewalld
sudo systemctl start firewalld

# Configure
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --reload

Fail2ban

# Install Fail2ban
sudo pacman -S fail2ban

# Configure
sudo vim /etc/fail2ban/jail.local
[DEFAULT]
bantime = 3600
findtime = 600
maxretry = 5

[sshd]
enabled = true
sudo systemctl enable fail2ban
sudo systemctl start fail2ban

SSH Hardening

# /etc/ssh/sshd_config
PermitRootLogin no
PasswordAuthentication no
PubkeyAuthentication yes

Troubleshooting

Recovery

# Boot from Arch ISO
# Mount filesystem
mount /dev/sda3 /mnt
arch-chroot /mnt

# Repair
pacman -Syu
grub-install /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg

Common Issues

# Broken dependencies
sudo pacman -Sddp package

# Database issues
sudo mysql_upgrade -u root -p

# Service failing
journalctl -u service -xe

Arch-Based Distributions

Manjaro

# More user-friendly Arch derivative
# https://manjaro.org/

# Use pamac for package management
pamac install package

EndeavourOS

# Arch with easy setup
# https://endeavouros.com/

ArcoLinux

# Customizable Arch
# https://arcolinux.com/

Conclusion

Arch Linux provides ultimate control over your system, appealing to users who want to understand every component. The rolling release model ensures always-current software, while the AUR provides access to vast community packages. The learning curve is steep but rewards users with deep system knowledge.

Whether running a minimal server or a full desktop, Arch Linux offers flexibility unmatched by other distributions.

Resources

Comments