1
  | 
useradd -m -G wheel -s /bin/bash xiaoqi
  | 
 
 
参数说明:
| 参数 | 
解释 | 
| -m | 
创建用户的同时创建用户家目录 | 
| -G | 
选项后指定附加组 | 
| -s | 
指定 shell 程序 | 
 
然后设置新用户的密码:
最后使用 visudo 命令编辑 /etc/sudoers 文件:
找到如下这样的一行,把前面的注释符号 # 去掉:
1
2
  | 
- #%wheel ALL=(ALL:ALL) ALL
+ %wheel ALL=(ALL:ALL) ALL
  | 
 
 
 
编辑 /etc/pacman.conf 文件:
去掉 [multilib] 中的两行的注释,开启 32 位库支持。
1
2
3
4
  | 
- #[multilib]
- #Include = /etc/pacman.d/mirrorlist
+ [multilib]
+ Include = /etc/pacman.d/mirrorlist
  | 
 
 
在结尾处加入下面的文字,来添加 archlinuxcn 源。
## Server 多选一
[archlinuxcn]
Server = https://mirrors.zju.edu.cn/archlinuxcn/$arch           ## 浙江大学 (浙江杭州) (ipv4, ipv6, http, https)
Server = https://mirrors.cqupt.edu.cn/archlinuxcn/$arch         ## 重庆邮电大学 (重庆) (ipv4, ipv6, http, https)
Server = https://mirrors.bfsu.edu.cn/archlinuxcn/$arch          ## 北京外国语大学 (北京) (ipv4, ipv6, http, https)
Server = https://mirrors.jlu.edu.cn/archlinuxcn/$arch           ## 吉林大学 (吉林长春) (ipv4, ipv6, http, https)
Server = https://mirrors.sustech.edu.cn/archlinuxcn/$arch       ## 南方科技大学 (广东深圳) (ipv4, ipv6, http, https)
Server = https://mirrors.hust.edu.cn/archlinuxcn/$arch          ## 华中科技大学 (湖北武汉) (ipv4, ipv6, http, https)
Server = https://mirror.lzu.edu.cn/archlinuxcn/$arch            ## 兰州大学 (甘肃兰州) (ipv4, ipv6, http, https)
Server = https://mirrors.xjtu.edu.cn/archlinuxcn/$arch          ## 西安交通大学 (陕西西安) (ipv4, ipv6, http, https)
Server = https://mirror.nyist.edu.cn/archlinuxcn/$arch          ## 南阳理工学院 (河南南阳) (ipv4, ipv6, http, https)
Server = https://mirrors.njtech.edu.cn/archlinuxcn/$arch        ## 南京工业大学 (江苏南京) (ipv4, ipv6, http, https)
Server = https://mirrors.shanghaitech.edu.cn/archlinuxcn/$arch  ## 上海科技大学 (上海) (ipv4, https)
其它镜像源在 archlinuxcn 官方 Github Repo 里面有提供:archlinuxcn/mirrorlist。
最后记得刷新 pacman 数据库并更新:
1
2
  | 
# 首先导入 GPG key
pacman -Sy archlinuxcn-keyring
  | 
 
 
2023 年 12 月后,在新系统下安装 archlinuxcn-keyring 时可能会出现错误:
error: archlinuxcn-keyring: Signature from "Jiachen YANG (Arch Linux Packager Signing Key) " is marginal trust
需要在本地信任 Jiachen YANG (Arch Linux Packager Signing Key) 的 GPG key:
1
  | 
sudo pacman-key --lsign-key "farseerfc@archlinux.org"
  | 
 
 
最后在安装 yay:
 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
  | 
# Install Basic
pacman -S stow
pacman -S xorg xorg-xinit bspwm rofi alacritty
pacman -S tmux fish neovim lf nautilus flameshot
pacman -S xf86-video-amdgpu brightnessctl alsa-utils
pacman -S iwd dhcpcd
yay -S google-chrome
pacman -S fzf ripgrep lf bat fd
# Install Tools
pacman -S sxhkd
pacman -S betterlockscreen
pacman -S nitrogen
pacman -S fcitx5
yay -Sy antidot-bin
pacman -S polybar
pacman -S playerctl
pacman -S awk
pacman -S imwheel
# Install Picom
git clone git@github.com:yaocccc/picom.git
cd picom
pacman -S meson ninja libev uthash libconfig pcre
git submodule update --init --recursive
meson --buildtype=release . build
sudo ninja -C build install
git clone --recursive https://github.com/wwxiaoqi/dotfiles
cd dotfiles
./install.sh
  | 
 
 
 
1
2
3
4
5
  | 
yay -S wqy-microhei
yay -S nerd-fonts-jetbrains-mono
yay -S ttf-material-design-icons
yay -S ttf-joypixels
yay -S ttf-dejavu
  | 
 
 
 
1
2
3
4
5
  | 
sudo pacman -S fcitx5-im              # 输入法基础包组
sudo pacman -S fcitx5-chinese-addons  # 官方中文输入引擎
sudo pacman -S fcitx5-anthy           # 日文输入引擎
sudo pacman -S fcitx5-pinyin-moegirl  # 萌娘百科词库
sudo pacman -S fcitx5-material-color  # 输入法主题
  | 
 
 
接着配置下环境变量,通过 vim 创建并编辑文件 ~/.config/environment.d/im.conf:
1
  | 
vim ~/.config/environment.d/im.conf
  | 
 
 
在文件中加入以下内容并保存退出:
GTK_IM_MODULE=fcitx
QT_IM_MODULE=fcitx
XMODIFIERS=@im=fcitx
SDL_IM_MODULE=fcitx
GLFW_IM_MODULE=ibus
1
  | 
sudo pacman -S timeshift
  | 
 
 
如果 Timeshift 没有自动备份,需要手动开启 cronie 服务:
1
  | 
sudo systemctl enable --now cronie.service
  | 
 
 
配置完成后建议执行下述指令删除 subvolid:
1
  | 
sudo sed -i -E 's/(subvolid=[0-9]+,)|(,subvolid=[0-9]+)//g' /etc/fstab
  | 
 
 
否则,恢复 BTRFS 类型快照时,可能因子卷 ID 改变导致无法正常进入系统。
1
2
3
4
5
6
7
8
  | 
# Intel 核芯显卡
sudo pacman -S mesa lib32-mesa vulkan-intel lib32-vulkan-intel
# AMD 集成显卡
sudo pacman -S mesa lib32-mesa xf86-video-amdgpu vulkan-radeon lib32-vulkan-radeon
# 独立显卡
sudo pacman -S nvidia-open nvidia-settings lib32-nvidia-utils
  | 
 
 
如果同时拥有集成显卡与独立显卡的笔记本电脑,可以使用 optimus-manager 等工具自动切换。
dae 利用了 Linux 内核中的 eBPF 技术,采用了透明代理和流量分流套件,可以提升分流性能,具体工作原理请看 dae 如何工作。
1
2
3
  | 
# 二选一
sudo pacman -S dae   # dae 核心
sudo pacman -S daed  # 自带 Web 操作界面的 dae
  | 
 
 
 
1
2
  | 
# 设置开机自启动 daed 且立刻启动
sudo systemctl enable --now daed
  | 
 
 
daed 直接打开浏览器访问 http://localhost:2023 配置 daed 即可。
dae 需要自行配置 /etc/dae/config.dae:
 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
  | 
global {
  # 绑定到 LAN 和/或 WAN 接口
  # lan_interface: docker0
  wan_interface: auto # 使用 "auto" 自动侦测 WAN 接口
  log_level: info
  allow_insecure: false
  auto_config_kernel_parameter: true
}
subscription {
  # 在下面填入你的订阅链接
}
# 更多的 DNS 样例见 https://github.com/daeuniverse/dae/blob/main/docs/en/configuration/dns.md
dns {
  upstream {
    googledns: 'tcp+udp://dns.google.com:53'
    alidns: 'udp://dns.alidns.com:53'
  }
  routing {
    request {
      fallback: alidns
    }
    response {
      upstream(googledns) -> accept
      ip(geoip:private) && !qname(geosite:cn) -> googledns
      fallback: accept
    }
  }
}
group {
  proxy {
    policy: min_moving_avg
  }
}
# 更多的 Routing 样例见 https://github.com/daeuniverse/dae/blob/main/docs/en/configuration/routing.md
routing {
  pname(NetworkManager) -> direct
  dip(224.0.0.0/3, 'ff00::/8') -> direct
  ### 以下为自定义规则
  # 禁用 h3,因为它通常消耗很多 CPU 和内存资源
  l4proto(udp) && dport(443) -> block
  dip(geoip:private) -> direct
  dip(geoip:cn) -> direct
  domain(geosite:cn) -> direct
  fallback: proxy
}
  | 
 
 
如果你更注重隐私和 DNS 泄露,可以考虑使用以下配置替换上述的 dns 部分:
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
  | 
dns {
  upstream {
    googledns: 'tcp+udp://dns.google.com:53'
    alidns: 'udp://dns.alidns.com:53'
  }
  routing {
    request {
      qname(geosite:cn) -> alidns
      fallback: googledns
    }
  }
}
  | 
 
 
配置完毕后启动:
1
2
  | 
# 设置开机自启动 dae 且立刻启动
sudo systemctl enable --now dae
  |