安装过程按照 Installation_guide 指引一步一步往前走。
简要步骤
0. 简要提示
安装时,可以使用 Alt+arrow 切换到其他终端。
这样,就可以用 Lynx 终端浏览器查看安装帮助文档了。
1.链接网络、磁盘分区
# 链接网络$ iwctl[iwd] station list[iwd] station wlan0 connect wireless_name# Update the system clock$ timedatectl set-ntp true# 磁盘分区$ fdisk /dev/sdc # h 查看帮助# uefi 需要 3 个分区# - /mnt/efi # 最少 260M# - swap, # > 512M# - /mnt, # 对应 / 目录$ mkfs.ext4 /dev/sdc2$ mkswap /dev/swap_partition# 若 efi 分区不存在的化,新建一个分区# 挂载$ mount /dev/sdc2 /mnt$ mkdir /mnt/efi$ mount /dev/sdc4 /mnt/efi# 使用 swap 分区$ swapon /dev/swap_partition
2.安装主要软件
# 基础包$ pacstrap /mnt base linux linux-firmware# 网络(必需)$ pacstrap /mnt iwd dhcpcd# 编辑器$ pacstrap /mnt neovim
若安装速度很慢的话,可以考虑使用国内镜像站点。下面使用 reflector命令将 /etc/pacman.d/mirrorlist替换为国内最快的 5 个站点。
$ reflector--save /etc/pacman.d/mirrorlist--country China,Germany--protocol https--fastest 5
3.系统配置
# fstab$ genfstab -U /mnt >> /mnt/etc/fstab# change root$ arch-chroot /mnt# time zone$ ln -sf /usr/share/zoneinfo/Region/City /etc/localtime# hwclock$ hwclock --systohc# Localization# 编辑 /etc/locale.gen,取消注释 `en_US.UTF-8 UTF-8`,根据需要取消注释其他本地化的。# 这里主要是中文相关的$ locale-gen# locale.conf# 编辑 /etc/locale.conf# 填入 LANG=en_US.UTF-8# 网络配置# hostname# 创建 /etc/hostname# 填入你的 hostname# hosts# 创建 /etc/hosts# 填入:127.0.0.1 localhost::1 localhost127.0.1.1 myhostname.localdomain myhostname# 设置密码$ passwd
4.添加用户
$ useradd -m smith # with home$ pacman -S sudo# 在 /etc/sudoers 中给你的用户 sudo 权限
5.Boot loader
根据文档 GRUB 按步骤走
$ pacman -S grub efibootmgr os-prober# efibootmgr is used by the GRUB installation script to write boot entries to NVRAM# os-prober 让 grub-mkconfig 可以搜索到其他的系统,一般装多系统必需安装$ grub-install --target=x86_64-efi --efi-directory=efi --bootloader-id=Archlinux# 这里 Archlinux 为电脑启动项中显示的$ grub-mkconfig -o /boot/grub/grub.cfg# 这个文件里可以看到检测到了哪些系统# 这里遇到了一个问题,重启之后停在了 grub 终端,可能是之前 efi 分区删除了其他系统导致,可以加上 --recheck$ grub-mkconfig -o /boot/grub/grub.cfg# 若这里提示 Warning: os-prober will not be executed to detect other bootable partitions# 则应当编辑 /etc/default/grub,添加GRUB_DISABLE_OS_PROBER=false# 这可以让 os-prober 找到系统里的其他系统$ reboot
5.gnome
$ pacman -S gnome$ systemctl start gdm
FAQ
1.iwctl 连接之后 ping 不通
$ systemctl start iwd$ iwctl # 连接网络$ dhcpd # 获取 ip 等
2.浏览器中文显示不了
- 系统语言添加中文。
- 安装中文字体: pacman -S wqy-microhei
- 可以安装 firefox,很多中文字体会随之安装
