Build Your Arch Linux System From Scratch

Arch Linux is a do-it-yourself Linux distro, It’s very popular among linux geeks and developers that like to really get at the nuts and bolts of a system. Arch give you the freedom to make any choice about the system. It does not come with any pre-installed packages/drivers or graphical installer, instead It uses a command line installer.
When you boot it up for the first time, you’ll be greeted with a command-line tool. It expects you to perform the entire installation from the command-line and install all the necessary program/driver by yourself and customize it the way you want it — by piecing together the components that you’d like to include on your system.
Arch Linux is a really good way to learn what's going on inside a Linux box. You can learn a lot just from the installation process. I am going to walk through the base install, as well as several common post-install things like setting up networking, sound, mounts, X11 and video drivers, and adding users. I am not going to go in great detail on each step, so if you don't know how to do a certain step you may need to seek references elsewhere.
I'll also show you some tips, tricks and tweaks on how you can change the way the GNOME desktop looks and feel to suit your own personal tastes, that is, take a plain-vanilla GNOME Shell and transform it into a desktop that you like.
WARNING: There is a very HIGH chance you can destroy other operating systems or partition, if you don't do it right. Please proceed with caution. If you are new to Linux world I HIGHLY suggest you start off with a distro like Ubuntu or Mint Linux. Ubuntu is designed for people who want an off-the-shelf type system, where all of the choices are already made and the users are expected to sacrifice control for convenience.
Table of Contents
top
Here's a screenshot of my desktop, built just the way I want it


top
Bootable USB Installer
Download the ISO
First of all, you need the Arch Linux image, that can be downloaded from the Official Website.
Arch Linux requires a x86_64 (i.e. 64 bit) compatible machine with a minimum of 512 MB RAM and 800 MB disk space for a minimal installation. However, it is recommended to have 2 GB of RAM and at least 20 GB of storage for a GUI to work without hassle.
After that, you should create the bootable flash drive with the Arch Linux image.
Linux
If you're on a Linux distribution, you can use the dd command for it. Like:
$ dd bs=4M if=/path/to/archlinux.iso of=/dev/sdx status=progress oflag=sync && sync
Note that you need to update the of=/dev/sdx with your USB device location (it can be discovered with the lsblk command).
Otherwise, if you're on Windows, you can follow this tutorial.
MacOS
First, you need to identify the USB device. Open /Applications/Utilities/Terminal and list all storage devices with the command:
$ diskutil list
Your USB device will appear as something like /dev/disk4 (external, physical). Verify that this is the device you want to erase by checking its name and size and then use its identifier for the commands below instead of /dev/disk4.
A USB device is normally auto-mounted in macOS, and you have to unmount (not eject) it before block-writing to it with dd. In Terminal, do:
$ diskutil unmountDisk /dev/disk4
Now copy the ISO image file to the device. The dd command is similar to its Linux counterpart, but notice the 'r' before 'disk' for raw mode which makes the transfer much faster:
# sudo dd if=/Users/sayem/Downloads/archlinux-2019.04.01-x86_64.iso of=/dev/rdisk4 bs=1m
This command will run silently. To view progress, send SIGINFO by pressing Ctrl+t. Note diskX here should not include the s1 suffix, or else the USB device will only be bootable in UEFI mode and not legacy. After completion, macOS may complain that "The disk you inserted was not readable by this computer". Select 'Ignore'. The USB device will be bootable.
top
BIOS
We'll install Arch Linux on UEFI mode, so you should check your bios settings. Boot into your hardware settings or BIOS or UEFI settings. Then check following settings. It can have different names and different keyboard shortcuts to reach it.
- Disable
Secure Boot
- Disable
Launch CSM or Legacy Support
- Set
Boot Mode to UEFI
- Enable
USB Boot
- Set USB Disk as boot priority
top
Pre-installation
Set Keyboard Layout
Arch Linux standard boots into an US keyboard layout. Many of us do not have to do anything. Just check the main keyboard keys and see if they all work.
Check boot mode
To check if the UEFI mode is enabled, run:
# ls /sys/firmware/efi/efivars
If the directory does not exists, the system may be booted in BIOS.
Internet Connection
If you are connected via Ethernet, you can test the connectivity by pinging google:
ping www.google.com -c 3
PING www.google.com (172.217.12.164) 56(84) bytes of data.
64 bytes from lga25s62-in-f4.1e100.net (172.217.12.164): icmp_seq=1 ttl=56 time=5.26 ms
64 bytes from lga25s62-in-f4.1e100.net (172.217.12.164): icmp_seq=2 ttl=56 time=7.86 ms
64 bytes from lga25s62-in-f4.1e100.net (172.217.12.164): icmp_seq=3 ttl=56 time=10.4 ms
--- www.google.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 6ms
rtt min/avg/max/mdev = 5.256/7.841/10.405/2.104 ms
Configure the system time
Once connected to the internet, it is important to synchronize the system time. This can be done by turning on the Network Time Protocol (NTP). We will first check is the service is working and if not, we will activate it.
You can check the NTP service as below:
sh-4.3# timedatectl status
If the service is not working, you can set up it as below
sh-4.3# timedatectl set-ntp true
Partitioning
If you have multiple hard-drives in your machine, please unplug it now so you don’t end up formatting them by mistake. Plug only the one that you will format to install Arch Linux on it.
I have 1TB of storage with 8 partitions, described on the following table below: (I will create two partitions /dev/sdc5 and /dev/sdc6 to install Arch Linux)
| Partition |
Name |
File System |
Size |
| /dev/sdc1 |
EFI System Partition |
fat32 |
200M |
| /dev/sdc2 |
Macintosh HD |
apfs |
558G |
| /dev/sdc3 |
Ubuntu |
ext4 |
70G |
| /dev/sdc4 |
Linux Swap |
linux-swap |
2G |
| /dev/sdc5 |
Arch Linux |
ext4 |
67G |
| /dev/sdc6 |
Microsoft Reserved Partition |
unknown |
16M |
| /dev/sdc7 |
Windows 10 |
ntfs |
232G |