Introduction
Arch Linux is a Linux distribution known for its simplicity and minimalism. Although it is one of the most difficult Linux distributions to install, it is one of the most popular among Linux enthusiasts. In this article, I will show you how to install Arch Linux using the command line in case you get tangled up with the Arch Wiki.
You must know that there is now the possibility of installing Arch Linux with a graphical installer, but in this article, we will focus on the installation using the command line.
There are people who feel a bit “dirty” if they don’t install Arch Linux from the terminal, because with a graphical installer, they don’t have complete control over what they are installing. And the Arch Linux terminology is “Keep It Simple, Stupid”, so let’s install it from the terminal.
Important:
Note: This article assumes that you have a basic understanding of how Linux works and that you have a stable internet connection. If you don’t have basic Linux knowledge, I would recommend learning the basics first before proceeding with this article.
Personally, I learned a lot about Linux by installing Arch, as following the Arch Wiki initially seemed a bit challenging. However, after several days of attempts, with a lot of trial and error, I succeeded. And I decided to create a simpler step-by-step guide of what needs to be done.
Requirements
- A device with at least 512 MB of RAM.
- A stable internet connection.
- A USB storage device with at least 2 GB of free space.
- UEFI system.
Note: This installation has been done with a UEFI system and GPT partitions.
Installation
-
Verify UEFI Boot
-
Press Win + R, type msinfo32, and press Enter.
-
Look for the BIOS Mode entry.
-
If the value is Legacy, the boot environment is BIOS (Installation would be different). If it is another value like GPT, the corresponding boot environment will be displayed.
-
-
Download Arch Linux: First, you need to download the latest version of Arch Linux from the official website.
-
Boot Arch on a USB: To create a bootable USB, you can use Rufus on Windows.
Once Arch is booted, you can run the following commands:
1. Change Keyboard Layout
la-latin1
is the keyboard layout for Latin America, but you can choose the one you need. You can view more layouts with the following command:
2. Connect to Wi-Fi:
3. Verify Internet Connection
You should receive a response; if not, go back to step 2.
4. Update the system clock
5. Partition the Disk
We need at least 3 partitions: one for boot, another for swap, and another for root.
SIZE | PARTITION TYPE |
---|---|
512M | EFI System |
YOUR GB OF RAM | SWAP (linux swap) |
REMAINING GB | ROOT (linux filesystem) |
With the following command, we can see the disks we have:
Make sure to select the correct disk; in my case, it’s /dev/sda
. If you have an SSD, it’s likely to be /dev/nvme0n1
.
If your disk or partition doesn’t appear with the previous command, run this command to view all partitions and take note of your partition:
So, you run this command:
6. Format the Disks:
7. Mount the Disks:
First, create a mount point for EFI:
Then mount the partitions:
8. Install Essential Packages:
9. Execute fstab:
10. Execute chroot:
11. Configure Time Zone:
In my case, I will use the Bogota time zone, but you can choose the one you need.
Run hwclock to synchronize the system clock:
12. Edit Locale:
From here on, I’ll use nvim as the text editor. If you’re not familiar with it, you can follow this guide on Basic Commands for Neovim. At least, so you know how to save and exit Neovim.
- Locate the line containing: es_CO.UTF-8 for Colombia locale and uncomment it. Remove the # from the line and save the file.
13. Configure locale.conf:
14. Configure Keyboard:
15. Configure Hostname:
- Enter a name for your PC; in my case, I’ll put rxtsel
16. Configure host:
- Write exactly as shown in the image. Just replace
myhostname
with the name you set in yourhostname
17. Execute initramfs:
18. Install Grub and Other Packages:
19. Create EFI Directory:
20. Mount the EFI Partition:
21. Install bootloader:
We will install Grub, but you can choose to install another bootloader like systemd-boot:
22. Configure grub:
23. Enable Network Manager:
24. Add new user:
25. Add Sudo Permissions:
- Uncomment: %wheel ALL=(ALL) ALL and save.
26. Password for the New User:
- Set a password for the user you created, in my case, for rxtsel.
27. Configure Root Password:
- Set a password for the root user.
28. Install Display Driver:
If you have an INTEL GPU, run the following command:
If you have an AMD GPU, run the following command:
29. Install Display Server:
At this point, we have the basic Arch Linux setup. From here, you can restart and reconnect to the internet to install a desktop environment or window manager of your choice.
Exit to arch-chroot:
Unmount all partitions:
Reboot system:
And remove the USB…
Once restarted, you’ll see that it asks for a username and password in the console, but you still DON’T have any desktop environment or window manager. Therefore, we’ll need to download one. If you are connected by cable, you don’t need to follow these steps as you already have an internet connection. In case of using WIFI, run the following commands:
Alright, now test the connection with:
You now have an internet connection.
Installing Your Desktop Environment or Window Manager
From here, it’s your choice. You can install the desktop environment you prefer, or a window manager, or simply stick with the terminal. Some popular choices include:
Window Managers (TWM):
Desktop Environments:
You can explore and choose the one you like the most. In my case, I prefer TWM. Here you can check my dotfiles