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
sudo dd if=<path-to-arch-iso> of=<path-to-usb> status=progress
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
ls /sys/firmware/efi/efivars
- 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
:
iwctl
device list
station <wlan> scan
station <wlan> get-networks
station <wlan> connect <wifi-name>
station <wlan> show
exit
Check Internet
ping google.com
If you have no connection, re-check your Wi-Fi settings or use a wired connection.
Time & NTP
timedatectl set-ntp true
This ensures your system clock stays synchronized.
Partitioning
Using fdisk
or cfdisk
Identify target disk:
lsblk
Open the disk utility:
fdisk /dev/sda
or
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):
mkfs.ext4 /dev/sda1 # For /boot or /root or /home
mkfs.fat -F32 /dev/sda1 # For UEFI partition if using UEFI
mkswap /dev/sda2 # Swap partition
Mounting Partitions
Swap:
swapon /dev/sda2
Root:
mount /dev/sda3 /mnt
Boot (UEFI):
mkdir /mnt/boot mount /dev/sda1 /mnt/boot
Home (if separate):
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:
pacstrap /mnt base base-devel linux linux-firmware vim git
For Artix Linux (example):
basestrap -i /mnt base base-devel runit elogind-runit linux linux-firmware \
grub networkmanager networkmanager-runit cryptsetup lvm2 lvm2-runit neovim vim
Generating fstab
genfstab -U /mnt >> /mnt/etc/fstab
Check the file to ensure correct entries:
vim /mnt/etc/fstab
Chroot
Now “enter” the new system:
Arch:
arch-chroot /mnt
Artix:
artix-chroot /mnt bash
Configuration
Setting up Network Manager
pacman -S networkmanager
systemctl enable NetworkManager
(In Artix, you would enable the corresponding runit service instead.)
Installing and Configuring GRUB
For BIOS
pacman -S grub
grub-install --target=i386-pc /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg
For UEFI
pacman -S grub efibootmgr
grub-install --target=x86_64-efi --efi-directory=/boot
grub-mkconfig -o /boot/grub/grub.cfg
Root Password
passwd
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:
locale-gen
Create
/etc/locale.conf
:echo "LANG=en_US.UTF-8" > /etc/locale.conf
Set your timezone:
ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime # or use tzselect
Hostname
echo "myhostname" > /etc/hostname
Final Steps
Exit the chroot environment:
exit
umount -R /mnt
reboot
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:
useradd -m -g wheel <username> passwd han
Add additional groups if needed:
usermod -aG audio,video,storage han
Sudoers Configuration
Edit /etc/sudoers
:
visudo
Add or uncomment a line to allow members of the wheel group to use sudo
:
%wheel ALL=(ALL:ALL) ALL
Installing X.org and a Window Manager
Install Xorg:
pacman -S xorg-server xorg-xinit
Minimal Window Manager:
pacman -S i3 dmenu rxvt-unicode
Start X (for testing):
startx
For an automated start, add
exec i3
in your~/.xinitrc
.
Fonts
sudo pacman -S noto-fonts noto-fonts-cjk noto-fonts-emoji noto-fonts-extra
Or any other font packages that suit your language preferences. For powerline or devicons, install Nerd Fonts:
yay -S nerd-fonts-hack
Enabling a Display Manager (Optional)
If you prefer a graphical login screen:
sudo pacman -S lightdm lightdm-gtk-greeter
sudo systemctl enable lightdm.service
(Again, adapt for runit or other init systems.)
Sound Setup
Alsa
sudo pacman -S alsa-utils alsa-plugins
amixer
- Use
M
to unmute any channels.
PulseAudio
sudo pacman -S pulseaudio pulsemixer
pulseaudio --start
Installing Yay (AUR Helper)
Clone the Yay repository:
git clone https://aur.archlinux.org/yay.git
Build and install:
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.