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=progressif= input file (the ISO file).of= output file (usually something like/dev/sdb).- Be sure to confirm the correct USB path using
lsblkorfdisk -lbefore 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
exitCheck Internet
ping google.comIf you have no connection, re-check your Wi-Fi settings or use a wired connection.
Time & NTP
timedatectl set-ntp trueThis ensures your system clock stays synchronized.
Partitioning
Using fdisk or cfdisk
Identify target disk:
lsblkOpen the disk utility:
fdisk /dev/sdaor
cfdisk /dev/sda
BIOS Partition Scheme
A common layout might be:
- Boot:
+200M - Swap: typically 50% of your RAM size (
+8Gfor 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
+550Mand formatted as FAT32. - Swap: 50% of RAM or as needed.
- Root: Minimum
+25Gor 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 partitionMounting Partitions
Swap:
swapon /dev/sda2Root:
mount /dev/sda3 /mntBoot (UEFI):
mkdir /mnt/boot mount /dev/sda1 /mnt/bootHome (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 gitFor Artix Linux (example):
basestrap -i /mnt base base-devel runit elogind-runit linux linux-firmware \
grub networkmanager networkmanager-runit cryptsetup lvm2 lvm2-runit neovim vimGenerating fstab
genfstab -U /mnt >> /mnt/etc/fstabCheck the file to ensure correct entries:
vim /mnt/etc/fstabChroot
Now “enter” the new system:
Arch:
arch-chroot /mntArtix:
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.cfgFor UEFI
pacman -S grub efibootmgr
grub-install --target=x86_64-efi --efi-directory=/boot
grub-mkconfig -o /boot/grub/grub.cfgRoot Password
passwdSet a strong password for the root user.
Locale and Timezone
Edit
/etc/locale.genand uncomment your locale lines (e.g.,en_US.UTF-8).Generate them:
locale-genCreate
/etc/locale.conf:echo "LANG=en_US.UTF-8" > /etc/locale.confSet your timezone:
ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime # or use tzselect
Hostname
echo "myhostname" > /etc/hostnameFinal Steps
Exit the chroot environment:
exit
umount -R /mnt
rebootRemove 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 hanAdd additional groups if needed:
usermod -aG audio,video,storage han
Sudoers Configuration
Edit /etc/sudoers:
visudoAdd or uncomment a line to allow members of the wheel group to use sudo:
%wheel ALL=(ALL:ALL) ALLInstalling X.org and a Window Manager
Install Xorg:
pacman -S xorg-server xorg-xinitMinimal Window Manager:
pacman -S i3 dmenu rxvt-unicodeStart X (for testing):
startxFor an automated start, add
exec i3in your~/.xinitrc.
Fonts
sudo pacman -S noto-fonts noto-fonts-cjk noto-fonts-emoji noto-fonts-extraOr any other font packages that suit your language preferences. For powerline or devicons, install Nerd Fonts:
yay -S nerd-fonts-hackEnabling 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
Mto unmute any channels.
PulseAudio
sudo pacman -S pulseaudio pulsemixer
pulseaudio --startInstalling Yay (AUR Helper)
Clone the Yay repository:
git clone https://aur.archlinux.org/yay.gitBuild 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.