Arch Installation guide
- User
Arch Installation guide
- 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
ddcommand on Linux/macOS to write the ISO to a USB drive.Example using
ddon Linux:- First, find your USB drive's name with
lsblk. It might be/dev/sdbor/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/sdXwith your USB drive's identifier.
- Replace
Step 3: Boot into the Live Environment
- Plug the USB drive into your computer.
- Restart the computer and enter your BIOS/UEFI settings (usually by pressing
F2,F10,F12, orDelduring boot). - Disable Secure Boot. This is often required.
- Set the USB drive as the primary boot device.
- 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/efivarsIf 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
iwctlutility.# 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.orgPress
Ctrl+Cto 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:
lsblkLet's assume your disk is
/dev/nvme0n1or/dev/sda.We will use
cfdisk, a user-friendly partitioning tool.cfdisk /dev/sdX # Replace sdX with your diskWe will create three partitions for a standard UEFI setup:
- EFI System Partition (ESP): Where the bootloader lives.
- Swap: For virtual memory (optional but recommended).
- Root: Where the operating system and all your files will live.
Inside
cfdisk:- Select
gptas the label type. - Delete any existing partitions on the disk.
- Create the partitions:
- Partition 1 (EFI):
New-> Size:512M->EnterType-> SelectEFI System
- Partition 2 (Swap):
New-> Size:4G(or your desired RAM size) ->EnterType-> SelectLinux swap
- Partition 3 (Root):
New-> Size: Use all remaining space ->EnterType-> Leave asLinux filesystem(default)
- Partition 1 (EFI):
- Select
Write, typeyesto confirm, and thenQuit.
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/sdX3Step 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 efibootmgrbase: 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/fstabCheck 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 /mntYour 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.confStep 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-boxStep 15: Set the Root Password
This is the password for the administrator (
root) account.passwd # Enter and confirm your new passwordStep 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.cfgIf 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 rebootDon'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
rootwith 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 NetworkManagerReboot or run
systemctl start NetworkManagerto start it now. You can usenmtuito easily connect to a Wi-Fi network.Step 19: Create a User Account
Never use
rootfor 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_usernameThe
-G wheelpart adds your user to thewheelgroup, 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 visudoIn the file that opens, find the line
# %wheel ALL=(ALL:ALL) ALLand uncomment it (remove the#). Save and exit (Ctrl+X,Y,Enter).Now, log out of the
rootaccount (exit) and log in as your new user. You can now run commands with admin rights usingsudo.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 gdmReboot 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.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.