Install Arch Linux
I recently bought a mini PC because I wanted a lightweight machine that I can easily carry anywhere. Arch Linux’s minimalistic, rolling-release approach aligns perfectly with my love for a Vim-based workflow and a highly customizable setup. While the process can seem intimidating at first, it’s an incredibly rewarding experience that offers complete control over your system.
Installing Arch Linux (UEFI or BIOS)
Arch Linux is well-known for giving users full control over their system. This guide walks you through a fresh Arch Linux installation. While it is detailed, always refer to the official Arch Wiki for up-to-date information.
Contents
- Prerequisites
- Creating a Bootable USB
- Initial Setup
- Partitioning
- Formatting and Mounting
- Installing the Base System
- Configuration
- Post-Installation
Prerequisites
- A working internet connection on another device (in case you need help or to follow the Arch Wiki).
- A USB drive of at least 2 GB capacity.
- Familiarity with the command line.
Important: Installing Arch Linux involves formatting drives, which is destructive. Back up all important data before proceeding.
Creating a Bootable USB
On Linux
|
|
if
= input file (the ISO file).of
= output file (usually something like/dev/sdb
).- Be sure to confirm the correct USB path using
lsblk
orfdisk -l
before running the command.
On Windows
- Use Rufus . It’s a straightforward tool that avoids many potential pitfalls.
Initial Setup
- Boot from your USB and select the Arch Linux USB in your system’s boot menu.
- You should see a command-line shell once Arch boots.
Check UEFI or BIOS
|
|
- If you get an error, you’re in BIOS (Legacy) mode.
- If you see contents, you’re in UEFI mode.
Wi-Fi Connection
If you’re on Wi-Fi, use iwctl
:
|
|
Check Internet
|
|
If you have no connection, re-check your Wi-Fi settings or use a wired connection.
Time & NTP
|
|
This ensures your system clock stays synchronized.
Partitioning
Using fdisk
or cfdisk
Identify target disk:
lsblk
Open the disk utility:
1
fdisk /dev/sda
or
1
cfdisk /dev/sda
BIOS Partition Scheme
A common layout might be:
- Boot:
+200M
- Swap: typically 50% of your RAM size (
+8G
for 16 GB RAM) - Root: at least
+25G
- Home: rest of the disk space
Press w
to write changes and exit.
UEFI Partition Scheme
- EFI: around
+550M
and formatted as FAT32. - Swap: 50% of RAM or as needed.
- Root: Minimum
+25G
or more. - Home: Rest of the disk (if desired on a separate partition).
Formatting and Mounting
Creating File Systems
Example commands (adjust partitions to suit your layout):
|
|
Mounting Partitions
Swap:
1
swapon /dev/sda2
Root:
1
mount /dev/sda3 /mnt
Boot (UEFI):
1 2
mkdir /mnt/boot mount /dev/sda1 /mnt/boot
Home (if separate):
1 2
mkdir /mnt/home mount /dev/sda4 /mnt/home
Installing the Base System
Fast Mirror Selection
Choose the fastest mirrors by editing /etc/pacman.d/mirrorlist
. Move the closest/fastest mirrors to the top. This significantly speeds up package downloads.
pacstrap
/ basestrap
For Arch Linux:
|
|
For Artix Linux (example):
|
|
Generating fstab
|
|
Check the file to ensure correct entries:
|
|
Chroot
Now “enter” the new system:
Arch:
1
arch-chroot /mnt
Artix:
1
artix-chroot /mnt bash
Configuration
Setting up Network Manager
|
|
(In Artix, you would enable the corresponding runit service instead.)
Installing and Configuring GRUB
For BIOS
|
|
For UEFI
|
|
Root Password
|
|
Set a strong password for the root user.
Locale and Timezone
Edit
/etc/locale.gen
and uncomment your locale lines (e.g.,en_US.UTF-8
).Generate them:
1
locale-gen
Create
/etc/locale.conf
:1
echo "LANG=en_US.UTF-8" > /etc/locale.conf
Set your timezone:
1 2
ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime # or use tzselect
Hostname
|
|
Final Steps
Exit the chroot environment:
|
|
Remove your USB before booting, and the system should start from the newly installed Arch Linux.
Post-Installation
Creating a New User
Log in as
root
.Create a user:
1 2
useradd -m -g wheel <username> passwd han
Add additional groups if needed:
1
usermod -aG audio,video,storage han
Sudoers Configuration
Edit /etc/sudoers
:
|
|
Add or uncomment a line to allow members of the wheel group to use sudo
:
|
|
Installing X.org and a Window Manager
Install Xorg:
1
pacman -S xorg-server xorg-xinit
Minimal Window Manager:
1
pacman -S i3 dmenu rxvt-unicode
Start X (for testing):
1
startx
For an automated start, add
exec i3
in your~/.xinitrc
.
Fonts
|
|
Or any other font packages that suit your language preferences. For powerline or devicons, install Nerd Fonts:
|
|
Enabling a Display Manager (Optional)
If you prefer a graphical login screen:
|
|
(Again, adapt for runit or other init systems.)
Sound Setup
Alsa
|
|
- Use
M
to unmute any channels.
PulseAudio
|
|
Installing Yay (AUR Helper)
Clone the Yay repository:
1
git clone https://aur.archlinux.org/yay.git
Build and install:
1 2
cd yay makepkg -si
Yay lets you install packages from both the official repositories and the AUR.
Conclusion
Congratulations! Your Arch Linux system is now up and running. From here, you can customize it with whatever software and configurations you like. Remember, the Arch Wiki is your best friend for finding detailed guides and troubleshooting tips.
Happy hacking!