安装过程按照 Installation_guide 指引一步一步往前走。

简要步骤

0. 简要提示

安装时,可以使用 Alt+arrow 切换到其他终端。
这样,就可以用 Lynx 终端浏览器查看安装帮助文档了。

1.链接网络、磁盘分区

  1. # 链接网络
  2. $ iwctl
  3. [iwd] station list
  4. [iwd] station wlan0 connect wireless_name
  5. # Update the system clock
  6. $ timedatectl set-ntp true
  7. # 磁盘分区
  8. $ fdisk /dev/sdc # h 查看帮助
  9. # uefi 需要 3 个分区
  10. # - /mnt/efi # 最少 260M
  11. # - swap, # > 512M
  12. # - /mnt, # 对应 / 目录
  13. $ mkfs.ext4 /dev/sdc2
  14. $ mkswap /dev/swap_partition
  15. # 若 efi 分区不存在的化,新建一个分区
  16. # 挂载
  17. $ mount /dev/sdc2 /mnt
  18. $ mkdir /mnt/efi
  19. $ mount /dev/sdc4 /mnt/efi
  20. # 使用 swap 分区
  21. $ swapon /dev/swap_partition

2.安装主要软件

  1. # 基础包
  2. $ pacstrap /mnt base linux linux-firmware
  3. # 网络(必需)
  4. $ pacstrap /mnt iwd dhcpcd
  5. # 编辑器
  6. $ pacstrap /mnt neovim

若安装速度很慢的话,可以考虑使用国内镜像站点。下面使用 reflector命令将 /etc/pacman.d/mirrorlist替换为国内最快的 5 个站点。

  1. $ reflector
  2. --save /etc/pacman.d/mirrorlist
  3. --country China,Germany
  4. --protocol https
  5. --fastest 5

3.系统配置

  1. # fstab
  2. $ genfstab -U /mnt >> /mnt/etc/fstab
  3. # change root
  4. $ arch-chroot /mnt
  5. # time zone
  6. $ ln -sf /usr/share/zoneinfo/Region/City /etc/localtime
  7. # hwclock
  8. $ hwclock --systohc
  9. # Localization
  10. # 编辑 /etc/locale.gen,取消注释 `en_US.UTF-8 UTF-8`,根据需要取消注释其他本地化的。
  11. # 这里主要是中文相关的
  12. $ locale-gen
  13. # locale.conf
  14. # 编辑 /etc/locale.conf
  15. # 填入 LANG=en_US.UTF-8
  16. # 网络配置
  17. # hostname
  18. # 创建 /etc/hostname
  19. # 填入你的 hostname
  20. # hosts
  21. # 创建 /etc/hosts
  22. # 填入:
  23. 127.0.0.1 localhost
  24. ::1 localhost
  25. 127.0.1.1 myhostname.localdomain myhostname
  26. # 设置密码
  27. $ passwd

4.添加用户

  1. $ useradd -m smith # with home
  2. $ pacman -S sudo
  3. # 在 /etc/sudoers 中给你的用户 sudo 权限

5.Boot loader

根据文档 GRUB 按步骤走

  1. $ pacman -S grub efibootmgr os-prober
  2. # efibootmgr is used by the GRUB installation script to write boot entries to NVRAM
  3. # os-prober 让 grub-mkconfig 可以搜索到其他的系统,一般装多系统必需安装
  4. $ grub-install --target=x86_64-efi --efi-directory=efi --bootloader-id=Archlinux
  5. # 这里 Archlinux 为电脑启动项中显示的
  6. $ grub-mkconfig -o /boot/grub/grub.cfg
  7. # 这个文件里可以看到检测到了哪些系统
  8. # 这里遇到了一个问题,重启之后停在了 grub 终端,可能是之前 efi 分区删除了其他系统导致,可以加上 --recheck
  9. $ grub-mkconfig -o /boot/grub/grub.cfg
  10. # 若这里提示 Warning: os-prober will not be executed to detect other bootable partitions
  11. # 则应当编辑 /etc/default/grub,添加
  12. GRUB_DISABLE_OS_PROBER=false
  13. # 这可以让 os-prober 找到系统里的其他系统
  14. $ reboot

5.gnome

  1. $ pacman -S gnome
  2. $ systemctl start gdm

FAQ

1.iwctl 连接之后 ping 不通

  1. $ systemctl start iwd
  2. $ iwctl # 连接网络
  3. $ dhcpd # 获取 ip 等

2.浏览器中文显示不了

  • 系统语言添加中文。
  • 安装中文字体: pacman -S wqy-microhei
  • 可以安装 firefox,很多中文字体会随之安装