til/install-archlinux.md

5.8 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

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 additional_groups -s login_shell username

Set password:

passwd username

Enable sudo:

EDITOR=nvim visudo

# Uncomment group wheel
Pseudo Real
additional_groups wheel
login_shell /bin/bash
username joker

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

Install GNOME:

pacman -Syu gnome

Install MATE

pacman -Syu mate mate-extra

Install Xfce

pacman -Syu xfce4 xfce4-goodies

Install and enable GDM for GNOME:

pacman -Syu gdm

systemctl enable gdm.service

Install and enable LightDM for MATE, Xfce:

pacman -Syu lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings

systemctl enable lightdm.service

Install and enable NetworkManager:

pacman -Syu networkmanager

# MATE, Xfce
pacman -Suy network-manager-applet

systemctl enable NetworkManager.service

Install and enable Bluetooth:

pacman -Syu bluez bluez-utils

systemctl enable bluetooth.service

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

Hardware video acceleration

Kernel mode setting

Turn off CPU exploit mitigations

In the end

This guide is updated regularly I promise.