Skip to content

ArchLinux Installation

Recommand follow the Installation guide, and this artical is just some supplements.

1 Prepare an installation medium

Using ventoy. Remerber to update the ventoy's version.

2 Console fonts

# setfont ter-132b

3 Connect the internet

Using iwctl to connect the wireless network:

# ip link
# iwctl

[iwd]# device list
[iwd]# station [name] scan
[iwd]# station [name] get-networks
[iwd]# station [name] connect [SSID]
[iwd]# station [device] show

# ping archlinux.org

4 Update the system clock

# timedatectl

5 Partition the disks

## fdisk -l | less

## gdisk /dev/the_disk_to_be_partitioned

My partition layout:

Mount point Partition Partition type Suggested size
/boot /dev/efi_system_partition EFI system partition 1GiB
/ /dev/root_partition Linux root More
/home /dev/home_partition Linux home More
[SWAP] /dev/swap_partition Linux swap At least 4 GiB

6 Format partitions

# mkfs.xfs -f /dev/root_partition
# mkfs.xfs -f /dev/boot_partition
# mkfs.xfs -f /dev/home_partition

# mkswap /dev/swap_partition

7 Mount the file systems

# mount /dev/root_partition /mnt

# mount --mkdir /dev/efi_system_partition /mnt/boot

# swapon /dev/swap_partition

8 Select the mirrors

/etc/pacman.d/mirrorlist
------------------------------
Server = https://mirrors.tuna.tsinghua.edu.cn/archlinux/$repo/os/$arch
Server = https://mirrors.nju.edu.cn/archlinux/$repo/os/$arch

# sudo pacman -Syyu

9 File validation

# pacman -Sy archlinux-keyring

10 Install essential packages

# pacstrap -K /mnt base linux linux-firmware neovim networkmanager vim neovim

11 Fstab

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

12 Chroot

# arch-chroot /mnt

13 Time zone

Set the time zone:

# ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
# hwclock --systohc

14 Localization

Edit /etc/locale.gen and uncomment en_US.UTF-8 UTF-8 and other needed UTF-8 locales.Generate the locales by running:
编辑 /etc/locale.gen 并且取消注释 en_US.UTF-8 UTF-8

# locale-gen

Create the locale.conf file:

/etc/locale.conf
----------------------
LANG=en_US.UTF-8

15 Set the console keyboard layout

/etc/vconsole.conf
------------------------
FONT=LatGrkCyr-12x22

16 Network configuration

/etc/hostname
------------------
WGZ

17 Root password

# passwd

18 Boot loader

# pacman -S man-db man-pages texinfo
# pacman -S grub efibootmgr intel-ucode os-prober

19 Install boot loader

esp = EFI system partition
mount the esp into /boot/efi

# mount --mkdir /dev/[name] /boot/efi

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

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

20 Reboot

# exit
# umount -R /mnt
# reboot

21 Start the NetwrokManager Service

# systemctl enable NetworkManager
# systemctl start NetworkManager

22 Add new user

# pacman -S sudo
# sudo useradd -m [name]
# sudo passwd [name]

/etc/sudoers  
-----------------------
root ALL:(ALL:ALL)...
name ALL:(ALL:ALL)...

23 Font configuration/Chinese

$ sudo pacman -S ttf-roboto noto-fonts