Arch Linux Installation

Arch Linux Installation

πŸ’‘ 0x Note: It’s based on experience and device environment, in another case maybe you deal with some issues or problems. you can visit the arch forum here, or here.

πŸ’‘ 0x Tip: Important to know your own Laptop, what kind of boot (efi or uefi) ssd or hdd, vm, single boot, or dual boot, etc. Most Important RTFM [READ THE F*cking MANUALS].

⚠️ Disclaimer: This is a lean, fast, and minimalistic Arch Linux installation guide focused on speed, reproducibility, and flexibility. Ideal for both VM and bare-metal setups.

βœ… Pre-Install Checklist

πŸ’¬ More info: Arch Wiki - Installation Guide β€’ BBS Forum

1. Know Your Hardware

  • UEFI vs BIOS

    βœ… To check if your system booted in UEFI mode, run:

    ls /sys/firmware/efi/efivars
    

    If the directory exists and is populated, you’re in UEFI mode. If not, you’re likely in legacy BIOS mode.

    πŸ“š Arch Wiki - UEFI

  • Disk (NVMe, SSD, HDD)
  • Internet (Wi-Fi or LAN)
  • Keyboard layout
  • VM or real hardware

2. Download & Verify ISO

wget https://archlinux.org/iso/latest/archlinux-x86_64.iso
# Optional but recommended:
gpg --keyserver-options auto-key-retrieve --verify archlinux-*.iso.sig

3. Create Bootable Media

# Linux
sudo dd bs=4M if=archlinux.iso of=/dev/sdX status=progress oflag=sync

# macOS
sudo dd if=archlinux.iso of=/dev/diskX bs=1m

πŸ”₯ Booting Into Live ISO

Enter UEFI Menu > Boot From USB/DVD

  • Select “Boot Arch Linux (x86_64)”

🌐 Network Configuration

Ethernet (auto)

Usually auto-configured via DHCP.

Wi-Fi (optional)

If you’re using a graphical interface in the live ISO (like archinstall), you might already have NetworkManager. Otherwise, you may need to install it first or use alternatives.

# If NetworkManager is available:
nmtui  # Text-based UI for connecting to Wi-Fi

# If not available, use iwctl (for iwd-based connection)
iwctl
[iwd]# device list                      # List available Wi-Fi interfaces
[iwd]# station wlan0 scan              # Scan for available networks
[iwd]# station wlan0 get-networks      # List found networks
[iwd]# station wlan0 connect your-SSID # Replace with actual SSID
# You will be prompted to enter Wi-Fi password interactively

Note: nmtui is not installed by default on the base archiso. iwctl is usually available and works in minimalist setups.

Test:

ping archlinux.org

πŸ•“ Set Time

πŸ“š Reference: Arch Wiki - System Time

timedatectl set-ntp true

πŸ’½ Disk Partitioning with cfdisk

lsblk  # Check your disk layout first
cfdisk /dev/sda  # Replace with your actual disk
cfdisk /dev/sda  # Replace with your actual disk

Suggested Layout (GPT):

πŸ“š See also: Arch Wiki - Partitioning and Swap

  • EFI System: 512M–1G (Type: EFI System)

    βš™οΈ Required for UEFI boot. 512MB is sufficient, but 1GB gives room for multiple bootloaders or kernels.

  • Swap: Min 2G, or based on RAM and hibernation usage:

    🧠 Swap is used when RAM is full, for compressed memory cache, or for hibernation. Here are suggested sizes:

    • RAM 4GB β†’ Swap 2–4GB
    • RAM 8GB β†’ Swap 2–6GB
    • RAM 16GB β†’ Swap 4–8GB
    • RAM 32GB+ β†’ Swap 4–8GB normally, or 32GB+ if using hibernation

    πŸ’Ύ Hibernation Rule: Swap size β‰₯ RAM (e.g., 16GB RAM β†’ 17–20GB swap recommended)

    πŸ“ Use resume kernel parameter and add resume=/dev/sdX to your GRUB config for hibernation to work properly

  • Root: 30–50G (Type: Linux filesystem)

    🏠 Contains system and applications. 30GB is minimum for full desktop use; 50GB+ for dev work.

  • Home: Remaining space (optional)

    πŸ“ Good for storing user files separately from root. Optional but recommended for separation of data and config.

Format Partitions

mkfs.fat -F32 /dev/sda1
mkswap /dev/sda2
mkfs.ext4 /dev/sda3
mkfs.ext4 /dev/sda4  # If created β€” only do this if you're going to use /home, otherwise skip to avoid mount errors later

Mount Partitions

mount /dev/sda3 /mnt
mkdir -p /mnt/{boot,home}
mount /dev/sda1 /mnt/boot
mount /dev/sda4 /mnt/home  # If created
swapon /dev/sda2

πŸ“¦ Install Base System

πŸ“š See: Arch Wiki - pacstrap

pacstrap -K /mnt base base-devel linux linux-firmware vim networkmanager sudo grub efibootmgr os-prober openssh

Don’t worry about any localization-related errors you may receive β€” these will be resolved by future steps.

While the official installation guide only includes the base, linux, and linux-firmware packages, this guide adds several extras to ensure a smoother experience:

  • grub: The boot loader we’ll be using
  • efibootmgr: A utility to manage EFI entries
  • lvm2: For logical volume management setups (LVM)
  • vim: A reliable terminal text editor
  • openssh: SSH server for remote access
  • sudo: Required for safe privilege escalation
  • base-devel: Essential tools like make, gcc, etc β€” required for building AUR packages

πŸ“š See also: Arch Wiki - base-devel

You can optionally choose a different kernel flavor:

  • linux: default
  • linux-lts: Long Term Support kernel (stable, less frequent updates)
  • linux-zen: Tweaked for performance and responsiveness (useful for desktop)

Example:

pacstrap -K /mnt base linux-lts linux-firmware ...

πŸ“‚ Generate fstab

πŸ“š See also: Arch Wiki - fstab

genfstab -U /mnt >> /mnt/etc/fstab

πŸ› οΈ Chroot & Configure

πŸ“š Reference: Arch Wiki - arch-chroot

arch-chroot /mnt

Set Timezone

# Find your time zone:
ls /usr/share/zoneinfo  # Browse available zones

# Example for Asia/Jakarta:
ln -sf /usr/share/zoneinfo/Asia/Jakarta /etc/localtime
hwclock --systohc

Locale

vim /etc/locale.gen
# Uncomment en_US.UTF-8 UTF-8
locale-gen

echo "LANG=en_US.UTF-8" > /etc/locale.conf

Keymap (Optional β€” only if you use a non-US keyboard layout)

echo "KEYMAP=us" > /etc/vconsole.conf

Hostname

echo "your-hostname" > /etc/hostname

cat >> /etc/hosts <<EOF
127.0.0.1   localhost
::1         localhost
127.0.1.1   your-hostname.localdomain your-hostname
EOF

πŸ” Root Password

passwd

πŸ§ͺ Update initramfs (Initial Ramdisk)

πŸ“š Arch Wiki - mkinitcpio

If you modify /etc/mkinitcpio.conf (e.g., for LVM, encryption, resume hook for hibernation), you must regenerate the initramfs:

mkinitcpio -P

---

## πŸš€ Install Bootloader (GRUB)

> πŸ“š Reference: [Arch Wiki - GRUB](https://wiki.archlinux.org/title/GRUB)

```bash
# Already installed via pacstrap, this is just to verify or reinstall if needed
pacman -S grub efibootmgr os-prober 

### Dual Boot with Windows or Other Distros

To make GRUB detect Windows or other OSes automatically, enable `os-prober`.

1. First, install `os-prober` if not already:
   ```bash
   sudo pacman -S os-prober
   ```

2. Then edit `/etc/default/grub`:
   ```bash
   sudo vim /etc/default/grub
   ```

3. Find or add the line:
   ```bash
   GRUB_DISABLE_OS_PROBER=false
   ```

4. Regenerate the GRUB config:
   ```bash
   sudo grub-mkconfig -o /boot/grub/grub.cfg
   ```

> πŸ“š Reference: [Arch Wiki - Dual Boot with Windows](https://wiki.archlinux.org/title/Dual_boot_with_Windows)

# Mount check
ls /boot

grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB

grub-mkconfig -o /boot/grub/grub.cfg

🌐 Enable Network Services

πŸ“š See: Arch Wiki - NetworkManager, SSH, or systemd-networkd

systemctl enable sshd       # Enable SSH server
systemctl enable NetworkManager  # Enable network management via NetworkManager
# systemctl enable dhcpcd   # (Optional) Enable if using dhcpcd instead of NetworkManager

πŸ‘€ Add New User

pacman -S xdg-user-dirs 
# xdg-user-dirs: for creating standard user folders like ~/Documents
useradd -m -G wheel -s /bin/bash 0x
passwd 0x
EDITOR=vim visudo
# Uncomment: %wheel ALL=(ALL) ALL

Login into the newly created user

su - 0x
xdg-user-dirs-update  # Creates standard folders like Documents, Downloads, etc

πŸšͺ Exit & Reboot

(Optional β€” if you’re using systemd-networkd instead of NetworkManager)

systemctl enable systemd-networkd
systemctl enable systemd-resolved
exit
umount -R /mnt
swapoff -a  # Turn off swap before reboot to safely release the swap partition
reboot

πŸ’‘ Post-Install Suggestions

Essential Tools

sudo pacman -S git unzip wget reflector man-db neovim htop nmap ufw net-tools dnsutils ranger ncdu btop ripgrep fd bat fzf screenfetch

AUR Helper (yay) + Zsh Setup + Go Environment

πŸ“š See: Arch Wiki - Zsh, Go, AUR Helpers

# Install prerequisites
sudo pacman -S go zsh

# Set Zsh as default shell
chsh -s /bin/zsh

# Reboot or re-login to apply Zsh

# Install Oh My Zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

# Install useful Zsh plugins (syntax highlighting, autosuggestions, etc)
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
git clone https://github.com/MichaelAquilina/zsh-you-should-use.git ~/.oh-my-zsh/custom/plugins/zsh-you-should-use

# Edit ~/.zshrc and add the plugins:
# plugins=(git zsh-syntax-highlighting zsh-autosuggestions you-should-use)

# Source the updated Zsh config
source ~/.zshrc

# Setup Go PATH (optional)
echo 'export GOPATH=$HOME/go' >> ~/.zshrc
echo 'export PATH=$PATH:$GOPATH/bin' >> ~/.zshrc
source ~/.zshrc

# Install yay AUR helper
cd ~ && git clone https://aur.archlinux.org/yay.git
cd yay && makepkg -si

BlackArch Repository (Optional)

πŸ“š See: BlackArch Wiki

curl -O https://blackarch.org/strap.sh
chmod +x strap.sh
sudo ./strap.sh

⚠️ Warning: Adds thousands of penetration testing tools. Only install specific tools you need.


Understanding Pacman Repositories

πŸ“š Arch Wiki - pacman.conf

In /etc/pacman.conf you can enable/disable repos:

  • [core] – essential system packages
  • [extra] – userland tools & common software
  • [community] – community-maintained packages
  • [multilib] – 32-bit libs on 64-bit systems (enable this for apps like Steam)

To enable multilib:

[multilib]
Include = /etc/pacman.d/mirrorlist

πŸ§ƒ Add Candy to Pacman

Enable ASCII Pacman easter egg:

sudo vim /etc/pacman.conf

Uncomment or add:

Color
ILoveCandy

πŸŽ‰ You’ll see animated Pacman munching while syncing packages!

Audio

πŸ“š See: Arch Wiki - PipeWire, PulseAudio

πŸ”Š Why PipeWire instead of PulseAudio?

PipeWire is the future of Linux audio. It combines the best of PulseAudio and JACK with lower latency, better Bluetooth support, and a more modern design. Arch officially recommends PipeWire for most use-cases now.

sudo pacman -S pipewire pipewire-pulse pavucontrol alsa-utils pulsemixer

βš™οΈ Optional: Legacy PulseAudio Setup

sudo pacman -S pulseaudio pulseaudio-bluetooth pavucontrol alsa-utils

Fonts

sudo pacman -S \
  ttf-dejavu \
  ttf-liberation \
  ttf-jetbrains-mono \
  ttf-firacode-nerd \
  ttf-hack-nerd \
  ttf-ubuntu-font-family \
  ttf-droid \
  noto-fonts \
  noto-fonts-cjk \
  noto-fonts-emoji \
  ttf-font-awesome \
  ttf-font-awesome  # For terminal icons and statusbars

πŸ—―οΈ Sudo Insult Me Please

Raise your hand if you’ve always wanted your computer to insult you when you do something wrong. Hell. I know I have. Try this:

sudo EDITOR=vim visudo

At the top of that file you’ll see lines starting with Defaults. Scroll to the end of that section and add:

Defaults insults

Save and exit. Now, whenever you mistype your sudo password, your system will lob insults at you like:

  • “Listen, burrito brains, I don’t have time to listen to this trash.”
  • “Are you on drugs?”
  • “Your mind just hasn’t been the same since the electro-shocks, has it?”

πŸ’‘ Fun for your own system, or a prank on a friend’s Arch box 😈


### Bluetooth (Optional)

```bash
sudo pacman -S bluez bluez-utils blueman
sudo systemctl enable bluetooth
```

### SSD TRIM Optimization (for SSD users)

> πŸ“š See: [Arch Wiki - TRIM](https://wiki.archlinux.org/title/Solid_state_drive#TRIM)

TRIM helps your SSD stay fast over time by allowing the OS to inform the drive which blocks are no longer in use and can be wiped internally. This reduces write amplification and prolongs SSD lifespan.

Enable the systemd timer to automatically run TRIM weekly:

```bash
sudo systemctl enable fstrim.timer
```

You can also run it manually anytime with:

```bash
sudo fstrim -av
```

> ⚠️ Only enable TRIM if your disk is SSD or NVMe. It’s not useful for HDDs and could reduce lifespan on USB flash drives.

---

### NVIDIA Drivers (For Systems with NVIDIA GPU)

> πŸ“š See: [Arch Wiki - NVIDIA](https://wiki.archlinux.org/title/NVIDIA)

#### 1. Detect your GPU:
```bash
lspci | grep -E "VGA|3D"
```

#### 2. Install official NVIDIA driver:
```bash
sudo pacman -S nvidia nvidia-utils nvidia-settings
```

For LTS kernel users:
```bash
sudo pacman -S nvidia-lts
```

#### 3. Regenerate initramfs (optional but recommended):
```bash
sudo mkinitcpio -P
```

#### 4. Enable persistence and test:
```bash
reboot
nvidia-smi
```
You should see your GPU info displayed. If not, troubleshoot with `dmesg | grep nvidia`

> ⚠️ If you use a hybrid Intel+NVIDIA GPU (Optimus), consider tools like `nvidia-prime`, `bbswitch`, or `optimus-manager`. These setups require extra care.

---

## πŸ“‚ Permanently Auto-Mount Secondary HDD or Partition

> πŸ“š See: [Arch Wiki - fstab](https://wiki.archlinux.org/title/Fstab)

If you have a separate HDD or additional partition you want auto-mounted every time Arch boots, follow these steps:

### 1. Identify Your Drive and Partitions
Run:
```bash
lsblk
```
Find your HDD or secondary partition. Example output:
```
sdb      8:16   0  931.5G  0 disk
└─sdb1   8:17   0  931.5G  0 part
```
Let’s say your partition is `/dev/sdb1`.

### 2. Create a Mount Point
Choose where you want to mount the HDD. Example:
```bash
sudo mkdir -p /mnt/data
```

### 3. Get the UUID
```bash
sudo blkid /dev/sdb1
```
Example result:
```
/dev/sdb1: UUID="abcd-1234" TYPE="ext4"
```

### 4. Add to /etc/fstab
Edit fstab to make it persistent across reboots:
```bash
sudo vim /etc/fstab
```
Add the following line (replace with your UUID):
```
UUID=abcd-1234 /mnt/data ext4 defaults,noatime 0 2
```
> πŸ“ If your HDD is NTFS, use `ntfs-3g` instead of `ext4`. For FAT32/exFAT, install `exfatprogs` or `dosfstools`.

### 5. Test the Mount
```bash
sudo mount -a
```
Check with:
```bash
df -h
```

Now your HDD or secondary partition will auto-mount every boot. Clean, reliable, and Arch way. πŸ’Ύ`

---

## βœ… Next Steps: Install X11, DWM, and Friends

Stay tuned for:

- `xorg`, `dwm`, `st`, `dmenu`, `sxhkd`
- `.xinitrc` setup
- Autostart script

> πŸ“Œ Vim, `nmtui`, `cfdisk` all included. Minimal but powerful. If you understand what you install, you'll understand what you control.

```` ⚠️ **Disclaimer**: This is a lean, fast, and minimalistic Arch Linux installation guide focused on speed, reproducibility, and flexibility. Ideal for both VM and bare-metal setups.

## βœ… Pre-Install Checklist

> πŸ’¬ More info: [Arch Wiki - Installation Guide](https://wiki.archlinux.org/title/Installation_guide) β€’ [BBS Forum](https://bbs.archlinux.org/)

### 1. **Know Your Hardware**

- UEFI vs BIOS
  > βœ… To check if your system booted in UEFI mode, run:
  >
  > ```bash
  > ls /sys/firmware/efi/efivars
  > ```
  >
  > If the directory exists and is populated, you're in UEFI mode. If not, you're likely in legacy BIOS mode.
  >
  > πŸ“š [Arch Wiki - UEFI](https://wiki.archlinux.org/title/Unified_Extensible_Firmware_Interface)
- Disk (NVMe, SSD, HDD)
- Internet (Wi-Fi or LAN)
- Keyboard layout
- VM or real hardware

### 2. **Download & Verify ISO**

```bash
wget https://archlinux.org/iso/latest/archlinux-x86_64.iso
# Optional but recommended:
gpg --keyserver-options auto-key-retrieve --verify archlinux-*.iso.sig
```

### 3. **Create Bootable Media**

```bash
# Linux
sudo dd bs=4M if=archlinux.iso of=/dev/sdX status=progress oflag=sync

# macOS
sudo dd if=archlinux.iso of=/dev/diskX bs=1m
```

---

## πŸ”₯ Booting Into Live ISO

### Enter UEFI Menu > Boot From USB/DVD

- Select "Boot Arch Linux (x86\_64)"

---

## 🌐 Network Configuration

### Ethernet (auto)

Usually auto-configured via DHCP.

### Wi-Fi (optional)

> If you're using a graphical interface in the live ISO (like `archinstall`), you might already have NetworkManager. Otherwise, you may need to install it first or use alternatives.

```bash
# If NetworkManager is available:
nmtui  # Text-based UI for connecting to Wi-Fi

# If not available, use iwctl (for iwd-based connection)
iwctl
[iwd]# device list                      # List available Wi-Fi interfaces
[iwd]# station wlan0 scan              # Scan for available networks
[iwd]# station wlan0 get-networks      # List found networks
[iwd]# station wlan0 connect your-SSID # Replace with actual SSID
# You will be prompted to enter Wi-Fi password interactively
```

> Note: `nmtui` is not installed by default on the base `archiso`. `iwctl` is usually available and works in minimalist setups.

Test:

```bash
ping archlinux.org
```

---

## πŸ•“ Set Time

> πŸ“š Reference: [Arch Wiki - System Time](https://wiki.archlinux.org/title/System_time)

```bash
timedatectl set-ntp true
```

---

## πŸ’½ Disk Partitioning with `cfdisk`

```bash
lsblk  # Check your disk layout first
cfdisk /dev/sda  # Replace with your actual disk
```

```bash
cfdisk /dev/sda  # Replace with your actual disk
```

Suggested Layout (GPT):

> πŸ“š See also: [Arch Wiki - Partitioning](https://wiki.archlinux.org/title/Partitioning) and [Swap](https://wiki.archlinux.org/title/Swap)

- EFI System: **512M–1G** (Type: EFI System)

  > βš™οΈ Required for UEFI boot. 512MB is sufficient, but 1GB gives room for multiple bootloaders or kernels.

- Swap: **Min 2G**, or based on RAM and hibernation usage:

  > 🧠 Swap is used when RAM is full, for compressed memory cache, or for hibernation. Here are suggested sizes:
  >
  > - RAM 4GB β†’ Swap 2–4GB
  > - RAM 8GB β†’ Swap 2–6GB
  > - RAM 16GB β†’ Swap 4–8GB
  > - RAM 32GB+ β†’ Swap 4–8GB normally, or 32GB+ if using hibernation
  >
  > πŸ’Ύ *Hibernation Rule:* Swap size β‰₯ RAM (e.g., 16GB RAM β†’ 17–20GB swap recommended)
  >
  > πŸ“ Use `resume` kernel parameter and add `resume=/dev/sdX` to your GRUB config for hibernation to work properly

- Root: **30–50G** (Type: Linux filesystem)

  > 🏠 Contains system and applications. 30GB is minimum for full desktop use; 50GB+ for dev work.

- Home: **Remaining space** (optional)

  > πŸ“ Good for storing user files separately from root. Optional but recommended for separation of data and config.

### Format Partitions

```bash
mkfs.fat -F32 /dev/sda1
mkswap /dev/sda2
mkfs.ext4 /dev/sda3
mkfs.ext4 /dev/sda4  # If created β€” only do this if you're going to use /home, otherwise skip to avoid mount errors later
```

### Mount Partitions

```bash
mount /dev/sda3 /mnt
mkdir -p /mnt/{boot,home}
mount /dev/sda1 /mnt/boot
mount /dev/sda4 /mnt/home  # If created
swapon /dev/sda2
```

---

## πŸ“¦ Install Base System

> πŸ“š See: [Arch Wiki - pacstrap](https://wiki.archlinux.org/title/Install_Arch_Linux#Install_essential_packages)

```bash
pacstrap -K /mnt base base-devel linux linux-firmware vim networkmanager sudo grub efibootmgr os-prober openssh
```

Don’t worry about any localization-related errors you may receive β€” these will be resolved by future steps.

While the official installation guide only includes the `base`, `linux`, and `linux-firmware` packages, this guide adds several extras to ensure a smoother experience:

- `grub`: The boot loader we’ll be using
- `efibootmgr`: A utility to manage EFI entries
- `lvm2`: For logical volume management setups (LVM)
- `vim`: A reliable terminal text editor
- `openssh`: SSH server for remote access
- `sudo`: Required for safe privilege escalation
- `base-devel`: Essential tools like `make`, `gcc`, etc β€” required for building AUR packages

> πŸ“š See also: [Arch Wiki - base-devel](https://wiki.archlinux.org/title/Development_packages)

You can optionally choose a different kernel flavor:

- `linux`: default
- `linux-lts`: Long Term Support kernel (stable, less frequent updates)
- `linux-zen`: Tweaked for performance and responsiveness (useful for desktop)

Example:

```bash
pacstrap -K /mnt base linux-lts linux-firmware ...
```



---

## πŸ“‚ Generate fstab

> πŸ“š See also: [Arch Wiki - fstab](https://wiki.archlinux.org/title/Fstab)

```bash
genfstab -U /mnt >> /mnt/etc/fstab
```

---

## πŸ› οΈ Chroot & Configure

> πŸ“š Reference: [Arch Wiki - arch-chroot](https://wiki.archlinux.org/title/Arch-chroot)

```bash
arch-chroot /mnt
```

### Set Timezone

```bash
# Find your time zone:
ls /usr/share/zoneinfo  # Browse available zones

# Example for Asia/Jakarta:
ln -sf /usr/share/zoneinfo/Asia/Jakarta /etc/localtime
hwclock --systohc
```

### Locale

```bash
vim /etc/locale.gen
# Uncomment en_US.UTF-8 UTF-8
locale-gen

echo "LANG=en_US.UTF-8" > /etc/locale.conf
```

### Keymap (Optional β€” only if you use a non-US keyboard layout)

```bash
echo "KEYMAP=us" > /etc/vconsole.conf
```

### Hostname

```bash
echo "your-hostname" > /etc/hostname

cat >> /etc/hosts <<EOF
127.0.0.1   localhost
::1         localhost
127.0.1.1   your-hostname.localdomain your-hostname
EOF
```

---

## πŸ” Root Password

```bash
passwd
```

---

## πŸ§ͺ Update initramfs (Initial Ramdisk)

> πŸ“š [Arch Wiki - mkinitcpio](https://wiki.archlinux.org/title/Mkinitcpio)

If you modify `/etc/mkinitcpio.conf` (e.g., for LVM, encryption, resume hook for hibernation), you must regenerate the initramfs:

```bash
mkinitcpio -P
```

πŸš€ Install Bootloader (GRUB)

πŸ“š Reference: Arch Wiki - GRUB

# Already installed via pacstrap, this is just to verify or reinstall if needed
pacman -S grub efibootmgr os-prober 

### Dual Boot with Windows or Other Distros

To make GRUB detect Windows or other OSes automatically, enable `os-prober`.

1. First, install `os-prober` if not already:
   ```bash
   sudo pacman -S os-prober
  1. Then edit /etc/default/grub:

    sudo vim /etc/default/grub
    
  2. Find or add the line:

    GRUB_DISABLE_OS_PROBER=false
    
  3. Regenerate the GRUB config:

    sudo grub-mkconfig -o /boot/grub/grub.cfg
    

πŸ“š Reference: Arch Wiki - Dual Boot with Windows

Mount check

ls /boot

grub-install –target=x86_64-efi –efi-directory=/boot –bootloader-id=GRUB

grub-mkconfig -o /boot/grub/grub.cfg


---

## 🌐 Enable Network Services

> πŸ“š See: [Arch Wiki - NetworkManager](https://wiki.archlinux.org/title/NetworkManager), [SSH](https://wiki.archlinux.org/title/OpenSSH), or [systemd-networkd](https://wiki.archlinux.org/title/Systemd-networkd)

```bash
systemctl enable sshd       # Enable SSH server
systemctl enable NetworkManager  # Enable network management via NetworkManager
# systemctl enable dhcpcd   # (Optional) Enable if using dhcpcd instead of NetworkManager
```

---

## πŸ‘€ Add New User

```bash
pacman -S xdg-user-dirs 
# xdg-user-dirs: for creating standard user folders like ~/Documents
useradd -m -G wheel -s /bin/bash 0x
passwd 0x
EDITOR=vim visudo
# Uncomment: %wheel ALL=(ALL) ALL
```

### Login into the newly created user

```bash
su - 0x
xdg-user-dirs-update  # Creates standard folders like Documents, Downloads, etc
```

## πŸšͺ Exit & Reboot

(Optional β€” if you're using systemd-networkd instead of NetworkManager)

```bash
systemctl enable systemd-networkd
systemctl enable systemd-resolved
```

```bash
exit
umount -R /mnt
swapoff -a  # Turn off swap before reboot to safely release the swap partition
reboot
```

---

## πŸ’‘ Post-Install Suggestions

### Essential Tools

```bash
sudo pacman -S git unzip wget reflector man-db neovim htop nmap ufw net-tools dnsutils ranger ncdu btop ripgrep fd bat fzf screenfetch
```

### AUR Helper (yay) + Zsh Setup + Go Environment

> πŸ“š See: [Arch Wiki - Zsh](https://wiki.archlinux.org/title/Zsh), [Go](https://wiki.archlinux.org/title/Go), [AUR Helpers](https://wiki.archlinux.org/title/AUR_helpers)

```bash
# Install prerequisites
sudo pacman -S go zsh

# Set Zsh as default shell
chsh -s /bin/zsh

# Reboot or re-login to apply Zsh

# Install Oh My Zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

# Install useful Zsh plugins (syntax highlighting, autosuggestions, etc)
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
git clone https://github.com/MichaelAquilina/zsh-you-should-use.git ~/.oh-my-zsh/custom/plugins/zsh-you-should-use

# Edit ~/.zshrc and add the plugins:
# plugins=(git zsh-syntax-highlighting zsh-autosuggestions you-should-use)

# Source the updated Zsh config
source ~/.zshrc

# Setup Go PATH (optional)
echo 'export GOPATH=$HOME/go' >> ~/.zshrc
echo 'export PATH=$PATH:$GOPATH/bin' >> ~/.zshrc
source ~/.zshrc

# Install yay AUR helper
cd ~ && git clone https://aur.archlinux.org/yay.git
cd yay && makepkg -si
```

---

### BlackArch Repository (Optional)

> πŸ“š See: [BlackArch Wiki](https://blackarch.org/downloads.html#install-repo)

```bash
curl -O https://blackarch.org/strap.sh
chmod +x strap.sh
sudo ./strap.sh
```

> ⚠️ Warning: Adds thousands of penetration testing tools. Only install specific tools you need.

---

### Understanding Pacman Repositories

> πŸ“š [Arch Wiki - pacman.conf](https://wiki.archlinux.org/title/Pacman#Repositories)

In `/etc/pacman.conf` you can enable/disable repos:

- `[core]` – essential system packages
- `[extra]` – userland tools & common software
- `[community]` – community-maintained packages
- `[multilib]` – 32-bit libs on 64-bit systems (enable this for apps like Steam)

To enable `multilib`:

```ini
[multilib]
Include = /etc/pacman.d/mirrorlist
```

### πŸ§ƒ Add Candy to Pacman

Enable ASCII Pacman easter egg:

```bash
sudo vim /etc/pacman.conf
```

Uncomment or add:

```
Color
ILoveCandy
```

> πŸŽ‰ You'll see animated Pacman munching while syncing packages!

### Audio

> πŸ“š See: [Arch Wiki - PipeWire](https://wiki.archlinux.org/title/PipeWire), [PulseAudio](https://wiki.archlinux.org/title/PulseAudio)

> πŸ”Š **Why PipeWire instead of PulseAudio?**
>
> PipeWire is the future of Linux audio. It combines the best of PulseAudio and JACK with lower latency, better Bluetooth support, and a more modern design. Arch officially recommends PipeWire for most use-cases now.

#### βœ… Recommended (PipeWire)

```bash
sudo pacman -S pipewire pipewire-pulse pavucontrol alsa-utils pulsemixer
```

#### βš™οΈ Optional: Legacy PulseAudio Setup

```bash
sudo pacman -S pulseaudio pulseaudio-bluetooth pavucontrol alsa-utils
```

### Fonts

```bash
sudo pacman -S \
  ttf-dejavu \
  ttf-liberation \
  ttf-jetbrains-mono \
  ttf-firacode-nerd \
  ttf-hack-nerd \
  ttf-ubuntu-font-family \
  ttf-droid \
  noto-fonts \
  noto-fonts-cjk \
  noto-fonts-emoji \
  ttf-font-awesome \
  ttf-font-awesome  # For terminal icons and statusbars
```

### πŸ—―οΈ Sudo Insult Me Please

Raise your hand if you’ve always wanted your computer to insult you when you do something wrong. Hell. I know I have. Try this:

```bash
sudo EDITOR=vim visudo
```

At the top of that file you’ll see lines starting with `Defaults`. Scroll to the end of that section and add:

```
Defaults insults
```

Save and exit. Now, whenever you mistype your sudo password, your system will lob insults at you like:

- "Listen, burrito brains, I don’t have time to listen to this trash."
- "Are you on drugs?"
- "Your mind just hasn’t been the same since the electro-shocks, has it?"

> πŸ’‘ Fun for your own system, or a prank on a friend’s Arch box 😈

Bluetooth (Optional)

sudo pacman -S bluez bluez-utils blueman
sudo systemctl enable bluetooth

SSD TRIM Optimization (for SSD users)

πŸ“š See: Arch Wiki - TRIM

TRIM helps your SSD stay fast over time by allowing the OS to inform the drive which blocks are no longer in use and can be wiped internally. This reduces write amplification and prolongs SSD lifespan.

Enable the systemd timer to automatically run TRIM weekly:

sudo systemctl enable fstrim.timer

You can also run it manually anytime with:

sudo fstrim -av

⚠️ Only enable TRIM if your disk is SSD or NVMe. It’s not useful for HDDs and could reduce lifespan on USB flash drives.


NVIDIA Drivers (For Systems with NVIDIA GPU)

πŸ“š See: Arch Wiki - NVIDIA

1. Detect your GPU:

lspci | grep -E "VGA|3D"

2. Install official NVIDIA driver:

sudo pacman -S nvidia nvidia-utils nvidia-settings

For LTS kernel users:

sudo pacman -S nvidia-lts
sudo mkinitcpio -P

4. Enable persistence and test:

reboot
nvidia-smi

You should see your GPU info displayed. If not, troubleshoot with dmesg | grep nvidia

⚠️ If you use a hybrid Intel+NVIDIA GPU (Optimus), consider tools like nvidia-prime, bbswitch, or optimus-manager. These setups require extra care.


πŸ“‚ Permanently Auto-Mount Secondary HDD or Partition

πŸ“š See: Arch Wiki - fstab

If you have a separate HDD or additional partition you want auto-mounted every time Arch boots, follow these steps:

1. Identify Your Drive and Partitions

Run:

lsblk

Find your HDD or secondary partition. Example output:

sdb      8:16   0  931.5G  0 disk
└─sdb1   8:17   0  931.5G  0 part

Let’s say your partition is /dev/sdb1.

2. Create a Mount Point

Choose where you want to mount the HDD. Example:

sudo mkdir -p /mnt/data

3. Get the UUID

sudo blkid /dev/sdb1

Example result:

/dev/sdb1: UUID="abcd-1234" TYPE="ext4"

4. Add to /etc/fstab

Edit fstab to make it persistent across reboots:

sudo vim /etc/fstab

Add the following line (replace with your UUID):

UUID=abcd-1234 /mnt/data ext4 defaults,noatime 0 2

πŸ“ If your HDD is NTFS, use ntfs-3g instead of ext4. For FAT32/exFAT, install exfatprogs or dosfstools.

5. Test the Mount

sudo mount -a

Check with:

df -h

Now your HDD or secondary partition will auto-mount every boot. Clean, reliable, and Arch way. πŸ’Ύ`


βœ… Next Steps: Install X11, DWM, and Friends

Stay tuned for:

  • xorg, dwm, st, dmenu, sxhkd
  • .xinitrc setup
  • Autostart script

πŸ“Œ Vim, nmtui, cfdisk all included. Minimal but powerful. If you understand what you install, you’ll understand what you control.