How to Install Arch Linux: A Comprehensive Guide
If you’re someone who enjoys the thrill of customizing your Linux system to your exact specifications, then Arch Linux might be the perfect distribution for you. Arch Linux is known for its simplicity, minimalism, and do-it-yourself approach, offering a rolling release model that ensures you always have access to the latest software packages. In this guide, we’ll walk you through the step-by-step process of installing Arch Linux on your machine.
Before we dive into the installation process, make sure you have the following prerequisites:
- A bootable USB drive with the Arch Linux ISO image.
- A computer with at least 20 GB of free disk space.
- A reliable internet connection.
Step 1: Booting into the Arch Linux Live Environment
Insert your bootable USB drive into the computer and restart it. Enter the BIOS/UEFI settings and configure the boot order to prioritize the USB drive. Save your changes and reboot the computer. Arch Linux will load into the Live Environment.
Step 2: Connect to the Internet
To install Arch Linux, you’ll need an internet connection. You can use either an Ethernet connection or connect to a Wi-Fi network. For Wi-Fi, use the following command to list available networks:
iwctl station wlan0 scan iwctl station wlan0 get-networks iwctl station wlan0 connect <SSID>
<SSID> with the name of your Wi-Fi network and enter the passphrase when prompted.
Step 3: Partitioning the Disk
Now it’s time to partition your disk. Arch Linux doesn’t come with a graphical partitioning tool, so we’ll use the
fdisk utility. Type the following command to start partitioning your disk:
X with the appropriate letter for your disk (e.g.,
gto create a new GPT partition table.
nto create a new partition.
- Choose the partition type (usually primary) and set the partition size.
- Repeat the previous steps if you want additional partitions (e.g., for /home or /var).
Once you’ve created all your partitions, type
w to write the changes to disk.
Step 4: Formatting the Partitions
After partitioning, you’ll need to format the partitions. Here’s how:
- For the root partition (e.g.,
- For other partitions (e.g., /home), use the appropriate file system type (e.g.,
Step 5: Mounting the Partitions
Now, mount the root partition to
mount /dev/sdX1 /mnt
If you created additional partitions, mount them accordingly. For example:
mkdir /mnt/home mount /dev/sdX2 /mnt/home
Step 6: Installing the Base System
It’s time to install the base Arch Linux system. Use the following command to perform the installation:
pacstrap /mnt base linux linux-firmware
This will install the minimal essential packages needed to run Arch Linux.
Step 7: Generating the Fstab
fstab file to define how disk partitions should be mounted at boot:
genfstab -U /mnt >> /mnt/etc/fstab
Step 8: Chrooting into the New System
Now, change the root into the newly installed system:
Step 9: Configuring the System
The base system is installed, but there are still a few configurations to be made:
- Set the time zone:
ln -sf /usr/share/zoneinfo/Region/City /etc/localtime
- Uncomment the locale you want to use in
/etc/locale.gen, and then generate the locale:
- Create the
locale.conffile and set the desired locale:
echo "LANG=en_US.UTF-8" > /etc/locale.conf
- Set the hostname:
echo "myhostname" > /etc/hostname
- Edit the
/etc/hostsfile and add the following lines:
127.0.0.1 localhost ::1 localhost 127.0.1.1 myhostname.localdomain myhostname
- Set the root password:
Step 10: Installing the Boot Loader
To boot into Arch Linux, you’ll need to install a boot loader. We’ll use
Step 11: Rebooting
The installation is complete! Exit the chroot environment:
Unmount all partitions:
umount -R /mnt
Then, restart your system:
Welcome to Arch Linux!
Congratulations, you’ve successfully installed Arch Linux on your machine! Now you have a clean slate to build your personalized, minimalist Linux system. Enjoy exploring the vast world of Arch Linux and its incredible customization options!
Remember that Arch Linux requires some manual configuration and is designed for users who enjoy learning and customizing their systems. It’s not the best choice for absolute beginners, but it can be a rewarding experience for those who seek full control over their Linux environment.
Happy hacking! :tada: