Skip to content
The Chat Archive
gemini-2.5-pro· Google LMArena Human Preference 140K

Arch Installation guide

  1. User

    Arch Installation guide

  2. Assistant

    Of course. Here is a comprehensive, step-by-step guide to installing Arch Linux.

    🚨 Disclaimer: Read This First!

    Arch Linux is not for beginners. It expects you to be comfortable with the command line, to understand concepts like disk partitioning, and to be willing to read documentation. This guide provides a common, robust installation path, but it is not a substitute for the official Arch Wiki Installation Guide, which is the single source of truth.

    This guide assumes:

    • You are installing on a modern 64-bit machine with UEFI firmware. (This is standard for most computers made in the last 10+ years).
    • You have a reliable internet connection.
    • You are willing to erase the entire target disk. Back up your data first!

    Phase 1: Pre-Installation (The Live Environment)

    Step 1: Download the Arch ISO

    Go to the official Arch Linux Download Page and get the latest ISO file.

    Step 2: Create a Bootable USB Drive

    Use a tool like BalenaEtcher, Rufus (on Windows), or the dd command on Linux/macOS to write the ISO to a USB drive.

    Example using dd on Linux:

    • First, find your USB drive's name with lsblk. It might be /dev/sdb or /dev/sdc. Be very careful not to select your main hard drive.
    • sudo dd bs=4M if=/path/to/archlinux-*.iso of=/dev/sdX status=progress oflag=sync
      • Replace /dev/sdX with your USB drive's identifier.

    Step 3: Boot into the Live Environment

    1. Plug the USB drive into your computer.
    2. Restart the computer and enter your BIOS/UEFI settings (usually by pressing F2, F10, F12, or Del during boot).
    3. Disable Secure Boot. This is often required.
    4. Set the USB drive as the primary boot device.
    5. Save and exit. Your computer should now boot from the USB.

    You will be greeted with a black screen and a root@archiso ~ # prompt. Welcome to the Arch installation environment!

    Step 4: Verify Boot Mode

    This is critical. Run the following command to ensure you have booted in UEFI mode:

    ls /sys/firmware/efi/efivars
    

    If this command lists files, you are in UEFI mode. Continue with this guide. If it gives an error like "No such file or directory," you are in legacy BIOS mode, and the partitioning and bootloader steps will be different.

    Step 5: Connect to the Internet

    The installer needs the internet to download packages.

    • For Wi-Fi: Use the iwctl utility.
      # Enter the interactive prompt
      iwctl
      
      # List your Wi-Fi devices (e.g., wlan0)
      [iwd]# device list
      
      # Scan for networks
      [iwd]# station <device_name> scan
      
      # List available networks
      [iwd]# station <device_name> get-networks
      
      # Connect to a network
      [iwd]# station <device_name> connect "Your_Network_Name"
      # It will prompt for your password
      
      # Check your connection and exit
      [iwd]# station <device_name> show
      [iwd]# exit
      
    • For Ethernet: It should connect automatically.

    Verify your connection:

    ping archlinux.org
    

    Press Ctrl+C to stop the ping. If you get replies, you are connected.

    Step 6: Update the System Clock

    timedatectl set-ntp true
    

    Phase 2: Partitioning and Filesystems

    🚨 Warning: This step will destroy all data on the target disk. Double-check your disk identifier.

    Step 7: Partition the Disk

    First, identify your target disk:

    lsblk
    

    Let's assume your disk is /dev/nvme0n1 or /dev/sda.

    We will use cfdisk, a user-friendly partitioning tool.

    cfdisk /dev/sdX   # Replace sdX with your disk
    

    We will create three partitions for a standard UEFI setup:

    1. EFI System Partition (ESP): Where the bootloader lives.
    2. Swap: For virtual memory (optional but recommended).
    3. Root: Where the operating system and all your files will live.

    Inside cfdisk:

    1. Select gpt as the label type.
    2. Delete any existing partitions on the disk.
    3. Create the partitions:
      • Partition 1 (EFI):
        • New -> Size: 512M -> Enter
        • Type -> Select EFI System
      • Partition 2 (Swap):
        • New -> Size: 4G (or your desired RAM size) -> Enter
        • Type -> Select Linux swap
      • Partition 3 (Root):
        • New -> Size: Use all remaining space -> Enter
        • Type -> Leave as Linux filesystem (default)
    4. Select Write, type yes to confirm, and then Quit.

    Verify your new partitions with lsblk. You should see /dev/sdX1, /dev/sdX2, and /dev/sdX3.

    Step 8: Format the Partitions

    Now we create filesystems on our new partitions.

    # Format the EFI partition as FAT32
    mkfs.fat -F32 /dev/sdX1
    
    # Initialize the swap partition
    mkswap /dev/sdX2
    
    # Format the root partition as ext4
    mkfs.ext4 /dev/sdX3
    

    Step 9: Mount the Filesystems

    We need to mount our new partitions to a temporary location (/mnt) to install Arch onto them.

    # Mount the root partition first
    mount /dev/sdX3 /mnt
    
    # Create a boot directory and mount the EFI partition
    mkdir /mnt/boot
    mount /dev/sdX1 /mnt/boot
    
    # Turn on swap
    swapon /dev/sdX2
    

    Phase 3: The Base Installation

    Step 10: Install Essential Packages

    This is the core step where we download and install the base Arch Linux system onto our mounted partitions.

    # The pacstrap script installs packages to the new system
    pacstrap /mnt base linux linux-firmware nano networkmanager grub efibootmgr
    
    • base: The bare minimum packages to have a functional system.
    • linux: The Linux kernel.
    • linux-firmware: Firmware files for common hardware.
    • nano: A simple text editor (essential for configuration).
    • networkmanager: A popular, easy-to-use network management tool.
    • grub & efibootmgr: The GRUB bootloader and tools for UEFI.

    Step 11: Generate the fstab File

    This file tells your new system which partitions to mount on boot.

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

    Check the generated file to ensure it looks correct: cat /mnt/etc/fstab.


    Phase 4: System Configuration (Inside the Chroot)

    Step 12: Chroot into the New System

    We will now "change root" into our new system to configure it from the inside.

    arch-chroot /mnt
    

    Your prompt will change, indicating you are now operating on your newly installed system.

    Step 13: Set Time Zone and Locale

    # Set your time zone
    ln -sf /usr/share/zoneinfo/Region/City /etc/localtime
    # Example: ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime
    
    # Sync hardware clock
    hwclock --systohc
    
    # Edit the locale file to uncomment your language
    nano /etc/locale.gen
    # Find en_US.UTF-8 UTF-8 and uncomment it (remove the #)
    
    # Generate the locales
    locale-gen
    
    # Create the locale configuration file
    echo "LANG=en_US.UTF-8" > /etc/locale.conf
    

    Step 14: Network Configuration

    # Create the hostname file
    echo "my-arch-box" > /etc/hostname  # Choose any name you like
    
    # Create the hosts file
    nano /etc/hosts
    # Add the following lines:
    127.0.0.1   localhost
    ::1         localhost
    127.0.1.1   my-arch-box.localdomain my-arch-box
    

    Step 15: Set the Root Password

    This is the password for the administrator (root) account.

    passwd
    # Enter and confirm your new password
    

    Step 16: Install the Bootloader (GRUB)

    # Install GRUB for UEFI systems
    grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
    
    # Generate the GRUB configuration file
    grub-mkconfig -o /boot/grub/grub.cfg
    

    If this completes without errors, your system should be bootable.


    Phase 5: Finalizing and Rebooting

    Step 17: Exit and Reboot

    We are done configuring. Let's exit the chroot, unmount the partitions, and reboot.

    exit        # Exits the chroot, you are back in the live USB environment
    umount -R /mnt
    reboot
    

    Don't forget to remove the USB drive!

    If all went well, you will see the GRUB boot menu and then an Arch Linux login prompt. Congratulations! You have a working Arch Linux system. Log in as root with the password you set.


    🖥️ Post-Installation: Making it Usable

    You currently have a command-line-only system. Here are the first things you should do.

    Step 18: Enable Networking

    We installed NetworkManager, now let's enable it so it starts automatically on boot.

    systemctl enable NetworkManager
    

    Reboot or run systemctl start NetworkManager to start it now. You can use nmtui to easily connect to a Wi-Fi network.

    Step 19: Create a User Account

    Never use root for daily tasks. It's a huge security risk.

    # Replace 'your_username' with your desired username
    useradd -m -G wheel -s /bin/bash your_username
    
    # Set a password for your new user
    passwd your_username
    

    The -G wheel part adds your user to the wheel group, which we will grant admin privileges to.

    Step 20: Install and Configure sudo

    # Install sudo
    pacman -S sudo
    
    # Allow users in the 'wheel' group to use sudo
    EDITOR=nano visudo
    

    In the file that opens, find the line # %wheel ALL=(ALL:ALL) ALL and uncomment it (remove the #). Save and exit (Ctrl+X, Y, Enter).

    Now, log out of the root account (exit) and log in as your new user. You can now run commands with admin rights using sudo.

    Step 21: Install a Desktop Environment

    You probably want a graphical interface. Here's how to install GNOME, a popular and complete desktop environment.

    # Install GNOME and its display manager (GDM)
    sudo pacman -S gnome gdm
    
    # Enable the display manager to start on boot
    sudo systemctl enable gdm
    

    Reboot your computer. You should now be greeted by the GNOME graphical login screen!


    🎉 You're Done (with the basics)!

    Welcome to Arch Linux. Your next steps are to explore the Arch Wiki, install your favorite applications, and customize the system to your liking. A good place to start is learning about the Arch User Repository (AUR) and helpers like yay.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.