Arch Linux 配置备忘录~~(方便重装~~
请查看更新版本: ArchLinux安装及Snapper和btrfs-grub的使用
老一套,关闭 Secure Boot 后U盘启动
由于我用的是笔记本,所以用 iwctl 连接 WiFi:
1iwctl # 进入 iwd 命令行
2[iwd#] device list # 查询网卡设备
3[iwd#] station <devicename> connect <wifi-ssid> # 连接 WiFi
4[iwd#] exit # 退出 iwd
使用 ping
测试网络是否可用:
1ping -c4 1.2.4.8
1timedatectl set-ntp true
使用 vim
修改 /etc/pacman.d/mirrorlist
(别问我为啥不用 reflector
,问就自己去试试)
1Server = https://mirrors.ustc.edu.cn/archlinux/$repo/os/$arch
2Server = https://mirrors.bfsu.edu.cn/archlinux/$repo/os/$arch
老一套用 pacstrap
安装 base:
1pacstrap /mnt base base-devel linux linux-firmware vim sudo zsh
生成 fstab:
1genfstab -U /mnt >> /mnt/etc/fstab
chroot 到新系统下:
1arch-chroot /mnt
更改时区:
1ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
2hwclock --systohc
设置主机名:
1echo YOURHOSTNAME > /etc/hostname
修改 /etc/hosts
:
1printf '
2127.0.0.1 localhost
3::1 localhost
4127.0.1.1 YOURHOSTNAME.localdomain YOURHOSTNAME\n
5' > /etc/hosts
修改语言:
1echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
2echo "zh_CN.UTF-8 UTF-8" >> /etc/locale.gen
3locale-gen
4echo "LANG=en_US.UTF-8" > /etc/locale.conf
安装微码:
1pacman -S intel-ucode # Intel
2pacman -S amd-ucode # AMD
安装网络管理:
1pacman -S networkmanager dhcpcd
2systemctl enable NetworkManager.service
3systemctl enable dhcpcd.service
音频驱动:
1pacman -S alsa-utils sof-firmware
用户/密码:
1passwd root
2useradd -m -G wheel -s /bin/bash USERNAME
3passwd USERNAME
4EDITOR=vim visudo
5#找到 : # %wheel ALL=(ALL) ALL
6#改为:
7%wheel ALL=(ALL) ALL
安装 GRUB:
1pacman -S grub efibootmgr os-prober
生成引导:
1grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=ARCH
2grub-mkconfig -o /boot/grub/grub.cfg
安装字体:
1pacman -S noto-fonts-cjk noto-fonts-emoji
安装 KDE 和 Fcitx5:
1pacman -S sddm plasma-mate konsole dolphin fcitx5-im fcitx5-chinese-addons fcitx5-material-color
2systemctl enable sddm
1exit # 退出chroot
2umount -R /mnt # 卸载目录
3reboot
字体 vim :
1<?xml version="1.0"?>
2<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
3<fontconfig>
4 <alias>
5 <family>sans-serif</family>
6 <prefer>
7 <family>Noto Sans CJK SC</family>
8 <family>Noto Sans CJK TC</family>
9 <family>Noto Sans CJK JP</family>
10 </prefer>
11 </alias>
12 <alias>
13 <family>serif</family>
14 <prefer>
15 <family>Noto Serif CJK SC</family>
16 <family>Noto Serif CJK TC</family>
17 <family>Noto Serif CJK JP</family>
18 </prefer>
19 </alias>
20 <alias>
21 <family>monospace</family>
22 <prefer>
23 <family>FiraCode Nerd Font Mono</family>
24 <family>Hack Nerd Font Mono</family>
25 </prefer>
26 </alias>
27</fontconfig>
先写到这,有空再加