Arch Linux is a lightweight, flexible Linux distribution that emphasizes simplicity and code elegance. As it uses a rolling release model, Arch Linux always has the latest stable versions of software.

Installing Arch Linux requires more involvement than typical Linux distributions because it aims to give users control over the system. However, following this step-by-step guide will make it straightforward even for beginners.

Downloading the Arch ISO

To get started, you need to first download the Arch Linux ISO image from the official website. Arch Linux offers HTTP direct downloads as well as BitTorrent downloads.

It‘s recommended to verify the integrity of the downloaded ISO image before proceeding. This ensures the image has not been corrupted during download.

On Linux and macOS, you can verify using the sha1sum command:

sha1sum archlinux-version.iso

On Windows, you can install a tool like 7-Zip and use its file hash functionality.

With the ISO image ready, it‘s time to boot into the Arch Linux environment.

Booting the Arch ISO

There are a few methods for booting the Arch ISO:

  • Burn the ISO image to a CD/DVD and boot from it
  • Copy the ISO image to a USB drive with a tool like Etcher and boot from the USB
  • Use VirturalBox or other VM software to boot the ISO virtually

Once booted into Arch Linux, you should be presented with a terminal login prompt. Log in with the username root – no password is required. This drops you into a bash shell within the live Arch environment.

Connecting to The Internet

Before installing Arch, an internet connection needs to be established.

Start by checking the connection status with ping:

ping archlinux.org

If no connection is available, plug in an Ethernet cable or connect to Wi-Fi. Most Wi-Fi drivers are included, but for Broadcom cards you may need to install some additional packages.

Once connected, verify internet access again with ping. Next configure the network connection by finding the network interface name:

ip link

Enable DHCP on the interface for automatic IP assignment:

dhcpcd interface_name

For example, for the interface enp3s0:

dhcpcd enp3s0

The connection should now be up and running.

Updating the System Clock

To ensure the system date and time are correct, enable network time synchronization:

timedatectl set-ntp true

Verify with timedatectl status. Now the latest clock settings will be downloaded from the internet.

Partitioning the Disks

Next, the storage disks need to be partitioned and formatted. This prepares space for installing the Arch Linux system.

First list the available block devices:

fdisk -l

A typical setup requires a root partition, and optionally a swap partition for managing memory. Use a tool like fdisk or gdisk to create partitions on the target disk – generally /dev/sda or /dev/nvme0n1.

  • Create a primary partition for the root filesystem (/) at least 10GB in size
  • Optionally create a 2GB swap partition (or equivalent to RAM for hibernation ability)
  • Make the bootable partition flag enabled on the root partition

For example:

fdisk /dev/sda
> n # add partition
> 1 # partition number 
>   # default start sector
> +10G # 10GB partition size
> t 
> 1
> 83 # Linux filesystem hex code
> n # add swap partition
> 2 
>  
> +2G # 2GB in size
> t
> 2
> 19 # Linux swap hex code
> a 
> 1 # make bootable
> w # write partition changes

With partitions created, make filesystems and activate swap:

mkfs.ext4 /dev/sda1
mkswap /dev/sda2
swapon /dev/sda2

The disk is now ready for Arch Linux installation.

Install Essential Packages

Now mount the root partition onto /mnt which will serve as the root directory during installation:

mount /dev/sda1 /mnt

Next use the pacstrap script to bootstrap an Arch system by installing packages onto the mounted root directory:

pacstrap /mnt base base-devel linux linux-firmware vim

This installs the base packages, Linux kernel, hardware firmware, and the Vim text editor. Additional packages like a desktop environment can be installed later.

Configure the New System

With a basic Arch system deployed onto /mnt, chroot into this environment to configure things further:

arch-chroot /mnt

This changes the root directory to the new Arch Linux install. Now perform essential system configuration:

  • Set the timezone:

    ln -sf /usr/share/zoneinfo/Region/City /etc/localtime
  • Set the hardware clock:

    hwclock --systohc
  • Generate locales to enable language support:

    nano /etc/locale.gen
    locale-gen
    echo LANG=en_US.UTF-8 > /etc/locale.conf
  • Create /etc/hostname file:

    echo myhostname > /etc/hostname
  • Add matching entries to /etc/hosts:

    nano /etc/hosts
  • Set the root password:

    passwd
  • Install a boot loader like GRUB:

    pacman -S grub
    grub-install --target=i386-pc /dev/sda
    grub-mkconfig -o /boot/grub/grub.cfg

Finally, exit the chroot environment and reboot into the new Arch system:

exit
reboot

When the system comes back up, the GRUB menu should display Arch Linux as a boot option. Select it and log in as the root user.

Add User Accounts

As the root account has admin privileges, using it regularly is dangerous and discouraged. Instead, create a new user account with sudo abilities:

useradd -m -G wheel -s /bin/bash username
passwd username

EDITOR=vim visudo

Add the uncommented %wheel ALL=(ALL:ALL) ALL line to enable the sudo group that the user belongs to.

Log out as root and log back in with the normal user credentials. To test sudo access, try running sudo pacman -Syu which should prompt for the user‘s password before running pacman.

Install Additional Software

With a basic Arch system up and running, users can now install additional packages like:

  • Desktop environment:
    sudo pacman -S plasma kde-applications
  • Media tools:
    sudo pacman -S vlc gimp inkscape
  • Web browser:
    sudo pacman -S firefox
  • Office suite:
    sudo pacman -S libreoffice-fresh

Remember to use sudo when installing system packages. AUR helpers like yay are also useful for installing packages from the Arch User Repository.

Now enjoy your fully-functioning Arch Linux install!

Similar Posts