Arch Linux Post-Install Guide

This document is written causally, and is not a complete guide. It is intended to be a quick reference for post-installation tasks on Arch Linux.

Table of Contents

  1. System Configuration
  2. Hardware Drivers
  3. Desktop Environment
  4. Applications & Development
  5. System Services
  6. Shell Configuration
  7. Tips and Tricks

System Configuration

Pacman

1
2
3
sudo vim /etc/pacman.conf
sudo vim /etc/pacman.d/mirrorlist
sudo pacman -S archlinuxcn-keyring
1
2
3
4
5
6
7
8
9
10
11
[core]
Include = /etc/pacman.d/mirrorlist

[extra]
Include = /etc/pacman.d/mirrorlist

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

[archlinuxcn]
Server = https://mirrors.ustc.edu.cn/archlinuxcn/$arch

Grub

1
2
3
4
# /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="zswap.enabled=0 loglevel=3 sysrq_always_enabled=1"
GRUB_THEME="/usr/share/grub/themes/Hyacine/theme.txt"
GRUB_DISABLE_OS_PROBER=false
1
2
sudo pacman -S os-prober efibootmgr
sudo grub-mkconfig -o /boot/grub/grub.cfg

Hardware Drivers

Base System

1
sudo pacman -S base-devel linux-zen-headers power-profiles-daemon gst-libav gst-plugins-bad gst-plugins-base gst-plugins-good gst-plugins-uglygst-plugin-pipewire egl-wayland xdg-desktop-portal xdg-desktop-portal-wlr grim --needed

Graphics and Compute

1
2
sudo pacman -S --needed nvidia-open-dkms nvidia-utils lib32-nvidia-utils nvidia-settings vulkan-icd-loader lib32-vulkan-icd-loader lib32-mesa vulkan-intel lib32-vulkan-intel intel-compute-runtime hashcat cuda cuda-toolkit switcheroo-control switcheroo nvidia-prime libva-utils
sudo systemctl enable --now switcheroo-control

Driver Verification Commands

1
2
3
4
5
6
7
lsmod | grep kvm
cat /proc/driver/nvidia/params | grep PreserveVideoMemoryAllocations
sudo cat /sys/module/nvidia_drm/parameters/fbdev
sudo cat /sys/module/nvidia_drm/parameters/modeset
# echo 'GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX nvidia-drm.fbdev=1"' | sudo tee /etc/default/grub.d/nvidia-fbdev.cfg
# echo 'GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX nvidia-drm.modeset=1"' | sudo tee /etc/default/grub.d/nvidia-modeset.cfg
# echo 'options nvidia NVreg_PreserveVideoMemoryAllocations=1' | sudo tee /etc/modprobe.d/nvidia-power-management.conf

Desktop Environment

Desktop Settings

  • Avatar
  • Wallpaper
  • Night Color
  • Default Applications
  • Power Management
  • Refresh Rate

GNOME Extensions

1
2
3
yay -S extension-manager gnome-shell-extension-blur-my-shell gnome-shell-extension-dash-to-dock gnome-shell-extension-easyscreencast gnome-shell-extension-gnome-ui-tune-git gnome-shell-extension-gsconnect gnome-shell-extension-just-perfection-desktop gnome-shell-extension-kimpanel-git gnome-shell-extension-extension-list gnome-shell-extension-easyscreencast
sudo pacman -S gnome-browser-connector gnome-shell-extension-appindicator gnome-shell-extension-desktop-icons-ng gnome-shell-extensions
gsettings set org.gnome.mutter experimental-features "['scale-monitor-framebuffer', 'kms-modifiers', 'autoclose-xwayland', 'variable-refresh-rate', 'xwayland-native-scaling']"

QT Integration

1
2
sudo pacman -S kvantum
echo 'QT_STYLE_OVERRIDE=kvantum' >> /etc/environment

Themes and Icons

1
2
yay -S orchis-theme papirus-icon-theme papirus-folders bibata-cursor-theme
papirus-folders -C brown --theme Papirus-Light

Input Method (IME)

1
2
3
4
5
6
7
sudo pacman -S fcitx5 fcitx5-chinese-addons fcitx5-configtool  
echo 'QT_IM_MODULE=fcitx' >> /etc/environment
echo 'XMODIFIERS=@im=fcitx' >> /etc/environment
cat ~/.config/electron-flags.conf
ln -sf ~/.config/electron-flags.conf ~/.config/chrome-flags.conf
ln -sf ~/.config/electron-flags.conf ~/.config/chromium-flags.conf
ln -sf ~/.config/electron-flags.conf ~/.config/code-flags.conf
1
2
3
4
5
6
7
8
9
10
# ~/.config/electron-flags.conf
--enable-wayland-ime --wayland-text-input-version=3
--enable-unsafe-webgpu
--enable-features=UseOzonePlatform
--enable-features=VaapiVideoDecoder,VaapiVideoEncoder,VaapiVideoDecodeLinuxGL
--enable-features=WaylandWindowDecorations
--enable-features=TouchpadOverscrollHistoryNavigation
--enable-features=WebRTCPipeWireCapturer
--ozone-platform-hint=auto
--ozone-platform=wayland

Fonts

1
2
3
4
5
6
7
8
9
sudo usermod -aG disk $USER
# Logout and re-login
yay -S ttf-ms-win11-auto-zh_cn --noconfirm
sudo pacman -S otf-aurulent-nerd otf-codenewroman-nerd otf-comicshanns-nerd otf-commit-mono-nerd otf-droid-nerd otf-firamono-nerd otf-geist-mono-nerd otf-hasklig-nerd otf-hermit-nerd otf-monaspace-nerd otf-opendyslexic-nerd otf-overpass-nerd ttf-0xproto-nerd ttf-3270-nerd ttf-agave-nerd ttf-anonymouspro-nerd ttf-arimo-nerd ttf-bigblueterminal-nerd ttf-bitstream-vera-mono-nerd ttf-cascadia-code ttf-cascadia-code-nerd ttf-cascadia-mono-nerd ttf-cousine-nerd ttf-d2coding-nerd ttf-daddytime-mono-nerd ttf-dejavu-nerd ttf-envycoder-nerd ttf-fantasque-nerd ttf-firacode-nerd ttf-go-nerd ttf-gohu-nerd ttf-hack-nerd ttf-heavydata-nerd ttf-iawriter-nerd ttf-ibmplex-mono-nerd ttf-inconsolata-go-nerd ttf-inconsolata-lgc-nerd ttf-inconsolata-nerd ttf-input-nerd ttf-intone-nerd ttf-iosevka-nerd ttf-iosevkaterm-nerd ttf-iosevkatermslab-nerd ttf-jetbrains-mono-nerd ttf-lekton-nerd ttf-liberation-mono-nerd ttf-lilex-nerd ttf-martian-mono-nerd ttf-meslo-nerd ttf-monofur-nerd ttf-monoid-nerd ttf-mononoki-nerd ttf-mplus-nerd ttf-nerd-fonts-symbols ttf-nerd-fonts-symbols-common ttf-nerd-fonts-symbols-mono ttf-noto-nerd ttf-profont-nerd ttf-proggyclean-nerd ttf-recursive-nerd ttf-roboto-mono-nerd ttf-sharetech-mono-nerd ttf-sourcecodepro-nerd ttf-space-mono-nerd ttf-terminus-nerd ttf-tinos-nerd ttf-ubuntu-mono-nerd ttf-ubuntu-nerd ttf-victor-mono-nerd ttf-zed-mono-nerd
# Alternative: Essential nerd fonts only
sudo pacman -S ttf-firacode-nerd ttf-jetbrains-mono-nerd ttf-cascadia-code-nerd ttf-nerd-fonts-symbols-common gnu-free-fonts ttf-arphic-uming ttf-indic-otf noto-fonts noto-fonts-cjk noto-fonts-emoji noto-fonts-extra adobe-source-han-sans-cn-fonts adobe-source-han-serif-cn-fonts
sudo gnome-text-editor /etc/fonts/conf.d/64-language-selector-prefer.conf
fc-cache -fv
fc-match -s sans-serif:lang=zh-cn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<alias>
<family>sans-serif</family>
<prefer>
<family>Noto Sans CJK SC</family>
<family>Noto Sans CJK TC</family>
<family>Noto Sans CJK JP</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>Noto Sans Mono CJK SC</family>
<family>Noto Sans Mono CJK TC</family>
<family>Noto Sans Mono CJK JP</family>
</prefer>
</alias>
</fontconfig>

Terminal Emulators

Alacritty

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# ~/.config/alacritty/alacritty.toml
[font]
size = 12.0

[font.normal]
family = "FiraCode Nerd Font"
style = "Regular"

[window]
opacity = 0.9
dynamic_padding = true
blur = true

[window.padding]
x = 15
y = 15

[window.dimensions]
columns = 120
lines = 36

[selection]
save_to_clipboard = true

# [terminal]
# shell = { program = "/usr/bin/fish", args = [] }

Kitty

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# ~/.config/kitty/kitty.conf

# 字体设置
font_family FiraCode Nerd Font
font_size 12.0

# 窗口设置
background_opacity 0.9
dynamic_background_opacity yes
dim_opacity 0.9
window_padding_width 15

# 窗口尺寸
remember_window_size yes

# 选择设置
clipboard_control write-clipboard write-primary read-clipboard read-primary

# Shell设置
# shell /usr/bin/fish

Applications & Development

Development Tools

1
2
3
yay -S rustup go jdk21-openjdk npm nodejs base-devel visual-studio-code-bin
rustup install stable
cargo install cargo-xwin

Git Configuration

1
2
3
ssh-keygen
cat ~/.ssh/id_ed25519.pub
ssh -T [email protected]

Python Environment

1
2
3
python3 -m venv base_python_env
source ~/base_python_env/bin/activate
pip install requests matplotlib notebook jupyterlab numpy scipy pillow isort black flake8 pylint mypy pandas bs4

Software Collection

1
yay -S qbittorrent plocate lutris wine winetricks zenity gimp blender flatpak xdg-desktop-portal flatpak-kcm steam wechat-universal-bwrap linuxqq wps-office-365 google-chrome flameshot obs-studio ffmpeg texlive vlc mpv yt-dlp fastfetch octopi bleachbit 7zip vulkan-devel vulkan-headers vulkan-tools imagemagick swtpm appmenu-gtk-module libdbusmenu-glib

System Services

Memory Management (Zram)

1
2
3
4
5
sudo pacman -S zram-generator
sudo vim /etc/systemd/zram-generator.conf
sudo systemctl restart [email protected]
free -h
zramctl
1
2
3
[zram0]
zram-size = min(ram / 2, 4096)
compression-algorithm = zstd

Printing

1
2
yay -S cups
sudo systemctl enable --now cups

Bluetooth

1
2
sudo pacman -S bluez bluez-utils
sudo systemctl enable --now bluetooth.service

Virtualization

1
2
sudo pacman -S qemu-full libvirt virt-manager dnsmasq
sudo systemctl enable --now libvirtd

Shell Configuration

Zsh Packages

1
2
sudo pacman -S zsh-autocomplete zsh-autosuggestions zsh-completions zsh-doc zsh-history-substring-search zsh-lovers zsh-syntax-highlighting zsh-theme-powerlevel10k-git pkgfile eza tree 
sudo pkgfile --update

.zshrc

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# Enable Powerlevel10k instant prompt
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi

# Load theme
source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh

# Performance optimization for completion
autoload -Uz compinit
if [[ -n ~/.zcompdump(#qN.mh+24) ]]; then
compinit
else
compinit -C
fi

# Load plugins
source /usr/share/zsh/plugins/zsh-autocomplete/zsh-autocomplete.plugin.zsh
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh
# sudo pkgfile --update
source /usr/share/doc/pkgfile/command-not-found.zsh

# Smart history configuration
HISTFILE=~/.zsh_history
HISTSIZE=10000
SAVEHIST=10000

# Essential options only (removed defaults)
setopt correct
setopt extendedglob
setopt nocaseglob
setopt numericglobsort
setopt nobeep
setopt histignorealldups
setopt histignorespace
setopt autocd
setopt inc_append_history
setopt EXTENDED_HISTORY
setopt SHARE_HISTORY
setopt HIST_FIND_NO_DUPS
setopt hist_expire_dups_first
setopt hist_ignore_dups
setopt hist_verify
setopt AUTO_PUSHD PUSHD_SILENT PUSHD_TO_HOME PUSHD_IGNORE_DUPS PUSHD_MINUS

# Directory stack
DIRSTACKFILE="${XDG_CACHE_HOME:-$HOME/.cache}/zsh/dirs"
DIRSTACKSIZE='20'

# Key bindings (only non-defaults)
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down
bindkey '\t' menu-select
bindkey -M menuselect '\t' menu-complete
bindkey -M menuselect "$terminfo[kcbt]" reverse-menu-complete
bindkey -M menuselect '\r' .accept-line

# Simplified completion configuration
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}'
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
zstyle ':completion:*' menu select
zstyle ':completion:*' use-cache yes
zstyle ':completion:*' cache-path ~/.cache/zsh

# Simplified syntax highlighting
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main)
ZSH_HIGHLIGHT_STYLES[command]='fg=green'
ZSH_HIGHLIGHT_STYLES[alias]='fg=green'
ZSH_HIGHLIGHT_STYLES[path]='underline'

# Editor and enhanced aliases
EDITOR=vim
alias c='clear'
alias ff='fastfetch'
alias ls='eza -a --icons'
alias ll='eza -al --icons'
alias lt='eza -a --tree --level=1 --icons'
alias ..='cd ..'
alias ...='cd ../..'
alias mkdir='mkdir -p'
alias h='history'
alias which='type -a'
alias gs="git status"
alias ga="git add"
alias gc="git commit -m"
alias gp="git push"
alias gpl="git pull"
alias rm='rm -i'
alias update-grub='sudo grub-mkconfig -o /boot/grub/grub.cfg'
alias grep='grep --color=auto'
alias diff='diff --color=auto'
alias ip='ip --color=auto'

# Color man pages
export LESS_TERMCAP_mb=$'\E[1;31m'
export LESS_TERMCAP_md=$'\E[1;36m'
export LESS_TERMCAP_me=$'\E[0m'
export LESS_TERMCAP_so=$'\E[01;33m'
export LESS_TERMCAP_se=$'\E[0m'
export LESS_TERMCAP_us=$'\E[1;32m'
export LESS_TERMCAP_ue=$'\E[0m'

# Directory stack functions
autoload -Uz add-zsh-hook

if [[ -f "$DIRSTACKFILE" ]] && (( ${#dirstack} == 0 )); then
dirstack=("${(@f)"$(< "$DIRSTACKFILE")"}")
# Disabled auto-cd to prevent nautilus issue
fi

chpwd_dirstack() {
print -l -- "$PWD" "${(u)dirstack[@]}" > "$DIRSTACKFILE"
}
add-zsh-hook -Uz chpwd chpwd_dirstack

# Terminal title (simplified)
function set_title() {
print -Pn -- '\e]2;%n@%m %~\a'
}

function set_title_preexec() {
print -Pn -- '\e]2;%n@%m %~ %# ' && print -n -- "${(q)1}\a"
}

if [[ "$TERM" == (Eterm*|alacritty*|aterm*|foot*|gnome*|konsole*|kterm*|putty*|rxvt*|screen*|wezterm*|tmux*|xterm*) ]]; then
add-zsh-hook -Uz precmd set_title
add-zsh-hook -Uz preexec set_title_preexec
fi

Tips and Tricks

See also: https://wiki.cachyos.org/configuration/general_system_tweaks/

Useful Commands

  • comm -23 <(pacman -Qq | sort) <(pacman -Sql archlinuxcn core extra multilib | sort)
  • LANG=en_US.UTF-8 pacman -Sl archlinuxcn | grep '\[installed\]'
  • yay -Qtdq | yay -Rsn -

System Configuration

  • sudo vim /etc/locale.conf
  • sudo locale-gen
  • echo 'vm.max_map_count = 2147483642' | sudo tee /etc/sysctl.d/80-gamecompatibility.conf
  • timedatectl set-local-rtc 0

Git Configuration

  • git config --global user.name "Rukkhadevata123"
  • git config --global user.email "[email protected]"

File System

  • sudo pacman -S ntfsprogs-ntfs3; sudo ntfsfix --clear-dirty /dev/nvme0n1p4
  • unzip -O gbk file.zip

Audio

  • sudo pacman -S realtime-privileges && sudo gpasswd -a $USER realtime

Gaming

  • __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only __GLX_VENDOR_LIBRARY_NAME=nvidia %command%

Windows Compatibility

  • Windows: reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation" /v RealTimeIsUniversal /d 1 /t REG_DWORD /f

Arch Linux Post-Install Guide
https://rukkhadevata123.github.io/2025/06/03/arch-post-install/
作者
Dawn Chirps
发布于
2025年6月3日
许可协议