til/install-archlinux.md

6.2 KiB

Install Arch Linux

Install Arch Linux is thing I always want to do for my laptop/PC since I had my laptop in ninth grade.

This is not a guide for everyone, this is just save for myself in a future and for anyone who want to taste a bit.

Assume your laptop/PC is UEFI-capable.

Installation guide

Pre-installation

Check disks carefully:

lsblk

USB flash installation medium

Verify the boot mode

Check UEFI mode:

ls /sys/firmware/efi/efivars

Connect to the internet

Use iwd.

Update the system clock

timedatectl set-ntp true

Partition the disks

Partition:

# For convert GPT
cgdisk

cfdisk
Mount point Partition type Suggested size
/mnt/efi EFI system partition 512 MiB
/mnt/boot Linux extended boot 1 GiB
/mnt Linux
/mnt/home Linux
Linux swap RAM x 2

Format:

# efi
mkfs.fat -F32 /dev/efi_system_partition

# boot
mkfs.fat -F32 /dev/boot_system_partition

# root
mkfs.ext4 /dev/root_partition

# home
mkfs.ext4 /dev/home_partition

# swap
mkswap /dev/sdxY

Mount:

# root
mount /dev/root_partition /mnt

# efi
mkdir /mnt/efi
mount /dev/efi_system_partition /mnt/efi

# boot
mkdir /mnt/boot
mount /dev/boot_system_partition /mnt/boot

# home
mkdir /mnt/home
mount /dev/home_partition /mnt/home

# swap
swapon /dev/swap_partition

Installation

pacstrap /mnt base linux linux-firmware neovim

# LTS
pacstrap /mnt linux-lts

# Performance
pacstrap /mnt linux-zen

# Developement
pacstrap /mnt base-devel

# AMD
pacstrap /mnt amd-ucode

# Intel
pacstrap /mnt intel-ucode

# Documentation
pacstrap /mnt man-db man-pages

Configure

Fstab

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

Chroot

arch-chroot /mnt

Time zone

ln -sf /usr/share/zoneinfo/Region/City /etc/localtime

hwclock --systohc

Localization:

Edit /etc/locale.gen:

# Uncomment en_US.UTF-8 UTF-8

Generate locales:

locale-gen

Edit /etc/locale.conf:

LANG=en_US.UTF-8

Network configuration

Edit /etc/hostname:

myhostname

Edit /etc/hosts:

127.0.0.1		localhost
::1					localhost
127.0.1.1		myhostname.localdomain myhostname

Root password

passwd

Boot loader

systemd-boot

General recommendations

Always remember to check dependencies when install packages.

System administration

Add user:

useradd -m -G wheel -s /bin/bash -c "The Joker" joker

Set password:

passwd username

Enable sudo:

EDITOR=nvim visudo

# Uncomment group wheel

Desktop Environment

Install Xorg:

pacman -Syu xorg-server

# AMD
pacman -Syu xf86-video-amdgpu mesa

# Intel
pacman -Syu xf86-video-intel mesa

# NVIDIA
pacman -Syu xf86-video-nouveau mesa

GNOME

pacman -Syu gnome gdm

# Login manager
systemctl enable gdm.service

i3

pacman -Syu i3-wm i3lock i3status rofi \
	xorg-xinit lxappearance \
	feh archlinux-wallpaper \
	alacritty \
	fcitx-im fcitx-configtool fcitx-unikey fcitx-m17n

XDG user directories

pacman -Syu xdg-user-dirs

xdg-user-dirs-update

Power management

Backlight

# https://wiki.archlinux.org/index.php/Backlight#xbacklight
pacman -Syu xorg-xbacklight

Sound system

ALSA:

pacman -Syu alsa-utils

# https://wiki.archlinux.org/index.php/Advanced_Linux_Sound_Architecture#Unmute_with_alsamixer
alsamixer

PulseAudio:

pacman -Syu pulseaudio pulseaudio-alsa pulseaudio-bluetooth

Network managers

Use NetworkManager.

Use systemd-networkd.

Bluetooth

pacman -Syu bluez bluez-utils

systemctl enable bluetooth.service

Use Blueman.

Clock synchronization

Enable systemd-timesyncd

timedatectl set-ntp true

List of applications

pacman

Uncomment in /etc/pacman.conf:

# Misc options
Color

AUR

Install AUR package:

makepkg -sric

Improving performance

systemd-swap

systemd-journald

systemd-coredump

fstrim

earlyoom

Profile-sync-daemon

Watchdogs

Staggered spin-up

Silent boot

Hardware video acceleration

Kernel mode setting

Turn off CPU exploit mitigations

In the end

This guide is updated regularly I promise.