Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Arch Linux

pre-install

install

1

systemctl stop reflector.service
timedatectl set-ntp true
cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak
vim /etc/pacman.d/mirrorlist
Server = https://mirrors.ustc.edu.cn/archlinux/$repo/os/$arch
lsblk
cfdisk /dev/nvme?n1
size        | type             | comment
256M        | EFI System       | /boot
32G*0.6=18G | Linux Swap       |
free        | Linux filesystem | /
mkfs.fat -F32 /dev/nvme?n1p?
mkswap /dev/nvme?n1p?
mkfs.btrfs -L Arch /dev/nvme?n1p?
mount -t btrfs -o compress=zstd /dev/nvmex?1p? /mnt
btrfs subvolume create /mnt/@
btrfs subvolume create /mnt/@home
umount /mnt
mount -t btrfs -o subvol=/@,compress=zstd /dev/nvme?n1p? /mnt
mkdir /mnt/home
mount -t btrfs -o subvol=/@home,compress=zstd /dev/nvme?n1p? /mnt/home
mkdir -p /mnt/boot
# Mount EFI
mount /dev/nvme?n1p? /mnt/boot
# Mount Linux Swap
swapon /dev/nvmexn1pn
pacstrap /mnt base base-devel linux linux-firmware btrfs-progs
pacstrap /mnt networkmanager vim sudo zsh zsh-completions
genfstab -U /mnt > /mnt/etc/fstab
arch-chroot /mnt

2

vim /etc/hostname
arch
vim /etc/hosts
# Add
127.0.1.1	arch.local arch

3

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

4 5

vim /etc/locale.gen
# Find and uncomment
en_US.UTF-8 UTF-8
zh_CN.UTF-8 UTF-8
locale-gen
vim /etc/locale.conf
LANG=en_US.UTF-8
passwd root
useradd -m -G wheel -s /bin/bash <user>
passwd <user>
EDITOR=vim visudo
# Uncomment
%wheel ALL=(ALL:ALL) ALL
# pacman -S intel-ucode # Intel
pacman -S amd-ucode # AMD
pacman -S grub efibootmgr os-prober
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=ARCH
vim /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="loglevel=5 nowatchdog"
grub-mkconfig -o /boot/grub/grub.cfg
exit
umount -R /mnt
shutdown -h now

6

lsblk -o name,mountpoint,size,uuid
# Get UUID of Swap Partition
sudo vim /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="loglevel=5 nowatchdog resume=UUID=<swap_uuid>"
sudo grub-mkconfig -o /boot/grub/grub.cfg
sudo vim /etc/mkinitcpio.conf
HOOKS=(base udev resume ...)
sudo mkinitcpio -P
sudo reboot

Personal do

sudo pacman -S \
	ark
	# neomutt
	# restic
sudo pacman -Rns \
	xfce4-dict \
	xfce4-terminal \
	xfce4-screenshooter \
	xfce4-clipman-plugin \
	ristretto
	# xfce4-notifyd \
	# xfwm4 \

reference

cross-reference

  1. archwsl.md
  2. pacman.md
  3. flatpak.md
  4. pipewire.md
  5. bluez.md
  6. openssh.md
  7. tigervnc.md
  8. firewalld.md
  9. mount.md

troubleshoot

Bluetooth service was skipped because of an unmet condition check ...

7

sudo modprobe bluetooth
sudo systemctl restart bluetooth
systemctl status bluetooth

annex

arch-linux-arm_ucon arch-linux


  1. archlinux 基础安装

  2. Set the hostname

  3. System time

  4. Localization

  5. Localization/Simplified Chinese

  6. 可选配置(进阶篇)- 休眠(hibernate)设置

  7. Bluetooth not working on computer