ArchLinux Installation Guide

ArchLinux Installation Guide

Shetty Yttehs Lv1

Before Reading

Head picture is the art work ζ»šζŒ‚ηš„Arch by Glowing Bric@Pixiv.

Why Use ArchLinux

  • Just make a joke 🀣.

image

Errata

Before delving into the text, it’s important to note that there may be some grammar or syntax errors present. This could be due to translation errors, typing mistakes, or the author’s unique writing style ( I’m a Chinese native speaker πŸ˜… ).

Requirements

TargetRequirement
ComputerUEFI booted
YouKnowledge of vim

Background

Having experienced multiple system crashes and reinstallations, it’s time to record the steps of installation, this guide may include my custom configurations.

My computer: Asus Rog Strix G16

Create a Boot Disk

Download Boot Disk Maker

Download or install Ventoy, Rufus ( Windows only ), balenaEtcher or any other boot disk maker.

  • I prefer using Ventoy due to its multiple iso support.

Flash ArchLinux Installation Image

  1. Download ArchLinux iso from Official or tuna ( Recommended for Chinese users ).

  2. Follow the guide of the specific tool, and make the disk ( Usually USB disk ) a boot disk with ArchLinux image.

  • If you are using Ventoy, make your disk a Ventoy disk, and add the iso to boot disk.

Set Hard Disk as ESP Partition

  1. Before installation, be sure that the hard disk of computer is ESP partition.

  2. If not, use DiskGenius or other tools.

  3. STFW for more information.

Note: Backup date before modify partitions.

Configure BIOS Settings

  1. Disable Fast Boot and Secure Boot.

  2. Select USB Device as the first startup item.

Reboot Computer to Boot Disk

  • If you are using Ventoy, boot ArchLinux iso.

Waiting the boot progress, then get a shell from ArchLinux installation image.

Tips: Make use of tab completion from shell.

Check Environment

1
ls /sys/firmware/efi/efivars

If no error occurs, it means the computer is UEFI booted.

Be sure the computer is UEFI booted, then continue.

Connect to Network

  • If your computer has connected to the network cable, skip the step.
  1. Use iwd to connect wireless network.
1
2
3
4
5
6
iwctl
station wlan0 scan
station wlan0 get-networks
station wlan0 connect <wifi_ssid> # specific Wifi SSID
# input password of Wifi
exit
  1. Test the network.
1
ping archlinux.org -c 4

Pacman Source

  1. Stop reflector.service, which will choose the fastest source.
1
systemctl stop reflector
  1. Change pacman source ( Optional ).
1
vim /etc/pacman.d/mirrorlist

Add the following lines at the very top:

1
2
# tuna source
Server = https://mirrors.tuna.tsinghua.edu.cn/archlinux/$repo/os/$arch

Note: Remove sources from China after installation finished.

  • Info: the source provider from China has the ability to upload the IP and other information of users who installed qv2ray ( For example ) to the government server.

Sync Time

1
timedatectl set-ntp true

Check status

1
timedatectl status

Partitioning

Check partitions

1
lsblk
  1. Start partitioning.
Common Mounting Points
/
/boot ( Less than 1G )
/home
swapfile ( Usually 5 GB )

Some partition related tools:

1
2
3
4
5
6
fdisk       # CLI partition tool
gdisk # CLI partition tool
mkfs.ext4 # create an ext4 file system on a disk or partition
# example: mkfs.ext4 /dev/sda1
mkswap # create a swap file system on a disk or partition
# example: mkswap /dev/sda2
  • Do not know how to partition? STFW and RTFM.
  1. Mounting partitions.

Assume this is the partition result:

DeviceMounting Points
/dev/sda1 ( ESP partition )/boot/efi
/dev/sda2/
/dev/sda3/boot
/dev/sda4/home
/dev/sda5/opt
/dev/sda6swap
  • In some disk, there is no sd, nvme0 instead.
1
2
3
4
5
6
7
8
9
10
mount /dev/sda2 /mnt
mkdir /mnt/boot
mount /dev/sda3 /mnt/boot
mkdir /mnt/boot/efi
mount /dev/sda1 /mnt/boot/efi
mkdir /mnt/home
mount /dev/sda4 /mnt/home
mkdir /mnt/opt
mount /dev/sda5 /mnt/opt
swapon /dev/sda6
  • If you accidentally mount the wrong partition:
1
2
3
umount /dev/sda<number>
# or
umount -R /mnt
  1. Check the partition.
1
lsblk -f

Install Basic System

Install Basic Packages

  • You may need to wait for a while.
1
pacstrap /mnt linux linux-headers linux-firmware base base-devel vim bash-completion iwd dhcpcd
  • Or use my custom configuration:
1
pacstrap /mnt linux-zen linux-zen-headers linux-firmware base base-devel neovim fish iwd dhcpcd

Install Keyring ( Optional )

1
pacstrap /mnt archlinux-keyring

Generate Fstab

  1. Generate /etc/fstab.
1
genfstab -U /mnt >> /mnt/etc/fstab
  1. Check file.
1
cat /mnt/etc/fstab

Chroot

1
arch-chroot /mnt

Tips: Use fish shell to enjoy the powerful auto-completion.

1
2
pacman -S fish  # install if not exits
fish && exit

Grub

  1. Install packages.
1
pacman -S grub efibootmgr efivar
  1. Install grub.
1
2
grub-install /dev/sda1
grub-mkconfig -o /boot/grub/grub.cfg

Enable Network Service

1
systemctl enable iwd dhcpcd

Setup user root

  1. Set password for root.
1
passwd root
  1. Modify skel files.
1
vim /etc/skel/.bashrc

Add the following line at the very bottom:

1
export EDITOR='vim'
1
cp -a /etc/skel/. ~

Exit Chroot Environment

1
2
3
exit
umount -R /mnt
reboot

Connect to Network

Use iwctl.

  • If your computer has connected to the network cable, you may need:
1
2
pacman -S networkmanager
systemctl enable --now NetworkManager

Setup Timezone

1
2
3
4
5
# example
timedatectl set-timezone Asia/Shanghai
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
hwclock --systohc
timedatectl set-ntp true

Setup Locale

1
vim /etc/locale.gen

Uncomment specific locales:

1
2
3
# example
en_US.UTF-8 UTF-8
zh_CN.UTF-8 UTF-8
1
2
locale-gen
echo 'LANG=en_US.UTF-8' > /etc/locale.conf

Setup Host

Setup host name.

1
vim /etc/hostname
1
2
# example
ROG-Strix-G16

Add loopback address in hosts.

1
vim /etc/hosts

Add the following lines at the very bottom:

1
2
3
127.0.0.1   localhost
::1 localhost
127.0.1.1 <hostname> <hostname>.localdomain

Add User

  1. Create user.
1
2
3
useradd --create-home <user_name>
passwd <user_name>
usermod -aG adm,wheel,storage <user_name>
  1. Add sudo permission.
1
visudo

Uncomment the following line:

1
%wheel ALL=(ALL:ALL) ALL

Add Pacman Source

1
vim /etc/pacman.conf

Uncomment the following lines:

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

Add the following lines at the very bottom:

  • You may use other source but remember the Note.
1
2
3
[archlinuxcn]
SigLevel = Optional TrustAll
Server = https://repo.archlinuxcn.org/$arch

Init archlinuxcn source.

1
2
pacman -Syyu
pacman -S archlinuxcn-keyring

Remove SigLevel = Optional TrustAll below [archlinuxcn]

1
vim /etc/pacman.conf

Install Drivers

Install GPU Drivers

Intel Drivers:

1
pacman -S intel-ucode mesa lib32-mesa vulkan-intel lib32-vulkan-intel intel-media-driver libva-intel-driver lib32-libva-intel-driver

AMD Drivers:

1
pacman -S amd-ucode mesa lib32-mesa vulkan-radeon lib32-vulkan-radeon libva-mesa-driver lib32-libva-mesa-driver mesa-vdpau lib32-mesa-vdpau

Install Nvidia Drivers ( Optional )

Note: ArchWiki is better to guide how to install Nvidia drivers .

Note: Backup before install.

1
2
3
# example
# install timeshift first
sudo timeshift --create
  1. Install drivers.

If use kernel linux:

1
pacman -S nvidia

If use kernel linux-lts:

1
pacman -S nvidia-lts

Other kernels:

1
pacman -S nvidia-dkms
  1. Install settings.
1
pacman -S nvidia-settings
  1. Install prime ( Optional )
1
pacman -S nvidia-prime
  1. Install VA-API implementation.
1
pacman -S libva-nvidia-driver
  • If you are using laptop with both integrated graphics card and Nvidia graphic card:

Reboot to Windows and adjust GPU settings to Optimus.

Install Media Drivers

1
2
3
pacman -S alsa-utils alsa-plugins alsa-oss alsa-firmware alsa-ucm-conf
pacman -S sof-firmware
pacman -S pipeware pipeware-alsa pipeware-audio pipeware-pulse pipeware-jack

Install KDE Plasma Desktop

  • You may need to wait for a while.
  1. Install fonts.
1
pacman -S noto-fonts noto-fonts-cjk noto-fonts-emoji noto-fonts-emoji-blob noto-fonts-extra
  1. Install plasma.
1
pacman -S plasma plasma-meta konsole dolphin kate ark gwenview vlc
  1. Setup network.
1
2
3
4
systemctl enable sddm
systemctl disable iwd
pacman -S networkmanager
systemctl enable NetworkManager

Enjoy

πŸŽ‰πŸŽ‰πŸŽ‰ Congratulations! πŸŽ‰πŸŽ‰πŸŽ‰

Installation is over.

  • Enjoy your own ArchLinux.
1
reboot

My Custom Linux Configurations

  • Those are my personal configs, just modify them to suit your needs.

zpacman

A simple, small omz plugin manager.

Neovim-config

My custom neovim configuration.

Tmux-config

My custom tmux configuration.

Ranger-config

My custom ranger configuration.

.bashrc

My custom .bashrc.

References

  • Title: ArchLinux Installation Guide
  • Author: Shetty Yttehs
  • Created at : 2024-04-25 18:30:08
  • Updated at : 2024-09-01 12:58:06
  • Link: https://blog.shettyyttehs.org/2024/04/25/archlinux-installation-guide/
  • License: This work is licensed under CC BY-NC-SA 4.0.
Comments