Installation guide (正體中文)
本文將指引您使用由官方安裝映像檔啟動的 live system 安裝 Arch Linux。安裝之前請先閱讀 FAQ。For conventions used in this document, see Help:Reading。
更詳細的資源,可以參考 ArchWiki 文章(安裝過程中可以使用 ELinks 瀏覽),或者閱讀該命令的 man page ,參考 archlinux(7) for an overview of the configuration. 如需要互動式幫助,可透過 IRC channel 及 forums。
Contents
Pre-installation (安裝前)
Arch Linux 可以運行在任何記憶體不小於 256MB 的相容裝置上。最基本的 base 套件組需要至少 800MB 的磁碟空間。安裝過程需要從遠端的repo取得套件,因此必須確定網路正常運作。
Category:Getting and installing Arch 包含了下載並啟動安裝媒體的說明。啟動後您會以 root 的身份登入並進入 Zsh 命令列,常見的指令例如 systemctl(1) 可以使用 Tab 鍵自動補齊。
Verify the boot mode (驗證開機模式)
As instructions differ for UEFI systems,檢查 efivars 檔案以確認開機模式:
# ls /sys/firmware/efi/efivars
Set the keyboard layout (設定鍵盤配置)
默認的鍵盤配置(console keymap)為 US。ls /usr/share/kbd/keymaps/**/*.map.gz
可列出可用的键盘布局。
配置可用 loadkeys(1) 改變,加上檔案名稱(可以忽略路徑及副檔名)。例如:
# loadkeys de-latin1
Console fonts 位於 /usr/share/kbd/consolefonts/
,設置方式請參考 setfont(8)。
Connect to the Internet (連接到網際網路)
所有支援的有線網路在 live system 啟動後皆會啟用 dhcpcd,可以用 ping 等工具檢查網路連接。
如欲使用其他網路配置(network configuration)工具,可以使用 systemd-networkd及netctl。範例請參考systemd.network(5)和netctl.profile(5)。
使用兩個網路服務(service)之一時,請先 stop dhcpcd@interface.service
。
Update the system clock (更新系統時間)
用timedatectl(1)確保系統時間為正確的:
# timedatectl set-ntp true
他
用timedatectl status
檢查服務狀態。
Partition the disks (分割磁碟)
使用 fdisk 和 parted 製作 MBR 或 GPT 磁碟分割表(partition table),或使用 gdisk 製作 GPT 磁碟分割表。
至建立一個 /
分割區。UEFI 系統另外需要一個 EPS分割區(EFI System Partition)。Other partitions may be needed, such as a GRUB BIOS boot partition.
If wanting to create any stacked block devices for LVM, disk encryption or RAID, do it now.
Format the partitions (格式化磁碟)
使用 mkfs(8) 建立檔案系統(File systems),或者使用 mkswap(8) 建立 swap 區。詳細請參考 File systems#Create a file system。
Mount the partitions (掛載磁碟)
掛載(mount(8)) root 分割區到 /mnt
。例如:
# mount /dev/sda1 /mnt
之後請為其他分割區創建目錄(directory)並掛載他們 (/mnt/boot
, /mnt/home
, ...),並用 swapon(8) 啟動 swap 分割區,如此才能被 genfstab 偵測到。
Installation (安裝系統)
Select the mirrors (選擇映射站)
編輯 /etc/pacman.d/mirrorlist
並選擇您的映射站(mirror)。Regional mirrors usually work best; however, other criteria may be necessary to discern, read more on Mirrors.
此檔案(mirror 列表)也會被pacstrap複製到新系統中,所以請確保設置正確。
Install the base packages (安裝基本套件)
# pacstrap /mnt base
此套件組並無包含全部 live 安裝環境的中所有工具,例如 btrfs-progs 或特定的無線韌體。packages.both 包含了他們的差異。
To install other packages or groups to the new system, append their names to pacstrap (space separated) or to individual pacman(8) commands after the #Chroot[broken link: invalid section] step.
Configure the system (配置系統)
Fstab (檔案系統列表)
建立 fstab 檔案 (使用 -U
或 -L
選項設置 UUID 或 labels):
# genfstab -U /mnt >> /mnt/etc/fstab
接下來請檢查生成的檔案 /mnt/etc/fstab
,如有錯誤請更正。
Chroot (改變根目錄)
Change root 進入新的系統:
# arch-chroot /mnt
Time zone (時區)
設定 time zone:
# ln -s /usr/share/zoneinfo/zone/subzone /etc/localtime
使用 hwclock(8) 建立 /etc/adjtime
。If the hardware clock is set to UTC, other operating systems should be configured accordingly.
# hwclock --systohc --utc
Locale (語系)
在 /etc/locale.gen
移除 en_US.UTF-8 UTF-8
及其他需要的 localization 前的註釋符號(#),接著生成 locale 訊息:
# locale-gen
创建 locale.conf 并提交您的本地化选项 在 locale.conf(5) 中設定您的語系選項。例如:
# echo LANG=en_US.UTF-8 > /etc/locale.conf
If required, set the console keymap and font in vconsole.conf(5).
Hostname (主機名稱)
在 /etc/hostname
建立新的項目 hostname:
# echo myhostname > /etc/hostname
Add a matching line to /etc/hosts
:
127.0.1.1 myhostname.localdomain myhostname
Network configuration (網路設定)
需要對新安裝的系統設置網路配置請參考 Network configuration。
對於無線網路配置(Wireless configuration),安裝 iw, wpa_supplicant 和 dialog 以及需要的韌體套件(firmware packages)。
Initramfs
When making configuration changes to mkinitcpio.conf, create a new initial RAM disk with:
# mkinitcpio -p linux
Root password (Root 密碼)
設定 root password:
# passwd
Boot loader (開機管理程式)
可用的選擇和配置請參考 Category:Boot loaders。例如,如果您的系統支援 UEFI,使用 systemd-boot 建立開機管理,反之則用 GRUB。
如果您與用 Intel CPU,請另外安裝 intel-ucode 並啟用 Intel microcode Updates(enable microcode updates)。
Reboot (重新啟動)
輸入 exit
或按下 Ctrl+D
以離開 chroot 環境。
Optionally manually unmount all the partitions with umount -R /mnt
: this allows noticing any "busy" partitions, and finding the cause with fuser(1).
最後,輸入reboot
以重新啟動裝置,所有未卸載的磁碟分割區將會自動由 systemd 卸載。記得移除安裝媒體並以 root 身份登入新系統。
Post-installation (安裝後)
系統管理和安裝後的相關教學(例如:圖形化使用者界面,聲音,觸控板)請參考 General recommendations。
感興趣的各類應用程式,請參考 List of applications。