Part 2: Arch Linux Installation Guide
Tags: linux, archlinux, tutorial
Published: 2021-08-10 16:18:30

*Originally published on [xhalford.com](https://www.xhalford.com/part-2-arch-linux-installation-guide/)*


---

In part 2 of this **series**, we will be booting into a live Arch Linux environment. With the use of the USB drive we setup in the [previous article](https://www.xhalford.com/part-1-arch-linux-installation-guide/).

> _**Notes:** There are a few presumptions being made for this guide. Regarding yourself and your current setup._
> 
> - *You will be moving from another \*nix system.*
>     - *This will help with the initial steps, with the programs being used to download the image and write it to a USB drive.*
>     - *If you are coming from Windows, I will try to link to articles explaining this fairly trivial difference.*
> - *Have access to this guide on another device.*
>     - *As once we get to installing Arch Linux, we'll be stuck in a terminal for some major steps.*
> 
> - *Can handle looking deep into the empty void of the tty.*
> - *Make sure not to make any typos - as I try to do the same throughout these guides.*


---

## What you'll need:

- **USB drive** which will have our installation medium loaded to it.
- **Disable Secure Boot** for the installation image to be supported. This can be re-enabled once the install has finished.
- **Internet connection** available.
    - Preferably via Ethernet.
    - If you will be using WiFi there are a few steps that I will cover. Every install I've done has been this way and it's really no bother.


---

# Loading up the live environment

> Before booting the USB, make sure to turn off secure boot in the UEFI.

Plug in your USB and turn on you computer. Making sure to enter the boot menu and select the installation medium on your USB.

The key to press to enter the boot menu will vary depending on your motherboard. If you never see this boot menu option, and you load straight into your original operating system (likely Windows). This will mean you also need to turn off [Fast Startup](https://www.windowscentral.com/how-disable-windows-10-fast-startup) in you UEFI settings.

Now you should be greeted with the virtual console, and see that you are logged in as the root user.


---

# Setting up the live environment for installation


## Boot mode


Before anything, we need to verify that we are booting into UEFI mode.

```zsh
$ ls /sys/firmware/efi/efivars
```

This should hopefully output the directory. If it didn't, you may be using a different boot mode than UEFI (e.g. BIOS).

Next, we will make sure your keyboard, clock and internet are connected. Before we move onto partitioning the hard drive to make space for our Arch install to live.

---

## Keyboard layout


To get a list of all available key-maps available:

```zsh
$ ls /usr/share/kbd/keymaps/**/*.map.gz
```

To narrow down your search, you can be little more advanced and pipe this list into **grep**, to make the listing easier to read. A simple example to get all Dvorak key-maps: 

```zsh
$ ls /usr/share/kbd/keymaps/**/*.map.gz | grep dvorak
```

Then, once you've found your key-map of choice, load it up with the following command. Remembering to leave off the **.map.gz** file extension:

```zsh
$ loadkeys uk
```

> For the "/usr/share/kbd/keymaps/i386/qwerty/uk.map.gz" keymap.

Now everything should be inserted correctly when you type out the remaining commands.

---

## Make sure we're online


We first need to make sure our computer's network devices are recognised. As an example, my computer's Ethernet (eth13s0) and WLAN (wlp14s0) interfaces are listed with the following command:

```zsh
$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp13s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
    link/ether 40:8d:5c:50:76:63 brd ff:ff:ff:ff:ff:ff
3: wlp14s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DORMANT group default qlen 1000
    link/ether a4:34:d9:09:77:57 brd ff:ff:ff:ff:ff:ff
```

If you're connected with an Ethernet cable, you should be okay with connecting to the internet. We can test this by pinging a popular domain we expect to be running. Once we can see that we can connect to the outside world, we can move on to [the next step](#updating-the-system-clock).

```zsh
$ ping wikipedia.com
PING wikipedia.com (91.198.174.194) 56(84) bytes of data.
64 bytes from ncredir-lb.esams.wikimedia.org (91.198.174.194): icmp_seq=1 ttl=55 time=27.0 ms
64 bytes from ncredir-lb.esams.wikimedia.org (91.198.174.194): icmp_seq=2 ttl=55 time=28.6 ms
64 bytes from ncredir-lb.esams.wikimedia.org (91.198.174.194): icmp_seq=3 ttl=55 time=154 ms
^C
--- wikipedia.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 26.984/69.917/154.174/59.581 ms
```
> Entering Ctrl-C to stop this call (^C shown above)

---

### WiFi connection setup


For wireless connectivity, we will use the preinstalled **iwd** command line tool, with the following steps:

- To enter the tool's interactive prompt.
```zsh
$ iwctl
```

- Getting the name of the WiFi device. Mine was labelled as **wlan0**, so remember to replace the following commands with the name of your device.
```zsh
$ device list
```

- Start a scan for available networks.
```zsh
$ station wlan0 scan
```

- Bring up a list of the available networks.
```zsh
$ station wlan0 get-networks
```

- Connect to the network. Replace **SSID** with the name of the network you want to connect to. You will then be prompted to enter and submit the password for this network.
```zsh
$ station wlan0 connect SSID
```

- Hopefully show that you are now connected to your network.
```zsh
$ station wlan0 show
```

Exiting the interactive prompt with `Ctrl-d`.

To make sure things are running as they should.
```zsh
$ ping wikipedia.com
```

---

## Updating the system clock


This is a simple step.
```zsh
$ timedatectl set-ntp true
```

---

Follow me on [Twitter!](https://twitter.com/intent/user?screen_name=richardhalford_)