How to Install Arch Linux

install arch linux

install arch linux

Arch Linux is a popular Linux distribution for experienced users. It’s known for its rolling release model, which means you’re always using the latest software. However, Arch Linux can be more challenging to install and maintain than other distributions. This article will walk you through the process of installing Arch Linux, from preparation to first boot. Follow each section carefully to ensure a successful installation.

Prerequisites

Before beginning the installation, it is crucial to ensure that you have:

  • A USB drive (minimum 4GB)
  • Internet connection
  • Basic knowledge of command line operations
  • At least 512MB RAM (2GB recommended)
  • 20GB+ free disk space
  • Backed up important data

Creating Installation Media

  1. Download the latest ISO from archlinux.org
  2. Verify the ISO signature for security
  3. Create bootable USB using dd command:
<span class="token">sudo</span> <span class="token">dd</span> <span class="token assign-left">bs</span><span class="token">=</span>4M <span class="token assign-left">if</span><span class="token">=</span>/path/to/archlinux.iso <span class="token assign-left">of</span><span class="token">=</span>/dev/sdx <span class="token assign-left">status</span><span class="token">=</span>progress <span class="token assign-left">oflag</span><span class="token">=</span>sync

Boot Preparation

  1. Enter BIOS/UEFI settings
  2. Disable Secure Boot
  3. Set boot priority to USB
  4. Save and exit

What are the Initial Boot Steps?

  1. Boot from USB and select “Arch Linux install medium”
  2. Verify boot mode:
<span class="token">ls</span> /sys/firmware/efi/efivars

Internet Connection

For wired connection:

<span class="token">ip</span> <span class="token">link</span>
dhcpcd

For wireless:

iwctl
station wlan0 scan
station wlan0 connect SSID

Verify connection:

<span class="token">ping</span> archlinux.org

System Clock

Update the system clock:

timedatectl set-ntp <span class="token">true</span>

Disk Partitioning

  1. List available disks:
lsblk
  1. Create partitions (example using fdisk):
<span class="token">fdisk</span> /dev/sda

For UEFI systems:

  • EFI System Partition (ESP): 512MB
  • Root partition: Remaining space
  • Swap partition (optional): Equal to RAM size

For Legacy BIOS:

  • Root partition: Most of the disk
  • Swap partition (optional)
  1. Format partitions:
 
<span class="token"># For EFI partition</span>
mkfs.fat -F32 /dev/sda1

# For root partition
mkfs.ext4 /dev/sda2

 
 

# For swap
mkswap /dev/sda3
swapon /dev/sda3

Mounting Partitions

Mount root partition:

<span class="token">mount</span> /dev/sda2 /mnt

For UEFI systems, mount ESP:

<span class="token">mkdir</span> /mnt/boot
<span class="token">mount</span> /dev/sda1 /mnt/boot

Base System Installation

Install essential packages:

pacstrap /mnt base linux linux-firmware base-devel

System Configuration

  1. Generate fstab:
genfstab -U /mnt <span class="token">&gt;&gt;</span> /mnt/etc/fstab
  1. Change root into the new system:
arch-chroot /mnt
  1. Set timezone:
<span class="token">ln</span> -sf /usr/share/zoneinfo/Region/City /etc/localtime
hwclock --systohc
  1. Configure locale:
<span class="token">nano</span> /etc/locale.gen
<span class="token"># Uncomment en_US.UTF-8 UTF-8</span>
locale-gen
<span class="token">echo</span> <span class="token">"LANG=en_US.UTF-8"</span> <span class="token">&gt;</span> /etc/locale.conf
  1. Set hostname:
<span class="token">echo</span> <span class="token">"myhostname"</span> <span class="token">&gt;</span> /etc/hostname
  1. Configure hosts file:
<span class="token">nano</span> /etc/hosts
<span class="token"># Add:</span>
<span class="token"># 127.0.0.1    localhost</span>
<span class="token"># ::1          localhost</span>
<span class="token"># 127.0.1.1    myhostname.localdomain    myhostname</span>

Boot Loader Installation

For GRUB on UEFI systems:

pacman -S grub efibootmgr
grub-install --target<span class="token">=</span>x86_64-efi --efi-directory<span class="token">=</span>/boot --bootloader-id<span class="token">=</span>GRUB
<span class="token">grub-mkconfig</span> -o /boot/grub/grub.cfg

For GRUB on Legacy BIOS:

pacman -S grub
grub-install --target<span class="token">=</span>i386-pc /dev/sda
<span class="token">grub-mkconfig</span> -o /boot/grub/grub.cfg

Network Configuration

  1. Install network manager:
pacman -S networkmanager
systemctl <span class="token">enable</span> NetworkManager

User Management

  1. Set root password:
<span class="token">passwd</span>
  1. Create user account:
<span class="token">useradd</span> -m -G wheel username
<span class="token">passwd</span> username
  1. Configure sudo:
<span class="token assign-left">EDITOR</span><span class="token">=</span>nano visudo
<span class="token"># Uncomment %wheel ALL=(ALL) ALL</span>

Final Steps

  1. Exit chroot:
<span class="token">exit</span>
  1. Unmount partitions:
<span class="token">umount</span> -R /mnt
  1. Reboot:
<span class="token">reboot</span>

Post-Installation

After first boot:

  1. Install graphics drivers:
pacman -S xf86-video-amdgpu  <span class="token"># For AMD</span>
<span class="token"># or</span>
pacman -S nvidia nvidia-utils  <span class="token"># For NVIDIA</span>
  1. Install desktop environment (example with GNOME):
pacman -S xorg gnome
systemctl <span class="token">enable</span> gdm
  1. Install common applications:
pacman -S firefox terminal-emulator file-manager

Troubleshooting Tips

  • If bootloader fails to install, verify EFI variables are available
  • For wireless issues, ensure firmware is installed
  • Check logs with
    journalctl

    for error messages

  • Verify partition mounts with
    lsblk

Maintenance Recommendations

  1. Regular system updates:
pacman -Syu
  1. Clean package cache periodically:
pacman -Sc
  1. Check system logs regularly:
journalctl -p <span class="token">3</span> -xb
More Articles from Unixmen
https://www.unixmen.com/minimal-tools-on-arch-linux/
https://www.unixmen.com/top-things-installing-arch-linux/

Solve Kernel Panic on Arch Linux