Wx0xo6FsZRyx4rLE66hBR56d1ftvUDQRSK2eJM5q
Bookmark

Arch Linux Setup Guide: Surviving The Command Line Install

I still remember the first time I decided to install Arch Linux. It was about seven years ago, sitting in my college dorm room at 2 AM, staring at a black screen with a tiny, blinking cursor. I had just wiped my perfectly functional Windows partition because some guy on a forum told me I wasn't a "real" programmer if I wasn't using a rolling release distro. I felt a mix of excitement and absolute terror. There was no installer GUI, no mouse cursor, just me and the documentation. And honestly? I broke it three times that night before I finally saw a desktop environment.

But here's the thing: once I got it working, I never wanted to go back. That machine felt like mine in a way no other computer ever had. If you're reading this, you probably want that feeling too. You're tired of bloatware, or you just want to understand how your OS actually works under the hood. I'm going to walk you through this process—not as a textbook, but as someone who has messed this up enough times to know where the landmines are buried.

Step 0: Preparation (Don't Skip This)

Before you even download the ISO, you need to accept that this isn't like installing Ubuntu or Fedora. There is no "Next, Next, Finish" button here (unless you use the archinstall script, but we're doing this the manual way so you actually learn something).

First, grab the latest ISO from the Arch website. Don't use a mirror that hasn't synced in weeks; I usually stick to the torrent link or a local university mirror. Once you have that, you need to get it onto a USB drive.

My recommendation: Stop using Rufus or Etcher for this. Use Ventoy. It allows you to just drag and drop the ISO file onto the USB drive. If the Arch install fails (and it might), you can easily boot into a live Ubuntu ISO or Windows recovery ISO from the same stick without reformatting. I keep a 64GB drive on my keychain with Ventoy and about five different ISOs just in case.

Warning: Back up your data. I mean it. I once accidentally typed /dev/sda instead of /dev/sdb during partitioning and wiped my family photos drive. Don't be like past-me. Unplug any drives you aren't installing to if you can.

Booting and Connecting to the Internet

Plug in the stick, mash F12 (or whatever your BIOS boot menu key is), and select the USB. You'll be dropped into a Zsh shell. It looks intimidating, but it's just a command prompt.

The first hurdle is the internet. If you can plug in an Ethernet cable, do it. It just works 99% of the time. If you're on Wi-Fi, you'll need to use iwctl.

Here is exactly what I type:

  • iwctl (enters the interactive mode)
  • device list (find your card name, usually wlan0)
  • station wlan0 scan
  • station wlan0 get-networks
  • station wlan0 connect "Your_SSID"

Once you're connected, exit with Ctrl+D and ping Google to make sure you're alive: ping -c 3 google.com. If you get bytes back, you're golden.

The Scary Part: Partitioning Disks

This is where most people panic. The Arch Wiki will throw fdisk or parted commands at you, but honestly, just use cfdisk. It has a visual interface in the terminal that makes it much harder to screw up.

Run cfdisk /dev/nvme0n1 (or whatever your drive is—check with lsblk first). If you see a prompt about label type, choose GPT for any modern computer (UEFI). If you're reviving a laptop from 2008, you might need DOS/MBR, but that's rare these days.

You generally need two partitions:

  1. EFI Partition: About 512MB to 1GB. Type should be "EFI System".
  2. Root Partition: The rest of the drive. Type "Linux Filesystem".

I stopped creating separate Swap partitions years ago. I use a swapfile now—it's easier to resize later if I need more memory for compiling heavy stuff like the Zen kernel. Once you write the changes to the disk, you need to format them.

mkfs.fat -F32 /dev/nvme0n1p1 (for the EFI partition)
mkfs.ext4 /dev/nvme0n1p2 (for the root)

Mount them carefully. Mount root to /mnt and the EFI partition to /mnt/boot. If you forget to create the boot directory first, the mount command will yell at you.

Installing the Base System

This is the magic step where the USB stick copies the OS to your drive. The command is pacstrap, and you need to tell it exactly what to install. This is one of those "lessons learned" moments for me: early on, I just installed base and linux.

The problem? I rebooted into a system with no text editor, no network manager, and no way to connect to Wi-Fi to download them. I was stuck.

Here is a robust package list I use now:

pacstrap /mnt base linux linux-firmware base-devel nano vim networkmanager git intel-ucode

(Swap intel-ucode for amd-ucode if you're on a Ryzen chip). Including nano and networkmanager right now saves you a massive headache later.

Configuration: The Chroot Jail

Generate your fstab file so the system knows how to mount drives on boot: genfstab -U /mnt >> /mnt/etc/fstab. I always check this file with cat afterwards. If it's empty, something went wrong.

Now, enter your new system: arch-chroot /mnt.

You're now "inside" your installation. Set your timezone (ln -sf /usr/share/zoneinfo/Region/City /etc/localtime) and sync the hardware clock. Localization is annoying but necessary. Edit /etc/locale.gen and uncomment en_US.UTF-8 (or your language), then run locale-gen.

Don't forget the hostname. Create a file at /etc/hostname and put a cool name in it. I name my machines after spaceships. My current laptop is Rocinante.

The most critical step here is setting the root password with passwd and creating a user for yourself. Never run as root daily.
useradd -m -G wheel -s /bin/bash yourname
passwd yourname

You also need to edit the sudoers file (type EDITOR=nano visudo) and uncomment the line that allows members of the %wheel group to execute any command. If you skip this, you won't be able to use sudo, and you'll lock yourself out of administrative tasks.

The Bootloader

I used to use GRUB religiously, but lately, I've switched to systemd-boot for UEFI systems. It's built-in, simpler, and much faster. However, GRUB is still the king of compatibility.

If you want the safe bet, stick with GRUB:

pacman -S grub efibootmgr
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
grub-mkconfig -o /boot/grub/grub.cfg

If you see "Installation finished. No error reported," you can breathe a sigh of relief. If you see errors here, it's usually because you mounted the EFI partition to the wrong place or you booted in Legacy mode instead of UEFI.

The First Reboot & Desktop Environment

Exit the chroot, unmount everything with umount -R /mnt, and reboot. Pull the USB stick out.

If you see a login prompt, you did it. You have a base Arch system. But it's just a black screen with text. Now you need a Graphical User Interface (GUI).

First, enable the network: systemctl enable --now NetworkManager. (Note the capital N and M—Linux is case sensitive and it hates you if you forget that).

For beginners, I strongly suggest KDE Plasma or GNOME. They are full desktop environments that come with everything you need. I'm a KDE guy because I like customizing every single pixel.

pacman -S plasma-meta konsole dolphin

You'll also need a display manager (the login screen). For KDE, that's SDDM.
pacman -S sddm
systemctl enable sddm

Reboot one last time, and you should see a graphical login screen. Welcome to Arch.

The AUR: Arch's Superpower

The main reason I stick with Arch isn't the difficulty; it's the Arch User Repository (AUR). It contains almost every piece of software ever written for Linux, maintained by the community.

You can't use pacman for the AUR. You need a helper. I use yay (Yet Another Yogurt). To install it, you have to clone it manually first:

git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si

Once yay is installed, you can install anything. Spotify? yay -S spotify. VS Code? yay -S visual-studio-code-bin. It updates just like system packages. It's dangerously convenient.

FAQ: Questions I Get Asked Constantly

Is Arch really unstable and prone to breaking?

Honestly, this is a myth from ten years ago. In my daily usage over the last four years, Arch has broken on me exactly once, and it was because I updated the kernel while my laptop was running on 1% battery and it died mid-write. That was user error, not the distro. If you read the Arch News page before doing a major update, you'll be fine 99% of the time.

Can I game on Arch Linux?

Absolutely. In fact, the Valve Steam Deck runs on a version of Arch. I play Cyberpunk 2077 and Elden Ring on my Arch rig via Steam Proton, and the performance is often better than on Windows because there are fewer background processes eating up my CPU. Just make sure you install the proprietary NVIDIA drivers (nvidia-dkms) if you have a Green Team card.

What if I don't have time to configure everything manually?

If you want the Arch benefits (AUR, rolling release) but hate the installation process, look at EndeavourOS. It's basically Arch with a graphical installer and a friendly community. I put it on my work laptop because I needed to be up and running in 20 minutes. It's fantastic.

Why is the font so small on my 4K monitor?

The TTY (command line) doesn't scale well on HiDPI screens by default. It's super annoying during installation. You can change the font size temporarily with setfont ter-132n if you have the terminus-font package installed, but usually, I just squint until I get the desktop environment installed. KDE handles scaling beautifully these days.

My Final Take

Installing Arch is a rite of passage, but not for the elitist reasons people think. It forces you to understand the components of your computer. You learn what a partition is, how systemd services work, and where config files live.

It's frustrating at first. You will probably forget to install a font package and end up with squares instead of text. You might mess up your audio drivers and spend an hour reading the wiki to fix it. But when you're done, you have a system that runs exactly what you want, nothing more, nothing less. It's clean, it's fast, and it's yours. Just remember to run pacman -Syu at least once a week—rolling releases don't like to be ignored for too long.

Dengarkan
Pilih Suara
1x
* Mengubah pengaturan akan membuat artikel dibacakan ulang dari awal.
Posting Komentar