Skip to content

Instantly share code, notes, and snippets.

@anna328p
Last active April 6, 2024 13:31
Show Gist options
  • Save anna328p/d4085630cbea63ff1c41f45368d7d542 to your computer and use it in GitHub Desktop.
Save anna328p/d4085630cbea63ff1c41f45368d7d542 to your computer and use it in GitHub Desktop.
Arch Installation Guide for Total Beginners

Arch Installation Guide for Total Beginners

Guide by anna328p/alienpirate5.

This is meant as a companion for the official Arch install guide: https://wiki.archlinux.org/index.php/Installation_guide

This document is a guide for installing Arch Linux from the live system booted with the official installation image.

This document will walk you through the Arch Linux installation process based on the Arch Wiki installation guide. You will need to refer to the wiki for links; this guide just explains the steps in more detail. Keep in mind that this document will become outdated. If there are any differences between this document and the wiki, follow the wiki.

This document assumes that you want to replace your current operating system with Arch. Make sure that your important data is backed up. After you repartition your hard drive, previously stored data will be permanently lost. Make sure that your important data is backed up.

If you want to be able to boot your old operating system and Arch, follow the Arch Wiki guides for dual booting with Windows or dual booting with macOS.

Arch Linux should run on any x86_64-compatible machine with a minimum of 512 MiB RAM. A basic installation should take less than 800 MiB of disk space. As the installation process needs to retrieve packages from a remote repository, this guide assumes a working internet connection is available.

This guide assumes that you have a reasonably modern PC capable of running Arch Linux.

Arch Linux is not designed for new users. If you are not familiar with the Linux command line, the install process and later troubleshooting will be very difficult. A good resource for learning about the Linux command line is Linux Journey.

Conventions used in the document

A line of code prefixed with $ means that it should be run in the shell (in the terminal). The following means "run ls in the shell":

$ ls

A line of code prefixed with # means that it should be run in the shell as root (the administrator or superuser). During the Arch Linux installation process, while you are booted from the installation media, you are already logged in as root.

Pre-installation

The installation media and their GnuPG signatures can be acquired from the Download page.

The Arch Linux installation media comes as an ISO file, which can be burned to a CD. The Arch Linux image can also be written to a flash drive; this is the typical installation method.

Download the .iso file and the .sig signature from the linked download page.

Verify signature

A GnuPG signature is a way of verifying that the image is genuine through digital "signatures" that are very difficult to forge. This signature file can be used to verify if the image was downloaded correctly and to make sure that it has not been maliciously modified. This process is optional but recommended, though it is difficult on Windows.

It is recommended to verify the image signature before use, especially when downloading from an HTTP mirror, where downloads are generally prone to be intercepted to serve malicious images.

On a system with GnuPG installed, do this by downloading the PGP signature (under Checksums) to the ISO directory, and verifying it with:

$ gpg --keyserver-options auto-key-retrieve --verify archlinux-version-x86_64.iso.sig

Alternatively, from an existing Arch Linux installation run:

$ pacman-key -v archlinux-version-x86_64.iso.sig

Boot the live environment

The live environment can be booted from a USB flash drive, an optical disc or a network with PXE. For alternative means of installation, see Category:Installation process.

The ISO file is typically written to a flash drive or a CD/DVD.

To write the image to a flash drive, I recommend Etcher for new users. This program is very simple to use:

  1. Plug in your flash drive.
  2. Select the ISO image and the drive.
  3. Click "Flash". Wait until the process is finished.

Note that this will destroy all data on your flash drive.

To write the image to a CD/DVD on Windows or macOS, insert your disc, right click the downloaded ISO, and select "Burn disc image."

  • Pointing the current boot device to a drive containing the Arch installation media is typically achieved by pressing a key during the POST phase, as indicated on the splash screen. Refer to your motherboard's manual for details.

Keep the Arch Linux install media plugged in. The next steps depend on your brand and type of computer.

Standard PC, running Windows

If you are on Windows 10, try these steps first:

  1. Open Settings.
  2. Click "Update and Security".
  3. Select "Recovery" from the left sidebar.
  4. Under "Advanced startup", click "Restart now".
  5. After your computer restarts, click "Troubleshoot".
  6. Click "Advanced options".
  7. Click "UEFI Firmware Settings".
  8. Make sure that the option named "Secure Boot" is disabled.
  9. Save and quit.
  10. Reboot and repeat steps 1-4.
  11. Click "Use a device", then select your flash drive or DVD.

If you are not running Windows 10 or this does not work, try the following.

When you turn on your computer, you will typically see a message in the corner saying something like "Press F12 for boot menu". If you see a message like this, press the key repeatedly until you enter the boot menu.

If you do not see a message like this, try some common variants: F12, F11, Esc, Delete, F1, F2, F10. If none of these work, consult the manual for your motherboard or computer to find the proper way to enter the boot menu.

Make sure that you disable Secure Boot. By default, Secure Boot checks if your operating system is verified by Microsoft. As Arch Linux is not verified by Microsoft, Secure Boot needs to be disabled to boot it.

Mac, running macOS

If your Mac does not have a T2 Security Chip:

Reboot your computer while holding the Option key. Your computer will enter the boot menu. From this menu, select your flash drive and click the arrow underneath it.

If your Mac has a T2 Security Chip:

  1. Boot into macOS Recovery Mode.
  2. Open the Startup Security Utility from the Utilities menu.
  3. Set Secure Boot to "No Security" and set External Boot to "Allow booting from external media."
  4. Follow the instructions above.

By default, Secure Boot checks if your operating system is verified by Apple. As Arch Linux is not verified by Apple, Secure Boot needs to be disabled to boot it.

Note that there are driver and support issues with these newer Macs, and installing Linux on them can be problematic and difficult.

When the Arch menu appears, select Boot Arch Linux and press Enter to enter the installation environment. See README.bootparams for a list of boot parameters, and packages.x86_64 for a list of included packages.

If you have an Nvidia card, you may need to disable kernel modesetting to be able to properly see the text console. Follow the instructions here and add the parameter nouveau.modeset=0.

You will be logged in on the first virtual console as the root user, and presented with a Zsh shell prompt.

To switch to a different console—for example, to view this guide with ELinks alongside the installation—use the Alt+arrow shortcut.

You will be booted into the Arch Linux live installation environment. In this mode, you have booted your computer from the Arch installation media, effectively using it as a temporary hard drive. The environment is not persistent, meaning if you reboot, it will return to its original state.

The Arch Linux installation media provides text-mode virtual consoles. These are basically full-screen terminals. By default, there are six "tabs" that you can switch between by pressing Alt+F1, Alt+F2, Alt+F3, etc.

To edit configuration files, nano, vi and vim are available.

The live environment comes with three installed text editors: nano, vi, and vim. If you are new to command line text editors, nano is much easier to pick up and use. vi and vim are powerful, but they are also very different from most other text editors. I do not recommend vi/vim to new users.

Set the keyboard layout

The default console keymap is US. Available layouts can be listed with:

# ls /usr/share/kbd/keymaps/**/*.map.gz

To modify the layout, append a corresponding file name to loadkeys(1), omitting path and file extension. For example, to set a German keyboard layout:

# loadkeys de-latin1

Console fonts are located in /usr/share/kbd/consolefonts/ and can likewise be set with setfont(8).

If your keyboard layout is US English, you do not need to change it as it is the default. Otherwise, follow the steps above to select a layout that matches your keyboard.

Verify the boot mode

If UEFI mode is enabled on an UEFI motherboard, Archiso will boot Arch Linux accordingly via systemd-boot. To verify this, list the efivars directory:

# ls /sys/firmware/efi/efivars

If the directory does not exist, the system may be booted in BIOS or CSM mode. Refer to your motherboard's manual for details.

Run ls /sys/firmware/efi/efivars and read the result:

  • If the result is a long list of files, your system has booted with EFI. Take note of this information.
  • If the result is "Directory not found", your system has booted in legacy mode. Take note of this information.

Connect to the internet

To set up a network connection, go through the following steps:

  • Ensure your network interface is listed and enabled, for example with ip-link(8):

# ip link

  • Connect to the network. Plug in the Ethernet cable or connect to the wireless LAN.

  • Configure your network connection:

    • Static IP address
    • Dynamic IP address: use DHCP.
      • Note: The installation image enables dhcpcd (dhcpcd@interface.service) for wired network devices on boot.
  • The connection may be verified with ping:

# ping archlinux.org

I recommend using a wired (Ethernet) connection while installing Arch. If you must use a wireless network, follow the steps in the linked wiki article.

Update the system clock

Use timedatectl(1) to ensure the system clock is accurate:

# timedatectl set-ntp true

To check the service status, use timedatectl status.

This command turns on the time synchronization service that synchronizes your computer's system time with high precision atomic clocks. This is an important step: if your time is incorrect, there will be problems with establishing secure connections to servers.

Partition the disks

This is a very important step in the installation process, and often considered the most difficult step for new users. However, it is simpler than most people think.

Computer storage disks are typically divided into partitions. Partitions are areas of the disk that are considered separate. For example, on Windows, if you create multiple partitions on a disk and format them, they will show up as separate drive letters.

Partition tables

Partitions on a dosl are indicated by a partition table. This is an area of the disk that stores information on the partitions' locations. The two most common types of partition table are MBR and GPT.

MBR partition tables have been used since 1983, and are supported on almost all systems. However, it has limitations. MBR tables can only hold four partitions unless logical partitioning is used. They also are limited to addressing only 2 TB disks or smaller. Finally, most EFI systems cannot boot from MBR disks unless in legacy mode.

GPT is the modern standard partition table layout. It was introduced with EFI systems, but Linux systems installed on GPT drives can be used on both legacy and EFI computers. GPT solves the limitations of MBR partition tables and allows EFI booting on systems that support it.

This guide uses GPT partitioning.

Partitions

Each partition on the disk has a location, size, and type. The location specifies where on the disk the partition is located. The size specifies how much space is allocated to the partition. The type indicates the intended usage of the partition.

A typical Linux system needs several partitions. The layout depends on the type of firmware your computer has.

EFI Firmware

Here is a typical partition layout used with EFI:

Start   Size         Type
1MB     512MB        EFI system partition [EF00]
513MB   Rest of disk Linux root partition (x86-64) [8304]

The EFI system partition holds the bootloader, kernel, and related data. The root partition holds the operating system and user data.

Legacy firmware

Here is a typical partition layout for legacy boot:

Start   Size         Type
1MB     1MB          BIOS Boot partition [EF02]
2MB     Rest of disk Linux root partition (x86-64) [8304]

The BIOS Boot partition holds data for the GRUB bootloader. The root partition holds the operating system and user data.

Notes

This layout works best for systems with one storage disk. For systems with multiple disks, follow the Arch Wiki article on partitioning.

Partitioning your disk

Before you begin:

This process will erase all of the data on your drive.

Make sure that all important data is backed up before continuing.

@Cdungingwwind
Copy link

ummmmm yes use in arch linux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment