We are committed to provide service 24 X 7

Deals, Shopping, Training, Tools

Learn how to – How To Install Arch Linux using Arch Linux installer

Learn how to – How To Install Arch Linux using Arch Linux installer.

Arch Linux, started by Judd Vinet in March 2002 is one of the best Linux distributions available. This is an x86-64 Linux distribution that has a main focus on the KISS(Keep It Simple, Stupid) principle. This principle is achieved with the rolling release model. This simply means that there is no major release of completely new versions of Arch. New versions and attached packages are obtained with regular system updates. With this principle, there are minimal and distribution-specific changes that reduce breakage in updates.

The default package manager for Arch is Pacman, which is used to update and remove packages on the system. By following this guide to the periphery, you should be able to install Arch Linux using the Arch Linux installer. The manual Arch Linux is very complicated and tedious since it involves innumerable steps. Using the Arch Installer automates and simplifies the installation process.

Setup Requirements

You will need the following:

  • A working internet connection
  • USB/DVD drive
  • At least 1GB of RAM and 20GB of free hard-drive space
  • A 64bit system

You also need a basic understanding of machines, ISO files, and command-line utilities.

1. Create a bootable disk for Arch Linux

For this guide, you need a bootable disk to be able to boot into live mode and run the Arch Linux installer.

This can be any Linux system ISO file, but the most recommended one is the Arch Linux ISO file downloaded from the Arch Linux downloads page.

Now create a bootable media using the command:

# Identify USB device
sudo lsblk

# Flash Arch Linux to USB drive
sudo dd bs=4M if=Arch_linux.iso of=/dev/sdX status=progress oflag=sync

Remember to replace Arch_linux.iso with the correct ISO path and /dev/sdX with the bootable drive path.

2. Boot into Live Mode

Now with the created bootable disk, insert it into your system and boot from it. For example booting into Arch Linux live, proceed as below.

3. Install Arch Linux installer

By default, the Arch Linux installer exists when using the official Arch Linux ISO and there is no need to install it. But if you are using any other Linux-based system ISO, you need to install it. The Arch Linux installer can be installed in several ways. These methods are:

  • Installing with pacman

The Arch Linux installer exists in the default Arch repositories and can be installed as below:

pacman -S archinstall
  • Installing with PyPi

You can also use the Python PIP to install the Arch Linux installer:

pip install archinstall
  • Install using source code

You can as well install this package by building it from the source code. Begin by cloning the GitHub repository:

git clone https://github.com/archlinux/archinstall

Now you have two options to install the package:

  • Use Setuptools to install it into the module path
sudo python setup.py install
  • Move the folder into your project and simply do:
import archinstall

4. Install Arch Linux using the Arch Linux installer

The Arch Linux installer offers the easiest way to install Arch Linux on a physical or virtual machine. There are two options to run the guided installation:

  • Installing from a configuration file
  • Installing directly

When running the installer, you can add a config file to provide pre-configured answers to all the guided steps. The configuration file takes the below options:

  • –config – only deals with the general configuration of language and which profiles to use.
  • –disk_layouts – used for defining the desired partition strategy on the selected “hard drives” in –config.
  • –creds – used for any superuser, user, or root account data.

The config can be saved in a local or remote path as a .json file. For example, defining languages and profiles:

{
    "audio": "pipewire",
    "bootloader": "systemd-bootctl",
    "custom-commands": [
        "cd /home/devel; git clone https://aur.archlinux.org/paru.git",
        "chown -R devel:devel /home/devel/paru",
        "usermod -aG docker devel"
    ],
    "filesystem": "btrfs",
    "gfx_driver": "VMware / VirtualBox (open-source)",
    "harddrives": [
        "/dev/nvme0n1"
    ],
    "swap": true,
    "hostname": "development-box",
    "kernels": [
        "linux"
    ],
    "keyboard-language": "us",
    "mirror-region": "Worldwide",
    "nic": {
        "NetworkManager": true,
        "nic": "Use NetworkManager (necessary to configure internet graphically in GNOME and KDE)"
    },
    "ntp": true,
    "packages": ["docker", "git", "wget", "zsh"],
    "profile": "gnome",
    "services": ["docker"],
    "sys-encoding": "utf-8",
    "sys-language": "en_US",
    "timezone": "US/Eastern",
}

To use the config file say, example.json proceed as below.

archinstall --config example.json

Below is an example of the --creds .json file

{
    "!root-password" : "SecretSanta2022"
}

For the --disk_layouts option.

{
    "/dev/loop0": {
        "partitions": [
            {
                "boot": true,
                "encrypted": false,
                "filesystem": {
                    "format": "fat32"
                },
                "format": true,
                "mountpoint": "/boot",
                "size": "513MB",
                "start": "5MB",
                "type": "primary"
            },
            {
                "btrfs": {
                    "subvolumes": {
                        "@.snapshots": "/.snapshots",
                        "@home": "/home",
                        "@log": "/var/log",
                        "@pkgs": "/var/cache/pacman/pkg"
                    }
                },
                "encrypted": true,
                "filesystem": {
                    "format": "btrfs"
                },
                "format": true,
                "mountpoint": "/",
                "size": "100%",
                "start": "518MB",
                "type": "primary"
            }
        ],
        "wipe": true
    }
}

Run the guided installation

For this guide, we will run the installer directly without any pre-defined config file. Issue the command below:

archinstall --script guided

The installer will start by asking you to make configurations. First set the preferred Keyboard layout. For this guide, I will set the US keyboard:

Testing connectivity to the Arch Linux mirrors ...
 0: by     20: pl     
 1: ca     21: ro     
 2: cf     22: ru     
 3: cz     23: sg     
 4: de     24: ua     
 5: dk     25: uk     
 6: es     26: us     
 7: et     
 8: fa     
 9: fi     
10: fr     
11: gr     
12: hu     
13: il     
14: it     
15: lt     
16: lv     
17: mk     
18: nl     
19: no     
 -- You can choose a layout that isn't in this list, but whose name you know --
 -- Also, you can enter '?' or 'help' to search for more languages, or skip to use us layout --
Select one of the above keyboard languages (by number or full name): 26

Next set the location of Arch Linux mirrors. Remember to set a mirror close to you.

0: Australia
1: Austria
2: Bangladesh
3: Belarus
4: Belgium
5: Bosnia and Herzegovina
6: Brazil
7: Bulgaria
8: Cambodia
9: Canada
10: Chile
11: China
12: Colombia
.....
34: Kenya
35: Latvia
..
 -- You can skip this step by leaving the option blank --
Select one of the above regions to download packages from (by number or full name):34

Select the disk to which you want to make the installation.

0: BlockDevice(/run/archiso/bootmnt/arch/x86_64/airootfs.sfs, size=0.7GB, free_space=, bus_type=None)                            
1: BlockDevice(None, size=0.8GB, free_space=, bus_type=sata)
2: BlockDevice(/dev/vda, size=40.0GB, free_space=, bus_type=None)
Select one or more harddrives to use and configure (leave blank to skip this step): 2

Once set, the selected device will appear with “>>”, you can as well add another one. Otherwise, press Enter to proceed:

0: BlockDevice(/run/archiso/bootmnt/arch/x86_64/airootfs.sfs, size=0.7GB, free_space=, bus_type=None)                                                          
1: BlockDevice(None, size=0.8GB, free_space=, bus_type=sata)                    
2: >> BlockDevice(/dev/vda, size=40.0GB, free_space=, bus_type=None)           
Select one or more harddrives to use and configure (leave blank to skip this step): Press Enter

Format the selected partition:

Select one or more harddrives to use and configure (leave blank to skip this step): 
0: Wipe all selected drives and use a best-effort default partition layout
1: Select what to do with each individual drive (followed by partition usage)
Select what you wish to do with the selected block devices: 0

Select the Filesystem you want to use. Here, we will proceed with btrfs:

0: btrfs
1: ext4
2: xfs
3: f2fs
Select which filesystem your main partition should use (by number or name): 0
Would you like to use BTRFS subvolumes with a default structure? (Y/n): y

You can as well encrypt the partition. But here, we will not set the encryption.

Enter disk encryption password (leave blank for no encryption): Press Enter

Proceed and create a swap partition.

Would you like to use swap on zram? (Y/n): y

Set the preferred system hostname:

Desired hostname for the installation: arch.computingoforgeeks.com

Create a superuser. Here you create a required user by pressing Enter and creating a desired user and password.

Enter root password (leave blank to disable root & create superuser): Press Enter
Create a required super-user with sudo privileges: thor
Password for user thor: *********
And one more time for verification: *********
Enter a username to create an additional user (leave blank to skip & continue): Press Enter

Next, select the type of installation to make. The preferred installation is minimal which is a very basic installation that can be customized later.

0: desktop: Provides a selection of desktop environments and tiling window managers, e.g. gnome, kde, sway
1: minimal: A very basic installation that allows you to customize Arch Linux as you see fit.
2: server: Provides a selection of various server packages to install and enable, e.g. httpd, nginx, mariadb
3: xorg: Installs a minimal system as well as xorg and graphics drivers.
 -- The above list is a set of pre-programmed profiles. --
 -- They might make it easier to install things like desktop environments. --
 -- (Leave blank and hit enter to skip this step and continue) --
Enter a pre-programmed profile name if you want to install one: 1

Then select the audio driver to install :

0: pipewire
1: pulseaudio
2: none
Choose an audio server or leave blank to use none: 1

Set the preferred Linux kernel:

0: >> linux                                                                     1: linux-hardened                                        
2: linux-lts          
3: linux-zen 
Choose which kernels to use (leave blank for default: linux): Press Enter           

You can also install additional packages if you wish. Otherwise, press Enter to proceed.

Only packages such as base, base-devel, linux, linux-firmware, efibootmgr and optional profile packages are installed.
If you desire a web browser, such as firefox or chromium, you may specify it in the following prompt.
Write additional packages to install (space separated, leave blank to skip): 

Select the network interface to configure:

0: Copy ISO network configuration to installation
1: Use NetworkManager (necessary to configure internet graphically in GNOME and KDE)
2: enp1s0
Select one network interface to configure (leave blank to skip): 1

Set the Timezone and NTP:

Enter a valid timezone (examples: Europe/Stockholm, US/Eastern) or press enter to use UTC: Africa/Nairobi
Would you like to use automatic time synchronization (NTP) with the default time servers? [Y/n]: y

Then a preview of the made settings will be granted, proceed by pressing Enter:

This is your chosen configuration:
{
    "audio": "pulseaudio",
    "bootloader": "grub-install",
    "dry-run": false,
    "harddrives": [
        "/dev/vda"
    ],
    "hostname": "arch.computingoforgeeks.com",
    "kernels": [
        "linux"
......
               },
                "encrypted": false,
                "filesystem": {
                    "format": "btrfs"
                },
                "format": true,
                "mountpoint": "/",
                "size": "100%",
                "start": "518MB",
                "type": "primary"
            }
        ],
        "wipe": true
    }
}

Press Enter to continue.

The installation will begin as below:

Proceed as below:

Enabling service systemd-timesyncd
Setting keyboard language to us
Would you like to chroot into the newly created installation and perform post-installation configuration? [Y/n] n

You can chroot into the installation and make desired configurations. But for this guide, the configurations will be made later. Once complete, you should see this:

5. Post Arch Linux installation Configurations

Now eject the installation media and reboot your system:

reboot now

When the system reboots, log in using the created user and verify the installation as below:

$ cat /etc/os-release 
NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://archlinux.org/"
DOCUMENTATION_URL="https://wiki.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://bugs.archlinux.org/"
LOGO=archlinux-logo

Install desired applications. I will begin by installing the OpenSSH server.

sudo pacman -Sy openssh

Once installed, start and enable the service:

sudo systemctl start sshd
sudo systemctl enable sshd

Now obtain the IP Address of your system and proceed with SSH.

$ ip a

6. Install Desktop Environment on Arch Linux.

If you want a Desktop Environment on your system, you need to install the desired desktop environment:

##For KDE
sudo pacman -S plasma kde-applications-meta
sudo systemctl enable sddm.service

##For Gnome
sudo pacman-key --refresh-keys
sudo pacman -S xorg xorg-server
sudo pacman -S gnome gnome-extra
sudo pacman -S gdm
sudo systemctl enable gdm

##For XFCE
sudo pacman -S xfce4 xfce4-goodies xfce4-mixer gstreamer0.10-good-plugins  libxnvctrl xscreensaver # pacman -S lightdm lightdm-gtk-greeter
sudo systemctl enable lightdm.service

##For Cinnamon
sudo pacman -S cinnamon
sudo pacman –S gdm
sudo systemctl enable gdm

Once installed, reboot your system for the changes to apply.

sudo reboot

On reboot, log in to the system.

The Arch Linux Gnome desktop will appear as below.

For Gnome, verify the installation as below:

Conclusion

We have triumphantly installed Arch Linux using the Arch Linux installer. I hope this was easy and manageable.

See more guides in below links:

3
42.811,60