---
title: "Arch Linux Installation Guide & Setup | Ameya Shenoy"
description: "Install and configure Arch Linux with notes on boot media, disk partitions, networking, systemd-boot, desktop environments and NVIDIA drivers by Ameya Shenoy."
canonical: "https://www.codingcoffee.dev/blog/archlinux-my-sanctum-sanctorum"
published: "2019-01-15"
tags: "blog"
---

# Archlinux - My Sanctum Sanctorum

By Ameya Shenoy · Published 2019-01-15

Install and configure Arch Linux with notes on boot media, disk partitions, networking, systemd-boot, desktop environments and NVIDIA drivers by Ameya Shenoy.

This comprehensive guide covers setting up Arch Linux from scratch. I'd recommend first gaining familiarity with Linux through Ubuntu or similar distributions before attempting Arch, as it requires deeper system knowledge.

## Prerequisites

- Internet connectivity
- A computer or laptop
- Several hours of spare time
- Patience. Patience. Patience.

## Creating Bootable Installation Media

On Linux, identify your USB device using `lsblk`, then write the ISO:

```bash
dd bs=4M if={path_to_archlinux.iso} of=/dev/sd{x} status=progress oflag=sync
```

## Installation Process

### Initial Setup

- Disable Secure Boot in BIOS (keep UEFI enabled)
- Verify UEFI mode: `ls /sys/firmware/efi/efivars`
- Test internet: `ping -c3 google.com`

### Network Configuration

**Ethernet:** Start the DHCP service on your interface:

```bash
systemctl start dhcpcd@{interface}.service
```

**WiFi:**

```bash
iw dev {interface} scan | less
wpa_supplicant -B -i {interface} -c <(wpa_passphrase {SSID} {passphrase})
dhcpcd {interface}
```

### Disk Partitioning

Using `gdisk`, create:
- EFI partition: 512MB (type EF00)
- SWAP partition: 20GB (type 8200)
- Root partition: 80GB (type 8304)
- Home partition: Remainder (type 8300)

### Formatting and Mounting

```bash
mkfs.fat -F32 /dev/sda1
mkswap /dev/sda2 && swapon /dev/sda2
mkfs.ext4 /dev/sda3
mkfs.ext4 /dev/sda4
mount /dev/sda3 /mnt
mkdir -p /mnt/boot && mount /dev/sda1 /mnt/boot
mkdir -p /mnt/home && mount /dev/sda4 /mnt/home
```

### Core Installation

```bash
pacstrap /mnt base base-devel
genfstab -U /mnt >> /mnt/etc/fstab
arch-chroot /mnt
```

### System Configuration

**Timezone:**

```bash
ln -sf /usr/share/zoneinfo/{Region}/{City} /etc/localtime
```

**Locale:** Edit `/etc/locale.gen` to uncomment `en_US.UTF-8 UTF-8`, then:

```bash
locale-gen
```

Set `/etc/locale.conf`:

```
LANG=en_US.UTF-8
LC_CTYPE=en_US.UTF-8
LC_MESSAGES=en_US.UTF-8
LC_ALL=en_US.UTF-8
LANGUAGE="en_US.UTF-8"
```

**Hostname:** Create `/etc/hostname` with your desired name.

**Hosts file:** Add to `/etc/hosts`:

```
127.0.0.1 localhost.localdomain localhost
::1 localhost.localdomain localhost
127.0.1.1 {hostname}.localdomain {hostname}
```

**Root password:** `passwd`

**Microcode:** `pacman -S intel-ucode`

### Bootloader (systemd-boot)

```bash
bootctl install
bootctl update
```

Edit `/boot/loader/loader.conf`:

```
default arch
```

Create `/boot/loader/entries/arch.conf` with UUID of root partition:

```
title Arch Linux
linux /vmlinuz-linux
initrd /intel-ucode.img
initrd /initramfs-linux.img
options root=UUID={UUID} rw
```

For hibernation, add SWAP UUID:

```
options root=UUID={root_UUID} resume=UUID={swap_UUID} rw
```

### Essential Packages

```bash
pacman -S iproute2 acpi iw wpa_supplicant dialog vim zsh git curl wget aria2 stow networkmanager xdg-user-dirs
```

### Post-Installation

After rebooting, optionally add SSH keys:

```bash
mkdir -p ~/.ssh
curl -L https://github.com/{username}.keys >> ~/.ssh/authorized_keys
systemctl restart sshd
```

Activate Zsh:

```bash
chsh -s $(which zsh)
curl -L git.io/antigen > $HOME/antigen.zsh
exec zsh
```

### Pacman Configuration

Edit `/etc/pacman.conf` to uncomment:

```
Color
TotalDownload
CheckSpace
VerbosePkgLists
ILoveCandy
```

### User Management

```bash
useradd -m -G wheel {username}
passwd {username}
visudo  # Uncomment: %wheel ALL=(ALL) ALL
su - {username}
xdg-user-dirs-update
```

### Desktop Environment

Install KDE Plasma and applications:

```bash
pacman -S plasma docker firefox dolphin dolphin-plugins zip unzip unrar vlc p7zip rsync syncthing konsole openssh git blender krita gimp inkscape kwallet kwalletmanager networkmanager digikam spectacle ntfs-3g cups print-manager imagemagick mesa okular gparted screenfetch bluez bluez-utils pulseaudio-bluetooth linux-headers whois
```

### System Services

```bash
systemctl enable NetworkManager
systemctl enable org.cups.cupsd
systemctl enable sddm
systemctl enable bluetooth
systemctl enable sshd
```

## Advanced Topics

### NVIDIA Driver Setup (Optimus)

```bash
pacman -S bumblebee mesa nvidia xf86-video-intel
gpasswd -a {username} bumblebee
systemctl enable bumblebeed
pacman -S mesa-demos nvidia-settings intel_gpu_tools cuda cudnn bbswitch
```

Check GPU usage: `nvidia-smi`

Run applications on GPU: `optirun -b none {app} -c :8`

### Touchpad Gestures

```bash
gpasswd -a $USER input
git clone https://aur.archlinux.org/libinput-gestures.git
cd libinput-gestures && makepkg -sci
libinput-gestures-setup autostart
```

### Shutdown Timeout Reduction

Create `/etc/systemd/system.conf.d/timeout.conf`:

```
[Manager]
DefaultTimeoutStartSec=15s
DefaultTimeoutStopSec=5s
```

## Common Pacman Commands

- Update database: `pacman -Syy`
- Full system upgrade: `pacman -Syu`
- Install package: `pacman -S {package}`
- Remove package: `pacman -Rs {package}`
- Search database: `pacman -Ss {package}`

---

Canonical page: https://www.codingcoffee.dev/blog/archlinux-my-sanctum-sanctorum

[Site guide](/llms.txt) · [Contact](/contact) · [Sitemap](/sitemap-index.xml)
