Arch Linux's wiki has a great installation guide, but some find it very daunting and hard-to-read. This article is a summary of all the commands in that wiki page, as of time of writing.
This is not a replacement for the the official Installation Guide. Consider this more like a refresher course!
Next: Let's get started.
(Skip this step if you're not dual-booting Windows or MacOS.) Before you create your ext4
(Linux) partition, you'll need make space for it. Resize your current OS's partition down at least 60GB less to give you some space to create your Linux partition.
You can download the latest ArchLinux ISO from the Arch Linux Downloads page. To create these USB disks, you can use dd in Linux, RUFUS in Windows, or dd in MacOS.
Boot into your USB disk. It should land you onto a bash prompt. When you see this, it's time to get started!
Next: Let's type in a few commands.
If you're using different keyboard layout, change it now using loadkeys
. See kbd for a list of available layouts.
Check if the /sys/firmware/efi/efivars
path exists. If it is, you're using UEFI
mode. If not, you're using Legacy
mode. Most modern devices are using UEFI mode, and this guide assumes you're in UEFI mode.
Next: Let's connect to the Internet.
You will be installing packages from the Arch package repository over the Internet. For that, you'll need to be online.
Try going online by typing wifi-menu
. (If this didn't work, have a look at other ways of getting online.)
After all that, ensure that you're finally online.
Next: Update your system clock.
This will update your system clock through the Internet via NTP (Network Time Protocol).
Next: Partition your disk.
You'll need 2 partitions on your computer. You'll need an EFI partition
, which you already have (and can be reused) if you already have another OS installed. You'll also need an ext4 partition
for Arch Linux to be installed to.
I recommend using cfdisk
for this. See Partition the disks (wiki.archlinux.org) for more info.
You'll need to create an ext4
partition. You'll also need an efi
partition, but you probably have that already if you have an OS installed before all this.
Unlike other guides, I recommend not setting up a swap partition, and using systemd-swap instead (we'll set that up later on).
Format any ext4 partitions you made using mkfs.ext4
. Be sure to replace sda1
with the actual partition.
Next: Let's mount the partitions you just made.
After creating your partitions, you'll now need to mount it so we can write to it.
Mount the root partition to /mnt
. This is the ext4 partition that'll be installing Linux into.
Mount the EFI partition to /mnt/boot
. This is where the bootloader will be installed.
Next: Time to actually install Arch Linux.
Edit your mirror list, and move the geographically-closest location to you up the list. Don't skip this step! It'll likely be the difference between a 45-minute install and a 5-minute install.
Install packages using pacstrap
. This will take a while!
Generate the list of partitions (/etc/fstab
) to be mounted at boot time. This will be based on what partitions are already mounted right now.
Next: Let's enter the system.
We're going to "enter" the new system you just mounted using chroot! Use arch-chroot
to "enter" the new file system. This will make root path (/
) be what's in the new partition (until you exit
).
Next: Let's configure the rest of the stuff.
See tzdata for a list of available timezones.
Set your default locale. For most of us, that would be en_US.UTF-8
, but feel free to change that.
Edit the /etc/locale.conf
file and add the locale as LANG=<the locale>
. After this, type, locale-gen
.
(Optional) If you use a different keyboard layout, make it persist on boot.
Next: Set your system's hostname
It's time to pick a name for your machine. Pick a hostname and update /etc/hostname
.
Update /etc/hosts
with your new hostname. (Be sure to change myhostname
to your chosen hostname.)
Change your password using passwd
. This is not your main user's password.
Next: Let's install a boot loader.
You'll need a boot loader in your EFI partition. Think of this as a small program whose sole purpose is to kickstart your Linux session. There are many different boot loaders, but GRUB would be a good one to start with.
Let's install grub into /boot
. Be sure to read the Arch wiki, instructions may be different for your system!
Next: Let's create the user you'll be logging in with.
(This section is not listed in the Arch official installation guide, but I highly recommended this for most users.)
You'll need a user that you'll be logging in with for your day-to-day. (Be sure to change yourname
to whatever you feel like using.)
Set a password using passwd
.
You'll want to add them to some other groups too.
Next: Let's install sudo.
The sudo utility lets your everyday user run system admin tasks. Sudo is not part of the Arch Linux base
package, so we'll need to install that separately.
(This section is not listed in the Arch official installation guide, but I highly recommended this for most users.)
Add and configure the sudo
package to grant your user some superuser rights.
Use visudo
to edit the sudo config to add the wheel
group to it. This allows all users in that group to use sudo. (You did add your user to wheel
, right?)
Next: Install some packages.
(This section is not listed in the Arch official installation guide, but I highly recommended this for most users.)
Install some networking tools, so we may be able to go online later. NetworkManager is used by most desktop environments to manage network connections, and can be used in the console as well via nmtui
.
Next: Your mostly done! Lets do a few more things.
Congratulations, you now have a working Arch Linux installation. At this point, exit
out of the chroot, and reboot
. Be sure to remove the USB drive as you're rebooting, and you may need to go to your BIOS's boot order menu.
From here, I recommend proceeding to the After Installing Arch Linux guide. A basic Arch Linux installation doesn't have a user, swap, a desktop environment, sudo, and many other facilities we may be taking for granted.