How to Install Arch Linux [Beginner’s Guide]

7 min


This beginner’s guide explains the steps on how to install Arch Linux.

Arch Linux is the most bleeding-edge Linux distribution that comes with options to customize everything as per your need. Installing and using Arch Linux is complex for new users. The Arch Linux documentation is one of the most comprehensive but it is sometimes too much for the beginner. Hence this guide to install Arch Linux in a step by step manner.

Note: This guide is for legacy BIOS systems only. For UEFI systems, the installation may vary.

What you need before installing Arch Linux?

Make sure you have the following list sorted before you install Arch Linux.

  • Arch Linux .iso file [download link below]
  • USB drive with 2GB or more space
  • Stable internet connection
  • Know the basic Linux commands and comfortable with the terminal
  • A spare laptop/desktop/mobile phone with internet in case you are stuck need help from the internet.

How to Install Arch Linux

Download Arch Linux .iso

You can visit the below page to download Arch Linux. There are torrent files which is a recommended method of downloading the Arch Linux .iso file.

Create a LIVE USB and boot

Write the downloaded Arch Linux .iso image to a USB drive. If you are planning to install it on a virtual machine, then you can skip this step. If you want to install it on Virtual Machine, check out GNOME Boxes or Virtual Machine Manager for an installation guide before you proceed.

If you are using Ubuntu, then you can use the Disks utility to write the .iso image to the drive. Or you can use any utility to create a LIVE USB.

Alternatively, if you are comfortable with the command line you can use the below command to create a LIVE USB for Arch Linux. Change the sdb to your USB drive number.

Example:

dd bs=4M if=/home/Downloads/archlinux-2020.11.01-x86_64 of=/dev/sdb status=progress && sync

Boot from the Arch Linux LIVE USB

Boot from LIVE USB to install. After a successful boot, you should see the Arch Linux menu. Select the “Arch Linux Install Medium”.

Start Menu - Install Arch Linux
Start Menu – Install Arch Linux

You should be seeing the terminal with the LIVE Arch Linux.

Arch install prompt - Install Arch Linux
Arch install prompt – Install Arch Linux

Setup Keyboard Layout

You need to set the keyboard layout if you want as a first step. By default, the US keyboard layout is chosen. You can check the locale using the below command.

To list the available list of keyboard layout use:

ls /usr/share/kbd/keymaps/*/.map.gz
Keymaps - Install Arch Linux
Keymaps – Install Arch Linux

Then load the appropriate layout:

loadkeys <keymap name>

For example, replace <keymap name> with “fr-latin1.map.gz”.

If you are using English US as default, you should skip this step.

Connect to the Internet

First, run a ping to check whether you are already connected.

ping google.com

If not, then check out the Arch Linux networking guide to set up the wired/wireless connection. As I mentioned earlier, to install Arch you need a stable internet connection.

Run the below command to enable the installer to sync time via the internet.

timedatectl set-ntp true

Partition the disk for install

The next step would be partitioning your disk to install Arch Linux. Use this step very carefully as this causes direct writing to your disk and all data would be lost.

If you are not comfortable, you can exit from this step. Then take a backup of all your files and come back.

First list the drives that are available using fdisk.

fdisk -l
fdisk - Install Arch Linux
fdisk – Install Arch Linux

This might be different in every system. This will list the available partitions table in your current disk.

The next step is to use cfdisk – a partition tool with UI to help you to partition the drives. For this guide, I will create one installation partition and a swap partition for Arch Linux. Remember, the cfdisk utility uses arrow keys and enter keys for navigation.

cfdisk /dev/sda

On the next screen choose “dos” as label type.

cfdisk - label type - Install Arch Linux
cfdisk – label type – Install Arch Linux

The selected device partition list displays on the next screen. For this example:

cfdisk - new partition - Install Arch Linux
cfdisk – new partition – Install Arch Linux

In this screen, I will create two partitions using the free space. One is for installing Arch Linux and another for the swap area. Note down the free space to allocate numbers. The swap area ideally should be twice your device RAM size.

Highlight New at the bottom and press enter.

cfdisk - primary parition - Install Arch Linux
cfdisk – primary parition – Install Arch Linux

For this example, I will use 5GB for Arch Install and 1GB for the swap. You can mention the size in G or M for GB and MB respectively.

SEE ALSO:   CyberOS - A New QT Based Arch Linux Distribution that Looks Like Deepin DE

Next, choose as a primary partition for Arch Linux.

You can see the partition is created as /dev/sda1 with 5GB space.

Now, select free space again and create a new primary partition. Enter space as 1G. You can change this size as per your need.

Select the swap partition and choose type. From the type, list choose ’82 Linux Swap / Solaris’ and press enter.

cfdisk - partition type - Install Arch Linux
cfdisk – partition type – Install Arch Linux

Both the partition is now created.

cfdisk - parition created - Install Arch Linux
cfdisk – parition created – Install Arch Linux

From the bottom, choose to Write to make the changes to the disk. After a successful operation, you will see a message as below.

cfdisk - parition table written to disk - Install Arch Linux
cfdisk – parition table written to disk – Install Arch Linux

You can also run fdisk -l to check the partitions which are created.

fdisk after parition - Install Arch Linux
fdisk after parition – Install Arch Linux

Create file system and mount

The newly created partitions need a filesystem. For this guide, I will use the ext4 format. Run below commands sequentially to create file systems.

Create an ext4 file system to the /dev/sda1

mkfs.ext4 /dev/sda1

create swap file system to /dev/sda2

mkswap /dev/sda2

Mount the root file system to /mnt

mount /dev/sda1 /mnt

Turn on the swap

swapon /dev/sda2

You need to change the “1” or “2” according to your disk numbers.

create file system - Install Arch Linux
create file system – Install Arch Linux

Install base system

The next step is to install the Linux base via pacstrap. This step might require some time as pacstrap downloads a list of packages required for a basic Linux kernel and additional applications.

pacstrap /mnt base linux linux-firmware nano
install base system - Install Arch Linux
install base system – Install Arch Linux

Configure the Arch Linux

As you installed the base packages, now its time to create the filesystem table

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

After creating the file system table, login as root to newly installed Arch Linux.

arch-chroot /mnt

You can run ls to check the installation directories. As you can see the base system is installed.

Packages installed - Install Arch Linux
Packages installed – Install Arch Linux

Configure Timezone

To configure the timezone run the below command. For example, to set US Eastern time, you can run:

ln -sf /usr/share/zoneinfo/US/Eastern /etc/localtime

Generate Locale File

The next step is to generate a locale file. This can be changed later as well, once you completed the installation. Run the below commands in sequence to generate a locale file.

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

Create a Hostname File and Enable DHCP

Install DHCP using the below command.

pacman -S dhcpcd

Create a hostname file for network connectivity in /etc/hostname. For example, the below commands create a “debug point” hostname.

echo debugpoint > /etc/hostname

Enter below lines in the /etc/hosts file. You can change the “debug point” to your own hostname.

127.0.0.1 localhost
::1 localhost
127.0.0.1 debugpoint

Make sure to enable the dhcp for internet connectivity by running below command.

systemctl enable dhcpcd

Generate root password

You need to create a root password to use the system. To do that use the below command and enter the first time password.

passwd

Create GRUB, boot loader

This is an important step. If you are using Arch in dual boot, not planning for dual boot it is recommended that you install the grub boot loader. Run below commands in sequence to install grub, os-prober, and configure grub. Remember to change the “1” or “2” below with your device number.

pacman -S grub os-prober
grub-install /dev/sdX
grub-mkconfig -o /boot/grub/grub.cfg
Grub install - Install Arch Linux
Grub install – Install Arch Linux

Reboot and login

All necessary steps are complete. You can type below exit command to go back to LIVE session. Then followed by reboot.

exit
reboot

If all goes well, you should see the Arch Linux grub menu and able to login into the terminal.

Arch Linux Menu - Grub
Arch Linux Menu – Grub
Arch Linux Logged in
Arch Linux Logged in

Remember, this installation process did not install any desktop environment. This is basic Arch Linux image with latest Kernel. To install desktop environment such as GNOME, Xfce, LXQt you need to run additional steps.

For example – if you want to install LXQt desktop – you can run the below command to install basic LXQt packages with desktop.

sudo pacman -S --needed lxqt xdg-utils sddm libpulse libstatgrab libsysstat lm_sensors network-manager-applet oxygen-icons featherpad smplayer pavucontrol-qt xscreensaver

I hope this guide helps you to install Arch Linux in a most easy eay. Drop me a comment below if you are stuck or in trouble.


We bring the latest tech, software news and stuff that matters. Stay in touch via Telegram, Twitter, YouTube, and Facebook and never miss an update!

Join our Telegram channel and stay informed on the move.

Also Read


Like it? Share with your friends!

Arindam

Creator of debugpoint.com. All time Linux user and open-source supporter. Connect with me via Telegram, Twitter, LinkedIn, or send us an email.
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

3 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
3
0
Would love your thoughts, please comment.x
()
x