Technology Encyclopedia Home >How to Install Arch Linux?

How to Install Arch Linux?

To install Arch Linux, you need to follow several steps:

Preparation:

  • Backup your data.
  • Ensure your computer's hardware is compatible with Arch Linux.
  • Download the latest Arch Linux ISO from the official website.

Installation Steps:

  1. Create a Bootable USB Drive:

    • Use a tool like Rufus or Etcher to write the ISO to a USB drive.
  2. Boot from USB Drive:

    • Insert the USB drive into your computer and restart it.
    • Enter the BIOS/UEFI settings to change the boot order, setting the USB drive as the first boot device.
  3. Start the Installation:

    • Follow the on-screen instructions to start the Arch Linux installation script.
    • Partition your hard drive. You can use tools like cfdisk or gdisk.
    • Format the partitions. For example, you might format /dev/sda1 as ext4 for the root directory.
  4. Mount Partitions:

    • Mount the root partition (e.g., /dev/sda1) to /mnt.
    • Create and mount other necessary directories like /mnt/boot if you are using a separate boot partition.
  5. Install the Base System:

    • Run pacstrap /mnt base linux linux-firmware. This command installs the essential packages.
  6. Generate the fstab File:

    • Use genfstab -U /mnt >> /mnt/etc/fstab to create the fstab file which contains information about file systems to mount.
  7. Chroot into the New System:

    • Run arch-chroot /mnt to change the root directory to the newly installed system.
  8. Configure the System:

    • Set the timezone with timedatectl set-timezone Your/Timezone.
    • Set the locale with localectl set-locale LANG=en_US.UTF-8.
    • Configure the network. You might use nmcli for this purpose.
  9. Install a Bootloader:

    • Install GRUB with grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=ArchLinux.
    • Generate the GRUB configuration file with grub-mkconfig -o /boot/grub/grub.cfg.
  10. Exit Chroot and Reboot:

    • Type exit to leave the chroot environment.
    • Unmount all partitions with umount -R /mnt.
    • Reboot your computer with reboot.

Example:
For instance, when partitioning, you might create a root partition (/dev/sda1) and a boot partition (/dev/sda2). You would format /dev/sda1 as ext4 and mount it to /mnt, then proceed with the installation steps.

For more advanced users, Arch Linux offers a rolling release model, meaning you can always get the latest software versions. However, this also requires more manual configuration compared to other distributions.

If you need a more managed and less hands-on experience, consider services like Tencent Cloud's Cloud Virtual Machine, which provides pre-configured environments.