- Arch Linux is attractive to developers and power users because it offers the latest versions of software through its rolling release model.
- The Arch Linux installation process is complex but can be successfully done by following simple instructions, even for beginners.
- Arch Linux is highly customizable, allowing users to choose all the software they want in their installation, reducing software bloat.
If you’ve ever thought about trying Arch Linux, but have heard that it’s difficult to install, relax. Because it leaves so much up to the user, Arch Linux has a reputation for being difficult to install. Fortunately, as long as you can follow some simple instructions, you can successfully install this distro and start exploring this ultra-customizable Linux in ways you never could before.
Why Arch Linux?
You may wonder why you should bother installing Arch Linux in the first place.
One major reason is that Arch is a rolling release. This means that instead of coming out with a release on a regular schedule the way Ubuntu does, Arch adds new software versions as they come out. The result is that Arch contains the latest versions of software, which is attractive to developers and power users.
The second major reason that Arch is so popular with Linux power users is its customizability. Arch by itself doesn’t come with a desktop environment the way Ubuntu or Fedora do. It doesn’t even have a GUI at all. You have to choose all the software that you want in your Arch installation. For many Arch aficionados, this cuts down on software bloat.
Interested in installing Arch Linux? Use this step-by-step guide to download, install, configure, and use Arch Linux for the first time.
The first thing to do is to download the installation image and extract it to your media of choice.
Arch is a rolling release, so there’s no finite release as there is for a distro like Ubuntu. This means that Arch releases individual components when they’re ready. The exception to this is the installation image, which releases monthly.
Arch maintains links to its installation image. The best way of getting it is BitTorrent because that’s usually faster than a direct download. If you download the installation image directly, it’s a good idea to verify it with a checksum before you use it.
After that, you’ll want to extract the image to your media, whether that’s a USB drive or a writable disc. If you’re installing Arch in a virtual machine, you can just use the image as it is.
Because the Arch installation process is so complex, it’s best to do it while you’re alert. If you’re tired, go to bed and come back when you’re rested, or brew some coffee or tea. Or maybe a whole pot.
Download: Arch Linux
2. Boot Into the Installation Environment
After you’ve extracted your ISO image to the media, insert it and restart your computer. You may have to adjust the BIOS or UEFI boot priority to get your machine to see the installation media. If you don’t know how to do this, consult the documentation from the manufacturer.
The Arch installation environment is bare-bones: it’s completely in the console. You’ll enter standard Linux commands to accomplish tasks that you would in another distro’s installation program. The developers are working on an installer, but it’s not standard yet, so you’ll need to be comfortable using the shell and editing configuration files.
If this is your first time installing Arch Linux, it’s best to do so on either a spare machine or a virtual machine, so you don’t mess up your daily driver.
3. Choose a Keyboard Layout
By default, the installation environment will use a US keyboard layout. If you need to use another layout, you can find it under the /usr/share/kbd/keymaps directory.
Use the loadkeys command with the name of the layout you want to use:
4. Check Your Internet Connection
Check your internet connection before you proceed because you’re going to need to download packages to install Arch.
If you’re using a wired connection, it should work automatically. To test it, use the ping command:
To stop the ping, press Ctrl + c.
If you use Wi-Fi, there are more steps. The iwctl command is an interactive program that will show a list of available Wi-Fi networks in a menu. When you select your network, it will prompt you for the password, similar to if you used a desktop widget. You can then use the above ping command to test your connection.
5. Set Up Partitions
Next, you’ll need to set up your disk partitions. By default, the installation environment comes with the fdisk utility.
In this example, we’ll set up a main partition and a swap partition. The swap partition will hold data that is swapped out of main memory. If you’re setting up Arch on modern hardware with UEFI, you’ll also need a dedicated boot partition.
The device name of the first hard drive in Linux is typically /dev/sda.
To run fdisk, type fdisk followed by the disk device name. For example:
The fdisk utility is a menu-driven program. Pressing “m” at the prompt will show you its options. Create the partitions and set them to the format that you need.
If you find this daunting, consider using PartedMagic instead. It’s a separate live distro that runs the Gparted utility which gives you a nice graphical interface for setting up your partitions. You’ll want to use it if you’re setting up a dual-boot system, as there’s less chance of you messing the partitions up.
Be sure to back up any data before you work on your partition table no matter what utility you use.
After you set up your partitions, they’ll be named /dev/sdaN, where N is the partition number.
After that, you need to format your partitions. For example, for an EXT4 filesystem, use the mkfs.ext4 command:
And for the swap partition:
Now you’ll have to mount them. We’ll mount our root partition into /mnt:
mount /dev/sda1/ /mnt
6. Edit Your Fstab
After your partitions are set up, you can use the Arch installation’s genfstab utility to create an fstab file. This file will determine how your partitions mount when the system boots.
genfstab -U /mnt >> /mnt/etc/fstab
7. Set Up Your Mirror List
When you first booted your Arch installation environment, the system measured the speed of Arch package mirrors to automatically generate a text file listing them in order of speed for the pacman package manager:
You can install the basic packages for the system with the pacstrap command:
pacstrap -K /mnt base linux linux-firmware
This command will generate plenty of output, including details of exactly which packages it installs:
8. chroot Into Your Arch Environment
With your partitions created, chroot into your arch environment. When you start your Arch installation environment, you’re making changes to that. A chroot will switch the root directory from the live environment to the disk partition you just created.
Use the arch-chroot command with the root directory:
9. Set the System Clock
It’s important that your machine keeps time accurately. To do this, use the hwclock command. This will set the system’s hardware clock to the local time.
If you’re setting up a dual boot machine with Windows, don’t set the hardware clock.
10. Configure Your Locale
You’ll also need to set up your machine to use the right language. Like everything else, on Linux, you can configure this in a plain text file.
Simply open your editor to the file /etc/locale.gen.
All the available locales will be in the file, commented out. Go to the line with the locale you want to activate, which will usually be for your region, and uncomment it.
After that, run the locale-gen command. Since this machine is being set up in the United States, we’ll uncomment the “en_US.UTF-8” line. This will set up your machine to use the language you selected.
This is also a good time to set up the network. The NetworkManager program manages your network connections. You can install it with pacman:
pacman -s NetworkManager
Set it up to start at boot time with systemctl:
systemctl enable NetworkManager.service
After that, set the hostname of your machine by editing the /etc/hostname file. Whatever you put in that file will become the hostname.
11. Set Up the Root Account
With your system set up, you’ll need to set the root password. Use the “passwd” command to do this.
When you run the command, it will prompt you to enter your chosen root password twice.
12. Set Up GRUB
GRUB is the most popular bootloader for Linux. This utility lets you boot your new Arch Linux installation.
You’ll need to install it with pacman:
pacman install grub
The way you’ll install it will depend on whether you’re installing Arch on a newer machine using UEFI or one that uses the older BIOS. If you’re installing on a UEFI system, you’ll need to install the efibootmgr package as well.
To install on a BIOS system, use this command:
grub-install --target=i386-pc /dev/sda
To install on a UEFI system, make sure you’ve mounted the UEFI boot partition and use this command:
grub-install --target=x86_64-efi --efi-directory=esp --bootloader-id=GRUB
Be careful with UEFI, as you can render your system permanently unbootable if you mess this up.
On both systems, use this command to generate the boot menu:
grub-mkconfig -o /boot/grub/grub.cfg
Now You Can Get Started Exploring Arch Linux
With Arch Linux installed, your journey is just beginning. Next, you’ll be able to customize it to be everything you want in a Linux distro and nothing more.