Debian GNU/Linux 安裝手冊

Debian GNU/Linux 安裝手冊
November 3, 2017
Debian GNU/Linux 安裝手冊
版權 © 2004 –2017 Debian Installer 團隊
本手冊屬於自由軟體,您可以在 GNU 通用公共許可證 (GPL) 的條約下重新發佈和 (或) 修改它。該許可
證的內容請參考附錄 F。
i
Contents
1 歡迎使用 Debian
1.1 什麼是 Debian? . . . . . . . . .
1.2 什麼是 GNU/Linux? . . . . . . .
1.3 什麼是 Debian GNU/Linux? . . .
1.4 What is Debian GNU/kFreeBSD?
1.5 什麼是 Debian GNU/Hurd? . . .
1.6 取得 Debian . . . . . . . . . . .
1.7 取得本文件最新版本 . . . . . . .
1.8 本文架構 . . . . . . . . . . . . .
1.9 歡迎為此文件提供幫助 . . . . . .
1.10 關於版權與軟體協議 . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
1
1
1
2
2
3
3
3
3
4
4
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
2 系統需求
2.1 支援的硬體 . . . . . . . . . . . . . . . . .
2.1.1 支援的硬體架構 . . . . . . . . . .
2.1.2 中央處理器,主機板和顯示的支援
2.1.2.1 中央處理器 . . . . . . . .
2.1.2.2 I/O 匯流排 . . . . . . . .
2.1.3 筆記型電腦 . . . . . . . . . . . . .
2.1.4 多處理器 . . . . . . . . . . . . . .
2.1.5 Graphics Hardware Support . . .
2.1.6 網路連接硬體 . . . . . . . . . . . .
2.1.6.1 Wireless Network Cards
2.1.7 Braille Displays . . . . . . . . . .
2.1.8 Hardware Speech Synthesis . . .
2.1.9 周邊設備與其他硬體 . . . . . . . .
2.2 Devices Requiring Firmware . . . . . . .
2.3 特別為 GNU/Linux 採購硬體 . . . . . . .
2.3.1 避免專有或封閉的硬體 . . . . . .
2.4 安裝媒介 . . . . . . . . . . . . . . . . . .
2.4.1 CD-ROM/DVD-ROM/BD-ROM . . .
2.4.2 USB 隨身碟 . . . . . . . . . . . . .
2.4.3 網路 . . . . . . . . . . . . . . . . .
2.4.4 硬碟 . . . . . . . . . . . . . . . . .
2.4.5 Un*x 或 GNU 系統 . . . . . . . . .
2.4.6 支援的儲存系統 . . . . . . . . . .
2.5 記憶體與硬碟空間的需求 . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
5
. 5
. 5
. 6
. 6
. 6
. 6
. 6
. 6
. 7
. 7
. 7
. 7
. 7
. 7
. 8
. 8
. 9
. 9
. 9
. 9
. 9
. 10
. 10
. 10
3 安裝 Debian GNU/Linux 之前
3.1 安裝概述 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.2 備份您的所有資料! . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.3 一些有用的資料 . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.3.1 文件 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.3.1.1 安裝手冊 . . . . . . . . . . . . . . . . . . . . . . . .
3.3.1.2 硬體文件 . . . . . . . . . . . . . . . . . . . . . . . .
3.3.2 尋找硬體資訊來源 . . . . . . . . . . . . . . . . . . . . . . . .
3.3.3 硬體相容性 . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.3.3.1 Testing hardware compatibility with a Live-System
3.3.4 網路設置 . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.4 滿足最低的硬體要求 . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.5 為多重開機系統事先分割磁碟 . . . . . . . . . . . . . . . . . . . . . .
3.6 安裝前硬體和作業系統的相關設定 . . . . . . . . . . . . . . . . . . .
3.6.1 使用 BIOS 設定選單 . . . . . . . . . . . . . . . . . . . . . . .
3.6.2 選擇開機設備 . . . . . . . . . . . . . . . . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
ii
11
11
12
12
12
12
12
12
13
14
14
15
15
16
16
16
CONTENTS
3.6.3
3.6.4
3.6.5
Systems with UEFI firmware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Disabling the Windows 8 “fast boot”feature . . . . . . . . . . . . . . . . . . . . . 17
需要留意的硬體問題 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4 取得系統安裝媒介
4.1 Official Debian GNU/Linux CD/DVD-ROM Sets . . . . . . . . . . . .
4.2 從 Debian 鏡像伺服器下載檔案 . . . . . . . . . . . . . . . . . . . . .
4.2.1 哪裡能找到安裝映像檔 . . . . . . . . . . . . . . . . . . . . .
4.3 準備從 USB 隨身碟開機的檔案 . . . . . . . . . . . . . . . . . . . . .
4.3.1 Preparing a USB stick using a hybrid CD or DVD image . . .
4.3.2 Manually copying files to the USB stick . . . . . . . . . . . .
4.3.3 Manually copying files to the USB stick —the flexible way .
4.3.3.1 Partitioning the USB stick . . . . . . . . . . . . . .
4.3.3.2 Adding the installer image . . . . . . . . . . . . . .
4.4 準備從硬碟開機的檔案 . . . . . . . . . . . . . . . . . . . . . . . . . .
4.4.1 Hard disk installer booting from Linux using LILO or GRUB
4.4.2 Hard disk installer booting from DOS using loadlin . . . . .
4.5 準備以 TFTP 網路開機用的檔案 . . . . . . . . . . . . . . . . . . . . .
4.5.1 設置 DHCP 伺服器 . . . . . . . . . . . . . . . . . . . . . . . .
4.5.1.1 在 DHCP 設定中打開 PXE 開機功能 . . . . . . . . .
4.5.2 Setting up a BOOTP server . . . . . . . . . . . . . . . . . . .
4.5.3 啟用 TFTP 伺服器 . . . . . . . . . . . . . . . . . . . . . . . .
4.5.4 將 TFTP 映像放到適當的位置 . . . . . . . . . . . . . . . . . .
4.6 自動化安裝 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.6.1 使用 Debian 安裝程式進行自動安裝 . . . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
19
19
19
19
19
20
21
21
21
22
22
22
22
23
23
23
24
25
25
25
25
5 啟動安裝系統
5.1 在 32-bit PC 上啟動安裝程式 . . . . . . . . . . . . . .
5.1.1 從 USB 隨身碟開機 . . . . . . . . . . . . . . . .
5.1.2 從光碟開機 . . . . . . . . . . . . . . . . . . . .
5.1.3 Booting from Windows . . . . . . . . . . . . .
5.1.4 Booting from DOS using loadlin . . . . . . . .
5.1.5 使用 LILO 或 GRUB 啟動 Linux . . . . . . . . .
5.1.6 用 TFTP 開機 . . . . . . . . . . . . . . . . . . .
5.1.6.1 支援 PXE 的網卡或者主機板 . . . . .
5.1.6.2 採用 Network BootROM 的網卡 . . .
5.1.6.3 Etherboot . . . . . . . . . . . . . . .
5.1.7 The Boot Screen . . . . . . . . . . . . . . . . .
5.1.8 The Graphical Installer . . . . . . . . . . . . .
5.2 Accessibility . . . . . . . . . . . . . . . . . . . . . . .
5.2.1 Installer front-end . . . . . . . . . . . . . . . .
5.2.2 USB Braille Displays . . . . . . . . . . . . . . .
5.2.3 Serial Braille Displays . . . . . . . . . . . . . .
5.2.4 Software Speech Synthesis . . . . . . . . . . .
5.2.5 Hardware Speech Synthesis . . . . . . . . . .
5.2.6 Board Devices . . . . . . . . . . . . . . . . . .
5.2.7 High-Contrast Theme . . . . . . . . . . . . . .
5.2.8 Zoom . . . . . . . . . . . . . . . . . . . . . . .
5.2.9 Expert install, rescue mode, automated install
5.2.10 Accessibility of the installed system . . . . . .
5.3 開機參數 . . . . . . . . . . . . . . . . . . . . . . . . .
5.3.1 Boot console . . . . . . . . . . . . . . . . . . .
5.3.2 Debian 安裝程式的參數 . . . . . . . . . . . . .
5.3.3 Using boot parameters to answer questions .
5.3.4 Passing parameters to kernel modules . . . .
5.3.5 Blacklisting kernel modules . . . . . . . . . .
5.4 安裝過程中的障礙排除 . . . . . . . . . . . . . . . . . .
5.4.1 CD-ROM Reliability . . . . . . . . . . . . . . .
5.4.1.1 Common issues . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
26
26
26
26
27
27
27
28
28
28
28
28
29
30
30
30
30
31
31
31
31
31
31
32
32
32
32
34
35
35
35
35
36
iii
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
CONTENTS
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
36
37
37
37
38
38
38
38
6 使用 Debian 安裝程式
6.1 安裝程式如何運作 . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.1.1 Using the graphical installer . . . . . . . . . . . . . . . . . .
6.2 元件介紹 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.3 使用單獨的元件 . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.3.1 啟動 Debian 安裝程式與配置硬體 . . . . . . . . . . . . . . .
6.3.1.1 Check available memory / low memory mode . . .
6.3.1.2 選擇區域化選項 . . . . . . . . . . . . . . . . . . . .
6.3.1.3 選擇鍵盤 . . . . . . . . . . . . . . . . . . . . . . . .
6.3.1.4 尋找 Debian 安裝程式 ISO 映像 . . . . . . . . . . .
6.3.1.5 Configuring the Network . . . . . . . . . . . . . . .
6.3.1.5.1 Automatic network configuration . . . . .
6.3.1.5.2 Manual network configuration . . . . . .
6.3.1.5.3 IPv4 and IPv6 . . . . . . . . . . . . . . . .
6.3.1.6 Configuring the Clock and Time Zone . . . . . . . .
6.3.2 設定使用者和密碼 . . . . . . . . . . . . . . . . . . . . . . . .
6.3.2.1 設定 root 密碼 . . . . . . . . . . . . . . . . . . . . .
6.3.2.2 建立一個普通使用者 . . . . . . . . . . . . . . . . .
6.3.3 分割區與選擇掛載點 . . . . . . . . . . . . . . . . . . . . . . .
6.3.3.1 Supported partitioning options . . . . . . . . . . .
6.3.3.2 Guided Partitioning . . . . . . . . . . . . . . . . . .
6.3.3.3 Manual Partitioning . . . . . . . . . . . . . . . . . .
6.3.3.4 Configuring Multidisk Devices (Software RAID) . .
6.3.3.5 Configuring the Logical Volume Manager (LVM) . .
6.3.3.6 Configuring Encrypted Volumes . . . . . . . . . . .
6.3.4 安裝基本系統 . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.3.5 Installing Additional Software . . . . . . . . . . . . . . . . .
6.3.5.1 Configuring apt . . . . . . . . . . . . . . . . . . . .
6.3.5.1.1 Installing from more than one CD or DVD
6.3.5.1.2 Using a network mirror . . . . . . . . . .
6.3.5.1.3 Choosing a network mirror . . . . . . . .
6.3.5.2 Selecting and Installing Software . . . . . . . . . .
6.3.6 使系統可開機 . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.3.6.1 偵測其他的作業系統 . . . . . . . . . . . . . . . . .
6.3.6.2 安裝 Grub Boot Loader 到硬碟上 . . . . . . . . . .
6.3.6.3 安裝 LILO Boot Loader 到硬碟上 . . . . . . . . . .
6.3.6.4 不使用 boot-loader 繼續進行 . . . . . . . . . . . .
6.3.7 Finishing the Installation . . . . . . . . . . . . . . . . . . . .
6.3.7.1 Setting the System Clock . . . . . . . . . . . . . . .
6.3.7.2 Reboot the System . . . . . . . . . . . . . . . . . .
6.3.8 Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . .
6.3.8.1 保存安裝記錄 . . . . . . . . . . . . . . . . . . . . .
6.3.8.2 使用 Shell 查看記錄 . . . . . . . . . . . . . . . . . .
6.3.9 Installation Over the Network . . . . . . . . . . . . . . . . .
6.4 Loading Missing Firmware . . . . . . . . . . . . . . . . . . . . . . .
6.4.1 Preparing a medium . . . . . . . . . . . . . . . . . . . . . .
6.4.2 Firmware and the Installed System . . . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
40
40
40
41
42
42
42
43
43
44
44
44
44
44
45
45
45
45
46
46
47
48
49
51
51
53
54
54
54
55
55
56
57
57
57
58
58
58
58
58
59
59
59
59
61
61
62
5.4.2
5.4.3
5.4.4
5.4.5
5.4.6
5.4.7
5.4.1.2 How to investigate and maybe solve issues
開機設定 . . . . . . . . . . . . . . . . . . . . . . . . .
Software Speech Synthesis . . . . . . . . . . . . . . .
常見的 32-bit PC 安裝問題 . . . . . . . . . . . . . . .
5.4.4.1 在 PCMCIA 段系統當機 . . . . . . . . . . . .
解讀核心起始資訊 . . . . . . . . . . . . . . . . . . . .
Reporting Installation Problems . . . . . . . . . . . .
回報安裝報告 . . . . . . . . . . . . . . . . . . . . . . .
iv
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
CONTENTS
7 啟動新 Debian 系統
7.1 關鍵時刻 . . . . . . . . . . . .
7.2 Mounting encrypted volumes
7.2.1 Troubleshooting . . . .
7.3 登入 . . . . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
63
63
63
64
64
8 下一步該做什麼
8.1 Shutting down the system . . . . . . . . . . . . . .
8.2 如果您不熟悉 Unix . . . . . . . . . . . . . . . . . . .
8.3 讓您自己轉向 Debian . . . . . . . . . . . . . . . . .
8.3.1 Debian 軟體套件系統 . . . . . . . . . . . . .
8.3.2 Additional Software Available for Debian . .
8.3.3 應用程式版本管理 . . . . . . . . . . . . . . .
8.3.4 任務排程管理 . . . . . . . . . . . . . . . . . .
8.4 更多閱讀資訊 . . . . . . . . . . . . . . . . . . . . . .
8.5 Setting Up Your System To Use E-Mail . . . . . . . .
8.5.1 Default E-Mail Configuration . . . . . . . . .
8.5.2 Sending E-Mails Outside The System . . . .
8.5.3 Configuring the Exim4 Mail Transport Agent
8.6 編譯新核心 . . . . . . . . . . . . . . . . . . . . . . .
8.6.1 核心映像管理 . . . . . . . . . . . . . . . . . .
8.7 Recovering a Broken System . . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
65
65
65
65
65
66
66
66
66
66
67
67
67
68
68
69
A 安裝 Howto
A.1 前言 . . . . . . . . . . . .
A.2 啟動安裝程式 . . . . . . .
A.2.1 光碟 . . . . . . . .
A.2.2 USB 隨身碟 . . . .
A.2.3 透過網路開機 . . .
A.2.4 從硬碟開機 . . . .
A.3 安裝 . . . . . . . . . . . .
A.4 請寄給我們一份安裝報告
A.5 And finally… . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
71
71
71
71
71
72
72
72
73
73
B Automating the installation using preseeding
B.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . .
B.1.1 Preseeding methods . . . . . . . . . . . . . . . . . .
B.1.2 Limitations . . . . . . . . . . . . . . . . . . . . . . . .
B.2 Using preseeding . . . . . . . . . . . . . . . . . . . . . . . .
B.2.1 Loading the preconfiguration file . . . . . . . . . . .
B.2.2 Using boot parameters to preseed questions . . . .
B.2.3 Auto mode . . . . . . . . . . . . . . . . . . . . . . . .
B.2.4 Aliases useful with preseeding . . . . . . . . . . . . .
B.2.5 Using a DHCP server to specify preconfiguration files
B.3 Creating a preconfiguration file . . . . . . . . . . . . . . . .
B.4 Contents of the preconfiguration file (for buster) . . . . . .
B.4.1 Localization . . . . . . . . . . . . . . . . . . . . . . .
B.4.2 Network configuration . . . . . . . . . . . . . . . . .
B.4.3 Network console . . . . . . . . . . . . . . . . . . . . .
B.4.4 Mirror settings . . . . . . . . . . . . . . . . . . . . . .
B.4.5 Account setup . . . . . . . . . . . . . . . . . . . . . .
B.4.6 Clock and time zone setup . . . . . . . . . . . . . . .
B.4.7 Partitioning . . . . . . . . . . . . . . . . . . . . . . . .
B.4.7.1 Partitioning example . . . . . . . . . . . . .
B.4.7.2 Partitioning using RAID . . . . . . . . . . . .
B.4.7.3 Controlling how partitions are mounted . .
B.4.8 Base system installation . . . . . . . . . . . . . . . .
B.4.9 Apt setup . . . . . . . . . . . . . . . . . . . . . . . . .
B.4.10 Package selection . . . . . . . . . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
74
74
74
75
75
75
76
77
78
78
79
80
80
80
82
82
82
83
83
84
85
86
86
87
87
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
v
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
CONTENTS
B.4.11 Boot loader installation . . . . . . . . . . . . . . . .
B.4.12 Finishing up the installation . . . . . . . . . . . . .
B.4.13 Preseeding other packages . . . . . . . . . . . . . .
B.5 Advanced options . . . . . . . . . . . . . . . . . . . . . . .
B.5.1 Running custom commands during the installation
B.5.2 Using preseeding to change default values . . . . .
B.5.3 Chainloading preconfiguration files . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
88
89
89
89
89
90
90
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
92
92
92
93
94
94
95
D 其他
D.1 Linux 裡的設備 . . . . . . . . . . . . . . . . . . . . . . . . . . .
D.1.1 設定您的滑鼠 . . . . . . . . . . . . . . . . . . . . . . . .
D.2 各軟體集所需的磁碟空間 . . . . . . . . . . . . . . . . . . . . .
D.3 透過 Unix/Linux 系統來安裝 Debian GNU/Linux . . . . . . . .
D.3.1 準備開始 . . . . . . . . . . . . . . . . . . . . . . . . . .
D.3.2 安裝 debootstrap . . . . . . . . . . . . . . . . . . . . .
D.3.3 執行 debootstrap . . . . . . . . . . . . . . . . . . . . .
D.3.4 基本系統的設定 . . . . . . . . . . . . . . . . . . . . . .
D.3.4.1 Create device files . . . . . . . . . . . . . . .
D.3.4.2 分割區的掛載 . . . . . . . . . . . . . . . . . .
D.3.4.3 Setting Timezone . . . . . . . . . . . . . . . .
D.3.4.4 網路的設定 . . . . . . . . . . . . . . . . . . . .
D.3.4.5 Configure Apt . . . . . . . . . . . . . . . . . .
D.3.4.6 Configure Locales and Keyboard . . . . . . .
D.3.5 核心的安裝 . . . . . . . . . . . . . . . . . . . . . . . . .
D.3.6 Boot Loader 的設定 . . . . . . . . . . . . . . . . . . . .
D.3.7 Remote access: Installing SSH and setting up access .
D.3.8 Finishing touches . . . . . . . . . . . . . . . . . . . . .
D.4 Installing Debian GNU/Linux over Parallel Line IP (PLIP) . . .
D.4.1 Requirements . . . . . . . . . . . . . . . . . . . . . . .
D.4.2 Setting up source . . . . . . . . . . . . . . . . . . . . .
D.4.3 Installing target . . . . . . . . . . . . . . . . . . . . . .
D.5 Installing Debian GNU/Linux using PPP over Ethernet (PPPoE)
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
96
96
96
97
98
98
98
99
99
100
100
101
101
102
102
102
103
103
104
104
104
104
105
105
E 文案
E.1
E.2
E.3
E.4
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
107
107
107
107
108
C 為 Debian 分割磁區
C.1 決定 Debian 磁區及大小
C.2 目錄樹 . . . . . . . . . .
C.3 建議的分割方案 . . . .
C.4 Linux 裡的裝置名稱 . .
C.5 Debian 分割程式 . . . .
C.5.1 為 32-bit PC 分割
F
關於本文件 .
幫助本文件 .
主要貢獻人員
商標確認 . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
GNU General Public License(此許可証只有英文原文具有法律效力)
109
F.1 Preamble . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
F.2 GNU GENERAL PUBLIC LICENSE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
F.3 How to Apply These Terms to Your New Programs . . . . . . . . . . . . . . . . . . . . . . . 112
vi
List of Tables
3 安裝 Debian GNU/Linux 之前
3.1 Hardware Information Helpful for an Install . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.2 建議的最低系統需求 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
vii
Abstract
This document contains installation instructions for the Debian GNU/Linux 10 system (codename
“buster”), for the 32-bit PC (“i386”) architecture. It also contains pointers to more information and
information on how to make the most of your new Debian system.
警告
This translation of the installation guide is not up-to-date and currently there
is noone actively working on updating it. Keep this in mind when reading it; it
may contain outdated or wrong information. Read or double-check the English
variant, if in doubt. If you can help us with updating the translation, please
contact debian-boot@lists.debian.org or the debian-l10n-xxx mailinglist for this
language. Many thanks
在 i386 架構上安裝 Debian GNU/Linux 10
我們非常高興您決定嘗試 Debian,並確信您將發現 Debian 的 GNU/Linux 發行套件是獨一無二的。
Debian
GNU/Linux 集合了來自世界各地的高品質自由軟體,並將它們緊密的整合在一起。您會發現整合後的效
果比單純的程式集合還要更好。
我們瞭解大多數使用者都希望跳過閱讀本手冊的步驟並直接安裝 Debian,Debian 安裝程式就是為了
實現這個想法而設計的。如果您沒有時間來閱讀整個安裝指南,我們建議您看看 Installation Howto 一
文。該文包含了基本安裝過程的簡要介紹,以及安裝過程中遇到錯誤或需要更深入的內容時連向本手冊
可用鏈結。Installation Howto 一文請參閱附錄 A。
正如前面所說的,我們還是希望您能抽出時間來閱讀本手冊的大部分內容。這通常能讓您的安裝體驗
更詳盡、更成功。
ix
Chapter 1
歡迎使用 Debian
本 章 將 簡 要 介 紹 Debian 計 畫 和 Debian GNU/Linux。 如 果 您 已 經 對 Debian 計 畫 的 歷 史 和 Debian
GNU/Linux 發行套件有一定的瞭解,您可略過本章。
1.1
什麼是 Debian?
Debian is an all-volunteer organization dedicated to developing free software and promoting the ideals
of the Free Software community. The Debian Project began in 1993, when Ian Murdock issued an open
invitation to software developers to contribute to a complete and coherent software distribution based
on the relatively new Linux kernel. That relatively small band of dedicated enthusiasts, originally funded
by the Free Software Foundation and influenced by the GNU philosophy, has grown over the years into
an organization of around 1062 Debian Developers.
Debian 開發人員所做的工作包括有:網站和 FTP 站台管理、圖形設計、軟體許可證的法律分析、編
寫文件、當然,還有維護軟體套件。
為了傳遞我們的理念並吸引那些與 Debian 有著相同信仰的開發人員,Debian 計劃發表了許多文件來
闡明我們的價值觀和成為 Debian 開發人員的意義。
• Debian 社群契約是一份 Debian 對自由軟體社群的承諾聲明。任何同意遵守此社群契約的人都可以
成為維護人員。任何維護人員都能將新軟體引入 Debian —條件是此軟體必須滿足我們對「自由」
的衡量尺度,並且必須符合我們的品質標準。
• Debian 自由軟體準則 (Debian Free Software Guidelines)是 Debian 對於自由軟體標準的聲明,該
聲明清晰而簡潔。在自由軟體運動中,DFSG 是一份非常有影響力的文件,開放源代碼定義 (The
Open Source Definition)便是以 DFSG 為基礎所衍生而出。
• Debian 政策文件 (Debian Policy Manual)是一份有關 Debian 計畫中品質標準的規格說明書。
Debian 開發人員還參與了其他許多計畫。有些是針對 Debian 的,另外則是關於 Linux 社群的。例如:
• Linux 標準基礎 (Linux Standard Base, LSB) 是一個針對基本 GNU/Linux 系統標準化的計畫,它將
使第三方軟體和硬體開發者能更容易的為「通用 Linux」設計應用程式和驅動程式,而不僅僅是為
某個特定的 GNU/Linux 發行套件進行開發。
• 檔案系統架構標準 (Filesystem Hierarchy Standard, FHS) 則是朝 Linux 檔案系統架構標準化的方向
努力。FHS 將使軟體開發者能集中精力於程式設計,而不需要擔心軟體套件在不同的 GNU/Linux 發
行套件下要如何安裝。
• Debian Jr. 是一個內部計畫,目標是確保 Debian 能向年幼的使用者提供一些有用的東西。
關於 Debian 的更多資訊,請參考 Debian 常見問答集。
1.2
什麼是 GNU/Linux?
Linux 是一種作業系統:一系列能讓您與電腦互動並且執行其他程式的程式
作業系統由許多基礎程式組成,它們是讓電腦接受使用者指令並與之溝通的必要程式;讀取資料或
將其寫入硬碟、磁帶或印表機;控制記憶體的使用;以及執行其它軟體。作業系統最重要的部分是核心。
1
CHAPTER 1. 歡迎使用 DEBIAN
1.3. 什麼是 DEBIAN GNU/LINUX?
在 GNU/Linux 系統中,就是以 Linux 為核心。而系統的其他部分則是由其他程式組成,這些程式主要由
GNU 計畫所提供,或者是針對 GNU 計畫所編寫的。因為單獨的 Linux 核心不能成為一個可以正常工作
的作業系統,所以我們更傾向使用“GNU/Linux”一詞來表達人們常用的“Linux”。
Linux 是以 Unix 作業系統為原型。從一開始,它就被設計為一個多工、多使用者的系統。這些特點使
Linux 不同於其它著名的作業系統。事實上,Linux 比您所能想像的更加不同。相對於其他作業系統,沒
人真正擁有 Linux,大部分的開發工作都是由無酬償的志願者完成。
Development of what later became GNU/Linux began in 1984, when the Free Software Foundation
began development of a free Unix-like operating system called GNU.
The GNU Project has developed a comprehensive set of free software tools for use with Unix™ and
Unix-like operating systems such as Linux. These tools enable users to perform tasks ranging from
the mundane (such as copying or removing files from the system) to the arcane (such as writing and
compiling programs or doing sophisticated editing in a variety of document formats).
雖然有許多組織和個人都為 Linux 的發展做出貢獻,但是自由軟體基金會依然是最大的貢獻者。他不
僅僅創造了絕大部分在 Linux 中使用的工具,還為 Linux 的存在提供了理論和社會基礎。
Linux 核心 (kernel) 的首次面世是在 1991 年。當時,名為 Linus Torvalds 的芬蘭資訊科學系學
生在 Usenet 新聞群組 comp.os.minix 上發佈了一種替代 Minix 核心的早期版本。請參考 Linux
International 的 Linux 歷史。
Linus Torvalds continues to coordinate the work of several hundred developers with the help of a
number of subsystem maintainers. There is an official website for the Linux kernel. Information about
the linux-kernel mailing list can be found on the linux-kernel mailing list FAQ.
Linux 使用者在挑選軟體方面有著極大的自由。例如,Linux 使用者可以選擇幾十種不同的命令列介
殼 (shell) 和多種圖形桌面。這通常讓其它作業系統的使用者手足無措,他們可能從來沒想過命令列和桌
面其實是可以更換的。
Linux 很少會當機、適合在同一時間執行多個程式,而且比大多數作業系統更為安全。有了這些優勢,
Linux 在伺服器市場成為成長最快的作業系統。近來,它還開始在家庭和商業使用者之間變得越來越流行。
1.3
什麼是 Debian GNU/Linux?
Debian GNU/Linux 是將 Debian 哲學與方法論、GNU 工具集、Linux 核心,以及其他重要的自由軟體結
合在一起所構成的獨特的軟體發行套件。該發行套件由大量的軟體套件組成。發行套件中的每個軟體套
件都包含了執行檔、腳本、文件和設定資訊,並且擁有一位維護者,其主要職責是保持軟體套件更新、追
蹤臭蟲報告,並與軟體原作者保持聯絡。我們龐大的使用者群與臭蟲追蹤系統的結合可以確保問題被及
時發現和修復。
Debian 對細節的注重使我們可以生產出高品質、穩定和靈活的發行套件。經過簡單的設定後,可以
安裝並應用到各種場合,從精簡的防火牆到桌面科學工作站,甚至高級網路伺服器。
Debian 在進階使用者中非常流行的原因在於它具有優秀的技術,而且它對 Linux 的深入貢獻滿足了
社群的需求與期望。現今,Debian 為 Linux 引入的許多特色已經成為非常通用的標準。
例如,Debian 是第一個使用套件管理系統的 Linux 發行套件,它讓安裝和刪除軟體變得容易。而且它
還是第一個可以不用重新安裝就能升級的 Linux 發行套件。
Debian 一直是 Linux 開發的領導者。它的開發過程是開放原始碼開開發模式的範例—即使是用於建
立和維護一個完整作業系統這樣複雜的任務。
Debian 與其他 Linux 發行套件最大的不同之處在於套件管理系統的特性。這些工具讓 Debian 系統管
理員能夠完全控制安裝到系統上的軟體套件,包括安裝單一軟體套件和自動升級整個作業系統;個別軟
體套件也可以被保護而不被升級。您甚至可以告訴套件管理系統哪些軟體是您自己編譯的以及它們對其
他軟體套件的依賴關係。
為了提防“特洛伊木馬”和其他惡意軟體以保護您的系統,Debian 伺服器會驗證由在 Debian 註冊的
維護人員所上傳的軟體套件。Debian 的套件打包人員也會特別注意以安全的方式配置軟體套件。當發佈
出去的軟體套件有安全問題時,通常會很快被修復。透過 Debian 的簡易更新選項,可以從網際網路自動
下載和安裝各項安全更新。
為您的 Debian GNU/Linux 系統尋求技術支援和聯絡 Debian 開發人員,最主要、也是最好的方法是
透過 Debian 計畫的通信論壇 (撰寫本文時已有 283 個通信論壇) 進行溝通。訂閱這些論壇的最簡單方法
是透過 Debian 通訊論壇訂閱網頁並填寫相關表單。
1.4
What is Debian GNU/kFreeBSD?
Debian GNU/kFreeBSD is a Debian GNU system with the kFreeBSD kernel.
2
CHAPTER 1. 歡迎使用 DEBIAN
1.5. 什麼是 DEBIAN GNU/HURD?
This port of Debian is currently only being developed for the i386 and amd64 architectures, although
ports to other architectures is possible.
Please note that Debian GNU/kFreeBSD is not a Linux system, and thus some information on Linux
system may not apply to it.
For more information, see the Debian GNU/kFreeBSD ports page and the debian-bsd@lists.debian.
org mailing list.
1.5
什麼是 Debian GNU/Hurd?
Debian GNU/Hurd is a Debian GNU system with the GNU Hurd —a set of servers running on top of the
GNU Mach microkernel.
The Hurd is still unfinished, and is unsuitable for day-to-day use, but work is continuing. The Hurd
is currently only being developed for the i386 architecture, although ports to other architectures will
be made once the system becomes more stable.
Please note that Debian GNU/Hurd is not a Linux system, and thus some information on Linux
system may not apply to it.
請參閱 Debian GNU/Hurd 移植網頁以及 debian-hurd@lists.debian.org 通信論壇來取得更多資訊。
1.6
取得 Debian
關於如何從網際網路上下載 Debian GNU/Linux 或者從何購買官方 Debian 光碟的資訊,請參閱 發行網
頁。Debian 鏡像列表包含完整的 Debian 官方鏡像站,您可以很容易找到最近的一個。
Debian 在安裝之後可以很容易的升級。如果有需要,安裝步驟將幫助您建立系統,使您可以在安裝
之後立即進行升級。
1.7
取得本文件最新版本
本文件會不斷地修訂。請查閱 Debian 10 網頁 以瞭解最新的 10 版 Debian GNU/Linux 系統相關資訊。更
新的安裝手冊也可以從官方安裝手冊網頁取得。
1.8
本文架構
本文件意在成為 Debian 新手的使用手冊。儘管它已經盡量對您的的專業知識水平做最少的假設,但我們
還是假設您對電腦硬體的工作方式有基本的瞭解。
專業使用者也可以在本手冊中找到一些有趣的參考資訊,包括最小安裝所需的空間,Debian 安裝程
式支援的硬體細節等等。我們鼓勵專業使用者選擇性的瀏覽本文件。
基本上,本手冊內容以線性鋪陳,從開始安裝帶領您到安裝結束。以下是安裝 Debian GNU/Linux 的
步驟,以及每步驟相關的章節:
1. 確定您的硬體是否滿足安裝系統的要求,請參考章 2。
2. 備份您的系統,並且在安裝 Debian 之前進行必要的規劃和硬體配置,請參考章 3。如果您需要多
重開機於不同的作業系統,您可能需要為 Debian 建立硬碟分割區。
3. 您所選擇的安裝方式所需要的安裝文件章 4 取得。
4. The next 章 5 describes booting into the installation system. This chapter also discusses troubleshooting procedures in case you have problems with this step.
5. Perform the actual installation according to 章 6. This involves choosing your language, configuring peripheral driver modules, configuring your network connection, so that remaining installation files can be obtained directly from a Debian server (if you are not installing from a CD/DVD
set), partitioning your hard drives and installation of a base system, then selection and installation
of tasks. (Some background about setting up the partitions for your Debian system is explained
in 附錄 C.)
6. Boot into your newly installed base system, from 章 7.
3
CHAPTER 1. 歡迎使用 DEBIAN
1.9. 歡迎為此文件提供幫助
當系統安裝完成,您可以閱讀章 8。該章節將解釋在哪裡尋找更多有關 Unix 和 Debian 的資訊,以及
如何更換您的核心。
最後,是關於本文件的資訊以及您可以如何對此做出貢獻,請參考附錄 E。
1.9
歡迎為此文件提供幫助
對於任何幫助、建議,特別是補丁,我們都非常感謝。本文件的開發中版本位於 http://d-i.alioth.
debian.org/manual/。在那裡,您可以看到所有本文件對不同語言以及硬體架構的版本列表。
本文件的原始檔也是公開的。請參考附錄 E 以瞭解如何貢獻您的心力。我們歡迎建議,批評,補丁和
錯誤報告 (請以對 installation-guide 軟體套件為名提出臭蟲報告,但是請先檢查該問題是否已經
被提出)。
1.10
關於版權與軟體協議
我們相信您曾經閱讀過一些商業軟體的授權—它們通常要求您只能在一台電腦上使用一份軟體拷貝。本
系統所使用的授權與它們完全不同。我們鼓勵您在學校或商業機構的每台電腦上安裝本系統。將安裝媒
介借給朋友,並幫助他們安裝到電腦上!您甚至可以製造上千份的拷貝,然後將之出售—儘管這會有一
些限制。您安裝和使用系統的自由權利是因為 Debian 乃基於自由軟體的緣故。
Calling software free doesn’t mean that the software isn’t copyrighted, and it doesn’t mean that
CDs/DVDs containing that software must be distributed at no charge. Free software, in part, means that
the licenses of individual programs do not require you to pay for the privilege of distributing or using
those programs. Free software also means that not only may anyone extend, adapt, and modify the
software, but that they may distribute the results of their work as well.
注
The Debian project, as a pragmatic concession to its users, does make some
packages available that do not meet our criteria for being free. These packages
are not part of the official distribution, however, and are only available from
the contrib or non-free areas of Debian mirrors or on third-party CD/DVDROMs; see the Debian FAQ, under “The Debian FTP archives”, for more information about the layout and contents of the archives.
系統中很多軟體所使用的許可證是 GNU General Public License(通用公共許可證),通常簡稱為“GPL”
。
GPL 要求您將程式的 原始碼隨著二進位拷貝一起發佈﹔許可證的這項規定確保任何使用者都可以修改軟
體。正是由於此規定,所有這類程式的原始碼1 都可以在 Debian 系統中取得。
Debian 中的程式還使用許多其他形式的版權聲明和軟體許可證。您可以在您的系統中找到每個軟體
套件相關的版權和許可證,它們位於 /usr/share/doc/軟體套件名/copyright ,這些文件在您將軟
體套件安裝到系統後就存在了。
Debian 如何判斷軟體是否足夠自由到可以包括在主發行套件中的資訊,請參考 Debian 自由軟軟體準
則。
在此,最重要的法律聲明是此軟體 無擔保。程式設計創造此軟體為的是使社群受益,而不能保證軟體
適用於任何特定用途。但是,因為軟體是自由的,您可以修改此軟體以使其能適用於您的需要—並享用
其他人透過這種途徑擴充修改後的成果。
1 關於如何從 Debian 原始碼套件中尋找、解開以及建立二進位檔的資訊,請參閱“Debian 軟體套件管理系統入門”中的Debian
FAQ。
4
Chapter 2
系統需求
本章包括運作 Debian 所需硬體的資訊。您還能找到更多有關 GNU 和 Linux 所支援硬體的超鏈結資訊。
2.1
支援的硬體
Debian does not impose hardware requirements beyond the requirements of the Linux or kFreeBSD
kernel and the GNU tool-sets. Therefore, any architecture or platform to which the Linux or kFreeBSD
kernel, libc, gcc, etc. have been ported, and for which a Debian port exists, can run Debian. Please
refer to the Ports pages at http://www.debian.org/ports/i386/ for more details on 32-bit PC
architecture systems which have been tested with Debian GNU/Linux.
本章僅包含一些通用的資訊以及在何處可以取得更多資訊的指引,而不試圖列出所有支援 32-bit PC
的硬體配置。
2.1.1 支援的硬體架構
Debian GNU/Linux 10 supports ten major architectures and several variations of each architecture
known as “flavors”.
架構
Debian 命名
Intel x86-based
i386
AMD64 & Intel 64
amd64
ARM
ARM with hardware
FPU
64bit ARM
32bit MIPS
(big-endian)
子架構
default x86 machines
Xen PV domains only
風味
default
xen
armel
Marvell Kirkwood and
Orion
marvell
armhf
multiplatform
armmp
MIPS Malta
Cavium Octeon
MIPS Malta
Cavium Octeon
Loongson 3
MIPS Malta
Cavium Octeon
Loongson 3
IBM POWER8 or
newer machines
IPL from VM-reader
and DASD
4kc-malta
octeon
5kc-malta
octeon
loongson-3
4kc-malta
octeon
loongson-3
arm64
mips
64bit MIPS
(little-endian)
mips64el
32bit MIPS
(little-endian)
mipsel
Power Systems
ppc64el
64bit IBM S/390
s390x
generic
This document covers installation for the 32-bit PC architecture using the Linux kernel. If you are
looking for information on any of the other Debian-supported architectures take a look at the DebianPorts pages.
5
CHAPTER 2. 系統需求
2.1. 支援的硬體
2.1.2 中央處理器,主機板和顯示的支援
被支援的周邊設備資訊可以在 Linux Hardware Compatibility HOWTO 中找到。本節只是基本的概況。
2.1.2.1
中央處理器
Nearly all x86-based (IA-32) processors still in use in personal computers are supported. This also
includes 32-bit AMD and VIA (former Cyrix) processors, and processors like the Athlon XP and Intel P4
Xeon.
However, Debian GNU/Linux buster will not run on 586 (Pentium) or earlier processors.
注
If your system has a 64-bit processor from the AMD64 or Intel 64 families, you
will probably want to use the installer for the amd64 architecture instead of the
installer for the (32-bit) i386 architecture.
2.1.2.2
I/O 匯流排
The system bus is the part of the motherboard which allows the CPU to communicate with peripherals
such as storage devices. Your computer must use the PCI, PCIe, or PCI-X bus. Essentially all personal
computers sold in recent years use one of these.
2.1.3 筆記型電腦
From a technical point of view, laptops are normal PCs, so all information regarding PC systems applies
to laptops as well. Installations on laptops nowadays usually work out of the box, including things like
automatically suspending the system on closing the lid and laptop specfic hardware buttons like those
for disabling the wifi interfaces (“airplane mode”). Nonetheless sometimes the hardware vendors use
specialized or proprietary hardware for some laptop-specific functions which might not be supported.
To see if your particular laptop works well with GNU/Linux, see for example the Linux Laptop pages.
2.1.4 多處理器
Multiprocessor support —also called“symmetric multiprocessing”or SMP —is available for this architecture. The standard Debian 10 kernel image has been compiled with SMP-alternatives support. This
means that the kernel will detect the number of processors (or processor cores) and will automatically
deactivate SMP on uniprocessor systems.
Having multiple processors in a computer was originally only an issue for high-end server systems
but has become common in recent years nearly everywhere with the introduction of so called “multicore”processors. These contain two or more processor units, called “cores”, in one physical chip.
2.1.5 Graphics Hardware Support
Debian’s support for graphical interfaces is determined by the underlying support found in X.Org’s
X11 system, and the kernel. Basic framebuffer graphics is provided by the kernel, whilst desktop environments use X11. Whether advanced graphics card features such as 3D-hardware acceleration or
hardware-accelerated video are available, depends on the actual graphics hardware used in the system
and in some cases on the installation of additional “firmware”images (see 節 2.2).
On modern PCs, having a graphical display usually works out of the box. In very few cases there have
been reports about hardware on which installation of additional graphics card firmware was required
even for basic graphics support, but these have been rare exceptions. For quite a lot of hardware, 3D
acceleration also works well out of the box, but there is still some hardware that needs binary blobs to
work well.
Details on supported graphics hardware and pointing devices can be found at http://xorg.
freedesktop.org/. Debian 10 ships with X.Org version 7.7.
6
CHAPTER 2. 系統需求
2.2. DEVICES REQUIRING FIRMWARE
2.1.6 網路連接硬體
Almost any network interface card (NIC) supported by the Linux kernel should also be supported by
the installation system; drivers should normally be loaded automatically. This includes most PCI/PCIExpress cards as well as PCMCIA/Express Cards on laptops. Many older ISA cards are supported as
well.
ISDN is supported, but not during the installation.
2.1.6.1
Wireless Network Cards
Wireless networking is in general supported as well and a growing number of wireless adapters are
supported by the official Linux kernel, although many of them do require firmware to be loaded.
If firmware is needed, the installer will prompt you to load firmware. See 節 6.4 for detailed information on how to load firmware during the installation.
Wireless NICs that are not supported by the official Linux kernel can generally be made to work
under Debian GNU/Linux, but are not supported during the installation.
If there is a problem with wireless and there is no other NIC you can use during the installation, it
is still possible to install Debian GNU/Linux using a full CD-ROM or DVD image. Select the option to not
configure a network and install using only the packages available from the CD/DVD. You can then install
the driver and firmware you need after the installation is completed (after the reboot) and configure
your network manually.
In some cases the driver you need may not be available as a Debian package. You will then have
to look if there is source code available in the internet and compile the driver yourself. How to do
this is outside the scope of this manual. If no Linux driver is available, your last resort is to use the
ndiswrapper package, which allows you to use a Windows driver.
2.1.7 Braille Displays
Support for braille displays is determined by the underlying support found in brltty. Most displays
work under brltty, connected via either a serial port, USB or bluetooth. Details on supported braille
devices can be found on the brltty website. Debian GNU/Linux 10 ships with brltty version 5.4.
2.1.8 Hardware Speech Synthesis
Support for hardware speech synthesis devices is determined by the underlying support found in spe
akup. speakup only supports integrated boards and external devices connected to a serial port (no
USB, serial-to-USB or PCI adapters are supported). Details on supported hardware speech synthesis
devices can be found on the speakup website. Debian GNU/Linux 10 ships with speakup version
3.1.6.
2.1.9 周邊設備與其他硬體
Linux supports a large variety of hardware devices such as mice, printers, scanners, PCMCIA/CardBus/ExpressCard and USB devices. However, most of these devices are not required while installing the
system.
USB hardware generally works fine. On some very old PC systems some USB keyboards may require additional configuration (see 節 3.6.5). On modern PCs, USB keyboards and mice work without
requiring any specific configuration.
2.2
Devices Requiring Firmware
Besides the availability of a device driver, some hardware also requires so-called firmware or microcode
to be loaded into the device before it can become operational. This is most common for network interface cards (especially wireless NICs), but for example some USB devices and even some hard disk
controllers also require firmware. With many graphics cards, basic functionality is available without
additional firmware, but the use of advanced features requires an appropriate firmware file to be installed in the system.
7
CHAPTER 2. 系統需求
2.3. 特別為 GNU/LINUX 採購硬體
On many older devices which require firmware to work, the firmware file was permanently placed
in an EEPROM/Flash chip on the device itself by the manufacturer. Nowadays most new devices do not
have the firmware embedded this way anymore, so the firmware file must be uploaded into the device
by the host operating system every time the system boots.
In most cases firmware is non-free according to the criteria used by the Debian GNU/Linux project
and thus cannot be included in the main distribution or in the installation system. If the device driver
itself is included in the distribution and if Debian GNU/Linux legally can distribute the firmware, it will
often be available as a separate package from the non-free section of the archive.
However, this does not mean that such hardware cannot be used during an installation. Starting
with Debian GNU/Linux 5.0, debian-installer supports loading firmware files or packages containing firmware from a removable medium, such as a USB stick. See 節 6.4 for detailed information on
how to load firmware files or packages during the installation.
If the debian-installer prompts for a firmware file and you do not have this firmware file available or do not want to install a non-free firmware file on your system, you can try to proceed without
loading the firmware. There are several cases where a driver prompts for additional firmware because
it may be needed under certain circumstances, but the device does work without it on most systems
(this e.g. happens with certain network cards using the tg3 driver).
2.3
特別為 GNU/Linux 採購硬體
There are several vendors, who ship systems with Debian or other distributions of GNU/Linux preinstalled. You might pay more for the privilege, but it does buy a level of peace of mind, since you can
be sure that the hardware is well-supported by GNU/Linux.
If you do have to buy a machine with Windows bundled, carefully read the software license that
comes with Windows; you may be able to reject the license and obtain a rebate from your vendor.
Searching the Internet for “windows refund”may get you some useful information to help with that.
無論是購買一個搭配 Linux 販售的系統,還是一個已經用過的系統,檢查 Linux 核心是否支援您的
硬體仍然很重要。請檢查您的硬體是否出現在上面的參考資料中。讓推銷員 (或者其他人) 知道您是在為
Linux 系統採購設備。請支援對 Linux 友好的硬體銷售商。
2.3.1 避免專有或封閉的硬體
Some hardware manufacturers simply won’t tell us how to write drivers for their hardware. Others
won’t allow us access to the documentation without a non-disclosure agreement that would prevent
us from releasing the driver’s source code, which is one of the central elements of free software.
Since we haven’t been granted access to usable documentation on these devices, they simply won’t
work under Linux.
In many cases there are standards (or at least some de-facto standards) describing how an operating
system and its device drivers communicate with a certain class of devices. All devices which comply to
such a (de-facto-)standard can be used with a single generic device driver and no device-specific drivers
are required. With some kinds of hardware (e.g. USB “Human Interface Devices”, i.e. keyboards,
mice, etc., and USB mass storage devices like USB flash disks and memory card readers) this works
very well and practically every device sold in the market is standards-compliant.
In other fields, among them e.g. printers, this is unfortunately not the case. While there are many
printers which can be addressed via a small set of (de-facto-)standard control languages and therefore
can be made to work without problems in any operating system, there are quite a few models which
only understand proprietary control commands for which no usable documentation is available and
therefore either cannot be used at all on free operating systems or can only be used with a vendorsupplied closed-source driver.
Even if there is a vendor-provided closed-source driver for such hardware when purchasing the
device, the practical lifespan of the device is limited by driver availability. Nowadays product cycles
have become short and it is not uncommon that a short time after a consumer device has ceased
production, no driver updates get made available any more by the manufacturer. If the old closedsource driver does not work anymore after a system update, an otherwise perfectly working device
becomes unusable due to lacking driver support and there is nothing that can be done in this case. You
should therefore avoid buying closed hardware in the first place, regardless of the operating system
you want to use it with.
8
CHAPTER 2. 系統需求
2.4. 安裝媒介
You can help improve this situation by encouraging manufacturers of closed hardware to release
the documentation and other resources necessary for us to provide free drivers for their hardware.
2.4
安裝媒介
This section will help you determine which different media types you can use to install Debian. There is
a whole chapter devoted to media, 章 4, which lists the advantages and disadvantages of each media
type. You may want to refer back to this page once you reach that section.
2.4.1 CD-ROM/DVD-ROM/BD-ROM
注
Whenever you see“CD-ROM”in this manual, it applies to all of CD-ROMs, DVDROMs and BD-ROMs, because all these technologies are really the same from
the operating system’s point of view.
CD-ROM based installation is supported for most architectures.
On PCs SATA, IDE/ATAPI, USB and SCSI CD-ROMs are supported, as are FireWire devices that are
supported by the ohci1394 and sbp2 drivers.
2.4.2 USB 隨身碟
USB flash disks a.k.a. USB memory sticks have become a commonly used and cheap storage device.
Most modern computer systems also allow booting the debian-installer from such a stick. Many
modern computer systems, in particular netbooks and thin laptops, do not have a CD/DVD-ROM drive
anymore at all and booting from USB media is the standard way of installing a new operating system
on them.
2.4.3 網路
The network can be used during the installation to retrieve files needed for the installation. Whether
the network is used or not depends on the installation method you choose and your answers to certain
questions that will be asked during the installation. The installation system supports most types of network connections (including PPPoE, but not ISDN or PPP), via either HTTP or FTP. After the installation
is completed, you can also configure your system to use ISDN and PPP.
You can also boot the installation system over the network without needing any local media like
CDs/DVDs or USB sticks. If you already have a netboot-infrastructure available (i.e. you are already
running DHCP and TFTP services in your network), this allows an easy and fast deployment of a large
number of machines. Setting up the necessary infrastructure requires a certain level of technical experience, so this is not recommended for novice users.
無磁碟安裝;使用網路從區域網路開機,並使用 NFS 掛載所有的本地檔案系統是另一種選擇。
2.4.4 硬碟
Booting the installation system directly from a hard disk is another option for many architectures. This
will require some other operating system to load the installer onto the hard disk. This method is only
recommended for special cases when no other installation method is available.
9
CHAPTER 2. 系統需求
2.5. 記憶體與硬碟空間的需求
2.4.5 Un*x 或 GNU 系統
If you are running another Unix-like system, you could use it to install Debian GNU/Linux without using
the debian-installer described in the rest of this manual. This kind of install may be useful for
users with otherwise unsupported hardware or on hosts which can’t afford downtime. If you are
interested in this technique, skip to the 節 D.3. This installation method is only recommended for
advanced users when no other installation method is available.
2.4.6 支援的儲存系統
The Debian installer contains a kernel which is built to maximize the number of systems it runs on.
Generally, the Debian installation system includes support for IDE (also known as PATA) drives, SATA
and SCSI controllers and drives, USB, and FireWire. The supported file systems include FAT, Win-32 FAT
extensions (VFAT) and NTFS.
2.5
記憶體與硬碟空間的需求
You must have at least 135MB of memory and 780MB of hard disk space to perform a normal installation. Note that these are fairly minimal numbers. For more realistic figures, see 節 3.4.
Installation on systems with less memory1 or disk space available may be possible but is only advised for experienced users.
1 Installation images that support the graphical installer require more memory than images that support only the textual
installer and should not be used on systems with less than 135MB of memory. If there is a choice between booting the text-based
and the graphical installer, the former should be selected on such systems.
10
Chapter 3
安裝 Debian GNU/Linux 之前
本章用於處理在開機安裝程式以安裝 Debian 之前的準備工作。這包括備份您的資料,搜集您的硬體資
訊,以及取得其他一些必要的資料。
3.1
安裝概述
首先,提一下關於重新安裝的事情。使用 Debian 時,必須進行完全重新安裝的情況非常少見,可能導致
這種情況的大多是硬碟的物理故障。
許多常見的作業系統在遇到嚴重錯誤或者要升級到新的版本時,必須進行重新安裝。就算不需要完全
重新安裝,您通常還得把您的應用程式在新系統裡也再重新安裝一遍才行。
在 Debian GNU/Linux 裡,如果作業系統遇到錯誤,大多數的時候您都能把它修復而不用重新安裝。
在這裡,升級不再需要進行大規模的安裝動作,您可以就地升級它,而這些程式也總能和新版的作業系
統和平共處。如果一個程式的新版本需要其他程式的更新來支援它,Debian 軟體套件管理系統會自動幫
您把所有必須的軟體一併安裝上。關鍵是,Debian 為了避免重新安裝而做了大量努力,所以您盡可以不
用去煩心這些問題:我們的安裝程式不是設計來重裝您的舊系統的。
以下將帶領您走過安裝過程的每個步驟:
1. 把將要用來安裝系統的硬碟上的所有資料或者文件都備份下來﹔
2. 在開始安裝之前,收集您電腦的硬體資料和可能會用到的文件﹔
3. Locate and/or download the installer software and any specialized driver or firmware files your
machine requires.
4. Set up boot media such as CDs/DVDs/USB sticks or provide a network boot infrastructure from
which the installer can be booted.
5. 開機安裝系統﹔
6. Select the installation language.
7. 如果可能,啟用網路連結﹔
8. If necessary, resize existing partitions on your target harddisk to make space for the installation.
9. 建立並掛載用來安裝 Debian 的分割區﹔
10. 等待自動化的下載、安裝和設置基本系統。
11. 安裝 boot loader,它負責開機 Debian GNU/Linux 和 (或) 已有的其他系統。
12. Load the newly installed system for the first time.
For 32-bit PC you have the option of using a graphical version of the installation system. For more
information about this graphical installer, see 節 5.1.8.
如果您在安裝過程中遇到問題,下面的資訊可以幫助您找到每個步驟裡牽涉到的軟體套件。有關這場
安裝「戲劇」的「主角」的介紹:
The installer software, debian-installer, is the primary concern of this manual. It detects
hardware and loads appropriate drivers, uses dhcp-client to set up the network connection, runs
11
CHAPTER 3. 安裝 DEBIAN GNU/LINUX 之前
3.2. 備份您的所有資料!
debootstrap to install the base system packages, and runs tasksel to allow you to install certain
additional software. Many more actors play smaller parts in this process, but debian-installer has
completed its task when you load the new system for the first time.
To tune the system to your needs, tasksel allows you to choose to install various predefined
bundles of software like a Web server or a Desktop environment.
One important option during the installation is whether or not to install a graphical desktop environment, consisting of the X Window System and one of the available graphical desktop environments.
If you choose not to select the“Desktop environment”task, you will only have a relatively basic, command line driven system. Installing the Desktop environment task is optional because in relation to a
text-mode-only system it requires a comparatively large amount of disk space and because many Debian GNU/Linux systems are servers which don’t really have any need for a graphical user interface
to do their job.
Just be aware that the X Window System is completely separate from debian-installer, and in
fact is much more complicated. Troubleshooting of the X Window System is not within the scope of
this manual.
3.2
備份您的所有資料!
Before you start, make sure to back up every file that is now on your system. If this is the first time a
non-native operating system is going to be installed on your computer, it is quite likely you will need to
re-partition your disk to make room for Debian GNU/Linux. Anytime you partition your disk, you run
a risk of losing everything on the disk, no matter what program you use to do it. The programs used
in the installation are quite reliable and most have seen years of use; but they are also quite powerful
and a false move can cost you. Even after backing up, be careful and think about your answers and
actions. Two minutes of thinking can save hours of unnecessary work.
If you are creating a multi-boot system, make sure that you have the distribution media of any
other present operating systems on hand. Even though this is normally not necessary, there might be
situations in which you could be required to reinstall your operating system’s boot loader to make
the system boot or in a worst case even have to reinstall the complete operating system and restore
your previously made backup.
3.3
一些有用的資料
3.3.1 文件
3.3.1.1
安裝手冊
The document you are now reading, which is a development version of the Installation Guide for the
next release of Debian; available in various formats and translations.
3.3.1.2
硬體文件
通常包含設置和使用您的硬體的實用資料。
• The Debian Wiki hardware page
3.3.2 尋找硬體資訊來源
許多情況下,安裝程式能自動檢測您的硬體。但作為預備,我們建議您還是在安裝之前熟悉一下您的硬
體比較好。
取得硬體資料的途徑有:
• 每個硬體附帶的手冊。
• The BIOS setup screens of your computer. You can view these screens when you start your computer by pressing a combination of keys. Check your manual for the combination. Often, it is
the Delete or the F2 key, but some manufacturers use other keys or key combinations. Usually
12
CHAPTER 3. 安裝 DEBIAN GNU/LINUX 之前
3.3. 一些有用的資料
upon starting the computer there will be a message stating which key to press to enter the setup
screen.
• 每個硬體的包裝盒。
• Windows 控制台裡面的系統視窗。
• 其他作業系統裡面的系統指令或工具,包括檔案管理員的顯示。該資源對瞭解隨機存取記憶體和硬
碟特別有用。
• 您的系統管理員或者網際網路服務提供商。他們可以告訴您所需的設定網路和電子郵件的相關資
料。
Table 3.1 Hardware Information Helpful for an Install
硬體
您需要瞭解的資料
您擁有的容量
它們在系統上的順序
Whether IDE (also known as PATA), SATA or
SCSI.
可用空間
分割區。
安裝有其他作業系統的分割區。
Type/model of available network interfaces.
型號與製造商。
Type/model and manufacturer.
硬碟
Network interfaces
印表機
顯示卡
3.3.3 硬體相容性
Many products work without trouble on Linux. Moreover, hardware support in Linux is improving daily.
However, Linux still does not run as many different types of hardware as some operating systems.
Drivers in Linux in most cases are not written for a certain “product”or “brand”from a specific manufacturer, but for a certain hardware/chipset. Many seemingly different products/brands are
based on the same hardware design; it is not uncommon that chip manufacturers provide so-called
“reference designs”for products based on their chips which are then used by several different device
manufacturers and sold under lots of different product or brand names.
This has advantages and disadvantages. An advantage is that a driver for one chipset works with
lots of different products from different manufacturers, as long as their product is based on the same
chipset. The disadvantage is that it is not always easy to see which actual chipset is used in a certain
product/brand. Unfortunately sometimes device manufacturers change the hardware base of their
product without changing the product name or at least the product version number, so that when
having two items of the same brand/product name bought at different times, they can sometimes be
based on two different chipsets and therefore use two different drivers or there might be no driver at
all for one of them.
For USB and PCI/PCI-Express/ExpressCard devices, a good way to find out on which chipset they
are based is to look at their device IDs. All USB/PCI/PCI-Express/ExpressCard devices have so called
“vendor”and “product”IDs, and the combination of these two is usually the same for any product
based on the same chipset.
On Linux systems, these IDs can be read with the lsusb command for USB devices and with the lspci
-nn command for PCI/PCI-Express/ExpressCard devices. The vendor and product IDs are usually given
in the form of two hexadecimal numbers, seperated by a colon, such as “1d6b:0001”.
An example for the output of lsusb: “Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root
hub”, whereby 1d6b is the vendor ID and 0002 is the product ID.
An example for the output of lspci -nn for an Ethernet card: “03:00.0 Ethernet controller [0200]:
Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller [10ec:8168]
(rev 06)”. The IDs are given inside the rightmost square brackets, i.e. here 10ec is the vendor- and
8168 is the product ID.
As another example, a graphics card could give the following output: “04:00.0 VGA compatible
controller [0300]: Advanced Micro Devices [AMD] nee ATI RV710 [Radeon HD 4350] [1002:954f]”.
13
CHAPTER 3. 安裝 DEBIAN GNU/LINUX 之前
3.3. 一些有用的資料
On Windows systems, the IDs for a device can be found in the Windows device manager on the tab
“details”, where the vendor ID is prefixed with VEN_ and the product ID is prefixed with DEV_. On
Windows 7 systems, you have to select the property“Hardware IDs”in the device manager’s details
tab to actually see the IDs, as they are not displayed by default.
Searching on the internet with the vendor/product ID, “Linux”and “driver”as the search terms
often results in information regarding the driver support status for a certain chipset. If a search for
the vendor/product ID does not yield usable results, a search for the chip code names, which are also
often provided by lsusb and lspci (“RTL8111”/“RTL8168B”in the network card example and“RV710”
in the graphics card example), can help.
3.3.3.1
Testing hardware compatibility with a Live-System
Debian GNU/Linux is also available as a so-called“live system”for certain architectures. A live system
is a preconfigured ready-to-use system in a compressed format that can be booted and used from a
read-only medium like a CD or DVD. Using it by default does not create any permanent changes on your
computer. You can change user settings and install additional programs from within the live system,
but all this only happens in the computer’s RAM, i.e. if you turn off the computer and boot the live
system again, everything is reset to its defaults. If you want to see whether your hardware is supported
by Debian GNU/Linux, the easiest way is to run a Debian live system on it and try it out.
There are a few limitations in using a live system. The first is that as all changes you do within the live
system must be held in your computer’s RAM, this only works on systems with enough RAM to do that,
so installing additional large software packages may fail due to memory constraints. Another limitation
with regards to hardware compatibility testing is that the official Debian GNU/Linux live system contains
only free components, i.e. there are no non-free firmware files included in it. Such non-free packages
can of course be installed manually within the system, but there is no automatic detection of required
firmware files like in the debian-installer, so installation of non-free components must be done
manually if needed.
Information about the available variants of the Debian live images can be found at the Debian Live
Images website.
3.3.4 網路設置
If your computer is connected to a fixed network (i.e. an Ethernet or equivalent connection —not
a dialup/PPP connection) which is administered by somebody else, you should ask your network’s
system administrator for this information:
• 您的主機名 (也許可以自己決定)。
• 您的網網域名稱。
• 您電腦的 IP 位址。
• 您網路的網路遮罩。
• 預設路由閘道的 IP 位址,如果您的網路有閘道器的話。
• 您的網路中作為 DNS (網域名稱稱服務) 伺服器的系統。
If the network you are connected to uses DHCP (Dynamic Host Configuration Protocol) for configuring network settings, you don’t need this information because the DHCP server will provide it directly
to your computer during the installation process.
If you have internet access via DSL or cable modem (i.e. over a cable tv network) and have a router
(often provided preconfigured by your phone or catv provider) which handles your network connectivity, DHCP is usually available by default.
As a rule of thumb: if you run a Windows system in your home network and did not have to manually perform any network settings there to achieve Internet access, network connectivity in Debian
GNU/Linux will also be configured automatically.
If you use a WLAN/WiFi network, you should find out:
• The ESSID (“network name”) of your wireless network.
• The WEP or WPA/WPA2 security key to access the network (if applicable).
14
CHAPTER 3. 安裝 DEBIAN GNU/LINUX 之前
3.4
3.4. 滿足最低的硬體要求
滿足最低的硬體要求
一旦您收集好您的電腦硬體配備的相關資料,再檢查一下您的硬體,就可以讓您如願以償的安裝系統。
基於您的需求,您也許可以用低於下面表格所列的配備安裝系統。但是,如果無視這些建議的話,多
數使用者會安裝失敗。
A Pentium 4, 1GHz system is the minimum recommended for a desktop system.
Table 3.2 建議的最低系統需求
安裝類別
RAM (minimum)
無桌面系統
128 megabytes
有桌面系統
256 megabytes
RAM (recommended)
512 megabytes
1 GB
硬碟
2 gigabytes
10 gigabytes
The actual minimum memory requirements are a lot less than the numbers listed in this table.
Depending on the architecture, it is possible to install Debian with as little as 60MB (for amd64). The
same goes for the disk space requirements, especially if you pick and choose which applications to
install; see 節 D.2 for additional information on disk space requirements.
It is possible to run a graphical desktop environment on older or low-end systems, but in that case
it is recommended to install a window manager that is less resource-hungry than those of the GNOME
or KDE Plasma desktop environments; alternatives include xfce4, icewm and wmaker, but there are
others to choose from.
It is practically impossible to give general memory or disk space requirements for server installations as those very much depend on what the server is to be used for.
Remember that these sizes don’t include all the other materials which are usually to be found,
such as user files, mail, and data. It is always best to be generous when considering the space for your
own files and data.
Disk space required for the smooth operation of the Debian GNU/Linux system itself is taken into
account in these recommended system requirements. Notably, the /var partition contains a lot of
state information specific to Debian in addition to its regular contents, like logfiles. The dpkg files (with
information on all installed packages) can easily consume 40MB. Also, apt puts downloaded packages
here before they are installed. You should usually allocate at least 200MB for /var, and a lot more if
you install a graphical desktop environment.
3.5
為多重開機系統事先分割磁碟
分割您的硬碟指的僅是將您的硬碟空間切分成幾塊。分割之後,每一塊都是獨立於其餘部分的單獨空間。
這和在一個大房幾里砌堵牆有幾分相似如果您在其中一間房間裡安置傢俱,不會對其它房間有任何影響。
If you already have an operating system on your system (Windows 9x, Windows NT/2000/XP/2003/Vista/7,
OS/2, MacOS, Solaris, FreeBSD, …) which uses the whole disk and you want to stick Debian on the same
disk, you will need to repartition it. Debian requires its own hard disk partitions. It cannot be installed
on Windows or Mac OS X partitions. It may be able to share some partitions with other Unix systems,
but that’s not covered here. At the very least you will need a dedicated partition for the Debian root
filesystem.
You can find information about your current partition setup by using a partitioning tool for your
current operating system, such as the integrated Disk Manager in Windows or fdisk in DOS. Partitioning
tools always provide a way to show existing partitions without making changes.
在一般情況下,改動一個已經建立檔案系統的分割區,會導致其中的資料遭到損毀。因而,您每次都
應當在重新分割之前先做好備份。繼續拿房幾作比喻,在移動牆壁時,您最好在把擋路的傢俱都移開,否
則就要冒著傢俱被破壞的危險。
Several modern operating systems offer the ability to move and resize certain existing partitions
without destroying their contents. This allows making space for additional partitions without losing
existing data. Even though this works quite well in most cases, making changes to the partitioning of
a disk is an inherently dangerous action and should only be done after having made a full backup of
all data. For FAT/FAT32 and NTFS partitions as used by DOS and Windows systems, the ability to move
and resize them losslessly is provided both by debian-installer as well as by the integrated Disk
Manager of Windows 7.
15
CHAPTER 3. 安裝 DEBIAN GNU/LINUX 之前
3.6. 安裝前硬體和作業系統的相關設定
To losslessly resize an existing FAT or NTFS partition from within debian-installer, go to the
partitioning step, select the option for manual partitioning, select the partition to resize, and simply
specify its new size.
Creating and deleting partitions can be done from within debian-installer as well as from an
existing operating system. As a rule of thumb, partitions should be created by the system for which
they are to be used, i.e. partitions to be used by Debian GNU/Linux should be created from within
debian-installer and partitions to be used from another operating system should be created from
there. debian-installer is capable of creating non-Linux partitions, and partitions created this way
usually work without problems when used in other operating systems, but there are a few rare corner
cases in which this could cause problems, so if you want to be sure, use the native partitioning tools to
create partitions for use by other operating systems.
If you are going to install more than one operating system on the same machine, you should install
all other system(s) before proceeding with the Debian installation. Windows and other OS installations
may destroy your ability to start Debian, or encourage you to reformat non-native partitions.
儘管您可以在這些操作之後再恢復回來,也可以避免它們,但是首先安裝本地系統就能夠幫您免除這
些煩惱。
3.6
安裝前硬體和作業系統的相關設定
This section will walk you through pre-installation hardware setup, if any, that you will need to do prior
to installing Debian. Generally, this involves checking and possibly changing BIOS/system firmware
settings for your system. The“BIOS”or“system firmware”is the core software used by the hardware;
it is most critically invoked during the bootstrap process (after power-up).
3.6.1 使用 BIOS 設定選單
The BIOS provides the basic functions needed to boot your machine and to allow your operating system
to access your hardware. Your system provides a BIOS setup menu, which is used to configure the
BIOS. To enter the BIOS setup menu you have to press a key or key combination after turning on the
computer. Often it is the Delete or the F2 key, but some manufacturers use other keys. Usually upon
starting the computer there will be a message stating which key to press to enter the setup screen.
3.6.2 選擇開機設備
Within the BIOS setup menu, you can select which devices shall be checked in which sequence for a
bootable operating system. Possible choices usually include the internal harddisks, the CD/DVD-ROM
drive and USB mass storage devices such as USB sticks or external USB harddisks. On modern systems
there is also often a possibility to enable network booting via PXE.
Depending on the installation media (CD/DVD ROM, USB stick, network boot) you have chosen you
should enable the appropriate boot devices if they are not already enabled.
Most BIOS versions allow you to call up a boot menu on system startup in which you select from
which device the computer should start for the current session. If this option is available, the BIOS
usually displays a short message like “press F12 for boot menu”on system startup. The actual key
used to select this menu varies from system to system; commonly used keys are F12, F11 and F8.
Choosing a device from this menu does not change the default boot order of the BIOS, i.e. you can
start once from a USB stick while having configured the internal harddisk as the normal primary boot
device.
If your BIOS does not provide you with a boot menu to do ad-hoc choices of the current boot device,
you will have to change your BIOS setup to make the device from which the debian-installer shall
be booted the primary boot device.
Unfortunately some computers contain buggy BIOS versions. Booting debian-installer from
a USB stick might not work even if there is an appropriate option in the BIOS setup menu and the stick
is selected as the primary boot device. On some of these systems using a USB stick as boot medium is
impossible; others can be tricked into booting from the stick by changing the device type in the BIOS
setup from the default“USB harddisk”or“USB stick”to“USB ZIP”or“USB CDROM”. In particular
if you use an isohybrid CD/DVD image on a USB stick (see 節 4.3.1), changing the device type to “USB
CDROM”helps on some BIOSes which will not boot from a USB stick in USB harddisk mode.
16
CHAPTER 3. 安裝 DEBIAN GNU/LINUX 之前
3.6. 安裝前硬體和作業系統的相關設定
If you cannot manipulate the BIOS to boot directly from a USB stick you still have the option of using
an ISO copied to the stick. Boot debian-installer using 節 4.4 and, after scanning the hard drives
for an installer ISO image, select the USB device and choose an installation image.
3.6.3 Systems with UEFI firmware
UEFI (“Unified Extensible Firmware Interface”) is a new kind of system firmware that is used on many
modern systems and is - among other uses - intended to replace the classic PC BIOS.
Currently most PC systems that use UEFI also have a so-called “Compatibility Support Module”
(CSM) in the firmware, which provides exactly the same interfaces to an operating system as a classic
PC BIOS, so that software written for the classic PC BIOS can be used unchanged. Nonetheless UEFI
is intended to one day completely replace the old PC BIOS without being fully backwards-compatible
and there are already a lot of systems with UEFI but without CSM.
On systems with UEFI there are a few things to take into consideration when installing an operating
system. The way the firmware loads an operating system is fundamentally different between the classic
BIOS (or UEFI in CSM mode) and native UEFI. One major difference is the way the harddisk partitions
are recorded on the harddisk. While the classic BIOS and UEFI in CSM mode use a DOS partition table,
native UEFI uses a different partitioning scheme called “GUID Partition Table”(GPT). On a single
disk, for all practical purposes only one of the two can be used and in case of a multi-boot setup with
different operating systems on one disk, all of them must therefore use the same type of partition
table. Booting from a disk with GPT is only possible in native UEFI mode, but using GPT becomes more
and more common as hard disk sizes grow, because the classic DOS partition table cannot address
disks larger than about 2 Terabytes while GPT allows for far larger disks. The other major difference
between BIOS (or UEFI in CSM mode) and native UEFI is the location where boot code is stored and in
which format it has to be. This means that different bootloaders are needed for each system.
The latter becomes important when booting debian-installer on a UEFI system with CSM because debian-installer checks whether it was started on a BIOS- or on a native UEFI system and
installs the corresponding bootloader. Normally this simply works but there can be a problem in multiboot environments. On some UEFI systems with CSM the default boot mode for removable devices can
be different from what is actually used when booting from hard disk, so when booting the installer from
a USB stick in a different mode from what is used when booting another already installed operating system from the hard disk, the wrong bootloader might be installed and the system might be unbootable
after finishing the installation. When choosing the boot device from a firmware boot menu, some
systems offer two seperate choices for each device, so that the user can select whether booting shall
happen in CSM or in native UEFI mode.
Another UEFI-related topic is the so-called “secure boot”mechanism. Secure boot means a function of UEFI implementations that allows the firmware to only load and execute code that is cryptographically signed with certain keys and thereby blocking any (potentially malicious) boot code that
is unsigned or signed with unknown keys. In practice the only key accepted by default on most UEFI
systems with secure boot is a key from Microsoft used for signing the Windows bootloader. As the
boot code used by debian-installer is not signed by Microsoft, booting the installer requires prior
deactivation of secure boot in case it is enabled. Secure boot is often enabled by default on systems
that come preinstalled with a 64-bit version of Windows 8 and there is unfortunately no standard way
to disable it in the UEFI setup. On some systems, the option to disable secure boot is only made visible
when a BIOS password has been set by the user, so if you have a system with secure boot enabled,
but cannot find an option to disable it, try setting a BIOS password, powercycle the machine and look
again for an appropriate option.
3.6.4 Disabling the Windows 8 “fast boot”feature
Windows 8 offers a feature called “fast boot”to cut down system startup time. Technically, when
this feature is enabled, Windows 8 does not do a real shutdown and a real cold boot afterwards when
ordered to shut down, but instead does something resembling a partial suspend to disk to reduce the
“boot”time. As long as Windows 8 is the only operating system on the machine, this is unproblematic,
but it can result in problems and data loss when you have a dual boot setup in which another operating
system accesses the same filesystems as Windows 8 does. In that case the real state of the filesystem
can be different from what Windows 8 believes it to be after the“boot”and this could cause filesystem
17
CHAPTER 3. 安裝 DEBIAN GNU/LINUX 之前
3.6. 安裝前硬體和作業系統的相關設定
corruption upon further write accesses to the filesystem. Therefore in a dual boot setup, to avoid
filesystem corruption the “fast boot”feature has to be disabled within Windows.
It may also be necessary to disable“fast boot”to even allow access to UEFI setup to choose to boot
another operating system or debian-installer. On some UEFI systems, the firmware will reduce
“boot”time by not initialising the keyboard controller or USB hardware; in these cases, it is necessary
to boot into Windows and disable this feature to allow for a change of boot order.
3.6.5 需要留意的硬體問題
USB BIOS 支援與鍵盤 If you have no PS/2-style keyboard, but only a USB model, on some very old PCs
you may need to enable legacy keyboard emulation in your BIOS setup to be able to use your keyboard
in the bootloader menu, but this is not an issue for modern systems. If your keyboard does not work
in the bootloader menu, consult your mainboard manual and look in the BIOS for “Legacy keyboard
emulation”or “USB keyboard support”options.
18
Chapter 4
取得系統安裝媒介
4.1
Official Debian GNU/Linux CD/DVD-ROM Sets
By far the easiest way to install Debian GNU/Linux is from an Official Debian CD/DVD-ROM Set. You can
buy a set from a vendor (see the CD vendors page). You may also download the CD/DVD-ROM images
from a Debian mirror and make your own set, if you have a fast network connection and a CD/DVD
burner (see the Debian CD page and Debian CD FAQ for detailed instructions). If you have a Debian
CD/DVD set and CDs/DVDs are bootable on your machine, which is the case on all modern PCs, you
can skip right to 章 5. Much effort has been expended to ensure the most-used files are on the first
CDs and DVDs, so that a basic desktop installation can be done with only the first DVD or - to a limited
extent - even with only the first CD.
As CDs have a rather limited capacity by today’s standards, not all graphical desktop environments
are installable with only the first CD; for some desktop environments a CD installation requires either
network connectivity during the installation to download the remaining files or additional CDs.
If your machine doesn’t support CD booting (only relevant on very old PC systems), but you do
have a CD set, you can use an alternative strategy such as hard disk, usb stick, net boot, or manually
loading the kernel from the CD to initially boot the system installer. The files you need for booting by
another means are also on the CD; the Debian network archive and CD folder organization are identical.
So when archive file paths are given below for particular files you need for booting, look for those files
in the same directories and subdirectories on your CD.
安裝程式啟動一旦啟動,它將能夠取得光碟中其他所有必需的檔案。
If you don’t have a CD set, then you will need to download the installer system files and place
them on the hard disk or usb stick or a connected computer so they can be used to boot the installer.
4.2
從 Debian 鏡像伺服器下載檔案
選擇離您較近的 (因此很可能也是最快的) 鏡像伺服器,請參閱 Debian 鏡像列表。
When downloading files from a Debian mirror using FTP, be sure to download the files in binary
mode, not text or automatic mode.
4.2.1 哪裡能找到安裝映像檔
安裝映像檔位於每一個 Debian 鏡像站的 debian/dists/buster/main/installer-i386/current/images/ —
MANIFEST 文件列出每個映像檔及其用途。
4.3
準備從 USB 隨身碟開機的檔案
To prepare the USB stick, you will need a system where GNU/Linux is already running and where USB
is supported. With current GNU/Linux systems the USB stick should be automatically recognized when
you insert it. If it is not you should check that the usb-storage kernel module is loaded. When the USB
stick is inserted, it will be mapped to a device named /dev/sdX, where the“X”is a letter in the range
a-z. You should be able to see to which device the USB stick was mapped by running the command
19
CHAPTER 4. 取得系統安裝媒介
4.3. 準備從 USB 隨身碟開機的檔案
dmesg after inserting it. To write to your stick, you may have to turn off its write protection switch.
警告
The procedures described in this section will destroy anything already on the
device! Make very sure that you use the correct device name for your USB stick.
If you use the wrong device the result could be that all information on for example a hard disk could be lost.
4.3.1 Preparing a USB stick using a hybrid CD or DVD image
Debian CD and DVD images can now be written directly to a USB stick, which is a very easy way to make
a bootable USB stick. Simply choose a CD or DVD image (such as the netinst, CD-1, DVD-1, or netboot)
that will fit on your USB stick. See 節 4.1 to get a CD or DVD image.
Alternatively, for very small USB sticks, only a few megabytes in size, you can download the mini.
iso image from the netboot directory (at the location mentioned in 節 4.2.1).
The CD or DVD image you choose should be written directly to the USB stick, overwriting its current
contents. For example, when using an existing GNU/Linux system, the CD or DVD image file can be
written to a USB stick as follows, after having made sure that the stick is unmounted:
# cp debian.iso /dev/sdX
# sync
The win32diskimager utility can be used under other operating systems to copy the image.
重要
The image must be written to the whole-disk device and not a partition, e.g.
/dev/sdb and not /dev/sdb1. Do not use tools like unetbootin which alter the
image.
重要
Simply writing the CD or DVD image to USB like this should work fine for most
users. The other options below are more complex, mainly for people with specialised needs.
The hybrid image on the stick does not occupy all the storage space, so it may be worth considering
using the free space to hold firmware files or packages or any other files of your choice. This could be
useful if you have only one stick or just want to keep everything you need on one device.
Create a second, FAT partition on the stick, mount the partition and copy or unpack the firmware
onto it. For example:
#
#
#
#
#
mount /dev/sdX2 /mnt
cd /mnt
tar zxvf /path/to/firmware.tar.gz
cd /
umount /mnt
You might have written the mini.iso to the USB stick. In this case the second partition doesn’t
have to be created as, very nicely, it will already be present. Unplugging and replugging the USB stick
should make the two partitions visible.
20
CHAPTER 4. 取得系統安裝媒介
4.3. 準備從 USB 隨身碟開機的檔案
4.3.2 Manually copying files to the USB stick
An alternative way to set up your USB stick is to manually copy the installer files, and also a CD image
to it. Note that the USB stick should be at least 1 GB in size (smaller setups are possible if you follow
節 4.3.3).
There is an all-in-one file hd-media/boot.img.gz which contains all the installer files (including
the kernel) as well as syslinux and its configuration file .
Note that, although convenient, this method does have one major disadvantage: the logical size
of the device will be limited to 1 GB, even if the capacity of the USB stick is larger. You will need to
repartition the USB stick and create new file systems to get its full capacity back if you ever want to use
it for some different purpose.
To use this image simply extract it directly to your USB stick:
# zcat boot.img.gz > /dev/sdX
After that, mount the USB memory stick (mount /dev/sdX /mnt), which will now have a FAT
filesystem on it, and copy a Debian ISO image (netinst or full CD) to it. Unmount the stick (umount
/mnt) and you are done.
4.3.3 Manually copying files to the USB stick —the flexible way
If you like more flexibility or just want to know what’s going on, you should use the following method
to put the files on your stick. One advantage of using this method is that —if the capacity of your USB
stick is large enough —you have the option of copying any ISO image, even a DVD image, to it.
4.3.3.1
Partitioning the USB stick
我們將展示如何使用隨身碟的第一個分割區,而不是整個設備。
注
Since most USB sticks come pre-configured with a single FAT16 partition, you
probably won’t have to repartition or reformat the stick. If you have to do that
anyway, use cfdisk or any other partitioning tool to create a FAT16 partitiona ,
install an MBR using:
# install-mbr /dev/sdX
The install-mbr command is contained in the mbr Debian package. Then create
the filesystem using:
# mkdosfs /dev/sdX1
Take care that you use the correct device name for your USB stick. The mkdosfs
command is contained in the dosfstools Debian package.
a
Don’t forget to set the “bootable”bootable flag.
為了能在 USB 隨身碟開機後啟動核心,我們要在 USB 隨身碟上放入一個 boot-loader。儘管任何
boot-loader (例如 lilo) 都應該可以勝任這個工作,不過還是使用 syslinux 更方便。主要原因是是它可以
使用 FAT16 分割區,而且只需要編輯一個文字檔案就能對其進行設定。任何支援 FAT 檔案系統的操作系
統可以用來改變 boot-loader 的設定檔案。
為了把 syslinux 放到您的 USB 隨身碟的 FAT16 分割區上,請在您的系統中安裝 syslinux 和
mtools 套件,然後執行:
# syslinux /dev/sdX1
再提醒一次,請確認您使用的是正確的設備名稱。還有,一定不能在啟動 syslinux 的時候掛載該分割
區,因為在操作過程中會向分割區的開機磁區寫入資料並且建立包含 boot-loader 代碼的 ldlinux.sys
檔案。
21
CHAPTER 4. 取得系統安裝媒介
4.3.3.2
4.4. 準備從硬碟開機的檔案
Adding the installer image
Mount the partition (mount /dev/sdX1 /mnt) and copy the following installer image files to the stick:
• vmlinuz or linux (kernel binary)
• initrd.gz (initial ramdisk image)
You can choose between either the text-based or the graphical version of the installer. The latter can
be found in the gtk subdirectory. If you want to rename the files, please note that syslinux can only
process DOS (8.3) file names.
Next you should create a syslinux.cfg configuration file, which at a bare minimum should contain the following line (change the name of the kernel binary to “linux”if you used a netboot
image):
default vmlinuz initrd=initrd.gz
For the graphical installer you should add vga=788 to the line. Other parameters can be appended as
desired.
To enable the boot prompt to permit further parameter appending, add a prompt 1 line.
If you used an hd-media image, you should now copy the ISO file of a Debian ISO image1 onto the
stick. When you are done, unmount the USB memory stick (umount /mnt).
4.4
準備從硬碟開機的檔案
安裝程式可以從硬碟分割區上面用開機文件開機。它們可以在其它作業系統下面啟動,或者直接使用
BIOS 提供的 boot-loader 直接啟動。
採用這個技術可以實現完全的“純網路”的安裝方式。這樣可以避免一些使用可移動媒介帶來的的缺
點,例如尋找和燒錄光碟映像或是與大量且不可靠的軟碟糾纏不清。
4.4.1 Hard disk installer booting from Linux using LILO or GRUB
這一節將解釋如何透過 LILO 或 GRUB 增加或者甚至替換現有的 linux 安裝。
在開機時,兩種 boot-loader 都支援將核心和磁碟映像掛載到記憶體中。這個記憶體虛擬磁碟可以被
用做核心的根檔案系統。
Copy the following files from the Debian archives to a convenient location on your hard drive (note
that LILO can not boot from files on an NTFS file system), for instance to /boot/newinstall/.
• vmlinuz(核心二進位文件)
• initrd.gz (記憶體虛擬磁碟映像)
最後,要設定 boot-loader,請進入節 5.1.5。
4.4.2 Hard disk installer booting from DOS using loadlin
This section explains how to prepare your hard drive for booting the installer from DOS using loadlin.
Copy the following directories from a Debian CD image to c:\.
• /install.386 (kernel binary and ramdisk image)
• /tools (loadlin tool)
1 You can use either a netinst or a full CD image (see 節 4.1). Be sure to select one that fits. Note that the “netboot
mini.iso”image is not usable for this purpose.
22
CHAPTER 4. 取得系統安裝媒介
4.5
4.5. 準備以 TFTP 網路開機用的檔案
準備以 TFTP 網路開機用的檔案
如果您的機器連接到了一個區域網路,您可以從網路上的另外一台機器上面透過 TFTP 來開機。如果您傾
向從另外一台機器上面啟動安裝系統,則開機檔案需要放在那台機器上面的某個特殊地方,並且設定您
的機器從該機器進行開機。
You need to set up a TFTP server, and for many machines a DHCP server, or BOOTP server.
BOOTP is an IP protocol that informs a computer of its IP address and where on the network to
obtain a boot image. The DHCP (Dynamic Host Configuration Protocol) is a more flexible, backwardscompatible extension of BOOTP. Some systems can only be configured via DHCP.
普通檔案傳輸協定 (Trivial File Transfer Protocol, TFTP) 能為客戶端提供開機映像。理論上,任何伺服
器,在任何平台上只要實做這些協定就都能夠被應用。在這一節的一些例子裡面,我們將提供在 SunOS
4.x、SunOS 5.x (即 Solaris) 和 GNU/Linux 上面的一些操作例子。
注
For a Debian GNU/Linux server we recommend tftpd-hpa. It’s written by
the same author as the syslinux bootloader and is therefore least likely to
cause issues. A good alternative is atftpd.
4.5.1 設置 DHCP 伺服器
One free software DHCP server is ISC dhcpd. For Debian GNU/Linux, the isc-dhcp-server package
is recommended. Here is a sample configuration file for it (see /etc/dhcp/dhcpd.conf):
option domain-name ”example.com”;
option domain-name-servers ns1.example.com;
option subnet-mask 255.255.255.0;
default-lease-time 600;
max-lease-time 7200;
server-name ”servername”;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.200 192.168.1.253;
option routers 192.168.1.1;
}
host clientname {
filename ”/tftpboot.img”;
server-name ”servername”;
next-server servername;
hardware ethernet 01:23:45:67:89:AB;
fixed-address 192.168.1.90;
}
在這個例子中,一台伺服器 servername 負責執行包括 DHCP 伺服器、TFTP 伺服器和閘道器在內的所
有工作。您需要修改網域名稱選項,以及伺服器名稱和客戶端硬體位址。filename 選項應是要從 TFTP
取得的檔案名稱。
After you have edited the dhcpd configuration file, restart it with /etc/init.d/isc-dhcp-server
restart.
4.5.1.1
在 DHCP 設定中打開 PXE 開機功能
Here is another example for a dhcp.conf using the Pre-boot Execution Environment (PXE) method of
TFTP.
option domain-name ”example.com”;
default-lease-time 600;
max-lease-time 7200;
23
CHAPTER 4. 取得系統安裝媒介
4.5. 準備以 TFTP 網路開機用的檔案
allow booting;
allow bootp;
# The next paragraph needs to be modified to fit your case
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.200 192.168.1.253;
option broadcast-address 192.168.1.255;
# the gateway address which can be different
# (access to the internet for instance)
option routers 192.168.1.1;
# indicate the dns you want to use
option domain-name-servers 192.168.1.3;
}
group {
next-server 192.168.1.3;
host tftpclient {
# tftp client hardware address
hardware ethernet 00:10:DC:27:6C:15;
filename ”pxelinux.0”;
}
}
Note that for PXE booting, the client filename pxelinux.0 is a boot loader, not a kernel image (see 節
4.5.4 below).
4.5.2 Setting up a BOOTP server
There are two BOOTP servers available for GNU/Linux. The first is CMU bootpd. The other is actually
a DHCP server: ISC dhcpd. In Debian GNU/Linux these are contained in the bootp and isc-dhcpserver packages respectively.
To use CMU bootpd, you must first uncomment (or add) the relevant line in /etc/inetd.conf.
On Debian GNU/Linux, you can run update-inetd --enable bootps, then /etc/init.d/inetd
reload to do so. Just in case your BOOTP server does not run Debian, the line in question should look
like:
bootps
dgram
udp
wait
root
/usr/sbin/bootpd
bootpd -i -t 120
Now, you must create an /etc/bootptab file. This has the same sort of familiar and cryptic format as
the good old BSD printcap, termcap, and disktab files. See the bootptab manual page for more
information. For CMU bootpd, you will need to know the hardware (MAC) address of the client. Here
is an example /etc/bootptab:
client:\
hd=/tftpboot:\
bf=tftpboot.img:\
ip=192.168.1.90:\
sm=255.255.255.0:\
sa=192.168.1.1:\
ha=0123456789AB:
You will need to change at least the “ha”option, which specifies the hardware address of the client.
The “bf”option specifies the file a client should retrieve via TFTP; see 節 4.5.4 for more details.
By contrast, setting up BOOTP with ISC dhcpd is really easy, because it treats BOOTP clients as a
moderately special case of DHCP clients. Some architectures require a complex configuration for booting clients via BOOTP. If yours is one of those, read the section 節 4.5.1. Otherwise you will probably be
able to get away with simply adding the allow bootp directive to the configuration block for the subnet containing the client in /etc/dhcp/dhcpd.conf, and restart dhcpd with /etc/init.d/iscdhcp-server restart.
24
CHAPTER 4. 取得系統安裝媒介
4.6. 自動化安裝
4.5.3 啟用 TFTP 伺服器
To get the TFTP server ready to go, you should first make sure that tftpd is enabled.
In the case of tftpd-hpa there are two ways the service can be run. It can be started on demand
by the system’s inetd daemon, or it can be set up to run as an independent daemon. Which of
these methods is used is selected when the package is installed and can be changed by reconfiguring
the package.
注
Historically, TFTP servers used /tftpboot as directory to serve images from.
However, Debian GNU/Linux packages may use other directories to comply with
the Filesystem Hierarchy Standard. For example, tftpd-hpa by default uses
/srv/tftp. You may have to adjust the configuration examples in this section
accordingly.
All in.tftpd alternatives available in Debian should log TFTP requests to the system logs by default.
Some of them support a -v argument to increase verbosity. It is recommended to check these log
messages in case of boot problems as they are a good starting point for diagnosing the cause of errors.
4.5.4 將 TFTP 映像放到適當的位置
Next, place the TFTP boot image you need, as found in 節 4.2.1, in the tftpd boot image directory. You
may have to make a link from that file to the file which tftpd will use for booting a particular client.
Unfortunately, the file name is determined by the TFTP client, and there are no strong standards.
For PXE booting, everything you should need is set up in the netboot/netboot.tar.gz tarball.
Simply extract this tarball into the tftpd boot image directory. Make sure your dhcp server is configured
to pass pxelinux.0 to tftpd as the filename to boot.
4.6
自動化安裝
For installing on multiple computers it’s possible to do fully automatic installations. Debian packages
intended for this include fai-quickstart (which can use an install server) and the Debian Installer
itself. Have a look at the FAI home page for detailed information.
4.6.1 使用 Debian 安裝程式進行自動安裝
The Debian Installer supports automating installs via preconfiguration files. A preconfiguration file can
be loaded from the network or from removable media, and used to fill in answers to questions asked
during the installation process.
Full documentation on preseeding including a working example that you can edit is in 附錄 B.
25
Chapter 5
啟動安裝系統
5.1
在 32-bit PC 上啟動安裝程式
警告
If you have any other operating systems on your system that you wish to keep
(dual boot setup), you should make sure that they have been properly shut down
before you boot the installer. Installing an operating system while another operating system is in hibernation (has been suspended to disk) could result in
loss of, or damage to the state of the suspended operating system which could
cause problems when it is rebooted.
注
For information on how to boot the graphical installer, see 節 5.1.8.
5.1.1 從 USB 隨身碟開機
If your computer will boot from USB, this will probably be the easiest route for installation. Assuming
you have prepared everything from 節 3.6.2 and 節 4.3, just plug your USB stick into some free USB
connector and reboot the computer. The system should boot up, and unless you have used the flexible
way to build the stick and not enabled it, you should be presented with a graphical boot menu (on
hardware that supports it). Here you can select various installer options, or just hit Enter.
5.1.2 從光碟開機
對於大多數人來說,最快的途徑是使用一套 Debian CD 光碟套件。如果您有此套件,並且如果您的機器
支援直接光碟開機,太棒了!只需要設定您的系統以光碟開機,請參閱節 3.6.2, 插入您的光碟,重開機,
然後繼續下一章。
注意某些特定的光碟機需要一些特殊的驅動程式,因為他們可能在安裝的早期步驟中無法被存取。如
果標準的光碟開機的方法不能用於您的硬體,閱讀本章中關於其他種類的核心以及安裝方法,它們有可
能能解決問題。
Even if you cannot boot from CD-ROM, you can probably install the Debian system components and
any packages you want from CD-ROM. Simply boot using a different medium and when it’s time to
install the operating system, base system, and any additional packages, point the installation system
at the CD-ROM drive.
26
CHAPTER 5. 啟動安裝系統
5.1. 在 32-BIT PC 上啟動安裝程式
如果您遇到開機方面的問題,請參閱節 5.4。
5.1.3 Booting from Windows
To start the installer from Windows, you can either
• obtain CD-ROM/DVD-ROM or USB memory stick installation media as described in 節 4.1 respective 節 4.3 or
• download a standalone Windows executable, which is available as tools/win32-loader/stable/win32loader.exe on the Debian mirrors.
If you use an installation CD or DVD, a pre-installation program should be launched automatically
when you insert the disc. In case Windows does not start it automatically, or if you are using a USB
memory stick, you can run it manually by accessing the device and executing setup.exe.
After the program has been started, a few preliminary questions will be asked and the system will
be prepared to reboot into the Debian GNU/Linux installer.
5.1.4 Booting from DOS using loadlin
Boot into DOS (not Windows). To do this, you can for instance boot from a recovery or diagnostic disk.
If you can access the installation CD, change the current drive to the CD-ROM drive, e.g.
d:
else make sure you have first prepared your hard disk as explained in 節 4.4.2, and change the current
drive to it if needed.
Enter the subdirectory for the flavor you chose, e.g.,
cd \install.386
If you prefer using the graphical installer, enter the gtk sub-directory.
cd gtk
Next, execute install.bat. The kernel will load and launch the installer system.
5.1.5 使用 LILO 或 GRUB 啟動 Linux
為了從硬碟開機安裝程式,您首先必須按照要求下載並且放置所需的文件,請參閱節 4.4。
If you intend to use the hard drive only for booting and then download everything over the network,
you should download the netboot/debian-installer/i386/initrd.gz file and its corresponding kernel netboot/debian-installer/i386/linux. This will allow you to repartition the hard
disk from which you boot the installer, although you should do so with care.
Alternatively, if you intend to keep an existing partition on the hard drive unchanged during the
install, you can download the hd-media/initrd.gz file and its kernel, as well as copy a CD (or DVD)
iso to the drive (make sure the file is named ending in .iso). The installer can then boot from the drive
and install from the CD/DVD image, without needing the network.
如果採用 LILO,您需要在 /etc/lilo.conf 中設定兩件最基本的事情:
• 在開機時載入 initrd.gz 安裝程式﹔
• 讓 vmlinuz 核心使用一個記憶體虛擬磁碟作為它的根分割區。
這裡是一個 /etc/lilo.conf 的例子:
image=/boot/newinstall/vmlinuz
label=newinstall
initrd=/boot/newinstall/initrd.gz
欲獲知更多細節,請參閱 initrd(4) 和 lilo.conf(5) man 手冊。現在執行 lilo 並且重新啟動。
The procedure for GRUB1 is quite similar. Locate your menu.lst in the /boot/grub/ directory
(or sometimes /boot/boot/grub/) and add an entry for the installer, for example (assuming /boot
is on the first partition of the first disk in the system):
27
CHAPTER 5. 啟動安裝系統
title
root
kernel
initrd
5.1. 在 32-BIT PC 上啟動安裝程式
New Install
(hd0,0)
/boot/newinstall/vmlinuz
/boot/newinstall/initrd.gz
The procedure for GRUB2 is very similar. The file is named grub.cfg instead of menu.lst. An
entry for the installer would be for instance for example:
menuentry ’New Install’ {
insmod part_msdos
insmod ext2
set root=’(hd0,msdos1)’
linux /boot/newinstall/vmlinuz
initrd /boot/newinstall/initrd.gz
}
從此之後,採用 GRUB 或 LILO 都沒區別。
5.1.6 用 TFTP 開機
Booting from the network requires that you have a network connection and a TFTP network boot server
(and probably also a DHCP, RARP, or BOOTP server for automatic network configuration).
The server-side setup to support network booting is described in 節 4.5.
在 i386 架構上有很多方法用 TFTP 進行開機。
5.1.6.1
支援 PXE 的網卡或者主機板
It could be that your Network Interface Card or Motherboard provides PXE boot functionality. This is
a Intel™ re-implementation of TFTP boot. If so, you may be able to configure your BIOS to boot from
the network.
5.1.6.2
採用 Network BootROM 的網卡
您的網卡很有可能提供了 TFTP 開機功能。
請讓我們知道 (debian-boot@lists.debian.org) 您如何操作,並參考此文件。
5.1.6.3
Etherboot
etherboot project 提供了為 TFTP 開機所需要的開機軟碟甚至是開機 ROMS 。
5.1.7 The Boot Screen
When the installer boots, you should be presented with a friendly graphical screen showing the Debian
logo and a menu:
Debian GNU/Linux installer boot menu
Graphical install
Install
Advanced options
>
Help
Install with speech synthesis
注
This graphical screen will look very slightly different depending on how your
computer has booted (BIOS or UEFI), but the same options will be shown.
28
CHAPTER 5. 啟動安裝系統
5.1. 在 32-BIT PC 上啟動安裝程式
Depending on the installation method you are using, the “Graphical install”option may not be
available. Bi-arch images additionally have a 64 bit variant for each install option, right below it, thus
almost doubling the number of options.
For a normal installation, select either the“Graphical install”or the“Install”entry —using either
the arrow keys on your keyboard or by typing the first (highlighted) letter —and press Enter to boot
the installer. The “Graphical install”entry is already selected by default.
The “Advanced options”entry gives access to a second menu that allows to boot the installer in
expert mode, in rescue mode and for automated installs.
If you wish or need to add any boot parameters for either the installer or the kernel, press Tab (BIOS
boot), or e then down arrow three times then end (UEFI boot). This will bring the boot command for
the selected menu entry and allow you to edit it to suit your needs. The help screens (see below) list
some common possible options. Press Enter (BIOS boot) or F10 (UEFI boot) to boot the installer with
your options; pressing Esc will return you to the boot menu and undo any changes you made.
Choosing the“Help”entry will result in the first help screen being displayed which gives an overview
of all available help screens. To return to the boot menu after the help screens have been displayed,
type ’menu’ at the boot prompt and press Enter. All help screens have a boot prompt at which the
boot command can be typed:
Press F1 for the help index, or ENTER to boot:
At this boot prompt you can either just press Enter to boot the installer with default options or enter a
specific boot command and, optionally, boot parameters. A number of boot parameters which might
be useful can be found on the various help screens. If you do add any parameters to the boot command line, be sure to first type the boot method (the default is install) and a space before the first
parameter (e.g., install fb=false).
注
The keyboard is assumed to have a default American English layout at this point.
This means that if your keyboard has a different (language-specific) layout, the
characters that appear on the screen may be different from what you’d expect
when you type parameters. Wikipedia has a schema of the US keyboard layout
which can be used as a reference to find the correct keys to use.
注
If you are using a system that has the BIOS configured to use serial console,
you may not be able to see the initial graphical splash screen upon booting the
installer; you may even not see the boot menu. The same can happen if you
are installing the system via a remote management device that provides a text
interface to the VGA console. Examples of these devices include the text console
of Compaq’s “integrated Lights Out”(iLO) and HP’s “Integrated Remote
Assistant”(IRA).
To bypass the graphical boot screen you can either blindly press Esc to get a
text boot prompt, or (equally blindly) press“H”followed by Enter to select the
“Help”option described above. After that your keystrokes should be echoed at
the prompt. To prevent the installer from using the framebuffer for the rest of
the installation, you will also want to add vga=normal fb=false to the boot
prompt, as described in the help text.
5.1.8 The Graphical Installer
The graphical version of the installer is only available for a limited number of architectures, including
32-bit PC . The functionality of the graphical installer is essentially the same as that of the text-based
29
CHAPTER 5. 啟動安裝系統
5.2. ACCESSIBILITY
installer as it basically uses the same programs, but with a different frontend.
Although the functionality is identical, the graphical installer still has a few significant advantages.
The main advantage is that it supports more languages, namely those that use a character set that
cannot be displayed with the text-based “newt”frontend. It also has a few usability advantages such
as the option to use a mouse, and in some cases several questions can be displayed on a single screen.
The graphical installer is available with all CD images and with the hd-media installation method. To
boot the graphical installer simply select the relevant option from the boot menu. Expert and rescue
mode for the graphical installer can be selected from the “Advanced options”menu. The previously
used boot methods installgui, expertgui and rescuegui can still be used from the boot prompt
which is shown after selecting the “Help”option in the boot menu.
There is also a graphical installer image that can be netbooted. And there is a special “mini”ISO
image1 , which is mainly useful for testing.
Just as with the text-based installer it is possible to add boot parameters when starting the graphical
installer.
注
The graphical installer requires significantly more memory to run than the textbased installer: 293MB. If insufficient memory is available, it will automatically
fall back to the text-based “newt”frontend.
If the amount of memory in your system is below 135MB, the graphical installer
may fail to boot at all while booting the text-based installer would still work.
Using the text-based installer is recommended for systems with little available
memory.
5.2
Accessibility
Some users may need specific support because of e.g. some visual impairment. USB braille displays
are detected automatically (not serial displays connected via a serial-to-USB converter), but most other
accessibility features have to be enabled manually. On machines that support it, the boot menu emits
beeps when it is ready to receive keystrokes. It beeps once on BIOS systems, and beeps twice on
UEFI systems. Some boot parameters can then be appended to enable accessibility features (see also
節 5.1.7). Note that on most architectures the boot loader interprets your keyboard as a QWERTY
keyboard.
5.2.1 Installer front-end
The Debian installer supports several front-ends for asking questions, with varying convenience for
accessibility: notably, text uses plain text while newt uses text-based dialog boxes. The choice can
be made at the boot prompt, see the documentation for DEBIAN_FRONTEND in 節 5.3.2.
5.2.2 USB Braille Displays
USB braille displays should be automatically detected. A textual version of the installer will then be
automatically selected, and support for the braille display will be automatically installed on the target
system. You can thus just press Enter at the boot menu. Once brltty is started, you can choose a
braille table by entering the preference menu. Documentation on key bindings for braille devices is
available on the brltty website.
5.2.3 Serial Braille Displays
Serial braille displays cannot safely be automatically detected (since that may damage some of them).
You thus need to append the brltty=driver,port boot parameter to tell brltty which driver and
1
The mini ISO image can be downloaded from a Debian mirror as described in 節 4.2. Look for netboot/gtk/mini.iso.
30
CHAPTER 5. 啟動安裝系統
5.2. ACCESSIBILITY
port it should use. driver should be replaced by the two-letter driver code for your terminal (see the
BRLTTY manual). port should be replaced by the name of the serial port the display is connected to,
ttyS0 is the default, ttyUSB0 can be typically used when using a serial-to-USB converter. A third parameter can be provided, to choose the name of the braille table to be used (see the BRLTTY manual);
the English table is the default. Note that the table can be changed later by entering the preference
menu. A fourth parameter can be provided to pass parameters to the braille driver, such as protocol=foo which is needed for some rare models. Documentation on key bindings for braille devices is
available on the brltty website.
5.2.4 Software Speech Synthesis
Support for software speech synthesis is available on all installer images which have the graphical
installer, i.e. all netinst, CD and DVD images, and the netboot gtk variant. It can be activated by selecting
it in the boot menu by typing s Enter. The textual version of the installer will then be automatically
selected, and support for software speech synthesis will be automatically installed on the target system.
The first question (language) is spoken in english, and the remainder of installation is spoken in the
selected language (if available in espeak).
The default speech rate is quite slow. To make it faster, press CapsLock-6. To make it slower, press
CapsLock-5. The default volume should be medium. To make it louder, press CapsLock-2. To make it
quieter, press CapsLock-1. To get more details on the browsing shortcuts, see the Speakup guide. To
just accept the default answer for a question, simply press Enter at the prompt. To provide an empty
answer for a question, type ! at the prompt. To get back to the previous question, type < at the prompt.
5.2.5 Hardware Speech Synthesis
Support for hardware speech synthesis devices is available on all installer images which have the graphical installer, i.e. all netinst, CD and DVD images, and the netboot gtk variant. You thus need to select
a “Graphical install”entry in the boot menu.
Hardware speech synthesis devices cannot be automatically detected. You thus need to append the
speakup.synth=driver boot parameter to tell speakup which driver it should use. driver should
be replaced by the driver code for your device (see driver code list). The textual version of the installer
will then be automatically selected, and support for the speech synthesis device will be automatically
installed on the target system.
5.2.6 Board Devices
Some accessibility devices are actual boards that are plugged inside the machine and that read text directly from the video memory. To get them to work framebuffer support must be disabled by using the
vga=normal fb=false boot parameter. This will however reduce the number of available languages.
If desired a textual version of the bootloader can be activated before adding the boot parameter by
typing h Enter.
5.2.7 High-Contrast Theme
For users with low vision, the installer can use a high-contrast color theme that makes it more readable.
To enable it, append the theme=dark boot parameter.
5.2.8 Zoom
For users with low vision, the graphical installer has a very basic zoom support: the Control-+ and
Control– shortcuts increase and decrease the font size.
5.2.9 Expert install, rescue mode, automated install
Expert, Rescue, and Automated installation choices are also available with accessibility support. To
access them, one has to first enter the “Advanced options”submenu from the boot menu by typing
a. When using a BIOS system (the boot menu will have beeped only once), this has to be followed by
31
CHAPTER 5. 啟動安裝系統
5.3. 開機參數
Enter. Then, to enable speech synthesis, s can optionally be pressed (followed again by Enter when
using a BIOS system). From there, various shortcuts can be used: x for expert installation, r for rescue
mode, or a for automated installation. When using a BIOS system, they must be followed by Enter.
The automated install choice allows to install Debian completely automatically by using preseeding,
whose source can be entered after accessibility features get started. Preseeding itself is documented
in 附錄 B.
5.2.10
Accessibility of the installed system
Documentation on accessibility of the installed system is available on the Debian Accessibility wiki page.
5.3
開機參數
開機參數是 Linux 核心的參數。一般用於確保周邊設備能夠正確地運行。對於其中的大多數部分來說,核
心可以自動檢查周邊設備的相關資訊。但是在某些情況下,您可能需要給核心一點小小的幫助。
如果這是您第一次開機系統,嘗試預設的開機參數 (即:不要輸入任何參數) 並且檢查是否工作正確。
大部分情況下應該如此,如果不是,可以重新啟動,並且檢查需要告訴系統什麼樣的特定參數。
有關很多開機參數的資訊可以參閱 Linux BootPrompt HOWTO,其中包括一些老舊硬體的解決方法。
這一節只描述一些對最常用的基本參數。一些常見的問題描述見節 5.4。
5.3.1 Boot console
If you are booting with a serial console, generally the kernel will autodetect this. If you have a videocard
(framebuffer) and a keyboard also attached to the computer which you wish to boot via serial console,
you may have to pass the console=device argument to the kernel, where device is your serial device,
which is usually something like ttyS0.
You may need to specify parameters for the serial port, such as speed and parity, for instance
console=ttyS0,9600n8; other typical speeds may be 57600 or 115200. Be sure to specify this option
after “---”, so that it is copied into the bootloader configuration for the installed system (if supported
by the installer for the bootloader).
In order to ensure the terminal type used by the installer matches your terminal emulator, the
parameter TERM=type can be added. Note that the installer only supports the following terminal
types: linux, bterm, ansi, vt102 and dumb. The default for serial console in debian-installer is
vt102. If you are using an IPMI console, or a virtualization tool which does not provide conversion into
such terminals types itself, e.g. QEMU/KVM, you can start it inside a screen session. That will indeed
perform translation into the screen terminal type, which is very close to vt102.
5.3.2 Debian 安裝程式的參數
The installation system recognizes a few additional boot parameters2 which may be useful.
A number of parameters have a“short form”that helps avoid the limitations of the kernel command
line options and makes entering the parameters easier. If a parameter has a short form, it will be listed
in brackets behind the (normal) long form. Examples in this manual will normally use the short form
too.
debconf/priority (priority) This parameter sets the lowest priority of messages to be displayed.
The default installation uses priority=high. This means that both high and critical priority
messages are shown, but medium and low priority messages are skipped. If problems are encountered, the installer adjusts the priority as needed.
If you add priority=medium as boot parameter, you will be shown the installation menu and
gain more control over the installation. When priority=low is used, all messages are shown
(this is equivalent to the expert boot method). With priority=critical, the installation system will display only critical messages and try to do the right thing without fuss.
2 With current kernels (2.6.9 or newer) you can use 32 command line options and 32 environment options. If these numbers
are exceeded, the kernel will panic. Also there is a limit of 255 characters for the whole kernel command line, everything above
this limit may be silently truncated.
32
CHAPTER 5. 啟動安裝系統
5.3. 開機參數
DEBIAN_FRONTEND This boot parameter controls the type of user interface used for the installer. The
current possible parameter settings are:
• DEBIAN_FRONTEND=noninteractive
• DEBIAN_FRONTEND=text
• DEBIAN_FRONTEND=newt
• DEBIAN_FRONTEND=gtk
The default frontend is DEBIAN_FRONTEND=newt. DEBIAN_FRONTEND=text may be preferable for serial console installs. Some specialized types of install media may only offer a limited
selection of frontends, but the newt and text frontends are available on most default install
media. On architectures that support it, the graphical installer uses the gtk frontend.
BOOT_DEBUG 設定此開機參數為 2 將使得安裝程式的啟動程序寫下所有冗長的紀錄。設定為 3 使得除
錯介殼在決定性的時間點上能被使用。(離開介殼後將繼續安裝程序。)
BOOT_DEBUG=0 此為預設。
BOOT_DEBUG=1 更多的資訊。
BOOT_DEBUG=2 大量的除錯資訊。
BOOT_DEBUG=3 介殼腳本將在開機期間執行於不同的地方以允許細節上的調整。退出介殼將繼續
開機過程。
INSTALL_MEDIA_DEV 此參數值是載入 Debian 安裝程式設備的路徑,
例如:INSTALL_MEDIA_DEV=/dev/floppy/0
The boot floppy, which normally scans all floppies it can to find the root floppy, can be overridden
by this parameter to only look at the one device.
log_host, log_port Causes the installer to send log messages to a remote syslog on the specified host
and port as well as to a local file. If not specified, the port defaults to the standard syslog port
514.
lowmem Can be used to force the installer to a lowmem level higher than the one the installer sets by
default based on available memory. Possible values are 1 and 2. See also 節 6.3.1.1.
noshell Prevents the installer from offering interactive shells on tty2 and tty3. Useful for unattended
installations where physical security is limited.
debian-installer/framebuffer (fb) Some architectures use the kernel framebuffer to offer installation
in a number of languages. If framebuffer causes a problem on your system you can disable the
feature using the parameter vga=normal fb=false. Problem symptoms are error messages
about bterm or bogl, a blank screen, or a freeze within a few minutes after starting the install.
debian-installer/theme (theme) A theme determines how the user interface of the installer looks (colors, icons, etc.). What themes are available differs per frontend. Currently both the newt and
gtk frontends only have a “dark”theme that was designed for visually impaired users. Set the
theme by booting with theme=dark.
netcfg/disable_autoconfig By default, the debian-installer automatically probes for network configuration via IPv6 autoconfiguration and DHCP. If the probe succeeds, you won’t have a chance
to review and change the obtained settings. You can get to the manual network setup only in case
the automatic configuration fails.
If you have an IPv6 router or a DHCP server on your local network, but want to avoid them because
e.g. they give wrong answers, you can use the parameter netcfg/disable_autoconfig=true
to prevent any automatic configuration of the network (neither v4 nor v6) and to enter the information manually.
hw-detect/start_pcmcia 設定成 false 來阻止啟動 PCMCIA 服務,如果其引起各種問題。有些筆記型電
腦對此會有錯誤的行為。
disk-detect/dmraid/enable (dmraid) Set to true to enable support for Serial ATA RAID (also called ATA
RAID, BIOS RAID or fake RAID) disks in the installer. Note that this support is currently experimental. Additional information can be found on the Debian Installer Wiki.
33
CHAPTER 5. 啟動安裝系統
5.3. 開機參數
preseed/url (url) Specify the url to a preconfiguration file to download and use for automating the
install. See 節 4.6.
preseed/file (file) Specify the path to a preconfiguration file to load for automating the install. See 節
4.6.
preseed/interactive Set to true to display questions even if they have been preseeded. Can be useful
for testing or debugging a preconfiguration file. Note that this will have no effect on parameters
that are passed as boot parameters, but for those a special syntax can be used. See 節 B.5.2 for
details.
auto-install/enable (auto) Delay questions that are normally asked before preseeding is possible until
after the network is configured. See 節 B.2.3 for details about using this to automate installs.
finish-install/keep-consoles During installations from serial or management console, the regular virtual consoles (VT1 to VT6) are normally disabled in /etc/inittab. Set to true to prevent this.
cdrom-detect/eject 在重開機前,debian-installer 預設會自動退出安裝時的光學媒介。如果系統
不是自動從光碟開機,這不是必要的動作。在某些情況下,這反而不便,例如,如果光碟機不能自
動插入光碟片,使用者又不在旁邊操作。許多 slot loading, slim-line 和 caddy 類型的光碟機不能自
動重新掛載媒介。
設為 false 可以禁止自動退出,但要小心確保系統在安裝完後,不會自動從光碟開機。
base-installer/install-recommends (recommends) By setting this option to false, the package management system will be configured to not automatically install“Recommends”, both during the
installation and for the installed system. See also 節 6.3.4.
Note that this option allows to have a leaner system, but can also result in features being missing
that you might normally expect to be available. You may have to manually install some of the
recommended packages to obtain the full functionality you want. This option should therefore
only be used by very experienced users.
debian-installer/allow_unauthenticated By default the installer requires that repositories be authenticated using a known gpg key. Set to true to disable that authentication. Warning: insecure, not
recommended.
rescue/enable Set to true to enter rescue mode rather than performing a normal installation. See 節
8.7.
5.3.3 Using boot parameters to answer questions
With some exceptions, a value can be set at the boot prompt for any question asked during the installation, though this is only really useful in specific cases. General instructions how to do this can be
found in 節 B.2.2. Some specific examples are listed below.
debian-installer/language (language), debian-installer/country (country), debian-installer/locale (locale)
There are two ways to specify the language, country and locale to use for the installation and the
installed system.
The first and easiest is to pass only the parameter locale. Language and country will then be
derived from its value. You can for example use locale=de_CH to select German as language
and Switzerland as country (de_CH.UTF-8 will be set as default locale for the installed system).
Limitation is that not all possible combinations of language, country and locale can be achieved
this way.
The second, more flexible option is to specify language and country separately. In this case
locale can optionally be added to specify a specific default locale for the installed system. Example: language=en country=DE locale=en_GB.UTF-8.
anna/choose_modules (modules) Can be used to automatically load installer components that are not
loaded by default. Examples of optional components that may be useful are openssh-clientudeb (so you can use scp during the installation) and ppp-udeb (see 節 D.5).
netcfg/disable_autoconfig Set to true if you want to disable IPv6 autoconfiguration and DHCP and
instead force static network configuration.
34
CHAPTER 5. 啟動安裝系統
5.4. 安裝過程中的障礙排除
mirror/protocol (protocol) By default the installer will use the http protocol to download files from
Debian mirrors and changing that to ftp is not possible during installations at normal priority. By
setting this parameter to ftp, you can force the installer to use that protocol instead. Note that
you cannot select an ftp mirror from a list, you have to enter the hostname manually.
tasksel:tasksel/first (tasks) Can be used to select tasks that are not available from the interactive task
list, such as the kde-desktop task. See 節 6.3.5.2 for additional information.
5.3.4 Passing parameters to kernel modules
If drivers are compiled into the kernel, you can pass parameters to them as described in the kernel
documentation. However, if drivers are compiled as modules and because kernel modules are loaded
a bit differently during an installation than when booting an installed system, it is not possible to pass
parameters to modules as you would normally do. Instead, you need to use a special syntax recognized
by the installer which will then make sure that the parameters are saved in the proper configuration files
and will thus be used when the modules are actually loaded. The parameters will also be propagated
automatically to the configuration for the installed system.
Note that it is now quite rare that parameters need to be passed to modules. In most cases the
kernel will be able to probe the hardware present in a system and set good defaults that way. However,
in some situations it may still be needed to set parameters manually.
The syntax to use to set parameters for modules is:
module_name.parameter_name=value
If you need to pass multiple parameters to the same or different modules, just repeat this. For example,
to set an old 3Com network interface card to use the BNC (coax) connector and IRQ 10, you would pass:
3c509.xcvr=3 3c509.irq=10
5.3.5 Blacklisting kernel modules
Sometimes it may be necessary to blacklist a module to prevent it from being loaded automatically
by the kernel and udev. One reason could be that a particular module causes problems with your
hardware. The kernel also sometimes lists two different drivers for the same device. This can cause
the device to not work correctly if the drivers conflict or if the wrong driver is loaded first.
You can blacklist a module using the following syntax: module_name.blacklist=yes. This will
cause the module to be blacklisted in /etc/modprobe.d/blacklist.local both during the installation and for the installed system.
Note that a module may still be loaded by the installation system itself. You can prevent that from
happening by running the installation in expert mode and unselecting the module from the list of
modules displayed during the hardware detection phases.
5.4
安裝過程中的障礙排除
5.4.1 CD-ROM Reliability
Sometimes, especially with older CD-ROM drives, the installer may fail to boot from a CD-ROM. The
installer may also —even after booting successfully from CD-ROM —fail to recognize the CD-ROM or
return errors while reading from it during the installation.
There are many different possible causes for these problems. We can only list some common issues
and provide general suggestions on how to deal with them. The rest is up to you.
There are two very simple things that you should try first.
• If the CD-ROM does not boot, check that it was inserted correctly and that it is not dirty.
• If the installer fails to recognize a CD-ROM, try just running the option Detect and mount CD-ROM
a second time. Some DMA related issues with very old CD-ROM drives are known to be resolved
in this way.
35
CHAPTER 5. 啟動安裝系統
5.4. 安裝過程中的障礙排除
If this does not work, then try the suggestions in the subsections below. Most, but not all, suggestions discussed there are valid for both CD-ROM and DVD, but we’ll use the term CD-ROM for
simplicity.
If you cannot get the installation working from CD-ROM, try one of the other installation methods
that are available.
5.4.1.1
Common issues
• Some older CD-ROM drives do not support reading from discs that were burned at high speeds
using a modern CD writer.
• Some very old CD-ROM drives do not work correctly if“direct memory access”(DMA) is enabled
for them.
5.4.1.2
How to investigate and maybe solve issues
If the CD-ROM fails to boot, try the suggestions listed below.
• Check that your BIOS actually supports booting from CD-ROM (only an issue for very old systems)
and that CD booting is enabled in the BIOS.
• If you downloaded an iso image, check that the md5sum of that image matches the one listed
for the image in the MD5SUMS file that should be present in the same location as where you
downloaded the image from.
$ md5sum debian-testing-i386-netinst.iso
a20391b12f7ff22ef705cee4059c6b92 debian-testing-i386-netinst.iso
Next, check that the md5sum of the burned CD-ROM matches as well. The following command
should work. It uses the size of the image to read the correct number of bytes from the CD-ROM.
$ dd if=/dev/cdrom | \
> head -c ‘stat --format=%s debian-testing-i386-netinst.iso‘ | \
> md5sum
a20391b12f7ff22ef705cee4059c6b92 262668+0 records in
262668+0 records out
134486016 bytes (134 MB) copied, 97.474 seconds, 1.4 MB/s
If, after the installer has been booted successfully, the CD-ROM is not detected, sometimes simply
trying again may solve the problem. If you have more than one CD-ROM drive, try changing the CDROM to the other drive. If that does not work or if the CD-ROM is recognized but there are errors when
reading from it, try the suggestions listed below. Some basic knowledge of Linux is required for this. To
execute any of the commands, you should first switch to the second virtual console (VT2) and activate
the shell there.
• Switch to VT4 or view the contents of /var/log/syslog (use nano as editor) to check for any
specific error messages. After that, also check the output of dmesg.
• Check in the output of dmesg if your CD-ROM drive was recognized. You should see something
like (the lines do not necessarily have to be consecutive):
ata1.00: ATAPI: MATSHITADVD-RAM UJ-822S, 1.61, max UDMA/33
ata1.00: configured for UDMA/33
scsi 0:0:0:0: CD-ROM
MATSHITA DVD-RAM UJ-822S 1.61 PQ: 0 ANSI: 5
sr0: scsi3-mmc drive: 24x/24x writer dvd-ram cd/rw xa/form2 cdda tray
cdrom: Uniform CD-ROM driver Revision: 3.20
If you don’t see something like that, chances are the controller your CD-ROM is connected to
was not recognized or may be not supported at all. If you know what driver is needed for the
controller, you can try loading it manually using modprobe.
36
CHAPTER 5. 啟動安裝系統
5.4. 安裝過程中的障礙排除
• Check that there is a device node for your CD-ROM drive under /dev/. In the example above,
this would be /dev/sr0. There should also be a /dev/cdrom.
• Use the mount command to check if the CD-ROM is already mounted; if not, try mounting it
manually:
$ mount /dev/hdc /cdrom
Check if there are any error messages after that command.
• Check if DMA is currently enabled:
$ cd /proc/ide/hdc
$ grep using_dma settings
using_dma
1
0
1
rw
A “1”in the first column after using_dma means it is enabled. If it is, try disabling it:
$ echo -n ”using_dma:0” >settings
Make sure that you are in the directory for the device that corresponds to your CD-ROM drive.
• If there are any problems during the installation, try checking the integrity of the CD-ROM using
the option near the bottom of the installer’s main menu. This option can also be used as a
general test if the CD-ROM can be read reliably.
5.4.2 開機設定
如果在開機過程中您遇到了問題或者核心當掉、無法辨識存在的周邊設備或者辨識錯誤,首先要做的事
情是檢查開機參數,如同節 5.3 之中的內容。
In some cases, malfunctions can be caused by missing device firmware (see 節 2.2 and 節 6.4).
5.4.3 Software Speech Synthesis
If software speech synthesis does not work, there is most probably an issue with your sound board,
usually because either the driver for it is not included in the installer, or because it has unusual mixer
level names which are set to muted by default. You should thus submit a bug report which includes
the output of the following commands, run on the same machine from a Linux system which is known
to have sound working (e.g., a live CD).
• dmesg
• lspci
• lsmod
• amixer
5.4.4 常見的 32-bit PC 安裝問題
傳入某些啟動參數可以解決或避免一些常見的安裝問題。
If your screen begins to show a weird picture while the kernel boots, eg. pure white, pure black
or colored pixel garbage, your system may contain a problematic video card which does not switch
to the framebuffer mode properly. Then you can use the boot parameter fb=false to disable the
framebuffer console. Only a reduced set of languages will be available during the installation due to
limited console features. See 節 5.3 for details.
37
CHAPTER 5. 啟動安裝系統
5.4.4.1
5.4. 安裝過程中的障礙排除
在 PCMCIA 段系統當機
Some very old laptop models produced by Dell are known to crash when PCMCIA device detection tries
to access some hardware addresses. Other laptops may display similar problems. If you experience
such a problem and you don’t need PCMCIA support during the installation, you can disable PCMCIA
using the hw-detect/start_pcmcia=false boot parameter. You can then configure PCMCIA after
the installation is completed and exclude the resource range causing the problems.
或者,您可以在啟動安裝程式時進入專家模式。您需要按照要求輸入硬體資源範圍選項。例如,您
如果有如上所說的 Dell 筆記型電腦問題,應該在這裡輸入 exclude port 0x800-0x8ff。在 System
resource settings section of the PCMCIA HOWTO 處有一個列表,整理出一些有問題的資源範圍選項。注
意在安裝程式中,輸入這些值的時候必須忽略逗號。
5.4.5 解讀核心起始資訊
During the boot sequence, you may see many messages in the form can’t find something, or som
ething not present, can’t initialize something, or even this driver release depen
ds on something. Most of these messages are harmless. You see them because the kernel for the
installation system is built to run on computers with many different peripheral devices. Obviously,
no one computer will have every possible peripheral device, so the operating system may emit a few
complaints while it looks for peripherals you don’t own. You may also see the system pause for a
while. This happens when it is waiting for a device to respond, and that device is not present on your
system. If you find the time it takes to boot the system unacceptably long, you can create a custom
kernel later (see 節 8.6).
5.4.6 Reporting Installation Problems
If you get through the initial boot phase but cannot complete the install, the menu option Save debug
logs may be helpful. It lets you store system error logs and configuration information from the installer
to a floppy, or download them using a web browser. This information may provide clues as to what went
wrong and how to fix it. If you are submitting a bug report, you may want to attach this information to
the bug report.
Other pertinent installation messages may be found in /var/log/ during the installation, and
/var/log/installer/ after the computer has been booted into the installed system.
5.4.7 回報安裝報告
If you still have problems, please submit an installation report. We also encourage installation reports
to be sent even if the installation is successful, so that we can get as much information as possible on
the largest number of hardware configurations.
Note that your installation report will be published in the Debian Bug Tracking System (BTS) and
forwarded to a public mailing list. Make sure that you use an e-mail address that you do not mind
being made public.
If you have a working Debian system, the easiest way to send an installation report is to install the
installation-report and reportbug packages (apt install installation-report reportbug), configure reportbug as explained in 節 8.5.2, and run the command reportbug installation-reports.
Alternatively you can use this template when filling out installation reports, and file the report as
a bug report against the installation-reports pseudo package, by sending it to submit@bugs.
debian.org.
Package: installation-reports
Boot method: <How did you boot the installer? CD? floppy? network?>
Image version: <Full URL to image you downloaded is best>
Date: <Date and time of the install>
Machine: <Description of machine (eg, IBM Thinkpad R32)>
Processor:
Memory:
Partitions: <df -Tl will do; the raw partition table is preferred>
38
CHAPTER 5. 啟動安裝系統
5.4. 安裝過程中的障礙排除
Output of lspci -knn (or lspci -nn):
Base System Installation Checklist:
[O] = OK, [E] = Error (please elaborate below), [ ] = didn’t try it
Initial boot:
Detect network card:
Configure network:
Detect CD:
Load installer modules:
Detect hard drives:
Partition hard drives:
Install base system:
Clock/timezone setup:
User/password setup:
Install tasks:
Install boot loader:
Overall install:
[
[
[
[
[
[
[
[
[
[
[
[
[
]
]
]
]
]
]
]
]
]
]
]
]
]
Comments/Problems:
<Description of the install, in prose, and any thoughts, comments
and ideas you had during the initial install.>
In the bug report, describe what the problem is, including the last visible kernel messages in the event
of a kernel hang. Describe the steps that you did which brought the system into the problem state.
39
Chapter 6
使用 Debian 安裝程式
6.1
安裝程式如何運作
Debian 安裝程式由一些特定功能的元件組成,它們完成各自的安裝任務。每一元件執行任務時,會詢問
一些任務相關的問題。每個任務又有各自的優先級,可以在安裝程式開始時設定優先級以決定哪些問題
會被問到。
執行預設安裝時,只有必要的 (高優先級) 的問題會被問到。使得安裝過程可以高度自動化,幾乎不需
使用者干預。元件按次序執行﹔至於哪些元件會執行,取決於您使用的安裝方法,以及您的硬體。對於沒
有詢問的問題,安裝程式將採用預設值。
如何遇到麻煩,使用者會看到錯誤畫面,並且顯示安裝選單供選擇其它替代操作。如果沒有問題,使
用者將不會碰到安裝選單,只需依此回答每個元件的提問。嚴重錯誤提示的優先級為“critical”,因此使
用者總會注意到。
Some of the defaults that the installer uses can be influenced by passing boot arguments when deb
ian-installer is started. If, for example, you wish to force static network configuration (IPv6 autoconfiguration and DHCP are used by default if available), you could add the boot parameter netcfg/disable_autoconfig=true. See 節 5.3.2 for available options.
Power users may be more comfortable with a menu-driven interface, where each step is controlled
by the user rather than the installer performing each step automatically in sequence. To use the installer in a manual, menu-driven way, add the boot argument priority=medium.
If your hardware requires you to pass options to kernel modules as they are installed, you will need
to start the installer in “expert”mode. This can be done by either using the expert command to start
the installer or by adding the boot argument priority=low. Expert mode gives you full control over
debian-installer.
In the character-based environment the use of a mouse is not supported. Here are the keys you
can use to navigate within the various dialogs. The Tab or right arrow keys move “forward”, and the
Shift-Tab or left arrow keys move “backward”between displayed buttons and selections. The up and
down arrow select different items within a scrollable list, and also scroll the list itself. In addition, in
long lists, you can type a letter to cause the list to scroll directly to the section with items starting with
the letter you typed and use Pg-Up and Pg-Down to scroll the list in sections. The space bar selects an
item such as a checkbox. Use Enter to activate choices.
Some dialogs may offer additional help information. If help is available this will be indicated on the
bottom line of the screen by displaying that help information can be accessed by pressing the F1 key.
Error messages and logs are redirected to the fourth console. You can access this console by pressing Left Alt-F4 (hold the left Alt key while pressing the F4 function key); get back to the main installer
process with Left Alt-F1.
These messages can also be found in /var/log/syslog. After installation, this log is copied to
/var/log/installer/syslog on your new system. Other installation messages may be found in
/var/log/ during the installation, and /var/log/installer/ after the computer has been booted
into the installed system.
6.1.1 Using the graphical installer
The graphical installer basically works the same as the text-based installer and thus the rest of this
manual can be used to guide you through the installation process.
40
CHAPTER 6. 使用 DEBIAN 安裝程式
6.2. 元件介紹
If you prefer using the keyboard over the mouse, there are two things you need to know. To expand
a collapsed list (used for example for the selection of countries within continents), you can use the +
and - keys. For questions where more than one item can be selected (e.g. task selection), you first
need to tab to the Continue button after making your selections; hitting enter will toggle a selection,
not activate Continue.
If a dialog offers additional help information, a Help button will be displayed. The help information
can be accessed either by activating the button or by pressing the F1 key.
To switch to another console, you will also need to use the Ctrl key, just as with the X Window
System. For example, to switch to VT2 (the first debug shell) you would use: Ctrl-Left Alt-F2. The
graphical installer itself runs on VT5, so you can use Left Alt-F5 to switch back.
6.2
元件介紹
下面列出安裝程式使用的元件,和各個元件目的的簡要說明。如果您需要瞭解各元件詳細的資訊,請參
閱節 6.3。
main-menu 在安裝進行中,顯示元件列表,並執行選中的元件。主選單的優先級設為中,如果您的優先
級設為高或緊急 (預設為高),您不會看到該選單。另一方面,假如出現問題需要您決定,詢問的優
先級會臨時調低,讓您解決該問題,選單可能在這種情況下出現。
You can get to the main menu by selecting the Go Back button repeatedly to back all the way out
of the currently running component.
localechooser 讓使用者選擇安裝過程以及安裝好的系統所使用的語言、國家和地區選項。除非選取的語
言沒有被翻譯,安裝程式將以您選擇的語言顯示資訊。對於沒有翻譯的部分,將以英文顯示。
console-setup 顯示鍵盤列表,使用者在其中選擇與自己鍵盤相合的模式。
hw-detect 自動識別大多數系統硬體,包括網卡、硬碟和 PCMCIA。
cdrom-detect 尋找並掛載 Debian 安裝光碟。
netcfg 設定電腦網路連線,使它能連上網際網路。
iso-scan Searches for ISO images (.iso files) on hard drives.
choose-mirror 列出 Debian 軟體套件鏡像。使用者可以選擇從哪裡安裝軟體套件。
cdrom-checker Checks integrity of a CD-ROM. This way, the user may assure him/herself that the installation CD-ROM was not corrupted.
lowmem 它會檢測小記憶體容量的系統,並採用一些技巧從記憶體中刪除 debian-installer 不需要
的部分 (代價是喪失一些功能)。
anna Anna’s Not Nearly APT。從選擇的鏡像站或 CD 取得安裝軟體套件。
user-setup Sets up the root password, and adds a non-root user.
clock-setup Updates the system clock and determines whether the clock is set to UTC or not.
tzsetup Selects the time zone, based on the location selected earlier.
partman 讓使用者為系統安排磁碟分割區,建立檔案系統,並分配掛載點。它包括一些有趣的功能,如
自動模式或 LVM 支援。在 Debian 裡這是建議的分割工具。
partitioner 允許使用者為系統安排磁碟分割區。根據使用者電腦的架構選擇合適的分割工具。
partconf 顯示分割區列表,按照使用者指令為選擇的分割區建立檔案系統。
lvmcfg 幫助使用者配置 LVM (Logical Volume Manager)。
mdcfg 讓使用者設置軟體 磁碟陣列 (Redundant Array of Inexpensive Disks)。Software RAID 通常比新
主機板提供的廉價 IDE (虛擬硬體) RAID 控制器的高級。
base-installer 安裝一些基本的套件,讓電腦重起後能在 Debian GNU/Linux 下運行。
41
CHAPTER 6. 使用 DEBIAN 安裝程式
6.3. 使用單獨的元件
apt-setup Configures apt, mostly automatically, based on what media the installer is running from.
pkgsel Uses tasksel to select and install additional software.
os-prober 偵測目前電腦上安裝的作業系統,將資訊傳遞給 bootloader-installer,使它能將偵測到的作
業系統添加到 bootloader 的啟動選單裡面。方便使用者選擇啟動哪個操作系統。
bootloader-installer The various bootloader installers each install a boot loader program on the hard
disk, which is necessary for the computer to start up using Linux without using a floppy or CDROM. Many boot loaders allow the user to choose an alternate operating system each time the
computer boots.
shell 讓使用者能從選單或者第二控制台執行介殼。
save-logs Provides a way for the user to record information on a floppy disk, network, hard disk, or
other media when trouble is encountered, in order to accurately report installer software problems to Debian developers later.
6.3
使用單獨的元件
本節將會描述各個安裝元件的詳細資訊。各元件按使用者可以識別的階段分組。它們在安裝過程中按次序
顯示出來。注意,每次安裝並不會使用所有的模組﹔至於使用哪些模組,取決於您的安裝方法和您的硬體。
6.3.1 啟動 Debian 安裝程式與配置硬體
假設 Debian 安裝程式已經啟動,然後您看到了初始畫面。此時,debian-installer 的能力還很有限。
它還不瞭解您的硬體、語言、甚至不知道要執行什麼任務。不用擔心,因為 debian-installer 相當
聰明,它能自動探測您的硬體,尋找其餘的元件,並更新自己以具備安裝系統的能力。但您仍然要協助
debian-installer,不能自動決定的內容 (例如選擇語言,鍵盤配置或網路鏡像站)。
您會留意到 debian-installer 在本階段執行硬體偵測多次。第一次目的是指定哪些硬體需要安裝
(例如,您的 CD-ROM 或者網卡)。在第一次執行的時候並不是所有的驅動程式都就緒,硬體偵測會在後
續過程裡面多次重複。
During hardware detection debian-installer checks if any of the drivers for the hardware devices in your system require firmware to be loaded. If any firmware is requested but unavailable, a
dialog will be displayed that allows the missing firmware to be loaded from a removable medium. See
節 6.4 for further details.
6.3.1.1
Check available memory / low memory mode
debian-installer 首先要做的一件事是檢測有效的記憶體。如果記憶體有限,該元件將修改後續的
安裝進程,使您可以將 Debian GNU/Linux 安裝到您的系統上。
The first measure taken to reduce memory consumption by the installer is to disable translations,
which means that the installation can only be done in English. Of course, you can still localize the
installed system after the installation has completed.
If that is not sufficient, the installer will further reduce memory consumption by loading only those
components essential to complete a basic installation. This reduces the functionality of the installation
system. You will be given the opportunity to load additional components manually, but you should be
aware that each component you select will use additional memory and thus may cause the installation
to fail.
If the installer runs in low memory mode, it is recommended to create a relatively large swap partition (64–128MB). The swap partition will be used as virtual memory and thus increases the amount
of memory available to the system. The installer will activate the swap partition as early as possible in
the installation process. Note that heavy use of swap will reduce performance of your system and may
lead to high disk activity.
Despite these measures, it is still possible that your system freezes, that unexpected errors occur
or that processes are killed by the kernel because the system runs out of memory (which will result in
“Out of memory”messages on VT4 and in the syslog).
For example, it has been reported that creating a big ext3 file system fails in low memory mode
when there is insufficient swap space. If a larger swap doesn’t help, try creating the file system as
42
CHAPTER 6. 使用 DEBIAN 安裝程式
6.3. 使用單獨的元件
ext2 (which is an essential component of the installer) instead. It is possible to change an ext2 partition
to ext3 after the installation.
It is possible to force the installer to use a higher lowmem level than the one based on available
memory by using the boot parameter “lowmem”as described in 節 5.3.2.
6.3.1.2
選擇區域化選項
In most cases the first questions you will be asked concern the selection of localization options to be
used both for the installation and for the installed system. The localization options consist of language,
location and locales.
您選擇的語言將用於接下來的安裝過程,對話框已經有各種語言翻譯的版本。如果選擇的語言沒有對
應翻譯的版本,安裝將預設使用英文。選擇的語言也將助於選擇一個合適的鍵盤配置。
The selected geographic location (in most cases a country) will be used later in the installation
process to select the correct time zone and a Debian mirror appropriate for that country. Language
and country together will help determine the default locale for your system and select the correct
keyboard layout.
首先您將會被要求選擇您偏好的語言。語言清單中,各語言名稱將以英文列出 (左邊),而語言本身將
以適當的文字則列於右邊。清單以英文名稱排序。清單的頂端是一個額外的“C”地區選項,選擇“C”將
使得安裝程序以英文進行;locales 軟體套件將不會安裝在安裝好的系統中,因此系統也不會支援任何
地區設定。
Next you will be asked to select your geographic location. If you selected a language that is recognized as an official language for more than one country1 , you will be shown a list of only those countries.
To select a country that is not in that list, choose other (the last option). You will then be presented
with a list of continents; selecting a continent will lead to a list of relevant countries on that continent.
If the language has only one country associated with it, a list of countries will be displayed for the
continent or region the country belongs to, with that country selected as the default. Use the Go Back
option to select countries on a different continent.
注
It is important to select the country where you live or where you are located as
it determines the time zone that will be configured for the installed system.
If you selected a combination of language and country for which no locale is defined and there exist
multiple locales for the language, then the installer will allow you to choose which of those locales you
prefer as the default locale for the installed system2 . In all other cases a default locale will be selected
based on the selected language and country.
Any default locale selected as described in the previous paragraph will use UTF-8 as character encoding.
If you are installing at low priority, you will have the option of selecting additional locales, including
so-called“legacy”locales3 , to be generated for the installed system; if you do, you will be asked which
of the selected locales should be the default for the installed system.
6.3.1.3
選擇鍵盤
鍵盤經常因不同語言使用的字元不同而有不同的配置。選擇一個適合您鍵盤的配置,或者為沒出現的配
置選擇一個接近的。一旦系統安裝完畢,您可以從更大的範圍您選擇鍵盤配置 (在安裝完之後用 root 執
行 dpkg-reconfigure keyboard-configuration)。
Move the highlight to the keyboard selection you desire and press Enter. Use the arrow keys to
move the highlight —they are in the same place in all national language keyboard layouts, so they are
independent of the keyboard configuration.
1
In technical terms: where multiple locales exist for that language with differing country codes.
At medium and low priority you can always select your preferred locale from those available for the selected language (if
there’s more than one).
3 Legacy locales are locales which do not use UTF-8, but one of the older standards for character encoding such as ISO 8859-1
(used by West European languages) or EUC-JP (used by Japanese).
2
43
CHAPTER 6. 使用 DEBIAN 安裝程式
6.3.1.4
6.3. 使用單獨的元件
尋找 Debian 安裝程式 ISO 映像
當使用 hd-media 方式安裝,將會有尋找和掛載 Debian 安裝程式 iso 映像的動作,用於取得其它的安裝
檔案。元件 iso-scan 正是用來完成此任務。
首先,iso-scan 自動掛載具有已知檔案系統的資料塊 (block) 設備 (例如,分割區),然後按序搜索檔案
副檔名是 .iso (或 .ISO 之類)。注意,第一次只嘗試掃瞄位於根目錄和第一層子目錄的檔案 (例如,它
找到 /whatever.iso, /data/whatever.iso,而不是 /data/tmp/whatever.iso)。在 iso 映像檔案
找到後,iso-scan 會檢查它包含的內容,確定該映像檔是不是有效的 Debian iso 映像。如為前者,任務
結束﹔如果是後者,iso-scan 會搜索其它的映像檔案。
萬一前面嘗試尋找 iso 映像失敗,iso-scan 會詢問您是否原意進行完整的搜索。這次不只查看最上級
目錄,而是真正地搜尋整個檔案系統。
如果 iso-scan 找不到您的安裝 iso 映像檔,請重新啟動返回到您以前的作業系統,檢查映像檔名
是否正確 (以 .iso 結尾),是否放在一個能被 debian-installer 識別的檔案系統上,是否損壞 (用
checksum 校驗)。有經驗的 Unix 使用者可以在第二個控制台上完成這些動作,而毋須重新啟動。
6.3.1.5
Configuring the Network
到了此步驟,如果系統檢測到您有多於網路設備,您將被要求選擇哪個設備是您的主網路介面,例如,您
在安裝中要用的那個。其他的網路介面這時不會被設定。您可以在安裝完畢之後去設定額外的介面﹔請參
考 interfaces(5) man 頁。
6.3.1.5.1 Automatic network configuration By default, debian-installer tries to configure your
computer’s network automatically as far as possible. If the automatic configuration fails, that may be
caused by many factors ranging from an unplugged network cable to missing infrastructure for automatic configuration. For further explanation in case of errors, check the error messages on the fourth
console. In any case, you will be asked if you want to retry, or if you want to perform a manual setup.
Sometimes the network services used for autoconfiguration can be slow in their responses, so if you
are sure everything is in place, simply start the autoconfiguration attempt again. If autoconfiguration
fails repeatedly, you can instead choose the manual network setup.
6.3.1.5.2 Manual network configuration The manual network setup in turn asks you a number of
questions about your network, notably IP address, Netmask, Gateway, Name server addres
ses, and a Hostname. Moreover, if you have a wireless network interface, you will be asked to provide
your Wireless ESSID (“wireless network name”) and a WEP key or WPA/WPA2 passphrase. Fill
in the answers from 節 3.3.
注
Some technical details you might, or might not, find handy: the program assumes the network IP address is the bitwise-AND of your system’s IP address and your netmask. The default broadcast address is calculated as the
bitwise OR of your system’s IP address with the bitwise negation of the netmask. It will also guess your gateway. If you can’t find any of these answers, use the offered defaults —if necessary, you can change them by editing
/etc/network/interfaces once the system has been installed.
6.3.1.5.3 IPv4 and IPv6 From Debian GNU/Linux 7.0 (“Wheezy”) onwards, debian-installer
supports IPv6 as well as the “classic”IPv4. All combinations of IPv4 and IPv6 (IPv4-only, IPv6-only
and dual-stack configurations) are supported.
Autoconfiguration for IPv4 is done via DHCP (Dynamic Host Configuration Protocol). Autoconfiguration for IPv6 supports stateless autoconfiguration using NDP (Neighbor Discovery Protocol, including
recursive DNS server (RDNSS) assignment), stateful autoconfiguration via DHCPv6 and mixed stateless/stateful autoconfiguration (address configuration via NDP, additional parameters via DHCPv6).
44
CHAPTER 6. 使用 DEBIAN 安裝程式
6.3.1.6
6.3. 使用單獨的元件
Configuring the Clock and Time Zone
The installer will first attempt to connect to a time server on the Internet (using the NTP protocol) in
order to correctly set the system time. If this does not succeed, the installer will assume the time and
date obtained from the system clock when the installation system was booted are correct. It is not
possible to manually set the system time during the installation process.
Depending on the location selected earlier in the installation process, you may be shown a list of
time zones relevant for that location. If your location has only one time zone and you are doing a
default installation, you will not be asked anything and the system will assume that time zone.
In expert mode or when installing at medium priority, you will have the additional option to select
“Coordinated Universal Time”(UTC) as time zone.
If for some reason you wish to set a time zone for the installed system that does not match the
selected location, there are two options.
1. The simplest option is to just select a different time zone after the installation has been completed
and you’ve booted into the new system. The command to do this is:
# dpkg-reconfigure tzdata
2. Alternatively, the time zone can be set at the very start of the installation by passing the parameter
time/zone=value when you boot the installation system. The value should of course be a valid
time zone, for example Europe/London or UTC.
For automated installations the time zone can be set to any desired value using preseeding.
6.3.2 設定使用者和密碼
Just before configuring the clock, the installer will allow you to set up the “root”account and/or an
account for the first user. Other user accounts can be created after the installation has been completed.
6.3.2.1
設定 root 密碼
root 帳戶也被稱為超級使用者。系統中的所有安全防護措施對以超級使用者身份登陸者都是無效的。root
帳戶應該僅用來進行系統管理,而且使用時間應該盡可能短。
您所建立的任何密碼都應該包含至少 6 個字元,同時包含大小寫字母,並且最好帶有標點符號等特殊
字元。因為超級使用者具有最高權限,因此在您設定 root 密碼時尤其要小心。請避免採用能夠在字典中
查到的單詞或者很容易猜測的個人資訊。
如果他人向您索取您的 root 密碼,您也需要特別謹慎。除非您所管理的系統有多位管理員,否則您
通常不應該將超級使用者密碼交給別人。
In case you do not specify a password for the“root”user here, this account will be disabled but the
sudo package will be installed later to enable administrative tasks to be carried out on the new system.
By default, the first user created on the system will be allowed to use the sudo command to become
root.
6.3.2.2
建立一個普通使用者
系統會詢問您現在是否希望建立一個普通帳戶。您將使用該帳戶進行日常登陸操作。切記,平時不要使
用 root 帳戶登陸或者將其作為個人帳號使用。
為什麼呢?避免使用 root 特權帳戶的一個原因是,它很容易對系統造成無法挽回的破壞。另一個原
因是,您有可能被惡意誘使執行特洛伊木馬程式—這是一種在您未知的情況下利用超級使用者權限損害
系統安全的程式。任何合格的 Unix 系統管理書籍中都會涉及到這一主題—如果您不是很瞭解這方面的內
容,建議您找一本書進行學習。
您首先會被要求輸入使用者的全名。然後要求輸入使用者帳號名﹔通常為姓之類的即可,並且會成為
預設值。最後,您將要求輸入該帳號的密碼。
如果在安裝完畢後您還希望建立其它新帳戶,請使用 adduser 命令。
45
CHAPTER 6. 使用 DEBIAN 安裝程式
6.3. 使用單獨的元件
6.3.3 分割區與選擇掛載點
At this time, after hardware detection has been executed a final time, debian-installer should be
at its full strength, customized for the user’s needs and ready to do some real work. As the title of
this section indicates, the main task of the next few components lies in partitioning your disks, creating
filesystems, assigning mountpoints and optionally configuring closely related options like RAID, LVM or
encrypted devices.
If you are uncomfortable with partitioning, or just want to know more details, see 附錄 C.
First you will be given the opportunity to automatically partition either an entire drive, or available
free space on a drive. This is also called “guided”partitioning. If you do not want to autopartition,
choose Manual from the menu.
6.3.3.1
Supported partitioning options
The partitioner used in debian-installer is fairly versatile. It allows to create many different partitioning schemes, using various partition tables, file systems and advanced block devices.
Exactly which options are available depends mainly on the architecture, but also on other factors.
For example, on systems with limited internal memory some options may not be available. Defaults
may vary as well. The type of partition table used by default can for example be different for large
capacity hard disks than for smaller hard disks. Some options can only be changed when installing at
medium or low debconf priority; at higher priorities sensible defaults will be used.
The installer supports various forms of advanced partitioning and use of storage devices, which in
many cases can be used in combination.
• Logical Volume Management (LVM)
• Software RAID
Supported are RAID levels 0, 1, 4, 5, 6 and 10.
• Encryption
• Serial ATA RAID (using dmraid)
Also called“fake RAID”or“BIOS RAID”. Support for Serial ATA RAID is currently only available
if enabled when the installer is booted. Further information is available on our Wiki.
• Multipath (experimental)
See our Wiki for information. Support for multipath is currently only available if enabled when
the installer is booted.
The following file systems are supported.
• ext2, ext3, ext4
The default file system selected in most cases is ext4; for /boot partitions ext2 will be selected
by default when guided partitioning is used.
• jfs (not available on all architectures)
• xfs (not available on all architectures)
• reiserfs (optional; not available on all architectures)
Support for the Reiser file system is no longer available by default. When the installer is running at medium or low debconf priority it can be enabled by selecting the partman-reiserfs
component. Only version 3 of the file system is supported.
• qnx4
Existing partitions will be recognized and it is possible to assign mount points for them. It is not
possible to create new qnx4 partitions.
• FAT16, FAT32
• NTFS (read-only)
Existing NTFS partitions can be resized and it is possible to assign mount points for them. It is
not possible to create new NTFS partitions.
46
CHAPTER 6. 使用 DEBIAN 安裝程式
6.3.3.2
6.3. 使用單獨的元件
Guided Partitioning
If you choose guided partitioning, you may have three options: to create partitions directly on the hard
disk (classic method), or to create them using Logical Volume Management (LVM), or to create them
using encrypted LVM4 .
注
The option to use (encrypted) LVM may not be available on all architectures.
When using LVM or encrypted LVM, the installer will create most partitions inside one big partition;
the advantage of this method is that partitions inside this big partition can be resized relatively easily
later. In the case of encrypted LVM the big partition will not be readable without knowing a special key
phrase, thus providing extra security of your (personal) data.
When using encrypted LVM, the installer will also automatically erase the disk by writing random
data to it. This further improves security (as it makes it impossible to tell which parts of the disk are in
use and also makes sure that any traces of previous installations are erased), but may take some time
depending on the size of your disk.
注
If you choose guided partitioning using LVM or encrypted LVM, some changes in
the partition table will need to be written to the selected disk while LVM is being
set up. These changes effectively erase all data that is currently on the selected
hard disk and you will not be able to undo them later. However, the installer
will ask you to confirm these changes before they are written to disk.
If you choose guided partitioning (either classic or using (encrypted) LVM) for a whole disk, you will
first be asked to select the disk you want to use. Check that all your disks are listed and, if you have
several disks, make sure you select the correct one. The order they are listed in may differ from what
you are used to. The size of the disks may help to identify them.
Any data on the disk you select will eventually be lost, but you will always be asked to confirm any
changes before they are written to the disk. If you have selected the classic method of partitioning, you
will be able to undo any changes right until the end; when using (encrypted) LVM this is not possible.
Next, you will be able to choose from the schemes listed in the table below. All schemes have their
pros and cons, some of which are discussed in 附錄 C. If you are unsure, choose the first one. Bear
in mind that guided partitioning needs a certain minimal amount of free space to operate with. If you
don’t give it at least about 1GB of space (depends on chosen scheme), guided partitioning will fail.
分割區方式
所有檔案在同一分割區
Separate /home partition
Separate /home, /var and
/tmp partitions
所需最小空間
600MB
500MB
所新建的分割區
/, swap
/, /home, swap
1GB
/, /home, /var, /tmp, swap
If you choose guided partitioning using (encrypted) LVM, the installer will also create a separate
/boot partition. The other partitions, including the swap partition, will be created inside the LVM
partition.
If you have booted in EFI mode then within the guided partitioning setup there will be an additional
partition, formatted as a FAT32 bootable filesystem, for the EFI boot loader. This partition is known as
an EFI System Partition (ESP). There is also an additional menu item in the formatting menu to manually
set up a partition as an ESP.
在選定了分割區方式後的下一個畫面,您會看到關於自己分割區的一張表格,上面標明了分割區是否
將被格式化,將以何種方式格式化,以及它們將被掛載到哪裡的相關資訊。
4
The installer will encrypt the LVM volume group using a 256 bit AES key and makes use of the kernel’s“dm-crypt”support.
47
CHAPTER 6. 使用 DEBIAN 安裝程式
6.3. 使用單獨的元件
分割區表格的格式如下:
SCSI1 (0,0,0) (sda) - 6.4 GB WDC AC36400L
#1 primary
16.4 MB
ext2
/boot
#2 primary 551.0 MB
swap
swap
#3 primary
5.8 GB
ntfs
pri/log
8.2 MB
FREE SPACE
SCSI2 (1,0,0) (sdb) - 80.0 GB ST380021A
#1 primary
15.9 MB
ext3
#2 primary 996.0 MB
fat16
#3 primary
3.9 GB
xfs
#5 logical
6.0 GB
f ext4
#6 logical
1.0 GB
ext3
#7 logical 498.8 GB
ext3
/home
/
/var
本例中有兩塊硬碟,它們分別被分割成了幾個分割區。其中,第一塊硬碟上還有些未使用空間。表中,每
行列出了分割區編號、其類型、分割區大小、可選的旗標、採用的檔案系統,及其掛載點 (如果有的話)。
This concludes the guided partitioning. If you are satisfied with the generated partition table, you
can choose Finish partitioning and write changes to disk from the menu to implement the new partition
table (as described at the end of this section). If you are not happy, you can choose to Undo changes
to partitions and run guided partitioning again, or modify the proposed changes as described below
for manual partitioning.
6.3.3.3
Manual Partitioning
如果您選擇了手動分割區的話,它的畫面和上面介紹的嚮導式分割區大體上相同。不同之處在於,畫面
上顯示的是您目前的分割區列表,而且其中並沒有掛載點的資訊。關於如何手動設置您的分割區表,以
及新安裝的 Debian 系統將如何使用這些分割區,這些內容將會在本節的後面談到。
If you select a pristine disk which has neither partitions nor free space on it, you will be asked if a
new partition table should be created (this is needed so you can create new partitions). After this, a
new line entitled “FREE SPACE”should appear in the table under the selected disk.
If you select some free space, you will have the opportunity to create a new partition. You will have
to answer a quick series of questions about its size, type (primary or logical), and location (beginning or
end of the free space). After this, you will be presented with a detailed overview of your new partition.
The main setting is Use as:, which determines if the partition will have a file system on it, or be used
for swap, software RAID, LVM, an encrypted file system, or not be used at all. Other settings include
mountpoint, mount options, and bootable flag; which settings are shown depends on how the partition
is to be used. If you don’t like the preselected defaults, feel free to change them to your liking. E.g. by
selecting the option Use as:, you can choose a different filesystem for this partition, including options
to use the partition for swap, software RAID, LVM, or not use it at all. When you are satisfied with your
new partition, select Done setting up the partition and you will return to partman’s main screen.
If you decide you want to change something about your partition, simply select the partition, which
will bring you to the partition configuration menu. This is the same screen as is used when creating
a new partition, so you can change the same settings. One thing that may not be very obvious at a
first glance is that you can resize the partition by selecting the item displaying the size of the partition.
Filesystems known to work are at least fat16, fat32, ext2, ext3 and swap. This menu also allows you to
delete a partition.
請確保至少分出兩個分割區:其中一個作為 root 檔案系統 (它必須掛載到 /) 另一個用於 swap。若是
您忘記了掛載根 (root) 檔案系統的話,partman 會拒絕讓您繼續下面的步驟,直到您改正了這個錯誤。
If you boot in EFI mode but forget to select and format an EFI System Partition, partman will detect
this and will not let you continue until you allocate one.
由於 partman 的功能是透過安裝本套件的各模組功能以延伸和擴展,但是具體又因您的系統的架構
而有所區別。因此,如果您發現安裝的實際情況與我們所言不符,缺少了某些功能特性,那麼請檢查一
下,確保已掛載了所有必須的模組 (例如 partman-ext3、partman-xfs 或者 partman-lvm)。
對分割區設定感到滿意後,就可以選擇分割區選單中的結束磁碟分割作業並將變更寫入磁碟中一項。
在這之後,會出現一個清單,列出即將在硬碟上進行的所有操作。此時,安裝程式會讓您確認是否就照
此設定進行分割。
48
CHAPTER 6. 使用 DEBIAN 安裝程式
6.3.3.4
6.3. 使用單獨的元件
Configuring Multidisk Devices (Software RAID)
If you have more than one harddrive5 in your computer, you can use mdcfg to set up your drives for
increased performance and/or better reliability of your data. The result is called Multidisk Device (or
after its most famous variant software RAID).
MD 本質上是一組位於部分磁碟上的分割區,組合在一起形成一個 邏輯設備。該設備可以像正常的分
割區一樣使用 (例如可以用 partman 格式化,分配掛載點,等等)。
What benefits this brings depends on the type of MD device you are creating. Currently supported
are:
RAID0 Is mainly aimed at performance. RAID0 splits all incoming data into stripes and distributes
them equally over each disk in the array. This can increase the speed of read/write operations,
but when one of the disks fails, you will lose everything (part of the information is still on the
healthy disk(s), the other part was on the failed disk).
The typical use for RAID0 is a partition for video editing.
RAID1 Is suitable for setups where reliability is the first concern. It consists of several (usually two)
equally-sized partitions where every partition contains exactly the same data. This essentially
means three things. First, if one of your disks fails, you still have the data mirrored on the remaining disks. Second, you can use only a fraction of the available capacity (more precisely, it
is the size of the smallest partition in the RAID). Third, file-reads are load-balanced among the
disks, which can improve performance on a server, such as a file server, that tends to be loaded
with more disk reads than writes.
Optionally you can have a spare disk in the array which will take the place of the failed disk in the
case of failure.
RAID5 Is a good compromise between speed, reliability and data redundancy. RAID5 splits all incoming
data into stripes and distributes them equally on all but one disk (similar to RAID0). Unlike RAID0,
RAID5 also computes parity information, which gets written on the remaining disk. The parity disk
is not static (that would be called RAID4), but is changing periodically, so the parity information
is distributed equally on all disks. When one of the disks fails, the missing part of information
can be computed from remaining data and its parity. RAID5 must consist of at least three active
partitions. Optionally you can have a spare disk in the array which will take the place of the failed
disk in the case of failure.
As you can see, RAID5 has a similar degree of reliability to RAID1 while achieving less redundancy.
On the other hand, it might be a bit slower on write operations than RAID0 due to computation
of parity information.
RAID6 Is similar to RAID5 except that it uses two parity devices instead of one.
A RAID6 array can survive up to two disk failures.
RAID10 RAID10 combines striping (as in RAID0) and mirroring (as in RAID1). It creates n copies of
incoming data and distributes them across the partitions so that none of the copies of the same
data are on the same device. The default value of n is 2, but it can be set to something else in
expert mode. The number of partitions used must be at least n. RAID10 has different layouts for
distributing the copies. The default is near copies. Near copies have all of the copies at about the
same offset on all of the disks. Far copies have the copies at different offsets on the disks. Offset
copies copy the stripe, not the individual copies.
RAID10 can be used to achieve reliability and redundancy without the drawback of having to
calculate parity.
To sum it up:
類型
最少設備
備用設備
倖免於磁碟損
壞?
可用空間
RAID0
2
否
否
容量為最小分割
區容量乘以 RAID
設備數
5 To be honest, you can construct an MD device even from partitions residing on single physical drive, but that won’t give
any benefits.
49
CHAPTER 6. 使用 DEBIAN 安裝程式
6.3. 使用單獨的元件
類型
最少設備
備用設備
倖免於磁碟損
壞?
RAID1
2
可選
是
RAID5
3
可選
是
RAID6
4
可選
是
RAID10
2
可選
是
可用空間
容量為 RAID 中
的最小分割區
容量為最小分割
區乘以 (RAID 設
備數量減一)
Size of the
smallest
partition
multiplied by
(number of
devices in RAID
minus two)
Total of all
partitions
divided by the
number of
chunk copies
(defaults to two)
If you want to know more about Software RAID, have a look at Software RAID HOWTO.
為了建立 MD 設備,您需要將欲參與陣列的分割區標記為供 RAID 使用。(透過 partman 命令中的分
割區設定:選單完成,您應該選擇用途: → RAID 的物理容量。)
注
Make sure that the system can be booted with the partitioning scheme you are
planning. In general it will be necessary to create a separate file system for
/boot when using RAID for the root (/) file system. Most boot loaders (including
lilo and grub) do support mirrored (not striped!) RAID1, so using for example
RAID5 for / and RAID1 for /boot can be an option.
Next, you should choose Configure software RAID from the main partman menu. (The menu will
only appear after you mark at least one partition for use as physical volume for RAID.) On the first
screen of mdcfg simply select Create MD device. You will be presented with a list of supported types
of MD devices, from which you should choose one (e.g. RAID1). What follows depends on the type of
MD you selected.
• RAID0 是簡單的—您會看到可用的 RAID 分割區,然後您的任務僅是選擇那些想要組成 MD 的分割
區。
• RAID1 is a bit more tricky. First, you will be asked to enter the number of active devices and the
number of spare devices which will form the MD. Next, you need to select from the list of available
RAID partitions those that will be active and then those that will be spare. The count of selected
partitions must be equal to the number provided earlier. Don’t worry. If you make a mistake
and select a different number of partitions, debian-installer won’t let you continue until
you correct the issue.
• RAID5 has a setup procedure similar to RAID1 with the exception that you need to use at least
three active partitions.
• RAID6 also has a setup procedure similar to RAID1 except that at least four active partitions are
required.
• RAID10 again has a setup procedure similar to RAID1 except in expert mode. In expert mode,
debian-installer will ask you for the layout. The layout has two parts. The first part is the
layout type. It is either n (for near copies), f (for far copies), or o (for offset copies). The second
part is the number of copies to make of the data. There must be at least that many active devices
so that all of the copies can be distributed onto different disks.
50
CHAPTER 6. 使用 DEBIAN 安裝程式
6.3. 使用單獨的元件
It is perfectly possible to have several types of MD at once. For example, if you have three 200
GB hard drives dedicated to MD, each containing two 100 GB partitions, you can combine the first
partitions on all three disks into the RAID0 (fast 300 GB video editing partition) and use the other three
partitions (2 active and 1 spare) for RAID1 (quite reliable 100 GB partition for /home).
按您的需要設定 MD 設備之後,您可以結束 mdcfg 返回到 partman 去建立 MD 設備的檔案系統並分
配掛載點。
6.3.3.5
Configuring the Logical Volume Manager (LVM)
如果您做電腦系統管理員工作或者“進階”使用者,您一定遇過磁碟分區 (經常是最重要的那個) 空間不
足,同時其他的分割區卻不能平衡使用,然後您不得不被移動檔案或符號鏈結等方法所困擾。
To avoid the described situation you can use Logical Volume Manager (LVM). Simply said, with LVM
you can combine your partitions (physical volumes in LVM lingo) to form a virtual disk (so called volume
group), which can then be divided into virtual partitions (logical volumes). The point is that logical
volumes (and of course underlying volume groups) can span across several physical disks.
Now when you realize you need more space for your old 160GB /home partition, you can simply
add a new 300GB disk to the computer, join it with your existing volume group and then resize the
logical volume which holds your /home filesystem and voila —your users have some room again on
their renewed 460GB partition. This example is of course a bit oversimplified. If you haven’t read it
yet, you should consult the LVM HOWTO.
LVM setup in debian-installer is quite simple and completely supported inside partman. First,
you have to mark the partition(s) to be used as physical volumes for LVM. This is done in the Partition
settings menu where you should select Use as: → physical volume for LVM.
When you return to the main partman screen, you will see a new option Configure the Logical
Volume Manager. When you select that, you will first be asked to confirm pending changes to the
partition table (if any) and after that the LVM configuration menu will be shown. Above the menu a
summary of the LVM configuration is shown. The menu itself is context sensitive and only shows valid
actions. The possible actions are:
• Display configuration details: shows LVM device structure, names and sizes of logical volumes
and more
• Create volume group
• Create logical volume
• Delete volume group
• Delete logical volume
• Extend volume group
• Reduce volume group
• Finish: return to the main partman screen
Use the options in that menu to first create a volume group and then create your logical volumes
inside it.
After you return to the main partman screen, any created logical volumes will be displayed in the
same way as ordinary partitions (and you should treat them as such).
6.3.3.6
Configuring Encrypted Volumes
debian-installer allows you to set up encrypted partitions. Every file you write to such a partition
is immediately saved to the device in encrypted form. Access to the encrypted data is granted only
after entering the passphrase used when the encrypted partition was originally created. This feature
is useful to protect sensitive data in case your laptop or hard drive gets stolen. The thief might get
physical access to the hard drive, but without knowing the right passphrase, the data on the hard drive
will look like random characters.
The two most important partitions to encrypt are: the home partition, where your private data
resides, and the swap partition, where sensitive data might be stored temporarily during operation.
Of course, nothing prevents you from encrypting any other partitions that might be of interest. For
51
CHAPTER 6. 使用 DEBIAN 安裝程式
6.3. 使用單獨的元件
example /var where database servers, mail servers or print servers store their data, or /tmp which
is used by various programs to store potentially interesting temporary files. Some people may even
want to encrypt their whole system. The only exception is the /boot partition which must remain
unencrypted, because currently there is no way to load the kernel from an encrypted partition.
注
Please note that the performance of encrypted partitions will be less than that
of unencrypted ones because the data needs to be decrypted or encrypted for
every read or write. The performance impact depends on your CPU speed, chosen cipher and a key length.
To use encryption, you have to create a new partition by selecting some free space in the main
partitioning menu. Another option is to choose an existing partition (e.g. a regular partition, an LVM
logical volume or a RAID volume). In the Partition settings menu, you need to select physical volume for
encryption at the Use as: option. The menu will then change to include several cryptographic options
for the partition.
The encryption method supported by debian-installer is dm-crypt (included in newer Linux
kernels, able to host LVM physical volumes).
Let’s have a look at the options available when you select encryption via Device-mapper (dmcrypt). As always: when in doubt, use the defaults, because they have been carefully chosen with
security in mind.
Encryption: aes This option lets you select the encryption algorithm (cipher) which will be used to
encrypt the data on the partition. debian-installer currently supports the following block
ciphers: aes, blowfish, serpent, and twofish. It is beyond the scope of this document to discuss
the qualities of these different algorithms, however, it might help your decision to know that in
2000, AES was chosen by the American National Institute of Standards and Technology as the
standard encryption algorithm for protecting sensitive information in the 21st century.
Key size: 256 Here you can specify the length of the encryption key. With a larger key size, the strength
of the encryption is generally improved. On the other hand, increasing the length of the key
usually has a negative impact on performance. Available key sizes vary depending on the cipher.
IV algorithm: xts-plain64 The Initialization Vector or IV algorithm is used in cryptography to ensure
that applying the cipher on the same clear text data with the same key always produces a unique
cipher text. The idea is to prevent the attacker from deducing information from repeated patterns
in the encrypted data.
From the provided alternatives, the default xts-plain64 is currently the least vulnerable to
known attacks. Use the other alternatives only when you need to ensure compatibility with some
previously installed system that is not able to use newer algorithms.
Encryption key: Passphrase Here you can choose the type of the encryption key for this partition.
Passphrase The encryption key will be computed6 on the basis of a passphrase which you will be
able to enter later in the process.
Random key A new encryption key will be generated from random data each time you try to bring
up the encrypted partition. In other words: on every shutdown the content of the partition
will be lost as the key is deleted from memory. (Of course, you could try to guess the key
with a brute force attack, but unless there is an unknown weakness in the cipher algorithm,
it is not achievable in our lifetime.)
Random keys are useful for swap partitions because you do not need to bother yourself
with remembering the passphrase or wiping sensitive information from the swap partition
before shutting down your computer. However, it also means that you will not be able to use
the “suspend-to-disk”functionality offered by newer Linux kernels as it will be impossible
(during a subsequent boot) to recover the suspended data written to the swap partition.
6
Using a passphrase as the key currently means that the partition will be set up using LUKS.
52
CHAPTER 6. 使用 DEBIAN 安裝程式
6.3. 使用單獨的元件
Erase data: yes Determines whether the content of this partition should be overwritten with random
data before setting up the encryption. This is recommended because it might otherwise be possible for an attacker to discern which parts of the partition are in use and which are not. In addition,
this will make it harder to recover any leftover data from previous installations7 .
After you have selected the desired parameters for your encrypted partitions, return back to the
main partitioning menu. There should now be a new menu item called Configure encrypted volumes.
After you select it, you will be asked to confirm the deletion of data on partitions marked to be erased
and possibly other actions such as writing a new partition table. For large partitions this might take
some time.
Next you will be asked to enter a passphrase for partitions configured to use one. Good passphrases
should be longer than 8 characters, should be a mixture of letters, numbers and other characters
and should not contain common dictionary words or information easily associable with you (such as
birthdates, hobbies, pet names, names of family members or relatives, etc.).
警告
Before you input any passphrases, you should have made sure that your keyboard is configured correctly and generates the expected characters. If you
are unsure, you can switch to the second virtual console and type some text at
the prompt. This ensures that you won’t be surprised later, e.g. by trying to
input a passphrase using a qwerty keyboard layout when you used an azerty
layout during the installation. This situation can have several causes. Maybe
you switched to another keyboard layout during the installation, or the selected
keyboard layout might not have been set up yet when entering the passphrase
for the root file system.
If you selected to use methods other than a passphrase to create encryption keys, they will be
generated now. Because the kernel may not have gathered a sufficient amount of entropy at this early
stage of the installation, the process may take a long time. You can help speed up the process by
generating entropy: e.g. by pressing random keys, or by switching to the shell on the second virtual
console and generating some network and disk traffic (downloading some files, feeding big files into
/dev/null, etc.). This will be repeated for each partition to be encrypted.
After returning to the main partitioning menu, you will see all encrypted volumes as additional
partitions which can be configured in the same way as ordinary partitions. The following example
shows a volume encrypted via dm-crypt.
Encrypted volume (sda2_crypt) - 115.1 GB Linux device-mapper
#1 115.1 GB F ext3
Now is the time to assign mount points to the volumes and optionally change the file system types if
the defaults do not suit you.
Pay attention to the identifiers in parentheses (sda2_crypt in this case) and the mount points you
assigned to each encrypted volume. You will need this information later when booting the new system.
The differences between the ordinary boot process and the boot process with encryption involved will
be covered later in 節 7.2.
Once you are satisfied with the partitioning scheme, continue with the installation.
6.3.4 安裝基本系統
Although this stage is the least problematic, it consumes a significant fraction of the install because
it downloads, verifies and unpacks the whole base system. If you have a slow computer or network
connection, this could take some time.
During installation of the base system, package unpacking and setup messages are redirected to
tty4. You can access this terminal by pressing Left Alt-F4; get back to the main installer process with
Left Alt-F1.
7 It is believed that the guys from three-letter agencies can restore the data even after several rewrites of the magnetooptical
media, though.
53
CHAPTER 6. 使用 DEBIAN 安裝程式
6.3. 使用單獨的元件
The unpack/setup messages generated during this phase are also saved in /var/log/syslog. You
can check them there if the installation is performed over a serial console.
作為安裝的一部分,Linux 核心也會被安裝。在預設的優先等級下,安裝程式會選擇一個與您硬體最
匹配的核心。在較低的優先級下,您可以從列表中選擇一個有效的核心。
When packages are installed using the package management system, it will by default also install
packages that are recommended by those packages. Recommended packages are not strictly required
for the core functionality of the selected software, but they do enhance that software and should, in
the view of the package maintainers, normally be installed together with that software.
注
For technical reasons packages installed during the installation of the base system are installed without their“Recommends”. The rule described above only
takes effect after this point in the installation process.
6.3.5 Installing Additional Software
At this point you have a usable but limited system. Most users will want to install additional software
on the system to tune it to their needs, and the installer allows you do so. This step can take even
longer than installing the base system if you have a slow computer or network connection.
6.3.5.1
Configuring apt
One of the tools used to install packages on a Debian GNU/Linux system is the program apt, from
the apt package8 . Other front-ends for package management, like aptitude and synaptic, are also in
use. These front-ends are recommended for new users, since they integrate some additional features
(package searching and status checks) in a nice user interface.
apt must be configured so that it knows from where to retrieve packages. The results of this configuration are written to the file /etc/apt/sources.list. You can examine and edit this file to your
liking after the installation is complete.
If you are installing at default priority, the installer will largely take care of the configuration automatically, based on the installation method you are using and possibly using choices made earlier
in the installation. In most cases the installer will automatically add a security mirror and, if you are
installing the stable distribution, a mirror for the “stable-updates”service.
If you are installing at a lower priority (e.g. in expert mode), you will be able to make more decisions
yourself. You can choose whether or not to use the security and/or stable-updates services, and you
can choose to add packages from the “contrib”and “non-free”sections of the archive.
6.3.5.1.1 Installing from more than one CD or DVD If you are installing from a CD or a DVD that
is part of a larger set, the installer will ask if you want to scan additional CDs or DVDs. If you have
additional CDs or DVDs available, you probably want to do this so the installer can use the packages
included on them.
If you do not have any additional CDs or DVDs, that is no problem: using them is not required. If you
also do not use a network mirror (as explained in the next section), it can mean that not all packages
belonging to the tasks you select in the next step of the installation can be installed.
8 Note that the program which actually installs the packages is called dpkg. However, this program is more of a low-level tool.
apt is a higher-level tool, which will invoke dpkg as appropriate. It knows how to retrieve packages from your CD, the network,
or wherever. It is also able to automatically install other packages which are required to make the package you’re trying to
install work correctly.
54
CHAPTER 6. 使用 DEBIAN 安裝程式
6.3. 使用單獨的元件
注
Packages are included on CDs (and DVDs) in the order of their popularity. This
means that for most uses only the first CDs in a set are needed and that only
very few people actually use any of the packages included on the last CDs in a
set.
It also means that buying or downloading and burning a full CD set is just a waste
of money as you’ll never use most of them. In most cases you are better off
getting only the first 3 to 8 CDs and installing any additional packages you may
need from the Internet by using a mirror. The same goes for DVD sets: the first
DVD, or maybe the first two DVDs will cover most needs.
If you do scan multiple CDs or DVDs, the installer will prompt you to exchange them when it needs
packages from another CD/DVD than the one currently in the drive. Note that only CDs or DVDs that
belong to the same set should be scanned. The order in which they are scanned does not really matter,
but scanning them in ascending order will reduce the chance of mistakes.
6.3.5.1.2 Using a network mirror One question that will be asked during most installs is whether or
not to use a network mirror as a source for packages. In most cases the default answer should be fine,
but there are some exceptions.
If you are not installing from a full CD or DVD or using a full CD/DVD image, you really should use a
network mirror as otherwise you will end up with only a very minimal system. However, if you have a
limited Internet connection it is best not to select the desktop task in the next step of the installation.
If you are installing from a single full CD or using a full CD image, using a network mirror is not
required, but is still strongly recommended because a single CD contains only a fairly limited number
of packages. If you have a limited Internet connection it may still be best to not select a network
mirror here, but to finish the installation using only what’s available on the CD and selectively install
additional packages after the installation (i.e. after you have rebooted into the new system).
If you are installing from a DVD or using a DVD image, any packages needed during the installation
should be present on the first DVD. The same is true if you have scanned multiple CDs as explained in
the previous section. Use of a network mirror is optional.
One advantage of adding a network mirror is that updates that have occurred since the CD/DVD
set was created and have been included in a point release, will become available for installation, thus
extending the life of your CD/DVD set without compromising the security or stability of the installed
system.
In summary: selecting a network mirror is generally a good idea, except if you do not have a good
Internet connection. If the current version of a package is available from CD/DVD, the installer will
always use that. The amount of data that will be downloaded if you do select a mirror thus depends
on
1. the tasks you select in the next step of the installation,
2. which packages are needed for those tasks,
3. which of those packages are present on the CDs or DVDs you have scanned, and
4. whether any updated versions of packages included on the CDs or DVDs are available from a
mirror (either a regular package mirror, or a mirror for security or stable-updates).
Note that the last point means that, even if you choose not to use a network mirror, some packages
may still be downloaded from the Internet if there is a security or stable-updates update available for
them and those services have been configured.
6.3.5.1.3 Choosing a network mirror If you have selected to use a network mirror during the installation (optional for CD/DVD installs, required for netboot images), you will be presented with a list of
geographically nearby (and therefore hopefully fast) network mirrors, based upon your country selection earlier in the installation process. Choosing the offered default is usually fine.
55
CHAPTER 6. 使用 DEBIAN 安裝程式
6.3. 使用單獨的元件
A mirror can also be specified by hand by choosing “enter information manually”. You can then
specify a mirror host name and an optional port number. As of Wheezy, that actually has to be a URL
base, i.e. when specifying an IPv6 address, one has to add square brackets around it, for instance
“[2001:db8::1]”.
If your computer is on an IPv6-only network (which is probably not the case for the vast majority
of users), using the default mirror for your country might not work. All the mirrors in the list are
reachable via IPv4, but only some of them can be used via IPv6. As connectivity of individual mirrors
can change over time, this information is not available in the installer. If there is no IPv6 connectivity
for the default mirror for your country, you can either try some of the other mirrors offered to you
or choose the “enter information manually”option. You can then specify “ftp.ipv6.debian.org”as
the mirror name, which is an alias for a mirror available via IPv6, although it will probably not be the
fastest possible one.
Another option when choosing to specify the mirror manually is to use “httpredir.debian.org”as
your mirror. “httpredir.debian.org”is not a physical mirror but a mirror redirection service, i.e. it
automatically refers your system to a real mirror near you in terms of network topology. It takes into
account by which protocol you connect to it, i.e. if you use IPv6, it will refer you to an IPv6-capable
mirror near you.
6.3.5.2
Selecting and Installing Software
During the installation process, you are given the opportunity to select additional software to install.
Rather than picking individual software packages from the 75573 available packages, this stage of the
installation process focuses on selecting and installing predefined collections of software to quickly set
up your computer to perform various tasks.
So, you have the ability to choose tasks first, and then add on more individual packages later. These
tasks loosely represent a number of different jobs or things you want to do with your computer, such
as “Desktop environment”, “Web server”, or “Print server”9 . 節 D.2 lists the space requirements
for the available tasks.
Some tasks may be pre-selected based on the characteristics of the computer you are installing. If
you disagree with these selections you can deselect them. You can even opt to install no tasks at all at
this point.
提示
In the standard user interface of the installer, you can use the space bar to
toggle selection of a task.
9 You should know that to present this list, the installer is merely invoking the tasksel program. It can be run at any time after
installation to install more packages (or remove them), or you can use a more fine-grained tool such as aptitude. If you are looking
for a specific single package, after installation is complete, simply run aptitude install package, where package is the
name of the package you are looking for.
56
CHAPTER 6. 使用 DEBIAN 安裝程式
6.3. 使用單獨的元件
注
The “Desktop environment”task will install a graphical desktop environment.
By default, debian-installer installs the Gnome desktop environment. It is
possible to interactively select a different desktop environment during the installation. It is also possible to install multiple desktops, but some combinations
of desktop may not be co-installable.
Note that this will only work if the packages needed for the desired desktop
environment are actually available. If you are installing using a single full CD
image, they will possibly need to be downloaded from a network mirror as some
of the needed packages for your choice might only be included on later CDs.
Installing any of the available desktop environments this way should work fine
if you are using a DVD image or any other installation method.
The various server tasks will install software roughly as follows. Web server: apache2; Print server:
cups; SSH server: openssh.
The“Standard system”task will install any package that has a priority“standard”. This includes a
lot of common utilities that are normally available on any Linux or Unix system. You should leave this
task selected unless you know what you are doing and want a really minimal system.
If during language selection a default locale other than the “C”locale was selected, tasksel will
check if any localization tasks are defined for that locale and will automatically try to install relevant
localization packages. This includes for example packages containing word lists or special fonts for your
language. If a desktop environment was selected, it will also install appropriate localization packages
for that (if available).
Once you’ve selected your tasks, select Continue. At this point, aptitude will install the packages
that are part of the selected tasks. If a particular program needs more information from the user, it
will prompt you during this process.
You should be aware that especially the Desktop task is very large. Especially when installing from a
normal CD-ROM in combination with a mirror for packages not on the CD-ROM, the installer may want
to retrieve a lot of packages over the network. If you have a relatively slow Internet connection, this
can take a long time. There is no option to cancel the installation of packages once it has started.
Even when packages are included on the CD-ROM, the installer may still retrieve them from the
mirror if the version available on the mirror is more recent than the one included on the CD-ROM. If
you are installing the stable distribution, this can happen after a point release (an update of the original
stable release); if you are installing the testing distribution this will happen if you are using an older
image.
6.3.6 使系統可開機
If you are installing a diskless workstation, obviously, booting off the local disk isn’t a meaningful
option, and this step will be skipped.
6.3.6.1
偵測其他的作業系統
在啟動開機器安裝之前,安裝程式會試著偵測已經安裝到電腦上的其他作業系統。如果它找到支援的作
業系統,您將在啟動開機器安裝步驟裡得到提示,與 Debian 一起,電腦也將設定為可以啟動其他作業系
統。
注意,從單機上啟動多個作業系統仍然是種魔術。自動偵測和設定 boot-loader 啟動其他作業系統的
功能會依硬體架構甚至是子架構而不同。如果它不能運作,您應該參考 boot-loader 的文件以瞭解更多資
訊。
6.3.6.2
安裝 Grub Boot Loader 到硬碟上
The main i386 boot loader is called “grub”. Grub is a flexible and robust boot loader and a good
default choice for new users and old hands alike.
57
CHAPTER 6. 使用 DEBIAN 安裝程式
6.3. 使用單獨的元件
預設狀況下,grub 會被裝在主開機區 (MBR)。如果裝在那裡的話,它將會完全控制啟動的整個過程。
如果您喜歡的話,您可以把 grub 裝在其他地方。若要全面和完整的資訊,請參閱 grub 的手冊。
If you do not want to install grub, use the Go Back button to get to the main menu, and from there
select whatever bootloader you would like to use.
6.3.6.3
安裝 LILO Boot Loader 到硬碟上
第二個 i386 boot-loader 名叫“LILO”
。它是個老派的強大程式,提供很多功能,包括對 DOS、Windows
以及 OS/2 的開機管理。如果有特別的要求的話,請您仔細閱讀 /usr/share/doc/lilo/ 目錄裡的提
示和教學,同時,您也可以參閱 LILO mini-HOWTO。
注
目前 LILO 安裝時只能為那些可以 chainloaded 的作業系統建立選單項。就是說
您不得不在安裝之後手動添加 GNU/Linux 和 GNU/Hurd 這類作業系統。
debian-installer offers you three choices on where to install the LILO boot loader:
主開機區 (MBR) 這種方式 LILO 將完全控制開機過程。
新 Debian 分割區 如果您想使用其它 boot-loader,選擇此方式。LILO 將安裝到新 Debian 分割區的起始
位置,並能作為第二 boot loader。
其它選擇 Useful for advanced users who want to install LILO somewhere else. In this case you will be
asked for desired location. You can use traditional device names such as /dev/sda.
If you can no longer boot into Windows 9x (or DOS) after this step, you’ll need to use a Windows
9x (MS-DOS) boot disk and use the fdisk /mbr command to reinstall the MS-DOS master boot record
—however, this means that you’ll need to use some other way to get back into Debian!
6.3.6.4
不使用 boot-loader 繼續進行
該選項用於完成安裝而不安裝 boot-loader,這種情況可能是硬體架構/子架構不支援,或是因為不想要
(例如,您想使用已經存在的 boot-loader)。
如果您打算手動設定 boot-loader,您需要檢查安裝在 /target/boot 的核心名稱。您還需要檢查
initrd 存在的目錄﹔如果存在,也許需要指定 bootloader 使用它。其相關資訊包括為 / 檔案系統選擇磁碟
和分割區,並且,如果您打算安裝 /boot 到一個獨立的分割區,還需要 /boot 檔案系統。
6.3.7 Finishing the Installation
This is the last step in the Debian installation process during which the installer will do any last minute
tasks. It mostly consists of tidying up after the debian-installer.
6.3.7.1
Setting the System Clock
The installer may ask you if the computer’s clock is set to UTC. Normally this question is avoided if
possible and the installer tries to work out whether the clock is set to UTC based on things like what
other operating systems are installed.
In expert mode you will always be able to choose whether or not the clock is set to UTC. Systems
that (also) run Dos or Windows are normally set to local time. If you want to dual-boot, select local
time instead of UTC.
At this point debian-installer will also attempt to save the current time to the system’s hardware clock. This will be done either in UTC or local time, depending on the selection that was just
made.
6.3.7.2
Reboot the System
You will be prompted to remove the boot media (CD, floppy, etc) that you used to boot the installer.
After that the system will be rebooted into your new Debian system.
58
CHAPTER 6. 使用 DEBIAN 安裝程式
6.3. 使用單獨的元件
6.3.8 Troubleshooting
這裡的元件通常不在安裝程序之內,但會背景待命,以幫助使用者遇到麻煩時處理問題。
6.3.8.1
保存安裝記錄
If the installation is successful, the logfiles created during the installation process will be automatically
saved to /var/log/installer/ on your new Debian system.
Choosing Save debug logs from the main menu allows you to save the log files to a floppy disk,
network, hard disk, or other media. This can be useful if you encounter fatal problems during the
installation and wish to study the logs on another system or attach them to an installation report.
6.3.8.2
使用 Shell 查看記錄
There are several methods you can use to get a shell while running an installation. On most systems,
and if you are not installing over serial console, the easiest method is to switch to the second virtual
console by pressing Left Alt-F210 (on a Mac keyboard, Option-F2). Use Left Alt-F1 to switch back to the
installer itself.
For the graphical installer see also 節 6.1.1.
If you cannot switch consoles, there is also an Execute a Shell item on the main menu that can be
used to start a shell. You can get to the main menu from most dialogs by using the Go Back button one
or more times. Type exit to close the shell and return to the installer.
At this point you are booted from the RAM disk, and there is a limited set of Unix utilities available
for your use. You can see what programs are available with the command ls /bin /sbin /usr/bin /usr/sbin and by typing help. The shell is a Bourne shell clone called ash and has some nice features like
autocompletion and history.
To edit and view files, use the text editor nano. Log files for the installation system can be found in
the /var/log directory.
注
Although you can do basically anything in a shell that the available commands
allow you to do, the option to use a shell is really only there in case something
goes wrong and for debugging.
Doing things manually from the shell may interfere with the installation process
and result in errors or an incomplete installation. In particular, you should always use let the installer activate your swap partition and not do this yourself
from a shell.
6.3.9 Installation Over the Network
One of the more interesting components is network-console. It allows you to do a large part of the
installation over the network via SSH. The use of the network implies you will have to perform the first
steps of the installation from the console, at least to the point of setting up the networking. (Although
you can automate that part with 節 4.6.)
This component is not loaded into the main installation menu by default, so you have to explicitly
ask for it. If you are installing from CD, you need to boot with medium priority or otherwise invoke
the main installation menu and choose Load installer components from CD and from the list of additional components select network-console: Continue installation remotely using SSH. Successful load
is indicated by a new menu entry called Continue installation remotely using SSH.
After selecting this new entry, you will be asked for a new password to be used for connecting to the
installation system and for its confirmation. That’s all. Now you should see a screen which instructs
you to login remotely as the user installer with the password you just provided. Another important
10
That is: press the Alt key on the left-hand side of the space bar and the F2 function key at the same time.
59
CHAPTER 6. 使用 DEBIAN 安裝程式
6.3. 使用單獨的元件
detail to notice on this screen is the fingerprint of this system. You need to transfer the fingerprint
securely to the person who will continue the installation remotely.
Should you decide to continue with the installation locally, you can always press Enter, which will
bring you back to the main menu, where you can select another component.
Now let’s switch to the other side of the wire. As a prerequisite, you need to configure your
terminal for UTF-8 encoding, because that is what the installation system uses. If you do not, remote
installation will be still possible, but you may encounter strange display artefacts like destroyed dialog
borders or unreadable non-ascii characters. Establishing a connection with the installation system is
as simple as typing:
$ ssh -l installer install_host
Where install_host is either the name or IP address of the computer being installed. Before the
actual login the fingerprint of the remote system will be displayed and you will have to confirm that it
is correct.
注
The ssh server in the installer uses a default configuration that does not send
keep-alive packets. In principle, a connection to the system being installed
should be kept open indefinitely. However, in some situations —depending
on your local network setup —the connection may be lost after some period
of inactivity. One common case where this can happen is when there is some
form of Network Address Translation (NAT) somewhere between the client and
the system being installed. Depending on at which point of the installation the
connection was lost, you may or may not be able to resume the installation after
reconnecting.
You may be able to avoid the connection being dropped by adding the option
-o ServerAliveInterval=value when starting the ssh connection, or by
adding that option in your ssh configuration file. Note however that in some
cases adding this option may also cause a connection to be dropped (for example if keep-alive packets are sent during a brief network outage, from which ssh
would otherwise have recovered), so it should only be used when needed.
注
If you install several computers in turn and they happen to have the same IP
address or hostname, ssh will refuse to connect to such host. The reason is that
it will have different fingerprint, which is usually a sign of a spoofing attack. If
you are sure this is not the case, you will need to delete the relevant line from
~/.ssh/known_hostsa and try again.
a The following command will remove an existing entry for a host:
<hostname|IP address>.
ssh-keygen -R
After the login you will be presented with an initial screen where you have two possibilities called
Start menu and Start shell. The former brings you to the main installer menu, where you can continue
with the installation as usual. The latter starts a shell from which you can examine and possibly fix the
remote system. You should only start one SSH session for the installation menu, but may start multiple
sessions for shells.
60
CHAPTER 6. 使用 DEBIAN 安裝程式
6.4. LOADING MISSING FIRMWARE
警告
After you have started the installation remotely over SSH, you should not go back
to the installation session running on the local console. Doing so may corrupt
the database that holds the configuration of the new system. This in turn may
result in a failed installation or problems with the installed system.
6.4
Loading Missing Firmware
As described in 節 2.2, some devices require firmware to be loaded. In most cases the device will not
work at all if the firmware is not available; sometimes basic functionality is not impaired if it is missing
and the firmware is only needed to enable additional features.
If a device driver requests firmware that is not available, debian-installer will display a dialog
offering to load the missing firmware. If this option is selected, debian-installer will scan available
devices for either loose firmware files or packages containing firmware. If found, the firmware will be
copied to the correct location (/lib/firmware) and the driver module will be reloaded.
注
Which devices are scanned and which file systems are supported depends on
the architecture, the installation method and the stage of the installation. Especially during the early stages of the installation, loading the firmware is most
likely to succeed from a FAT-formatted floppy disk or USB stick. On i386 and
amd64 firmware can also be loaded from an MMC or SD card.
Note that it is possible to skip loading the firmware if you know the device will also function without
it, or if the device is not needed during the installation.
debian-installer only prompts for firmware needed by kernel modules loaded during the installation. Not all drivers are included in debian-installer, in particular radeon is not, so this
implies that the capabilities of some devices may be no different at the end of the installation from
what they were at the beginning. Consequently, some of your hardware may not be being used to its
full potential. If you suspect this is the case, or are just curious, it is not a bad idea to check the output
of the dmesg command on the newly booted system and search for “firmware”.
6.4.1 Preparing a medium
Official CD images do not include non-free firmware. The most common method to load such firmware
is from some removable medium such as a USB stick. Alternatively, unofficial CD builds containing non-free firmware can be found at http://cdimage.debian.org/cdimage/unofficial/
non-free/cd-including-firmware/. To prepare a USB stick (or other medium like a hard drive
partition, or floppy disk), the firmware files or packages must be placed in either the root directory or a
directory named /firmware of the file system on the medium. The recommended file system to use
is FAT as that is most certain to be supported during the early stages of the installation.
Tarballs and zip files containing current packages for the most common firmware are available from:
• http://cdimage.debian.org/cdimage/unofficial/non-free/firmware/
Just download the tarball or zip file for the correct release and unpack it to the file system on the
medium.
If the firmware you need is not included in the tarball, you can also download specific firmware
packages from the (non-free section of the) archive. The following overview should list most available
firmware packages but is not guaranteed to be complete and may also contain non-firmware packages:
• http://packages.debian.org/search?keywords=firmware
It is also possible to copy individual firmware files to the medium. Loose firmware could be obtained
for example from an already installed system or from a hardware vendor.
61
CHAPTER 6. 使用 DEBIAN 安裝程式
6.4. LOADING MISSING FIRMWARE
6.4.2 Firmware and the Installed System
Any firmware loaded during the installation will be copied automatically to the installed system. In
most cases this will ensure that the device that requires the firmware will also work correctly after the
system is rebooted into the installed system. However, if the installed system runs a different kernel
version from the installer there is a slight chance that the firmware cannot be loaded due to version
skew.
If the firmware was loaded from a firmware package, debian-installer will also install this
package for the installed system and will automatically add the non-free section of the package archive
in APT’s sources.list. This has the advantage that the firmware should be updated automatically
if a new version becomes available.
If loading the firmware was skipped during the installation, the relevant device will probably not
work with the installed system until the firmware (package) is installed manually.
注
If the firmware was loaded from loose firmware files, the firmware copied to
the installed system will not be automatically updated unless the corresponding
firmware package (if available) is installed after the installation is completed.
62
Chapter 7
啟動新 Debian 系統
7.1
關鍵時刻
當您的系統首次自行啟動,這在電子工程師圈子裡面稱為“冒煙測試”。
If you did a default installation, the first thing you should see when you boot the system is the menu
of the grub or possibly the lilo bootloader. The first choices in the menu will be for your new Debian
system. If you had any other operating systems on your computer (like Windows) that were detected
by the installation system, those will be listed lower down in the menu.
If the system fails to start up correctly, don’t panic. If the installation was successful, chances are
good that there is only a relatively minor problem that is preventing the system from booting Debian.
In most cases such problems can be fixed without having to repeat the installation. One available
option to fix boot problems is to use the installer’s built-in rescue mode (see 節 8.7).
If you are new to Debian and Linux, you may need some help from more experienced users. For
direct on-line help you can try the IRC channels #debian or #debian-boot on the OFTC network. Alternatively you can contact the debian-user mailing list. You can also file an installation report as described
in 節 5.4.7. Please make sure that you describe your problem clearly and include any messages that
are displayed and may help others to diagnose the issue.
If you had any other operating systems on your computer that were not detected or not detected
correctly, please file an installation report.
7.2
Mounting encrypted volumes
If you created encrypted volumes during the installation and assigned them mount points, you will be
asked to enter the passphrase for each of these volumes during the boot.
For partitions encrypted using dm-crypt you will be shown the following prompt during the boot:
Starting early crypto disks... part_crypt(starting)
Enter LUKS passphrase:
In the first line of the prompt, part is the name of the underlying partition, e.g. sda2 or md0. You are
now probably wondering for which volume you are actually entering the passphrase. Does it relate to
your /home? Or to /var? Of course, if you have just one encrypted volume, this is easy and you can
just enter the passphrase you used when setting up this volume. If you set up more than one encrypted
volume during the installation, the notes you wrote down as the last step in 節 6.3.3.6 come in handy.
If you did not make a note of the mapping between part_crypt and the mount points before, you
can still find it in /etc/crypttab and /etc/fstab of your new system.
The prompt may look somewhat different when an encrypted root file system is mounted. This
depends on which initramfs generator was used to generate the initrd used to boot the system. The
example below is for an initrd generated using initramfs-tools:
Begin: Mounting root file system... ...
Begin: Running /scripts/local-top ...
Enter LUKS passphrase:
63
CHAPTER 7. 啟動新 DEBIAN 系統
7.3. 登入
No characters (even asterisks) will be shown while entering the passphrase. If you enter the wrong
passphrase, you have two more tries to correct it. After the third try the boot process will skip this
volume and continue to mount the next filesystem. Please see 節 7.2.1 for further information.
After entering all passphrases the boot should continue as usual.
7.2.1 Troubleshooting
If some of the encrypted volumes could not be mounted because a wrong passphrase was entered,
you will have to mount them manually after the boot. There are several cases.
• The first case concerns the root partition. When it is not mounted correctly, the boot process will
halt and you will have to reboot the computer to try again.
• The easiest case is for encrypted volumes holding data like /home or /srv. You can simply mount
them manually after the boot.
However for dm-crypt this is a bit tricky. First you need to register the volumes with device mapper
by running:
# /etc/init.d/cryptdisks start
This will scan all volumes mentioned in /etc/crypttab and will create appropriate devices
under the /dev directory after entering the correct passphrases. (Already registered volumes will
be skipped, so you can repeat this command several times without worrying.) After successful
registration you can simply mount the volumes the usual way:
# mount /mount_point
• If any volume holding noncritical system files could not be mounted (/usr or /var), the system
should still boot and you should be able to mount the volumes manually like in the previous
case. However, you will also need to (re)start any services usually running in your default runlevel
because it is very likely that they were not started. The easiest way is to just reboot the computer.
7.3
登入
Once your system boots, you’ll be presented with the login prompt. Log in using the personal login
and password you selected during the installation process. Your system is now ready for use.
如果您是新使用者,您也許希望瀏覽已經安裝到系統上的文件。目前有多個文件系統,由不同類型的
文件組成。接下來將做簡略介紹。
Documentation accompanying programs you have installed can be found in /usr/share/doc/,
under a subdirectory named after the program (or, more precise, the Debian package that contains
the program). However, more extensive documentation is often packaged separately in special documentation packages that are mostly not installed by default. For example, documentation about the
package management tool apt can be found in the packages apt-doc or apt-howto.
In addition, there are some special folders within the /usr/share/doc/ hierarchy. Linux HOWTOs are installed in .gz (compressed) format, in /usr/share/doc/HOWTO/en-txt/. After installing
dhelp, you will find a browsable index of documentation in /usr/share/doc/HTML/index.html.
One easy way to view these documents using a text based browser is to enter the following commands:
$ cd /usr/share/doc/
$ w3m .
The dot after the w3m command tells it to show the contents of the current directory.
If you have a graphical desktop environment installed, you can also use its web browser. Start the
web browser from the application menu and enter /usr/share/doc/ in the address bar.
You can also type info command or man command to see documentation on most commands available at the command prompt. Typing help will display help on shell commands. And typing a command followed by --help will usually display a short summary of the command’s usage. If a command’s results scroll past the top of the screen, type | more after the command to cause the results
to pause before scrolling past the top of the screen. To see a list of all commands available which begin
with a certain letter, type the letter and then two tabs.
64
Chapter 8
下一步該做什麼
8.1
Shutting down the system
To shut down a running Debian GNU/Linux system, you must not reboot with the reset switch on the
front or back of your computer, or just turn off the computer. Debian GNU/Linux should be shut down
in a controlled manner, otherwise files might get lost and/or disk damage might occur. If you run a
desktop environment, there is usually an option to“log out”available from the application menu that
allows you to shutdown (or reboot) the system.
Alternatively you can press the key combination Ctrl-Alt-Del . If the key combinations do not work, a
last option is to log in as root and type the necessary commands. Use reboot to reboot the system. Use
halt to halt the system without powering it off 1 . To power off the machine, use poweroff or shutdown
-h now. The systemd init system provides additional commands that perform the same functions; for
example systemctl reboot or systemctl poweroff.
8.2
如果您不熟悉 Unix
如果您不熟悉 Unix,您也許應該出去買些書來讀。還可以從 Debian Reference 找到到大量有用的資訊。
Unix 常見問答集中包含了大量的 Usenet 文件,它提供很有用的參考。
Linux 是 Unix 的實作。Linux 文件計劃 (LDP) 收集了大量的 HOWTO 和 Linux 的線上書籍。這些文件
絕大部分可以在本地安裝;只要安裝 doc-linux-html 套件 (HTML 版本) 或者 doc-linux-text 套
件 (ASCII 版本),然後在 /usr/share/doc/HOWTO 裡面就能找到。在 Debian 軟體套件裡面也提供 LDP
HOWTO 的國際化版本。
8.3
讓您自己轉向 Debian
Debian 和其它的發行版有些不同。即使您熟悉其它發行版的 Linux,您也應該瞭解 Debian 的一些東西,
以便保持您的系統處在整潔良好的狀態。本章包含的內容可以幫助您瞭解 Debian﹔但這並不是一個如何
使用 Debian 的入門指南,而僅僅是對整個系統的一個粗略的介紹。
8.3.1 Debian 軟體套件系統
要掌握的最重要概念是 Debian 的軟體套件系統。事實上,您系統的絕大部分都該由軟體套件系統來控
制。包括:
• /usr (除了 /usr/local 之外)
• /var (您可以建立 /var/local,在那裡面進行安全的操作)
• /bin
• /sbin
1
Under the SysV init system halt had the same effect as poweroff, but with systemd as init system (the default since jessie)
their effects are different.
65
CHAPTER 8. 下一步該做什麼
8.4. 更多閱讀資訊
• /lib
例如,如果您替換了 /usr/bin/perl,它可以正常工作,但以後您升級了 perl 軟體套件,那個檔案
仍將被替換回來。有經驗的使用者可以將軟體套件設置為“hold”狀態,以避免這種情況,這需要使用
aptitude。
One of the best installation methods is apt. You can use the command line version of apt or fullscreen text version aptitude. Note apt will also let you merge main, contrib, and non-free so you can
have export-restricted packages as well as standard versions.
8.3.2 Additional Software Available for Debian
There are official and unofficial software repositories that are not enabled in the default Debian install.
These contain software which many find important and expect to have. Information on these additional
repositories can be found on the Debian Wiki page titled The Software Available for Debian’s Stable
Release.
8.3.3 應用程式版本管理
可選版本的應用程式可以透過 update-alternatives 來管理。如果您維護著多個版本的應用程式,請參閱
update-alternatives 的 man 手冊。
8.3.4 任務排程管理
Any jobs under the purview of the system administrator should be in /etc, since they are configuration
files. If you have a root cron job for daily, weekly, or monthly runs, put them in /etc/cron.{daily,
weekly,monthly}. These are invoked from /etc/crontab, and will run in alphabetic order, which
serializes them.
On the other hand, if you have a cron job that (a) needs to run as a special user, or (b) needs to
run at a special time or frequency, you can use either /etc/crontab, or, better yet, /etc/cron.d/
whatever. These particular files also have an extra field that allows you to stipulate the user account
under which the cron job runs.
在任何情況下,您只需編輯這些檔案,cron 將會自動處理它們。沒有必要再執行某個特殊的指令。欲
瞭解更多的資訊,請參閱 cron(8),crontab(5),以及 /usr/share/doc/cron/README.Debian。
8.4
更多閱讀資訊
如果您想查閱某個程式的更詳細資料,應該先試試 man 程式名稱,或者 info 程式名稱。
在 /usr/share/doc 目 錄 裡 有 很 多 有 用 的 文 件, 特 別 是 /usr/share/doc/HOWTO 和 /usr/
share/doc/FAQ 裡有很多值得一讀的文章。如果您想回報臭蟲報告,請先查閱這些文件:/usr/
share/doc/debian/bug*。針對某個程式,其有關於 Debian 的內容可以查閱文件:/usr/share/
doc/(package name)/README.Debian。
The Debian web site contains a large quantity of documentation about Debian. In particular, see the
Debian GNU/Linux FAQ and the Debian Reference. An index of more Debian documentation is available
from the Debian Documentation Project. The Debian community is self-supporting; to subscribe to one
or more of the Debian mailing lists, see the Mail List Subscription page. Last, but not least, the Debian
Mailing List Archives contain a wealth of information on Debian.
在 GNU/Linux 世界裡,最常用的文件資料來源是:Linux 文件計劃。在這裡您可以找到有關於
GNU/Linux 系統關於各個部分非常有價值的 HOWTO 文件以及其他指引。
8.5
Setting Up Your System To Use E-Mail
Today, email is an important part of many people’s life. As there are many options as to how to set
it up, and as having it set up correctly is important for some Debian utilities, we will try to cover the
basics in this section.
There are three main functions that make up an e-mail system. First there is the Mail User Agent
(MUA) which is the program a user actually uses to compose and read mails. Then there is the Mail
66
CHAPTER 8. 下一步該做什麼
8.5. SETTING UP YOUR SYSTEM TO USE E-MAIL
Transfer Agent (MTA) that takes care of transferring messages from one computer to another. And last
there is the Mail Delivery Agent (MDA) that takes care of delivering incoming mail to the user’s inbox.
These three functions can be performed by separate programs, but they can also be combined in
one or two programs. It is also possible to have different programs handle these functions for different
types of mail.
On Linux and Unix systems mutt is historically a very popular MUA. Like most traditional Linux
programs it is text based. It is often used in combination with exim or sendmail as MTA and procmail
as MDA.
With the increasing popularity of graphical desktop systems, the use of graphical e-mail programs
like GNOME’s evolution, KDE’s kmail or Mozilla’s thunderbird has becoming more popular. These
programs combine the function of a MUA, MTA and MDA, but can —and often are —also be used in
combination with the traditional Linux tools.
8.5.1 Default E-Mail Configuration
Even if you are planning to use a graphical mail program, it is important that a traditional MTA/MDA is
also installed and correctly set up on your Debian GNU/Linux system. Reason is that various utilities
running on the system2 can send important notices by e-mail to inform the system administrator of
(potential) problems or changes.
For this reason the packages exim4 and mutt will be installed by default (provided you did not
unselect the“standard”task during the installation). exim4 is a combination MTA/MDA that is relatively
small but very flexible. By default it will be configured to only handle e-mail local to the system itself
and e-mails addressed to the system administrator (root account) will be delivered to the regular user
account created during the installation3 .
When system e-mails are delivered they are added to a file in /var/mail/account_name. The
e-mails can be read using mutt.
8.5.2 Sending E-Mails Outside The System
As mentioned earlier, the installed Debian system is only set up to handle e-mail local to the system,
not for sending mail to others nor for receiving mail from others.
If you would like exim4 to handle external e-mail, please refer to the next subsection for the basic
available configuration options. Make sure to test that mail can be sent and received correctly.
If you intend to use a graphical mail program and use a mail server of your Internet Service Provider
(ISP) or your company, there is not really any need to configure exim4 for handling external e-mail. Just
configure your favorite graphical mail program to use the correct servers to send and receive e-mail
(how is outside the scope of this manual).
However, in that case you may need to configure individual utilities to correctly send e-mails. One
such utility is reportbug, a program that facilitates submitting bug reports against Debian packages. By
default it expects to be able to use exim4 to submit bug reports.
To correctly set up reportbug to use an external mail server, please run the command reportbug
--configure and answer “no”to the question if an MTA is available. You will then be asked for the
SMTP server to be used for submitting bug reports.
8.5.3 Configuring the Exim4 Mail Transport Agent
If you would like your system to also handle external e-mail, you will need to reconfigure the exim4
package4 :
# dpkg-reconfigure exim4-config
After entering that command (as root), you will be asked if you want split the configuration into
small files. If you are unsure, select the default option.
Next you will be presented with several common mail scenarios. Choose the one that most closely
resembles your needs.
2
Examples are: cron, quota, logcheck, aide, …
The forwarding of mail for root to the regular user account is configured in /etc/aliases. If no regular user account
was created, the mail will of course be delivered to the root account itself.
4 You can of course also remove exim4 and replace it with an alternative MTA/MDA.
3
67
CHAPTER 8. 下一步該做什麼
8.6. 編譯新核心
網際網路站 您的系統連接到網路上,並且您透過 SMTP 直接收發郵件。在接下來的幾頁中,程式會詢問
您一些基本問題,如:您的機器的郵件名稱、您接受或轉發郵件的網域名稱等等。
用 smarthost 發信 In this scenario your outgoing mail is forwarded to another machine, called a“smarthost”
, which takes care of sending the message on to its destination. The smarthost also usually stores
incoming mail addressed to your computer, so you don’t need to be permanently online. That
also means you have to download your mail from the smarthost via programs like fetchmail.
In a lot of cases the smarthost will be your ISP’s mail server, which makes this option very
suitable for dial-up users. It can also be a company mail server, or even another system on your
own network.
mail sent by smarthost; no local mail This option is basically the same as the previous one except that
the system will not be set up to handle mail for a local e-mail domain. Mail on the system itself
(e.g. for the system administrator) will still be handled.
僅在本地發送 This is the option your system is configured for by default.
現在不進行設定 除非您真的知道您在做什麼,否則請不要選擇這一選項。這會留下一個未設定的郵件系
統—在您再次設定它之前,您都無法收發任何郵件,並且可能會錯過一些系統工具發出的重要資訊。
If none of these scenarios suits your needs, or if you need a finer grained setup, you will need
to edit configuration files under the /etc/exim4 directory after the installation is complete. More
information about exim4 may be found under /usr/share/doc/exim4; the file README.Debian.
gz has further details about configuring exim4 and explains where to find additional documentation.
Note that sending mail directly to the Internet when you don’t have an official domain name, can
result in your mail being rejected because of anti-spam measures on receiving servers. Using your
ISP’s mail server is preferred. If you still do want to send out mail directly, you may want to use a
different e-mail address than is generated by default. If you use exim4 as your MTA, this is possible
by adding an entry in /etc/email-addresses.
8.6
編譯新核心
Why would someone want to compile a new kernel? It is often not necessary since the default kernel
shipped with Debian handles most configurations. Also, Debian often offers several alternative kernels.
So you may want to check first if there is an alternative kernel image package that better corresponds
to your hardware. However, it can be useful to compile a new kernel in order to:
• 支援某些特殊的硬體,或者預設的核心設定和某些硬體衝突。
• use options of the kernel which are not supported in the pre-supplied kernels (such as high memory support)
• 透過刪除無用的驅動程式來優化核心,以減少開機時間。
• create a monolithic instead of a modularized kernel
• 使用最新的核心或開發中的核心。
• learn more about linux kernels
8.6.1 核心映像管理
不要害怕嘗試編譯核心。它很有趣而且很有好處。
To compile a kernel the Debian way, you need some packages: fakeroot, kernel-package,
linux-source-2.6 and a few others which are probably already installed (see /usr/share/doc/
kernel-package/README.gz for the complete list).
此方法將從您的核心原始碼建立一個.deb 檔案,並且,如果您有非標準模組,將同時建立它們的同步
相依.deb 檔案。這是一個管理核心的較好的方法﹔/boot 目錄將保存核心,System.map,以及目前編譯
的活動設定檔紀錄。
Note that you don’t have to compile your kernel the “Debian way”; but we find that using the
packaging system to manage your kernel is actually safer and easier. In fact, you can get your kernel
68
CHAPTER 8. 下一步該做什麼
8.7. RECOVERING A BROKEN SYSTEM
sources right from Linus instead of linux-source-2.6, yet still use the kernel-package compilation method.
注意您可以找到完整的文件,
透過使用 kernel-package 它在 /usr/share/doc/kernel-package
裡。本節只包含一個簡單的入門指南。
Hereafter, we’ll assume you have free rein over your machine and will extract your kernel source
to somewhere in your home directory5 . We’ll also assume that your kernel version is 3.16. Make sure
you are in the directory to where you want to unpack the kernel sources, extract them using tar xf
/usr/src/linux-source-3.16.tar.xz and change to the directory linux-source-3.16 that
will have been created.
現在,您可以開始設定您的核心了。如果您已經安裝並正在執行 X11,請執行 make xconfig﹔否則
請執行 make menuconfig (必須已經安裝好 libncurses5-dev)。請花點時間閱讀線上說明並仔細地
選擇。如果有任何疑慮,通常把您所不確定的設備驅動程式 (用來管理周邊硬體的軟體,例如以太網路卡、
SCSI 控制器等) 一起編譯會比較好一點。注意:對於與特殊硬體無關的其它選項,如果您不瞭解它們,最
好保持預設值。不要忘記選擇“Kernel module loader”中的“Loadable module support”(它們預設並
沒有被選擇)。否則,您的 Debian 安裝將會遇到問題。
清除原始碼樹並復原 kernel-package 參數。也就是使用 make-kpkg clean。
Now, compile the kernel: fakeroot make-kpkg --initrd --revision=1.0.custom kernel_image. The version number of“1.0”can be changed at will; this is just a version number that you
will use to track your kernel builds. Likewise, you can put any word you like in place of“custom”(e.g.,
a host name). Kernel compilation may take quite a while, depending on the power of your machine.
Once the compilation is complete, you can install your custom kernel like any package. As root, do
dpkg -i ../linux-image-3.16-subarchitecture_1.0.custom_i386.deb. The subarchitec
ture part is an optional sub-architecture, such as “686”, depending on what kernel options you set.
dpkg -i will install the kernel, along with some other nice supporting files. For instance, the System.
map will be properly installed (helpful for debugging kernel problems), and /boot/config-3.16 will
be installed, containing your current configuration set. Your new kernel package is also clever enough
to automatically update your boot loader to use the new kernel. If you have created a modules package,
you’ll need to install that package as well.
下面到了重新啟動系統的時刻了﹔請仔細閱讀前述步驟所產生的所有警告資訊,然後執行 shutdown
-r now。
For more information on Debian kernels and kernel compilation, see the Debian Linux Kernel Handbook. For more information on kernel-package, read the fine documentation in /usr/share/
doc/kernel-package.
8.7
Recovering a Broken System
Sometimes, things go wrong, and the system you’ve carefully installed is no longer bootable. Perhaps
the boot loader configuration broke while trying out a change, or perhaps a new kernel you installed
won’t boot, or perhaps cosmic rays hit your disk and flipped a bit in /sbin/init. Regardless of the
cause, you’ll need to have a system to work from while you fix it, and rescue mode can be useful for
this.
To access rescue mode, select rescue from the boot menu, type rescue at the boot: prompt, or
boot with the rescue/enable=true boot parameter. You’ll be shown the first few screens of the
installer, with a note in the corner of the display to indicate that this is rescue mode, not a full installation. Don’t worry, your system is not about to be overwritten! Rescue mode simply takes advantage
of the hardware detection facilities available in the installer to ensure that your disks, network devices,
and so on are available to you while repairing your system.
Instead of the partitioning tool, you should now be presented with a list of the partitions on your
system, and asked to select one of them. Normally, you should select the partition containing the root
file system that you need to repair. You may select partitions on RAID and LVM devices as well as those
created directly on disks.
If possible, the installer will now present you with a shell prompt in the file system you selected,
which you can use to perform any necessary repairs. For example, if you need to reinstall the GRUB
boot loader into the master boot record of the first hard disk, you could enter the command grubinstall ’(hd0)’ to do so.
5 There are other locations where you can extract kernel sources and build your custom kernel, but this is easiest as it does
not require special permissions.
69
CHAPTER 8. 下一步該做什麼
8.7. RECOVERING A BROKEN SYSTEM
If the installer cannot run a usable shell in the root file system you selected, perhaps because the file
system is corrupt, then it will issue a warning and offer to give you a shell in the installer environment
instead. You may not have as many tools available in this environment, but they will often be enough
to repair your system anyway. The root file system you selected will be mounted on the /target
directory.
In either case, after you exit the shell, the system will reboot.
Finally, note that repairing broken systems can be difficult, and this manual does not attempt to go
into all the things that might have gone wrong or how to fix them. If you have problems, consult an
expert.
70
Appendix A
安裝 Howto
This document describes how to install Debian GNU/Linux buster for the 32-bit PC (“i386”) with the
new debian-installer. It is a quick walkthrough of the installation process which should contain
all the information you will need for most installs. When more information can be useful, we will link
to more detailed explanations in other parts of this document.
A.1
前言
The debian-installer is still in a beta state. If you encounter bugs during your install, please refer to 節
5.4.7 for instructions on how to report them. If you have questions which cannot be answered by this
document, please direct them to the debian-boot mailing list (debian-boot@lists.debian.org) or ask on
IRC (#debian-boot on the OFTC network).
A.2
啟動安裝程式
在debian-installer 的首頁,你可看到幾個光碟映像檔的快速連結。Debian-cd 小組在 Debian CD
網頁中提供了使用 debian-installer 光碟映像檔的編譯版本。如果您需要關於取得這些光碟的資訊,
請看節 4.1。
有些安裝方式需要其它種類的映像而非光碟映像檔。debian-installer 的網頁 上有其它映像檔的
連結。節 4.2.1 會告訴您如何在 Debian 的映像網站找到映像檔。
下一節我們就各種可能的安裝方法,仔細解釋如何取得所需的映像檔。
A.2.1 光碟
The netinst CD image is a popular image which can be used to install buster with the debian-instal
ler. This image is intended to boot from CD and install additional packages over a network; hence the
name ’netinst’. The image has the software components needed to run the installer and the base
packages to provide a minimal buster system. If you’d rather, you can get a full size CD image which
will not need the network to install. You only need the first CD of the set.
Download whichever type you prefer and burn it to a CD. To boot the CD, you may need to change
your BIOS configuration, as explained in 節 3.6.1.
A.2.2 USB 隨身碟
我們也可以透過 USB 隨身碟來安裝套件。無論到哪你都可帶著 USB 隨身碟,這是一個相當方便的 Debian
安裝工具。
The easiest way to prepare your USB memory stick is to download any Debian CD or DVD image that
will fit on it, and write the CD image directly to the memory stick. Of course this will destroy anything
already on the memory stick. This works because Debian CD images are ”isohybrid” images that can
boot both from CD and from USB drives.
除此之外,還有其它更為彈性的方式可以做出能啟動 debian-installer 的 USB 隨身碟,且即使是較小
容量的 USB 隨身碟亦可成功。欲知詳情,請看節 4.3。
71
APPENDIX A. 安裝 HOWTO
A.3. 安裝
有些 BIOS 支援直接透過 USB 隨身碟開機,但也有的 BIOS 不支援。您需要設定 BIOS 讓電腦從
“removable drive”或是“USB-ZIP”開機,使得此電腦能從 USB 隨身碟啟動。如果這樣不奏效,您可以
透過磁片開機,然後再用 USB 隨身碟完成之後的安裝。若需要一些有用的提示和細節說明,請參閱節
5.1.1。
A.2.3 透過網路開機
要完全從網路上啟動 (即 netboot) debian-installer 也是可行的。而採取哪種方法來從網路啟動取
決於您的硬體架構和網路啟動的相關設定。在 netboot/ 目錄裡的檔案是用來從網路啟動 debianinstaller 。
The easiest thing to set up is probably PXE netbooting. Untar the file netboot/pxeboot.tar.gz
into /srv/tftp or wherever is appropriate for your tftp server. Set up your DHCP server to pass
filename pxelinux.0 to clients, and with luck everything will just work. For detailed instructions, see
節 4.5.
A.2.4 從硬碟開機
It’s possible to boot the installer using no removable media, but just an existing hard disk, which can
have a different OS on it. Download hd-media/initrd.gz, hd-media/vmlinuz, and a Debian CD
image to the top-level directory of the hard disk. Make sure that the CD image has a filename ending
in .iso. Now it’s just a matter of booting linux with the initrd. 節 5.1.5 explains one way to do it.
A.3
安裝
Once the installer starts, you will be greeted with an initial screen. Press Enter to boot, or read the
instructions for other boot methods and parameters (see 節 5.3).
接下來畫面要求您選擇欲使用的語言。利用上下鍵來選擇語言,然後按 Enter 以繼續下面的步驟。接
下來,您要選擇您的國家,選項裡包括了那些使用您所選語言的國家。如果在列表中找不到您要找的國
家,還有一個包含世界上所有國家的列表以供選擇。
您還可能被要求確認一下您的鍵盤排列方式。選擇預設的那個方式,或是選擇更合適的一個。
現在可以休息一下了,這時 debian-installer 會偵測您的硬體,並從光碟、磁片、USB 隨身碟或其它
設備裡將其餘部分載入系統。
接下來,安裝程式會嘗試偵測網路相關硬體,透過 DHCP 完成網路的設定。如果電腦沒有連接網路,
或是沒有用 DHCP,那麼您也可以手動設定網路。
The next step is setting up your clock and time zone. The installer will try to contact a time server on
the Internet to ensure the clock is set correctly. The time zone is based on the country selected earlier
and the installer will only ask to select one if a country has multiple zones.
Setting up your clock and time zone is followed by the creation of user accounts. By default you
are asked to provide a password for the “root”(administrator) account and information necessary to
create one regular user account. If you do not specify a password for the “root”user, this account
will be disabled but the sudo package will be installed later to enable administrative tasks to be carried
out on the new system. By default, the first user created on the system will be allowed to use the sudo
command to become root.
Now it is time to partition your disks. First you will be given the opportunity to automatically partition either an entire drive, or available free space on a drive (see 節 6.3.3.2). This is recommended for
new users or anyone in a hurry. If you do not want to autopartition, choose Manual from the menu.
如果您想保留一個既存的 DOS 或 Windows 磁區,要小心使用自動分割磁區。如果您選擇手動分割磁
區,可以使用安裝程式重新設定既存 FAT 或 NTFS 分區的大小,分給 Debian 更多的安裝空間:只需選擇
該分區,並指定新的大小。
On the next screen you will see your partition table, how the partitions will be formatted, and where
they will be mounted. Select a partition to modify or delete it. If you did automatic partitioning, you
should just be able to choose Finish partitioning and write changes to disk from the menu to use what
it set up. Remember to assign at least one partition for swap space and to mount a partition on /. For
more detailed information on how to use the partitioner, please refer to 節 6.3.3; the appendix 附錄
C has more general information about partitioning.
現在 debian-installer 會先把您的磁區格式化,然後安裝基本系統,這兩步會花些時間。接著它
會安裝核心。
72
APPENDIX A. 安裝 HOWTO
A.4. 請寄給我們一份安裝報告
The base system that was installed earlier is a working, but very minimal installation. To make
the system more functional the next step allows you to install additional packages by selecting tasks.
Before packages can be installed apt needs to be configured as that defines from where the packages
will be retrieved. The “Standard system”task will be selected by default and should normally be
installed. Select the “Desktop environment”task if you would like to have a graphical desktop after
the installation. See 節 6.3.5.2 for additional information about this step.
The last step is to install a boot loader. If the installer detects other operating systems on your
computer, it will add them to the boot menu and let you know. By default GRUB will be installed to
the master boot record of the first harddrive, which is generally a good choice. You’ll be given the
opportunity to override that choice and install it elsewhere.
debian-installer will now tell you that the installation has finished. Remove the cdrom or other
boot media and hit Enter to reboot your machine. It should boot up into the newly installed system
and allow you to log in. This is explained in 章 7.
如果您想要更多的安裝過程相關資訊,請看章 6。
A.4
請寄給我們一份安裝報告
If you successfully managed an installation with debian-installer, please take time to provide us
with a report. The simplest way to do so is to install the reportbug package (apt install reportbug),
configure reportbug as explained in 節 8.5.2, and run reportbug installation-reports.
If you did not complete the install, you probably found a bug in debian-installer. To improve the
installer it is necessary that we know about them, so please take the time to report them. You can use
an installation report to report problems; if the install completely fails, see 節 5.4.6.
A.5
And finally…
我們希望您的 Debian 安裝順利愉快,並希望您能瞭解 Debian 好用之處。您或許想閱讀章 8。
73
Appendix B
Automating the installation using
preseeding
This appendix explains how to preseed answers to questions in debian-installer to automate your
installation.
The configuration fragments used in this appendix are also available as an example preconfiguration file from http://d-i.alioth.debian.org/manual/example-preseed.txt.
B.1
Introduction
Preseeding provides a way to set answers to questions asked during the installation process, without having to manually enter the answers while the installation is running. This makes it possible to
fully automate most types of installation and even offers some features not available during normal
installations.
Preseeding is not required. If you use an empty preseed file, the installer will behave just the same
way as in a normal manual installation. Each question you preseed will (if you got it right!) modify the
installation in some way from that baseline.
B.1.1 Preseeding methods
There are three methods that can be used for preseeding: initrd, file and network. Initrd preseeding
will work with any installation method and supports preseeding of more things, but it requires the most
preparation. File and network preseeding each can be used with different installation methods.
The following table shows which preseeding methods can be used with which installation methods.
Installation method
CD/DVD
netboot
hd-media (including
usb-stick)
initrd
yes
yes
file
yes
no
network
yes1
yes
yes
yes
yes1
An important difference between the preseeding methods is the point at which the preconfiguration
file is loaded and processed. For initrd preseeding this is right at the start of the installation, before the
first question is even asked. Preseeding from the kernel command line happens just after. It is thus
possible to override configuration set in the initrd by editing the kernel command line (either in the
bootloader configuration or manually at boot time for bootloaders that allow it). For file preseeding
this is after the CD or CD image has been loaded. For network preseeding it is only after the network
has been configured.
1
but only if you have network access, and set preseed/url appropriately
74
APPENDIX B. AUTOMATING THE INSTALLATION …
B.2. USING PRESEEDING
重要
Obviously, any questions that have been processed before the preconfiguration
file is loaded cannot be preseeded (this will include questions that are only displayed at medium or low priority, like the first hardware detection run). A not so
convenient way to avoid these questions from being asked is to preseed them
through the boot parameters, as described in 節 B.2.2.
In order to easily avoid the questions that would normally appear before the
preseeding occurs, you can start the installer in “auto”mode. This delays
questions that would normally be asked too early for preseeding (i.e. language,
country and keyboard selection) until after the network comes up, thus allowing them to be preseeded. It also runs the installation at critical priority, which
avoids many unimportant questions. See 節 B.2.3 for details.
B.1.2 Limitations
Although most questions used by debian-installer can be preseeded using this method, there are
some notable exceptions. You must (re)partition an entire disk or use available free space on a disk; it
is not possible to use existing partitions.
B.2
Using preseeding
You will first need to create a preconfiguration file and place it in the location from where you want
to use it. Creating the preconfiguration file is covered later in this appendix. Putting it in the correct
location is fairly straightforward for network preseeding or if you want to read the file off a floppy or
usb-stick. If you want to include the file on a CD or DVD, you will have to remaster the ISO image.
How to get the preconfiguration file included in the initrd is outside the scope of this document; please
consult the developers’ documentation for debian-installer.
An example preconfiguration file that you can use as basis for your own preconfiguration file is
available from http://d-i.alioth.debian.org/manual/example-preseed.txt. This file is
based on the configuration fragments included in this appendix.
B.2.1 Loading the preconfiguration file
If you are using initrd preseeding, you only have to make sure a file named preseed.cfg is included
in the root directory of the initrd. The installer will automatically check if this file is present and load it.
For the other preseeding methods you need to tell the installer what file to use when you boot
it. This is normally done by passing the kernel a boot parameter, either manually at boot time or by
editing the bootloader configuration file (e.g. syslinux.cfg) and adding the parameter to the end
of the append line(s) for the kernel.
If you do specify the preconfiguration file in the bootloader configuration, you might change the
configuration so you don’t need to hit enter to boot the installer. For syslinux this means setting the
timeout to 1 in syslinux.cfg.
To make sure the installer gets the right preconfiguration file, you can optionally specify a checksum
for the file. Currently this needs to be a md5sum, and if specified it must match the preconfiguration
file or the installer will refuse to use it.
Boot parameters to specify:
- if you’re netbooting:
preseed/url=http://host/path/to/preseed.cfg
preseed/url/checksum=5da499872becccfeda2c4872f9171c3d
- or
preseed/url=tftp://host/path/to/preseed.cfg
preseed/url/checksum=5da499872becccfeda2c4872f9171c3d
75
APPENDIX B. AUTOMATING THE INSTALLATION …
B.2. USING PRESEEDING
- if you’re booting a remastered CD:
preseed/file=/cdrom/preseed.cfg
preseed/file/checksum=5da499872becccfeda2c4872f9171c3d
- if you’re installing from USB media (put the preconfiguration file in the
toplevel directory of the USB stick):
preseed/file=/hd-media/preseed.cfg
preseed/file/checksum=5da499872becccfeda2c4872f9171c3d
Note that preseed/url can be shortened to just url, preseed/file to just file and preseed/
file/checksum to just preseed-md5 when they are passed as boot parameters.
B.2.2 Using boot parameters to preseed questions
If a preconfiguration file cannot be used to preseed some steps, the install can still be fully automated,
since you can pass preseed values on the command line when booting the installer.
Boot parameters can also be used if you do not really want to use preseeding, but just want to
provide an answer for a specific question. Some examples where this can be useful are documented
elsewhere in this manual.
To set a value to be used inside debian-installer, just pass path/to/variable=value for any
of the preseed variables listed in the examples in this appendix. If a value is to be used to configure
packages for the target system, you will need to prepend the owner2 of the variable as in owner:path/
to/variable=value. If you don’t specify the owner, the value for the variable will not be copied to
the debconf database in the target system and thus remain unused during the configuration of the
relevant package.
Normally, preseeding a question in this way will mean that the question will not be asked. To set
a specific default value for a question, but still have the question asked, use “?=”instead of “=”as
operator. See also 節 B.5.2.
Note that some variables that are frequently set at the boot prompt have a shorter alias. If an alias
is available, it is used in the examples in this appendix instead of the full variable. The preseed/url
variable for example has been aliased as url. Another example is the tasks alias, which translates to
tasksel:tasksel/first.
A“---”in the boot options has special meaning. Kernel parameters that appear after the last“---”
may be copied into the bootloader configuration for the installed system (if supported by the installer
for the bootloader). The installer will automatically filter out any options (like preconfiguration options)
that it recognizes.
注
Current linux kernels (2.6.9 and later) accept a maximum of 32 command line
options and 32 environment options, including any options added by default for
the installer. If these numbers are exceeded, the kernel will panic (crash). (For
earlier kernels, these numbers were lower.)
For most installations some of the default options in your bootloader configuration file, like vga=
normal, may be safely removed which may allow you to add more options for preseeding.
注
It may not always be possible to specify values with spaces for boot parameters,
even if you delimit them with quotes.
2
The owner of a debconf variable (or template) is normally the name of the package that contains the corresponding debconf
template. For variables used in the installer itself the owner is “d-i”. Templates and variables can have more than one owner
which helps to determine whether they can be removed from the debconf database if the package is purged.
76
APPENDIX B. AUTOMATING THE INSTALLATION …
B.2. USING PRESEEDING
B.2.3 Auto mode
There are several features of Debian Installer that combine to allow fairly simple command lines at the
boot prompt to result in arbitrarily complex customized automatic installs.
This is enabled by using the Automated install boot choice, also called auto for some architectures or boot methods. In this section, auto is thus not a parameter, it means selecting that boot
choice, and appending the following boot parameters on the boot prompt. See 節 5.1.7 for information
on how to add a boot parameter.
To illustrate this, here are some examples that can be used at the boot prompt:
auto url=autoserver
This relies on there being a DHCP server that will get the machine to the point where autoserver
can be resolved by DNS, perhaps after adding the local domain if that was provided by DHCP. If this
was done at a site where the domain is example.com, and they have a reasonably sane DHCP setup,
it would result in the preseed file being retrieved from http://autoserver.example.com/d-i/
buster/./preseed.cfg.
The last part of that url (d-i/buster/./preseed.cfg) is taken from auto-install/defaul
troot. By default this includes the directory buster to allow future versions to specify their own
codename and let people migrate forwards in a controlled manner. The /./ bit is used to indicate a
root, relative to which subsequent paths can be anchored (for use in preseed/include and preseed/run).
This allows files to be specified either as full URLs, paths starting with / that are thus anchored, or even
paths relative to the location where the last preseed file was found. This can be used to construct more
portable scripts where an entire hierarchy of scripts can be moved to a new location without breaking it,
for example copying the files onto a USB stick when they started out on a web server. In this example,
if the preseed file sets preseed/run to /scripts/late_command.sh then the file will be fetched
from http://autoserver.example.com/d-i/buster/./scripts/late_command.sh.
If there is no local DHCP or DNS infrastructure, or if you do not want to use the default path to
preseed.cfg, you can still use an explicit url, and if you don’t use the /./ element it will be anchored
to the start of the path (i.e. the third / in the URL). Here is an example that requires minimal support
from the local network infrastructure:
auto url=http://192.168.1.2/path/to/mypreseed.file
The way this works is that:
• if the URL is missing a protocol, http is assumed,
• if the hostname section contains no periods, it has the domain derived from DHCP appended to
it, and
• if there’s no /’s after the hostname, then the default path is added.
In addition to specifying the url, you can also specify settings that do not directly affect the behavior
of debian-installer itself, but can be passed through to scripts specified using preseed/run in
the loaded preseed file. At present, the only example of this is auto-install/classes, which has
an alias classes. This can be used thus:
auto url=example.com classes=class_A;class_B
The classes could for example denote the type of system to be installed, or the localization to be used.
It is of course possible to extend this concept, and if you do, it is reasonable to use the auto-install
namespace for this. So one might have something like auto-install/style which is then used in
your scripts. If you feel the need to do this, please mention it on the debian-boot@lists.debian.org
mailing list so that we can avoid namespace conflicts, and perhaps add an alias for the parameter for
you.
The auto boot choice is not yet defined on all arches. The same effect may be achieved by simply
adding the two parameters auto=true priority=critical to the kernel command line. The auto
kernel parameter is an alias for auto-install/enable and setting it to true delays the locale and
keyboard questions until after there has been a chance to preseed them, while priority is an alias
for debconf/priority and setting it to critical stops any questions with a lower priority from
being asked.
77
APPENDIX B. AUTOMATING THE INSTALLATION …
B.2. USING PRESEEDING
Additional options that may be of interest while attempting to automate an install while using DHCP
are: interface=auto netcfg/dhcp_timeout=60 which makes the machine choose the first viable NIC and be more patient about getting a reply to its DHCP query.
提示
An extensive example of how to use this framework, including example scripts
and classes, can be found on the website of its developer. The examples available there also show many other nice effects that can be achieved by creative
use of preconfiguration.
B.2.4 Aliases useful with preseeding
The following aliases can be useful when using (auto mode) preseeding. Note that these are simply
short aliases for question names, and you always need to specify a value as well: for example, auto=
true or interface=eth0.
debconf/priority
debian-installer/framebuffer
debian-installer/language
debian-installer/country
debian-installer/locale
debian-installer/theme
auto-install/enable
auto-install/classes
preseed/file
preseed/url
netcfg/get_domain
netcfg/get_hostname
netcfg/choose_interface
mirror/protocol
mirror/suite
anna/choose_modules
base-installer/install-recommends
tasksel:tasksel/first
tasksel:tasksel/desktop
disk-detect/dmraid/enable
keyboard-configuration/xkb-keymap
preseed/file/checksum
priority
fb
language
country
locale
theme
auto
classes
file
url
domain
hostname interface
protocol
suite
modules
recommends
tasks
desktop
dmraid
keymap
preseed-md5
B.2.5 Using a DHCP server to specify preconfiguration files
It’s also possible to use DHCP to specify a preconfiguration file to download from the network. DHCP
allows specifying a filename. Normally this is a file to netboot, but if it appears to be an URL then
installation media that support network preseeding will download the file from the URL and use it as a
preconfiguration file. Here is an example of how to set it up in the dhcpd.conf for version 3 of the ISC
DHCP server (the isc-dhcp-server Debian package).
if substring (option vendor-class-identifier, 0, 3) = ”d-i” {
filename ”http://host/preseed.cfg”;
}
Note that the above example limits this filename to DHCP clients that identify themselves as ”d-i”,
so it will not affect regular DHCP clients, but only the installer. You can also put the text in a stanza for
only one particular host to avoid preseeding all installs on your network.
A good way to use the DHCP preseeding is to only preseed values specific to your network, such
as the Debian mirror to use. This way installs on your network will automatically get a good mirror
78
APPENDIX B. AUTOMATING THE INSTALLATION …
B.3. CREATING A PRECONFIGURATION FILE
selected, but the rest of the installation can be performed interactively. Using DHCP preseeding to
fully automate Debian installs should only be done with care.
B.3
Creating a preconfiguration file
The preconfiguration file is in the format used by the debconf-set-selections command. The general
format of a line in a preconfiguration file is:
<owner> <question name> <question type> <value>
The file should start with #_preseed_V1
There are a few rules to keep in mind when writing a preconfiguration file.
• Put only a single space or tab between type and value: any additional whitespace will be interpreted as belonging to the value.
• A line can be split into multiple lines by appending a backslash (“\”) as the line continuation
character. A good place to split a line is after the question name; a bad place is between type and
value. Split lines will be joined into a single line with all leading/trailing whitespace condensed to
a single space.
• For debconf variables (templates) used only in the installer itself, the owner should be set to “di”; to preseed variables used in the installed system, the name of the package that contains the
corresponding debconf template should be used. Only variables that have their owner set to
something other than“d-i”will be propagated to the debconf database for the installed system.
• Most questions need to be preseeded using the values valid in English and not the translated
values. However, there are some questions (for example in partman) where the translated values
need to be used.
• Some questions take a code as value instead of the English text that is shown during installation.
• Start with #_preseed_V1
The easiest way to create a preconfiguration file is to use the example file linked in 節 B.4 as basis
and work from there.
An alternative method is to do a manual installation and then, after rebooting, use the debconf-getselections from the debconf-utils package to dump both the debconf database and the installer’s
cdebconf database to a single file:
$ echo ”#_preseed_V1” > file
$ debconf-get-selections --installer >> file
$ debconf-get-selections >> file
However, a file generated in this manner will have some items that should not be preseeded, and
the example file is a better starting place for most users.
注
This method relies on the fact that, at the end of the installation, the installer’s
cdebconf database is saved to the installed system in /var/log/installer/
cdebconf. However, because the database may contain sensitive information,
by default the files are only readable by root.
The directory /var/log/installer and all files in it will be deleted from your
system if you purge the package installation-report.
To check possible values for questions, you can use nano to examine the files in /var/lib/cdebconf
while an installation is in progress. View templates.dat for the raw templates and questions.dat
for the current values and for the values assigned to variables.
To check if the format of your preconfiguration file is valid before performing an install, you can use
the command debconf-set-selections -c preseed.cfg.
79
APPENDIX B. AUTOMATING THE INSTALLATION …
B.4
B.4. CONTENTS OF THE PRECONFIGURATION …
Contents of the preconfiguration file (for buster)
The configuration fragments used in this appendix are also available as an example preconfiguration
file from http://d-i.alioth.debian.org/manual/example-preseed.txt.
Note that this example is based on an installation for the Intel x86 architecture. If you are installing
a different architecture, some of the examples (like keyboard selection and bootloader installation) may
not be relevant and will need to be replaced by debconf settings appropriate for your architecture.
Details on how the different Debian Installer components actually work can be found in 節 6.3.
B.4.1 Localization
During a normal install the questions about localization are asked first, so these values can only be
preseeded via the initrd or kernel boot parameter methods. Auto mode (節 B.2.3) includes the setting
of auto-install/enable=true (normally via the auto preseed alias). This delays the asking of the
localisation questions, so that they can be preseeded by any method.
The locale can be used to specify both language and country and can be any combination of a
language supported by debian-installer and a recognized country. If the combination does not
form a valid locale, the installer will automatically select a locale that is valid for the selected language.
To specify the locale as a boot parameter, use locale=en_US.
Although this method is very easy to use, it does not allow preseeding of all possible combinations
of language, country and locale3 . So alternatively the values can be preseeded individually. Language
and country can also be specified as boot parameters.
# Preseeding only locale sets language, country and locale.
d-i debian-installer/locale string en_US
# The values can also be preseeded individually for greater flexibility.
#d-i debian-installer/language string en
#d-i debian-installer/country string NL
#d-i debian-installer/locale string en_GB.UTF-8
# Optionally specify additional locales to be generated.
#d-i localechooser/supported-locales multiselect en_US.UTF-8, nl_NL.UTF-8
Keyboard configuration consists of selecting a keymap and (for non-latin keymaps) a toggle key to
switch between the non-latin keymap and the US keymap. Only basic keymap variants are available during installation. Advanced variants are available only in the installed system, through dpkg-reconfigure
keyboard-configuration.
# Keyboard selection.
d-i keyboard-configuration/xkb-keymap select us
# d-i keyboard-configuration/toggle select No toggling
To skip keyboard configuration, preseed keymap with skip-config. This will result in the kernel
keymap remaining active.
B.4.2 Network configuration
Of course, preseeding the network configuration won’t work if you’re loading your preconfiguration
file from the network. But it’s great when you’re booting from CD or USB stick. If you are loading
preconfiguration files from the network, you can pass network config parameters by using kernel boot
parameters.
If you need to pick a particular interface when netbooting before loading a preconfiguration file
from the network, use a boot parameter such as interface=eth1.
Although preseeding the network configuration is normally not possible when using network preseeding (using “preseed/url”), you can use the following hack to work around that, for example if
you’d like to set a static address for the network interface. The hack is to force the network configuration to run again after the preconfiguration file has been loaded by creating a “preseed/run”script
containing the following commands:
3
Preseeding locale to en_NL would for example result in en_US.UTF-8 as default locale for the installed system. If e.g.
en_GB.UTF-8 is preferred instead, the values will need to be preseeded individually.
80
APPENDIX B. AUTOMATING THE INSTALLATION …
B.4. CONTENTS OF THE PRECONFIGURATION …
kill-all-dhcp; netcfg
The following debconf variables are relevant for network configuration.
# Disable network configuration entirely. This is useful for cdrom
# installations on non-networked devices where the network questions,
# warning and long timeouts are a nuisance.
#d-i netcfg/enable boolean false
# netcfg will choose an interface that has link if possible. This makes it
# skip displaying a list if there is more than one interface.
d-i netcfg/choose_interface select auto
# To pick a particular interface instead:
#d-i netcfg/choose_interface select eth1
# To set a different link detection timeout (default is 3 seconds).
# Values are interpreted as seconds.
#d-i netcfg/link_wait_timeout string 10
# If you have a slow dhcp server and the installer times out waiting for
# it, this might be useful.
#d-i netcfg/dhcp_timeout string 60
#d-i netcfg/dhcpv6_timeout string 60
# If you prefer to configure the network manually, uncomment this line and
# the static network configuration below.
#d-i netcfg/disable_autoconfig boolean true
# If you want the preconfiguration file to work on systems both with and
# without a dhcp server, uncomment these lines and the static network
# configuration below.
#d-i netcfg/dhcp_failed note
#d-i netcfg/dhcp_options select Configure network manually
# Static network configuration.
#
# IPv4 example
#d-i netcfg/get_ipaddress string 192.168.1.42
#d-i netcfg/get_netmask string 255.255.255.0
#d-i netcfg/get_gateway string 192.168.1.1
#d-i netcfg/get_nameservers string 192.168.1.1
#d-i netcfg/confirm_static boolean true
#
# IPv6 example
#d-i netcfg/get_ipaddress string fc00::2
#d-i netcfg/get_netmask string ffff:ffff:ffff:ffff::
#d-i netcfg/get_gateway string fc00::1
#d-i netcfg/get_nameservers string fc00::1
#d-i netcfg/confirm_static boolean true
# Any hostname and domain names assigned from dhcp take precedence over
# values set here. However, setting the values still prevents the questions
# from being shown, even if values come from dhcp.
d-i netcfg/get_hostname string unassigned-hostname
d-i netcfg/get_domain string unassigned-domain
# If you want to force a hostname, regardless of what either the DHCP
# server returns or what the reverse DNS entry for the IP is, uncomment
# and adjust the following line.
#d-i netcfg/hostname string somehost
# Disable that annoying WEP key dialog.
d-i netcfg/wireless_wep string
81
APPENDIX B. AUTOMATING THE INSTALLATION …
B.4. CONTENTS OF THE PRECONFIGURATION …
# The wacky dhcp hostname that some ISPs use as a password of sorts.
#d-i netcfg/dhcp_hostname string radish
# If non-free firmware is needed for the network or other hardware, you can
# configure the installer to always try to load it, without prompting. Or
# change to false to disable asking.
#d-i hw-detect/load_firmware boolean true
Please note that netcfg will automatically determine the netmask if netcfg/get_netmask is not
preseeded. In this case, the variable has to be marked as seen for automatic installations. Similarly,
netcfg will choose an appropriate address if netcfg/get_gateway is not set. As a special case, you
can set netcfg/get_gateway to “none”to specify that no gateway should be used.
B.4.3 Network console
# Use the following settings if you wish to make use of the network-console
# component for remote installation over SSH. This only makes sense if you
# intend to perform the remainder of the installation manually.
#d-i anna/choose_modules string network-console
#d-i network-console/authorized_keys_url string http://10.0.0.1/openssh-key
#d-i network-console/password password r00tme
#d-i network-console/password-again password r00tme
B.4.4 Mirror settings
Depending on the installation method you use, a mirror may be used to download additional components of the installer, to install the base system, and to set up the /etc/apt/sources.list for the
installed system.
The parameter mirror/suite determines the suite for the installed system.
The parameter mirror/udeb/suite determines the suite for additional components for the installer. It is only useful to set this if components are actually downloaded over the network and should
match the suite that was used to build the initrd for the installation method used for the installation.
Normally the installer will automatically use the correct value and there should be no need to set this.
# If you select ftp, the mirror/country string does not need to be set.
#d-i mirror/protocol string ftp
d-i mirror/country string manual
d-i mirror/http/hostname string http.us.debian.org
d-i mirror/http/directory string /debian
d-i mirror/http/proxy string
# Suite to install.
#d-i mirror/suite string testing
# Suite to use for loading installer components (optional).
#d-i mirror/udeb/suite string testing
B.4.5 Account setup
The password for the root account and name and password for a first regular user’s account can be
preseeded. For the passwords you can use either clear text values or crypt(3) hashes.
警告
Be aware that preseeding passwords is not completely secure as everyone with
access to the preconfiguration file will have the knowledge of these passwords.
Storing hashed passwords is considered secure unless a weak hashing algorithm
like DES or MD5 is used which allow for bruteforce attacks. Recommended password hashing algorithms are SHA-256 and SHA512.
82
APPENDIX B. AUTOMATING THE INSTALLATION …
B.4. CONTENTS OF THE PRECONFIGURATION …
# Skip creation of a root account (normal user account will be able to
# use sudo).
#d-i passwd/root-login boolean false
# Alternatively, to skip creation of a normal user account.
#d-i passwd/make-user boolean false
# Root password, either in clear text
#d-i passwd/root-password password r00tme
#d-i passwd/root-password-again password r00tme
# or encrypted using a crypt(3) hash.
#d-i passwd/root-password-crypted password [crypt(3) hash]
# To create a normal user account.
#d-i passwd/user-fullname string Debian User
#d-i passwd/username string debian
# Normal user’s password, either in clear text
#d-i passwd/user-password password insecure
#d-i passwd/user-password-again password insecure
# or encrypted using a crypt(3) hash.
#d-i passwd/user-password-crypted password [crypt(3) hash]
# Create the first user with the specified UID instead of the default.
#d-i passwd/user-uid string 1010
# The user account will be added to some standard initial groups. To
# override that, use this.
#d-i passwd/user-default-groups string audio cdrom video
The passwd/root-password-crypted and passwd/user-password-crypted variables can
also be preseeded with “!”as their value. In that case, the corresponding account is disabled. This
may be convenient for the root account, provided of course that an alternative method is set up to
allow administrative activities or root login (for instance by using SSH key authentication or sudo).
The following command (available from the whois package) can be used to generate a SHA-512
based crypt(3) hash for a password:
mkpasswd -m sha-512
B.4.6 Clock and time zone setup
# Controls whether or not the hardware clock is set to UTC.
d-i clock-setup/utc boolean true
# You may set this to any valid setting for $TZ; see the contents of
# /usr/share/zoneinfo/ for valid values.
d-i time/zone string US/Eastern
# Controls whether to use NTP to set the clock during the install
d-i clock-setup/ntp boolean true
# NTP server to use. The default is almost always fine here.
#d-i clock-setup/ntp-server string ntp.example.com
B.4.7 Partitioning
Using preseeding to partition the harddisk is limited to what is supported by partman-auto. You can
choose to partition either existing free space on a disk or a whole disk. The layout of the disk can be
determined by using a predefined recipe, a custom recipe from a recipe file or a recipe included in the
preconfiguration file.
Preseeding of advanced partition setups using RAID, LVM and encryption is supported, but not with
the full flexibility possible when partitioning during a non-preseeded install.
The examples below only provide basic information on the use of recipes. For detailed information see the files partman-auto-recipe.txt and partman-auto-raid-recipe.txt included in
83
APPENDIX B. AUTOMATING THE INSTALLATION …
B.4. CONTENTS OF THE PRECONFIGURATION …
the debian-installer package. Both files are also available from the debian-installer source
repository. Note that the supported functionality may change between releases.
警告
The identification of disks is dependent on the order in which their drivers are
loaded. If there are multiple disks in the system, make very sure the correct one
will be selected before using preseeding.
B.4.7.1
Partitioning example
# If the system has free space you can choose to only partition that space.
# This is only honoured if partman-auto/method (below) is not set.
#d-i partman-auto/init_automatically_partition select biggest_free
# Alternatively, you may specify a disk to partition. If the system has only
# one disk the installer will default to using that, but otherwise the device
# name must be given in traditional, non-devfs format (so e.g. /dev/sda
# and not e.g. /dev/discs/disc0/disc).
# For example, to use the first SCSI/SATA hard disk:
#d-i partman-auto/disk string /dev/sda
# In addition, you’ll need to specify the method to use.
# The presently available methods are:
# - regular: use the usual partition types for your architecture
# - lvm:
use LVM to partition the disk
# - crypto: use LVM within an encrypted partition
d-i partman-auto/method string lvm
# If one of the disks that are going to be automatically partitioned
# contains an old LVM configuration, the user will normally receive a
# warning. This can be preseeded away...
d-i partman-lvm/device_remove_lvm boolean true
# The same applies to pre-existing software RAID array:
d-i partman-md/device_remove_md boolean true
# And the same goes for the confirmation to write the lvm partitions.
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
# You can choose one of the three predefined partitioning recipes:
# - atomic: all files in one partition
# - home:
separate /home partition
# - multi: separate /home, /var, and /tmp partitions
d-i partman-auto/choose_recipe select atomic
# Or provide a recipe of your own...
# If you have a way to get a recipe file into the d-i environment, you can
# just point at it.
#d-i partman-auto/expert_recipe_file string /hd-media/recipe
# If not, you can put an entire recipe into the preconfiguration file in one
# (logical) line. This example creates a small /boot partition, suitable
# swap, and uses the rest of the space for the root partition:
#d-i partman-auto/expert_recipe string
\
#
boot-root ::
\
#
\
40 50 100 ext3
#
$primary{ } $bootable{ }
\
#
method{ format } format{ }
\
#
use_filesystem{ } filesystem{ ext3 }
\
#
mountpoint{ /boot }
\
#
.
\
84
APPENDIX B. AUTOMATING THE INSTALLATION …
#
#
#
#
#
#
#
#
#
#
#
#
#
B.4. CONTENTS OF THE PRECONFIGURATION …
500 10000 1000000000 ext3
method{ format } format{ }
use_filesystem{ } filesystem{ ext3 }
mountpoint{ / }
.
64 512 300% linux-swap
method{ swap } format{ }
.
\
\
\
\
\
\
\
The full recipe format is documented in the file partman-auto-recipe.txt
included in the ’debian-installer’ package or available from D-I source
repository. This also documents how to specify settings such as file
system labels, volume group names and which physical devices to include
in a volume group.
# This makes partman automatically partition without confirmation, provided
# that you told it what to do using one of the methods above.
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
# When disk encryption is enabled, skip wiping the partitions beforehand.
#d-i partman-auto-crypto/erase_disks boolean false
B.4.7.2
Partitioning using RAID
You can also use preseeding to set up partitions on software RAID arrays. Supported are RAID levels
0, 1, 5, 6 and 10, creating degraded arrays and specifying spare devices.
If you are using RAID 1, you can preseed grub to install to all devices used in the array; see 節
B.4.11.
警告
This type of automated partitioning is easy to get wrong. It is also functionality
that receives relatively little testing from the developers of debian-instal
ler. The responsibility to get the various recipes right (so they make sense and
don’t conflict) lies with the user. Check /var/log/syslog if you run into
problems.
# The method should be set to ”raid”.
#d-i partman-auto/method string raid
# Specify the disks to be partitioned. They will all get the same layout,
# so this will only work if the disks are the same size.
#d-i partman-auto/disk string /dev/sda /dev/sdb
# Next you need to specify the physical partitions that will be used.
#d-i partman-auto/expert_recipe string \
#
multiraid ::
\
#
1000 5000 4000 raid
\
#
$primary{ } method{ raid }
\
#
.
\
#
64 512 300% raid
\
#
method{ raid }
\
#
.
\
#
500 10000 1000000000 raid
\
#
method{ raid }
\
#
.
# Last you need to specify how the previously defined partitions will be
85
APPENDIX B. AUTOMATING THE INSTALLATION …
#
#
#
#
#
#
B.4. CONTENTS OF THE PRECONFIGURATION …
used in the RAID setup. Remember to use the correct partition numbers
for logical partitions. RAID levels 0, 1, 5, 6 and 10 are supported;
devices are separated using ”#”.
Parameters are:
<raidtype> <devcount> <sparecount> <fstype> <mountpoint> \
<devices> <sparedevices>
#d-i
#
#
#
#
#
#
#
#
#
partman-auto-raid/recipe string
1 2 0 ext3 /
/dev/sda1#/dev/sdb1
.
1 2 0 swap /dev/sda5#/dev/sdb5
.
0 2 0 ext3 /home
/dev/sda6#/dev/sdb6
.
\
\
\
\
\
\
\
\
\
# For additional information see the file partman-auto-raid-recipe.txt
# included in the ’debian-installer’ package or available from D-I source
# repository.
# This makes partman automatically partition without confirmation.
d-i partman-md/confirm boolean true
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
B.4.7.3
Controlling how partitions are mounted
Normally, filesystems are mounted using a universally unique identifier (UUID) as a key; this allows
them to be mounted properly even if their device name changes. UUIDs are long and difficult to read,
so, if you prefer, the installer can mount filesystems based on the traditional device names, or based
on a label you assign. If you ask the installer to mount by label, any filesystems without a label will be
mounted using a UUID instead.
Devices with stable names, such as LVM logical volumes, will continue to use their traditional names
rather than UUIDs.
警告
Traditional device names may change based on the order in which the kernel
discovers devices at boot, which may cause the wrong filesystem to be mounted.
Similarly, labels are likely to clash if you plug in a new disk or a USB drive, and
if that happens your system’s behaviour when started will be random.
# The default is to mount by UUID, but you can also choose ”traditional” to
# use traditional device names, or ”label” to try filesystem labels before
# falling back to UUIDs.
#d-i partman/mount_style select uuid
B.4.8 Base system installation
There is actually not very much that can be preseeded for this stage of the installation. The only questions asked concern the installation of the kernel.
# Configure APT to not install recommended packages by default. Use of this
# option can result in an incomplete system and should only be used by very
# experienced users.
86
APPENDIX B. AUTOMATING THE INSTALLATION …
B.4. CONTENTS OF THE PRECONFIGURATION …
#d-i base-installer/install-recommends boolean false
# The kernel image (meta) package to be installed; ”none” can be used if no
# kernel is to be installed.
#d-i base-installer/kernel/image string linux-image-686
B.4.9 Apt setup
Setup of the /etc/apt/sources.list and basic configuration options is fully automated based on
your installation method and answers to earlier questions. You can optionally add other (local) repositories.
# You can choose to install non-free and contrib software.
#d-i apt-setup/non-free boolean true
#d-i apt-setup/contrib boolean true
# Uncomment this if you don’t want to use a network mirror.
#d-i apt-setup/use_mirror boolean false
# Select which update services to use; define the mirrors to be used.
# Values shown below are the normal defaults.
#d-i apt-setup/services-select multiselect security, updates
#d-i apt-setup/security_host string security.debian.org
# Additional repositories, local[0-9] available
#d-i apt-setup/local0/repository string \
#
http://local.server/debian stable main
#d-i apt-setup/local0/comment string local server
# Enable deb-src lines
#d-i apt-setup/local0/source boolean true
# URL to the public key of the local repository; you must provide a key or
# apt will complain about the unauthenticated repository and so the
# sources.list line will be left commented out
#d-i apt-setup/local0/key string http://local.server/key
# By default the installer requires that repositories be authenticated
# using a known gpg key. This setting can be used to disable that
# authentication. Warning: Insecure, not recommended.
#d-i debian-installer/allow_unauthenticated boolean true
# Uncomment this to add multiarch configuration for i386
#d-i apt-setup/multiarch string i386
B.4.10
Package selection
You can choose to install any combination of tasks that are available. Available tasks as of this writing
include:
• standard (standard tools)
• desktop (graphical desktop)
• gnome-desktop (Gnome desktop)
• xfce-desktop (XFCE desktop)
• kde-desktop (KDE Plasma desktop)
• cinnamon-desktop (Cinnamon desktop)
• mate-desktop (MATE desktop)
• lxde-desktop (LXDE desktop)
87
APPENDIX B. AUTOMATING THE INSTALLATION …
B.4. CONTENTS OF THE PRECONFIGURATION …
• web-server (web server)
• print-server (print server)
• ssh-server (SSH server)
You can also choose to install no tasks, and force the installation of a set of packages in some other
way. We recommend always including the standard task.
If you want to install some individual packages in addition to packages installed by tasks, you can
use the parameter pkgsel/include. The value of this parameter can be a list of packages separated
by either commas or spaces, which allows it to be used easily on the kernel command line as well.
#tasksel tasksel/first multiselect standard, web-server, kde-desktop
# Individual additional packages to install
#d-i pkgsel/include string openssh-server build-essential
# Whether to upgrade packages after debootstrap.
# Allowed values: none, safe-upgrade, full-upgrade
#d-i pkgsel/upgrade select none
# Some versions of the installer can report back on what software you have
# installed, and what software you use. The default is not to report back,
# but sending reports helps the project determine what software is most
# popular and include it on CDs.
#popularity-contest popularity-contest/participate boolean false
B.4.11
Boot loader installation
# Grub is the default boot loader (for x86). If you want lilo installed
# instead, uncomment this:
#d-i grub-installer/skip boolean true
# To also skip installing lilo, and install no bootloader, uncomment this
# too:
#d-i lilo-installer/skip boolean true
# This is fairly safe to set, it makes grub install automatically to the MBR
# if no other operating system is detected on the machine.
d-i grub-installer/only_debian boolean true
# This one makes grub-installer install to the MBR if it also finds some other
# OS, which is less safe as it might not be able to boot that other OS.
d-i grub-installer/with_other_os boolean true
# Due notably to potential USB sticks, the location of the MBR can not be
# determined safely in general, so this needs to be specified:
#d-i grub-installer/bootdev string /dev/sda
# To install to the first device (assuming it is not a USB stick):
#d-i grub-installer/bootdev string default
# Alternatively, if you want to install to a location other than the mbr,
# uncomment and edit these lines:
#d-i grub-installer/only_debian boolean false
#d-i grub-installer/with_other_os boolean false
#d-i grub-installer/bootdev string (hd0,1)
# To install grub to multiple disks:
#d-i grub-installer/bootdev string (hd0,1) (hd1,1) (hd2,1)
# Optional password for grub, either in clear text
#d-i grub-installer/password password r00tme
#d-i grub-installer/password-again password r00tme
# or encrypted using an MD5 hash, see grub-md5-crypt(8).
#d-i grub-installer/password-crypted password [MD5 hash]
88
APPENDIX B. AUTOMATING THE INSTALLATION …
B.5. ADVANCED OPTIONS
# Use the following option to add additional boot parameters for the
# installed system (if supported by the bootloader installer).
# Note: options passed to the installer will be added automatically.
#d-i debian-installer/add-kernel-opts string nousb
An MD5 hash for a password for grub can be generated using grub-md5-crypt, or using the command from the example in 節 B.4.5.
B.4.12
Finishing up the installation
# During installations from serial console, the regular virtual consoles
# (VT1-VT6) are normally disabled in /etc/inittab. Uncomment the next
# line to prevent this.
#d-i finish-install/keep-consoles boolean true
# Avoid that last message about the install being complete.
d-i finish-install/reboot_in_progress note
# This will prevent the installer from ejecting the CD during the reboot,
# which is useful in some situations.
#d-i cdrom-detect/eject boolean false
# This is how to make the installer shutdown when finished, but not
# reboot into the installed system.
#d-i debian-installer/exit/halt boolean true
# This will power off the machine instead of just halting it.
#d-i debian-installer/exit/poweroff boolean true
B.4.13
#
#
#
#
#
#
#
Preseeding other packages
Depending on what software you choose to install, or if things go wrong
during the installation process, it’s possible that other questions may
be asked. You can preseed those too, of course. To get a list of every
possible question that could be asked during an install, do an
installation, and then run these commands:
debconf-get-selections --installer > file
debconf-get-selections >> file
B.5
Advanced options
B.5.1 Running custom commands during the installation
A very powerful and flexible option offered by the preconfiguration tools is the ability to run commands
or scripts at certain points in the installation.
When the filesystem of the target system is mounted, it is available in /target. If an installation
CD is used, when it is mounted it is available in /cdrom.
#
#
#
#
#
#
d-i preseeding is inherently not secure. Nothing in the installer checks
for attempts at buffer overflows or other exploits of the values of a
preconfiguration file like this one. Only use preconfiguration files from
trusted locations! To drive that home, and because it’s generally useful,
here’s a way to run any shell command you’d like inside the installer,
automatically.
# This first command is run as early as possible, just after
# preseeding is read.
#d-i preseed/early_command string anna-install some-udeb
# This command is run immediately before the partitioner starts. It may be
89
APPENDIX B. AUTOMATING THE INSTALLATION …
B.5. ADVANCED OPTIONS
# useful to apply dynamic partitioner preseeding that depends on the state
# of the disks (which may not be visible when preseed/early_command runs).
#d-i partman/early_command \
#
string debconf-set partman-auto/disk ”$(list-devices disk | head -n1)”
# This command is run just before the install finishes, but when there is
# still a usable /target directory. You can chroot to /target and use it
# directly, or use the apt-install and in-target commands to easily install
# packages and run commands in the target system.
#d-i preseed/late_command string apt-install zsh; in-target chsh -s /bin/zsh
B.5.2 Using preseeding to change default values
It is possible to use preseeding to change the default answer for a question, but still have the question
asked. To do this the seen flag must be reset to “false”after setting the value for a question.
d-i foo/bar string value
d-i foo/bar seen false
The same effect can be achieved for all questions by setting the parameter preseed/interactive=
true at the boot prompt. This can also be useful for testing or debugging your preconfiguration file.
Note that the“d-i”owner should only be used for variables used in the installer itself. For variables
belonging to packages installed on the target system, you should use the name of that package instead.
See the footnote to 節 B.2.2.
If you are preseeding using boot parameters, you can make the installer ask the corresponding
question by using the “?=”operator, i.e. foo/bar?=value (or owner:foo/bar?=value). This will of
course only have effect for parameters that correspond to questions that are actually displayed during
an installation and not for “internal”parameters.
For more debugging information, use the boot parameter DEBCONF_DEBUG=5. This will cause deb
conf to print much more detail about the current settings of each variable and about its progress
through each package’s installation scripts.
B.5.3 Chainloading preconfiguration files
It is possible to include other preconfiguration files from a preconfiguration file. Any settings in those
files will override pre-existing settings from files loaded earlier. This makes it possible to put, for example, general networking settings for your location in one file and more specific settings for certain
configurations in other files.
# More than one file can be listed, separated by spaces; all will be
# loaded. The included files can have preseed/include directives of their
# own as well. Note that if the filenames are relative, they are taken from
# the same directory as the preconfiguration file that includes them.
#d-i preseed/include string x.cfg
# The installer can optionally verify checksums of preconfiguration files
# before using them. Currently only md5sums are supported, list the md5sums
# in the same order as the list of files to include.
#d-i preseed/include/checksum string 5da499872becccfeda2c4872f9171c3d
# More flexibly, this runs a shell command and if it outputs the names of
# preconfiguration files, includes those files.
#d-i preseed/include_command \
#
string if [ ”‘hostname‘” = bob ]; then echo bob.cfg; fi
# Most flexibly of all, this downloads a program and runs it. The program
# can use commands such as debconf-set to manipulate the debconf database.
# More than one script can be listed, separated by spaces.
# Note that if the filenames are relative, they are taken from the same
# directory as the preconfiguration file that runs them.
#d-i preseed/run string foo.sh
90
APPENDIX B. AUTOMATING THE INSTALLATION …
B.5. ADVANCED OPTIONS
It is also possible to chainload from the initrd or file preseeding phase, into network preseeding
by setting preseed/url in the earlier files. This will cause network preseeding to be performed when
the network comes up. You need to be careful when doing this, since there will be two distinct runs at
preseeding, meaning for example that you get another chance to run the preseed/early command, the
second one happening after the network comes up.
91
Appendix C
為 Debian 分割磁區
C.1
決定 Debian 磁區及大小
最小化情況下,GNU/Linux 需要一個分割區。您可以有一個包含整個作業系統,應用程式以及您個人檔
案的分割區。大多數人認為另建一個的置換分割區是有必要的,雖然嚴格來說它並不正確。“Swap”是
一個作業系統用的空白空間,允許系統使用磁碟來提供“虛擬記憶體”。通過置換空間至一個分離的分割
區,Linux 可以有效地使用它。強迫 Linux 使用一個一般檔案作為置換空間也是可行的,但是並不建議這
種做法。
大多數人選擇給 GNU/Linu 比最小化更多的分區。有兩個原因可能使您願意把檔案系統打散放置到一
些較小的分區上。第一個問題是安全性,如果檔案系統出現了問題,一般來說只有一個磁區會受到影響。
因此,您只需要更換 (來自於您小心維護的備份) 一個磁區。在最小化階段,您應該考慮建立所謂的“根
分割區”。它含有最主要的系統組件。如果其它分割區出現了問題,您仍可以進入至 GNU/Linux 來修復
系統。這樣您可以不必從頭重新安裝系統。
第二個理由對商業設置來說更重要,但它實際上取決於您機器的使用。比如,一個郵件伺服器接受到
很多垃圾郵件會很快填滿一個分割區,如果您建立 /var/mail 在一個分離的分割區上面,大多數系統
在您得到太多垃圾郵件的情況下會繼續工作。
使用更多分割區的唯一缺點是很難預先知道您將來的需求。如果您建立了一個太小的分割區,則您可
能需要重新安裝系統或者不停地移動資料以增加分割區空間。除此之外,如果您建立的分割區過大,您
將浪費一些可以用在別的地方的空間。硬碟容量目前很便宜,但是為什麼要浪費呢?
C.2
目錄樹
Debian GNU/Linux 依照 檔案系統層次標準 (Filesystem Hierarchy Standard) 為目錄以及檔案命名。這個
標準允許使用者以及軟體程式預測檔案及目錄的位置。根層次目錄只是簡單表現為 /。在根層次,所有的
Debian 系統包括這些目錄:
目錄
bin
boot
dev
etc
home
lib
media
mnt
proc
root
run
sbin
sys
tmp
usr
var
內容
基礎命令執行檔案
boot loader 的靜態鏈結檔案
裝置檔案
主機特定的系統設定
使用者家目錄
基本共享程式庫以及核心單元
包含移動媒介的掛載點
暫時掛載檔案系統的掛載點
Virtual directory for system information
根使用者的家目錄
Run-time variable data
基本的系統執行檔案
Virtual directory for system information
暫存檔
第二層次
變動資料
92
APPENDIX C. 為 DEBIAN 分割磁區
C.3. 建議的分割方案
目錄
srv
opt
內容
Data for services provided by the system
附加的應用程式軟體套件
下面列出關於目錄和分割區的重要考量。要注意硬碟的使用隨系統設定和特定用途有很大變化。這裡
的建議是一般導引,提供分割區的基本分割方式。
• The root partition / must always physically contain /etc, /bin, /sbin, /lib and /dev, otherwise you won’t be able to boot. Typically 250–350MB is needed for the root partition.
• /usr: contains all user programs (/usr/bin), libraries (/usr/lib), documentation (/usr/
share/doc), etc. This is the part of the file system that generally takes up most space. You
should provide at least 500MB of disk space. This amount should be increased depending on the
number and type of packages you plan to install. A generous workstation or server installation
should allow 4–6GB.
• It is now recommended to have /usr on the root partition /, otherwise it could cause some
trouble at boot time. This means that you should provide at least 600–750MB of disk space for
the root partition including /usr, or 5–6GB for a workstation or a server installation.
• /var: variable data like news articles, e-mails, web sites, databases, the packaging system cache,
etc. will be placed under this directory. The size of this directory depends greatly on the usage of
your system, but for most people will be dictated by the package management tool’s overhead.
If you are going to do a full installation of just about everything Debian has to offer, all in one
session, setting aside 2 or 3 GB of space for /var should be sufficient. If you are going to install
in pieces (that is to say, install services and utilities, followed by text stuff, then X, ...), you can get
away with 300–500 MB. If hard drive space is at a premium and you don’t plan on doing major
system updates, you can get by with as little as 30 or 40 MB.
• /tmp: temporary data created by programs will most likely go in this directory. 40–100MB should
usually be enough. Some applications —including archive manipulators, CD/DVD authoring tools,
and multimedia software —may use /tmp to temporarily store image files. If you plan to use such
applications, you should adjust the space available in /tmp accordingly.
• /home: every user will put his personal data into a subdirectory of this directory. Its size depends
on how many users will be using the system and what files are to be stored in their directories.
Depending on your planned usage you should reserve about 100MB for each user, but adapt
this value to your needs. Reserve a lot more space if you plan to save a lot of multimedia files
(pictures, MP3, movies) in your home directory.
C.3
建議的分割方案
對於新使用者,個人 Debian 系統,家庭系統以及其它單用戶設定來說,一個單一/ 分割區 (加上置換區)
可能是最容易簡單的方式。但是如果您的分割區大於 6GB,請選擇 ext3 作為您的分割區類型。ext2 分割
區需要週期性的檔案系統完整性檢查,而且當分割區很大的時候,這個特性將導致開機的延遲。
For multi-user systems or systems with lots of disk space, it’s best to put /var, /tmp, and /home
each on their own partitions separate from the / partition.
You might need a separate /usr/local partition if you plan to install many programs that are
not part of the Debian distribution. If your machine will be a mail server, you might need to make
/var/mail a separate partition. Often, putting /tmp on its own partition, for instance 20–50MB, is a
good idea. If you are setting up a server with lots of user accounts, it’s generally good to have a separate, large /home partition. In general, the partitioning situation varies from computer to computer
depending on its uses.
對於非常複雜的系統來說,您應該閱讀 Multi Disk HOWTO。其中包含了很多對 ISP 以及設定伺服器
的用戶來說非常用的深入資訊。
至於在置換分割區大小的問題,不同的人有不同的觀點。我們的建議是使用和系統記憶體大小相同的
置換分割區。在大多數情況下它不應該小於 16MB ,當然也有一些例外。如果您正嘗試在 256MB 記憶體
的機器上同時解決 10000 個聯立方程式,您可能需要 1G (或者更多) 的置換分割區。
On some 32-bit architectures (m68k and PowerPC), the maximum size of a swap partition is 2GB.
That should be enough for nearly any installation. However, if your swap requirements are this high,
93
APPENDIX C. 為 DEBIAN 分割磁區
C.4. LINUX 裡的裝置名稱
you should probably try to spread the swap across different disks (also called “spindles”) and, if
possible, different SCSI or IDE channels. The kernel will balance swap usage between multiple swap
partitions, giving better performance.
例如,一個較老的機器可能具有 32MB 記憶體以及一個在 /dev/sda 上 1.7GB 的 IDE 磁碟。其他作
業系統寫在 /dev/sda1 上,此分區大小為 500MB ,一個 32MB 置換分割區作為 /dev/sda3 以及一個
1.2GB 分割區 /dev/sda2) 作為 Linux 分割區。
對於不同工作所需要多大的空間的概念,您也許對於系統安裝完畢後加入的安裝感興趣,請參照節
D.2。
C.4
Linux 裡的裝置名稱
Linux 磁碟以及分割區名稱可能和其它的作業系統有所不同。當您建立以及掛載分割區時,必須先知道
Linux 所使用的設備名稱。以下是基本的命名規則:
• 第一個軟碟機被命名為 /dev/fd0。
• 第二個軟碟機被命名為 /dev/fd1。
• The first hard disk detected is named /dev/sda.
• The second hard disk detected is named /dev/sdb, and so on.
• 第一個 SCSI 光碟機被命名為 /dev/scd0,也叫 /dev/sr0。
每個磁碟分割區的名字在磁碟名稱後面附加一個十進制數字:sda1 以及 sda2 表示系統裡第一個
SCSI 磁碟的第一個及第二個分割區。
這裡有個實際的例子。假設您有一個系統帶有兩個 SCSI 磁碟,一個 SCSI 位址是 2 而另外一個是 4。
第一個磁碟 (在 2 上) 會被命名為 sda 而第二個是 sdb。如果 sda 磁碟有 3 個分割區,它們將被命名為
sda1,sda2,以及 sda3。sdb 及其分割區亦是如此。
注意如果您有兩個 SCSI 主機匯流排適配器 (控制器),設備的順序可能會比較混亂。假設您知道磁碟模
式以及/或者容量,最好的解決方案是觀察開機訊息。
Linux represents the primary partitions as the drive name, plus the numbers 1 through 4. For example, the first primary partition on the first drive is /dev/sda1. The logical partitions are numbered
starting at 5, so the first logical partition on that same drive is /dev/sda5. Remember that the extended partition, that is, the primary partition holding the logical partitions, is not usable by itself.
C.5
Debian 分割程式
Debian 開發人員配置了幾種在不同硬碟及電腦架構上的分割區程式。下面是一個適合您的架構的程式列
表。
partman Recommended partitioning tool in Debian. This Swiss army knife can also resize partitions,
create filesystems (“format”in Windows speak) and assign them to the mountpoints.
fdisk 最早的 Linux 磁碟分割區工具,對高手來說很好用。
Be careful if you have existing FreeBSD partitions on your machine. The installation kernels include support for these partitions, but the way that fdisk represents them (or not) can make the
device names differ. See the Linux+FreeBSD HOWTO.
cfdisk 一個簡單易用,給其它人使用的是全螢幕磁碟分割區程式。
請注意 cfdisk 完全不瞭解 FreeBSD 的分割區,而且裝置名稱也可能有所不同。
One of these programs will be run by default when you select Partition disks (or similar). It may
be possible to use a different partitioning tool from the command line on VT2, but this is not recommended.
Remember to mark your boot partition as “Bootable”.
94
APPENDIX C. 為 DEBIAN 分割磁區
C.5. DEBIAN 分割程式
C.5.1 為 32-bit PC 分割
If you have an existing other operating system such as DOS or Windows and you want to preserve that
operating system while installing Debian, you may need to resize its partition to free up space for the
Debian installation. The installer supports resizing of both FAT and NTFS filesystems; when you get to
the installer’s partitioning step, select the option Manual and then simply select an existing partition
and change its size.
The PC BIOS generally adds additional constraints for disk partitioning. There is a limit to how many
“primary”and “logical”partitions a drive can contain. Additionally, with pre 1994–98 BIOSes, there
are limits to where on the drive the BIOS can boot from. More information can be found in the Linux
Partition HOWTO, but this section will include a brief overview to help you plan most situations.
“主”分割區是 PC 磁碟上最原始的分割區方式。但是,每個磁碟只能有四個主分區。為了突破這個限
制,發明了“延伸 (extended)”以及“邏輯”分割區。將一個主分割區設定為延伸分割區,您可以將之分
成許多邏輯分割區。每個延伸分割區最多可切割成 60 個邏輯分割區﹔但是每個磁碟只能有一個延伸分割
區。
對於 SCSI 來說,Linux 限制每個磁碟最多有 255 個分割區 ( 3 個可用的主分割區,252 個邏輯分割
區)。對於 IDE 來說可以有 63 個分割區 ( 3 個可用的主分割區,60 個邏輯分割區)。但是通常 Debian
GNU/Linux 系統只支持 20 個分割區裝置,因此您不能安裝超過 20 個的分割區,除非您先為這些分割區
手動建立裝置檔案。
如果您有一個很大的 IDE 磁碟,既沒有使用 LBA 定址,也沒有 overlay 驅動程式 (硬碟製造商有時候
提供此功能),那麼開機分割區 (含有您核心映像的分割區) 必須放置在硬碟第一個 1024 磁柱內。(在沒有
BIOS 轉換的情況下,大約有 524MB)。
如果您的 BIOS 在 1995—1998 年之後出產 (取決於製造商) 且支援“Enhanced Disk Drive Support
Specification”則不受限。Lilo ,Linux Loader 以及 Debian 的替代方案 mbr 必須使用 BIOS 從磁碟讀取
核心至記憶體。如果開啟 BIOS int 0x13 高容量硬碟的存取功能,則將被使用,否則合法的磁碟存取界面
會拿來當備用方式,而且它不能定址任何大於 1023rd 磁柱的位置。一旦 Linux 啟動後,不管電腦的 BIOS
哪一種,這些限制將不再起任何作用,因為 Linux 不使用 BIOS 來存取硬碟。
如果您有一個大硬碟,您也許必須使用磁柱轉換 (cylinder translation) 技術。它可以透過 BIOS 設定
程式中設定,比如 LBA (Logical Block Addressing) 或者 CHS 轉換模式 (“Large”)。關於大硬碟的各種議
題討論可以在 Large Disk HOWTO 下找到。如果您正在使用一個磁柱轉換方案,而 BIOS 不支援高容量硬
碟的存取,您的開機分割區必須放置在 轉換後的 1024 磁柱內。
The recommended way of accomplishing this is to create a small (25–50MB should suffice) partition
at the beginning of the disk to be used as the boot partition, and then create whatever other partitions
you wish to have, in the remaining area. This boot partition must be mounted on /boot, since that
is the directory where the Linux kernel(s) will be stored. This configuration will work on any system,
regardless of whether LBA or large disk CHS translation is used, and regardless of whether your BIOS
supports the large disk access extensions.
95
Appendix D
其他
D.1 Linux 裡的設備
In Linux various special files can be found under the directory /dev. These files are called device files
and behave unlike ordinary files. The most common types of device files are for block devices and
character devices. These files are an interface to the actual driver (part of the Linux kernel) which in
turn accesses the hardware. Another, less common, type of device file is the named pipe. The most
important device files are listed in the tables below.
fd0
fd1
第一個軟碟機
第二個軟碟機
sda
sdb
sda1
sdb7
First hard disk
Second hard disk
First partition of the first hard disk
Seventh partition of the second hard disk
sr0
sr1
First CD-ROM
Second CD-ROM
ttyS0
ttyS1
psaux
gpmdata
序列埠 0,即 MS-DOS 下的 COM1
序列埠 1,即 MS-DOS 下的 COM2
PS/2 滑鼠設備
虛擬設備,中繼從 GPM(滑鼠) 服務傳來的資料
cdrom
mouse
指向光碟機的符號鏈結
指向滑鼠設備檔的符號鏈結
null
zero
Anything written to this device will disappear
可以從該設備永無休止地讀出零
D.1.1 設定您的滑鼠
The mouse can be used in both the Linux console (with gpm) and the X window environment. Normally,
this is a simple matter of installing gpm and the X server itself. Both should be configured to use
/dev/input/mice as the mouse device. The correct mouse protocol is named exps2 in gpm, and
ExplorerPS/2 in X. The respective configuration files are /etc/gpm.conf and /etc/X11/xorg.
conf.
Certain kernel modules must be loaded in order for your mouse to work. In most cases the correct
96
APPENDIX D. 其他
D.2. 各軟體集所需的磁碟空間
modules are autodetected, but not always for old-style serial and bus mice1 , which are quite rare except
on very old computers. Summary of Linux kernel modules needed for different mouse types:
Module
psmouse
usbhid
sermouse
logibm
Description
PS/2 mice (should be autodetected)
USB mice (should be autodetected)
Most serial mice
Bus mouse connected to Logitech adapter card
Bus mouse connected to ATI or Microsoft
InPort card
inport
To load a mouse driver module, you can use the modconf command (from the package with the
same name) and look in the category kernel/drivers/input/mouse.
D.2 各軟體集所需的磁碟空間
A standard installation for the amd64 architecture, including all standard packages and using the default kernel, takes up 800MB of disk space. A minimal base installation, without the“Standard system”
task selected, will take 613MB.
重要
In both cases this is the actual disk space used after the installation is finished
and any temporary files deleted. It also does not take into account overhead
used by the file system, for example for journal files. This means that significantly more disk space is needed both during the installation and for normal
system use.
下面的表格一一列出了 tasksel 中每個軟體集所需的磁碟空間大小。該列表是使用 aptitude 產生的。
請注意,有些軟體集之間會有相重疊的部分,所以兩個軟體集一同安裝後所佔的空間,可能會小於這兩
個軟體集分別安裝所佔的空間。
By default the installer will install the GNOME desktop environment, but alternative desktop environments can be selected either by using one of the special CD images, or by specifying the desired
desktop environment when the installer is booted (see 節 6.3.5.2).
Note that you will need to add the sizes listed in the table to the size of the standard installation
when determining the size of partitions. Most of the size listed as “Installed size”will end up in /usr
and in /lib; the size listed as “Download size”is (temporarily) required in /var.
軟體集
Desktop environment
• GNOME (default)
• KDE Plasma
• Xfce
• LXDE
• MATE
• Cinnamon
Laptop
Web 伺服器
印表機伺服器
SSH 伺服器
安裝大小 (MB)
3163
3044
2122
2133
2288
2878
29
40
407
1
下載大小 (MB)
935
911
593
602
644
843
9
9
95
0
安裝所需空間 (MB)
4098
3955
2715
2735
2932
3721
38
49
502
1
If you install in a language other than English, tasksel may automatically install a localization task,
if one is available for your language. Space requirements differ per language; you should allow up to
350MB in total for download and installation.
1 Serial mice usually have a 9-hole D-shaped connector; bus mice have an 8-pin round connector, not to be confused with
the 6-pin round connector of a PS/2 mouse or the 4-pin round connector of an ADB mouse.
97
APPENDIX D. 其他
D.3. 透過 UNIX/LINUX 系統來安裝 DEBIAN …
D.3 透過 Unix/Linux 系統來安裝 Debian GNU/Linux
本節說明了如何透過現有的 Unix 或 Linux 系統來安裝 Debian GNU/Linux,而非使用本手冊後面要談到
的基於 ncurses,由選單驅動的安裝軟體。這篇“交叉安裝 (cross-install)”HOWTO 是應使用者的要求而
撰寫的。他們原來是 Redhat、Mandriva 和 SUSE 的使用者,現轉而使用 Debian GNU/Linux。在本節中,
我們假設您對於輸入 *nix 指令以及在檔案系統中穿梭移動並不生疏。同時,在本節中,$ 符號表示這個
指令是在使用者當前使用的系統中輸入的,而 # 則表示這個指令是在 Debian chroot 環境中輸入的。
您一旦根據自己的需求設定好了新的 Debian 系統,就可以將您的原來系統中的使用者資料 (如果有的
話) 全部遷移到 Debian 裡去。然後就能繼續爽了。一言以蔽之,這是一次“不關機”的 Debian GNU/Linux
安裝。同時,這也是處理那些因為硬體原因不能透過任何開機或者安裝媒介完成安裝的權宜之計。
注
As this is a mostly manual procedure, you should bear in mind that you will
need to do a lot of basic configuration of the system yourself, which will also
require more knowledge of Debian and of Linux in general than performing a
regular installation. You cannot expect this procedure to result in a system that
is identical to a system from a regular installation. You should also keep in mind
that this procedure only gives the basic steps to set up a system. Additional
installation and/or configuration steps may be needed.
D.3.1 準備開始
With your current *nix partitioning tools, repartition the hard drive as needed, creating at least one
filesystem plus swap. You need around 613MB of space available for a console only install, or about
2133MB if you plan to install X (more if you intend to install desktop environments like GNOME or KDE
Plasma).
在您的分割區上建立檔案系統。舉例來說,如果要在 /dev/sda6 分割區 (以後的例子中,將把它作
為 root 分割區) 建立一個 ext3 格式的檔案系統:
# mke2fs -j /dev/sda6
如果想建立的是 ext2 格式的檔案系統,就要去掉 -j。
初始化並啟用置換分割區 (請把分割區編號替換成您希望用作置換分割區的分割區編號):
# mkswap /dev/sda5
# sync
# swapon /dev/sda5
把一個分割區掛載 (mount) 到 /mnt/debinst(這是安裝的位置,將來作為您新系統的根 (/) 檔案系統)。
掛載點的名稱是任意的,後面的步驟將會用到它。
# mkdir /mnt/debinst
# mount /dev/sda6 /mnt/debinst
注
If you want to have parts of the filesystem (e.g. /usr) mounted on separate
partitions, you will need to create and mount these directories manually before
proceding with the next stage.
D.3.2 安裝 debootstrap
The utility used by the Debian installer, and recognized as the official way to install a Debian base system, is debootstrap. It uses wget and ar, but otherwise depends only on /bin/sh and basic Unix/Linux
98
APPENDIX D. 其他
D.3. 透過 UNIX/LINUX 系統來安裝 DEBIAN …
tools2 . Install wget and ar if they aren’t already on your current system, then download and install
debootstrap.
Or, you can use the following procedure to install it manually. Make a work folder for extracting
the .deb into:
# mkdir work
# cd work
The debootstrap binary is located in the Debian archive (be sure to select the proper file for your
architecture). Download the debootstrap .deb from the pool, copy the package to the work folder, and
extract the files from it. You will need to have root privileges to install the files.
# ar -x debootstrap_0.X.X_all.deb
# cd /
# zcat /full-path-to-work/work/data.tar.gz | tar xv
D.3.3 執行 debootstrap
debootstrap can download the needed files directly from the archive when you run it. You can substitute any Debian archive mirror for http.us.debian.org/debian in the command example below, preferably a mirror close to you network-wise. Mirrors are listed at http://www.debian.org/
mirror/list.
如果您已經把一張 buster 版本的 Debian GNU/Linux CD 掛載在 /cdrom,那麼也可以把 http URL 替
換成 file URL,即:file:/cdrom/debian/
Substitute one of the following for ARCH in the debootstrap command: amd64, arm64, armel,
armhf, i386, mips, mips64el, mipsel, powerpc, ppc64el, or s390x.
# /usr/sbin/debootstrap --arch ARCH buster \
/mnt/debinst http://ftp.us.debian.org/debian
If the target architecture is different than the host, you should add the --foreign option.
D.3.4 基本系統的設定
Now you’ve got a real Debian system, though rather lean, on disk. chroot into it:
# LANG=C.UTF-8 chroot /mnt/debinst /bin/bash
If the target architecture is different from the host, you will need to first copy qemu-user-static to the
new host:
# cp /usr/bin/qemu-ARCH-static /mnt/debinst/usr/bin
# LANG=C.UTF-8 chroot /mnt/debinst qemu-ARCH-static /bin/bash
After chrooting you may need to set the terminal definition to be compatible with the Debian base
system, for example:
# export TERM=xterm-color
Depending on the value of TERM, you may have to install the ncurses-term package to get support
for it.
If the target architecture is different from the host, you need to finish the multi-stage boot strap:
/debootstrap/debootstrap --second-stage
2
These include the GNU core utilities and commands like sed, grep, tar and gzip.
99
APPENDIX D. 其他
D.3. 透過 UNIX/LINUX 系統來安裝 DEBIAN …
D.3.4.1 Create device files
At this point /dev/ only contains very basic device files. For the next steps of the installation additional
device files may be needed. There are different ways to go about this and which method you should
use depends on the host system you are using for the installation, on whether you intend to use a
modular kernel or not, and on whether you intend to use dynamic (e.g. using udev) or static device
files for the new system.
A few of the available options are:
• install the makedev package, and create a default set of static device files using (after chrooting)
#
#
#
#
apt install makedev
mount none /proc -t proc
cd /dev
MAKEDEV generic
• manually create only specific device files using MAKEDEV
• bind mount /dev from your host system on top of /dev in the target system; note that the postinst
scripts of some packages may try to create device files, so this option should only be used with
care
D.3.4.2 分割區的掛載
You need to create /etc/fstab.
# editor /etc/fstab
Here is a sample you can modify to suit:
# /etc/fstab: static file system information.
#
# file system
mount point
type
options
/dev/XXX
/
ext3
defaults
/dev/XXX
/boot
ext3
ro,nosuid,nodev
dump pass
0
1
0
2
/dev/XXX
proc
none
/proc
0
0
0
0
/dev/fd0
/dev/cdrom
/media/floppy auto
noauto,rw,sync,user,exec 0
/media/cdrom iso9660 noauto,ro,user,exec
0
0
0
/dev/XXX
/dev/XXX
/dev/XXX
/dev/XXX
/tmp
/var
/usr
/home
2
2
2
2
swap
proc
ext3
ext3
ext3
ext3
sw
defaults
rw,nosuid,nodev
rw,nosuid,nodev
rw,nodev
rw,nosuid,nodev
0
0
0
0
Use mount -a to mount all the file systems you have specified in your /etc/fstab, or, to mount file
systems individually, use:
# mount /path
# e.g.: mount /usr
Current Debian systems have mountpoints for removable media under /media, but keep compatibility
symlinks in /. Create these as as needed, for example:
#
#
#
#
#
cd /media
mkdir cdrom0
ln -s cdrom0 cdrom
cd /
ln -s media/cdrom
You can mount the proc file system multiple times and to arbitrary locations, though /proc is customary. If you didn’t use mount -a, be sure to mount proc before continuing:
# mount -t proc proc /proc
100
APPENDIX D. 其他
D.3. 透過 UNIX/LINUX 系統來安裝 DEBIAN …
The command ls /proc should now show a non-empty directory. Should this fail, you may be
able to mount proc from outside the chroot:
# mount -t proc proc /mnt/debinst/proc
D.3.4.3 Setting Timezone
Setting the third line of the file /etc/adjtime to“UTC”or“LOCAL”determines whether the system
will interpret the hardware clock as being set to UTC respective local time. The following command
allows you to set that.
# editor /etc/adjtime
Here is a sample:
0.0 0 0.0
0
UTC
The following command allows you to choose your timezone.
# dpkg-reconfigure tzdata
D.3.4.4 網路的設定
To configure networking, edit /etc/network/interfaces, /etc/resolv.conf, /etc/hostname
and /etc/hosts.
# editor /etc/network/interfaces
Here are some simple examples from /usr/share/doc/ifupdown/examples:
######################################################################
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
# See the interfaces(5) manpage for information on what options are
# available.
######################################################################
# We always want the loopback interface.
#
auto lo
iface lo inet loopback
# To use dhcp:
#
# auto eth0
# iface eth0 inet dhcp
# An example static IP setup: (broadcast and gateway are optional)
#
# auto eth0
# iface eth0 inet static
#
address 192.168.0.42
#
network 192.168.0.0
#
netmask 255.255.255.0
#
broadcast 192.168.0.255
#
gateway 192.168.0.1
Enter your nameserver(s) and search directives in /etc/resolv.conf:
# editor /etc/resolv.conf
A simple example /etc/resolv.conf:
101
APPENDIX D. 其他
D.3. 透過 UNIX/LINUX 系統來安裝 DEBIAN …
search hqdom.local
nameserver 10.1.1.36
nameserver 192.168.9.100
Enter your system’s host name (2 to 63 characters):
# echo DebianHostName > /etc/hostname
And a basic /etc/hosts with IPv6 support:
127.0.0.1 localhost
127.0.1.1 DebianHostName
# The following lines are desirable for IPv6 capable hosts
::1
ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
If you have multiple network cards, you should arrange the names of driver modules in the /etc/
modules file into the desired order. Then during boot, each card will be associated with the interface
name (eth0, eth1, etc.) that you expect.
D.3.4.5 Configure Apt
Debootstrap will have created a very basic /etc/apt/sources.list that will allow installing additional packages. However, you may want to add some additional sources, for example for source
packages and security updates:
deb-src http://ftp.us.debian.org/debian buster main
deb http://security.debian.org/ buster/updates main
deb-src http://security.debian.org/ buster/updates main
Make sure to run apt update after you have made changes to the sources list.
D.3.4.6 Configure Locales and Keyboard
To configure your locale settings to use a language other than English, install the locales support
package and configure it. Currently the use of UTF-8 locales is recommended.
# apt install locales
# dpkg-reconfigure locales
To configure your keyboard (if needed):
# apt install console-setup
# dpkg-reconfigure keyboard-configuration
Note that the keyboard cannot be set while in the chroot, but will be configured for the next reboot.
D.3.5 核心的安裝
If you intend to boot this system, you probably want a Linux kernel and a boot loader. Identify available
pre-packaged kernels with:
# apt search linux-image
Then install the kernel package of your choice using its package name.
# apt install linux-image-arch-etc
102
APPENDIX D. 其他
D.3. 透過 UNIX/LINUX 系統來安裝 DEBIAN …
D.3.6 Boot Loader 的設定
To make your Debian GNU/Linux system bootable, set up your boot loader to load the installed kernel
with your new root partition. Note that debootstrap does not install a boot loader, but you can use apt
inside your Debian chroot to do so.
Check info grub or man lilo.conf for instructions on setting up the bootloader. If you are
keeping the system you used to install Debian, just add an entry for the Debian install to your existing
grub2 grub.cfg or lilo.conf. For lilo.conf, you could also copy it to the new system and edit it
there. After you are done editing, call lilo (remember it will use lilo.conf relative to the system you
call it from).
Installing and setting up grub2 is as easy as:
# apt install grub-pc
# grub-install /dev/sda
# update-grub
The second command will install grub2 (in this case in the MBR of sda). The last command will create
a sane and working /boot/grub/grub.cfg.
Note that this assumes that a /dev/sda device file has been created. There are alternative methods
to install grub2, but those are outside the scope of this appendix.
下面有一個簡單的 /etc/lilo.conf 例子:
boot=/dev/sda6
root=/dev/sda6
install=/boot/boot-menu.b
delay=20
lba32
image=/vmlinuz
label=Debian
D.3.7 Remote access: Installing SSH and setting up access
In case you can login to the system via console, you can skip this section. If the system should be
accessible via the network later on, you need to install SSH and set up access.
# apt install ssh
Root login with password is disabled by default, so setting up access can be done by setting a password
and re-enable root login with password:
# passwd
# editor /etc/ssh/sshd_config
This is the option to be enabled:
PermitRootLogin yes
Access can also be set up by adding an ssh key to the root account:
# mkdir /root/.ssh
# cat << EOF > /root/.ssh/authorized_keys
ssh-rsa ....
EOF
Lastly, access can be set up by adding a non-root user and setting a password:
# adduser joe
# passwd joe
103
APPENDIX D. 其他
D.4. INSTALLING DEBIAN GNU/LINUX OVER …
D.3.8 Finishing touches
As mentioned earlier, the installed system will be very basic. If you would like to make the system a bit
more mature, there is an easy method to install all packages with “standard”priority:
# tasksel install standard
Of course, you can also just use apt to install packages individually.
After the installation there will be a lot of downloaded packages in /var/cache/apt/archives/.
You can free up some diskspace by running:
# apt clean
D.4 Installing Debian GNU/Linux over Parallel Line IP (PLIP)
This section explains how to install Debian GNU/Linux on a computer without an Ethernet card, but
with just a remote gateway computer attached via a Null-Modem cable (also called Null-Printer cable).
The gateway computer should be connected to a network that has a Debian mirror on it (e.g. to the
Internet).
In the example in this appendix we will set up a PLIP connection using a gateway connected to the
Internet over a dial-up connection (ppp0). We will use IP addresses 192.168.0.1 and 192.168.0.2 for
the PLIP interfaces on the target system and the source system respectively (these addresses should
be unused within your network address space).
The PLIP connection set up during the installation will also be available after the reboot into the
installed system (see 章 7).
Before you start, you will need to check the BIOS configuration (IO base address and IRQ) for the
parallel ports of both the source and target systems. The most common values are io=0x378, irq=7.
D.4.1 Requirements
• A target computer, called target, where Debian will be installed.
• System installation media; see 節 2.4.
• Another computer connected to the Internet, called source, that will function as the gateway.
• A DB-25 Null-Modem cable. See the PLIP-Install-HOWTO for more information on this cable and
instructions how to make your own.
D.4.2 Setting up source
The following shell script is a simple example of how to configure the source computer as a gateway
to the Internet using ppp0.
#!/bin/sh
# We remove running modules from kernel to avoid conflicts and to
# reconfigure them manually.
modprobe -r lp parport_pc
modprobe parport_pc io=0x378 irq=7
modprobe plip
# Configure the plip interface (plip0 for me, see dmesg | grep plip)
ifconfig plip0 192.168.0.2 pointopoint 192.168.0.1 netmask 255.255.255.255 up
# Configure gateway
modprobe iptable_nat
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
104
APPENDIX D. 其他
D.5. INSTALLING DEBIAN GNU/LINUX USING …
D.4.3 Installing target
Boot the installation media. The installation needs to be run in expert mode; enter expert at the boot
prompt. If you need to set parameters for kernel modules, you also need to do this at the boot prompt.
For example, to boot the installer and set values for the “io”and “irq”options for the parport_pc
module, enter the following at the boot prompt:
expert parport_pc.io=0x378 parport_pc.irq=7
Below are the answers that should be given during various stages of the installation.
1. Load installer components from CD
Select the plip-modules option from the list; this will make the PLIP drivers available to the
installation system.
2. Detect network hardware
• If target does have a network card, a list of driver modules for detected cards will be shown.
If you want to force debian-installer to use plip instead, you have to deselect all listed
driver modules. Obviously, if target doesn’t have a network card, the installer will not show
this list.
• Because no network card was detected/selected earlier, the installer will ask you to select a
network driver module from a list. Select the plip module.
3. Configure the network
• Auto-configure network with DHCP: No
• IP address: 192.168.0.1
• Point-to-point address: 192.168.0.2
• Name server addresses: you can enter the same addresses used on source (see /etc/
resolv.conf)
D.5 Installing Debian GNU/Linux using PPP over Ethernet (PPPoE)
In some countries PPP over Ethernet (PPPoE) is a common protocol for broadband (ADSL or cable) connections to an Internet Service Provider. Setting up a network connection using PPPoE is not supported
by default in the installer, but can be made to work very simply. This section explains how.
The PPPoE connection set up during the installation will also be available after the reboot into the
installed system (see 章 7).
To have the option of setting up and using PPPoE during the installation, you will need to install using
one of the CD-ROM/DVD images that are available. It is not supported for other installation methods
(e.g. netboot).
Installing over PPPoE is mostly the same as any other installation. The following steps explain the
differences.
• Boot the installer with the boot parameter modules=ppp-udeb3 . This will ensure the component
responsible for the setup of PPPoE (ppp-udeb) will be loaded and run automatically.
• Follow the regular initial steps of the installation (language, country and keyboard selection; the
loading of additional installer components4 ).
• The next step is the detection of network hardware, in order to identify any Ethernet cards present
in the system.
3
See 節 5.1.7 for information on how to add a boot parameter.
The ppp-udeb component is loaded as one of the additional components in this step. If you want to install at medium or
low priority (expert mode), you can also manually select the ppp-udeb instead of entering the “modules”parameter at the
boot prompt.
4
105
APPENDIX D. 其他
D.5. INSTALLING DEBIAN GNU/LINUX USING …
• After this the actual setup of PPPoE is started. The installer will probe all the detected Ethernet
interfaces in an attempt to find a PPPoE concentrator (a type of server which handles PPPoE
connections).
It is possible that the concentrator will not to be found at the first attempt. This can happen
occasionally on slow or loaded networks or with faulty servers. In most cases a second attempt to
detect the concentrator will be successful; to retry, select Configure and start a PPPoE connection
from the main menu of the installer.
• After a concentrator is found, the user will be prompted to type the login information (the PPPoE
username and password).
• At this point the installer will use the provided information to establish the PPPoE connection.
If the correct information was provided, the PPPoE connection should be configured and the installer should be able to use it to connect to the Internet and retrieve packages over it (if needed).
If the login information is not correct or some error appears, the installer will stop, but the configuration can be attempted again by selecting the menu entry Configure and start a PPPoE connection.
106
Appendix E
文案
E.1
關於本文件
This manual was created for Sarge’s debian-installer, based on the Woody installation manual for
boot-floppies, which was based on earlier Debian installation manuals, and on the Progeny distribution
manual which was released under GPL in 2003.
本文件由 DocBook XML 寫成。有很多程式可以使用 docbook-xml 和 docbook-xsl 套件中的資訊
得到各種輸出格式。
為了提升本文件的可維護性,我們使用了一些 XML 的特性,例如 entities 和 profiling 屬性。它們充
當類似於程式語言中變數與條件的角色。本文件的 XML 原始文件包含了各種硬體架構的資訊—profiling
屬性用於分開架構相關的文件片段。
E.2
幫助本文件
If you have problems or suggestions regarding this document, you should probably submit them as
a bug report against the package installation-guide. See the reportbug package or read the
online documentation of the Debian Bug Tracking System. It would be nice if you could check the open
bugs against installation-guide to see whether your problem has already been reported. If so, you can
supply additional corroboration or helpful information to XXXX@bugs.debian.org, where XXXX is the
number for the already-reported bug.
更佳的途徑是取得一份本文件的 DocBook 原始文件,並且製作一個補丁。DocBook 的原始文件位於
debian-installer WebSVN。如果您不熟悉 DocBook,別發愁:在 manuals 目錄下有一個簡單的 cheatsheet
文件可以幫您開始。它像 html 文件,但更側重於文字的含義而不是示範。歡迎將補丁發送到 debian-boot
郵件論壇 (見下)。關於如何從 SVN 提出 (check out) 原始文件,請參考原始文件目錄中的 README 。
請勿直接聯繫本文件的作者。還有一個關於 debian-installer 的通信論壇,它包含本手冊的
討論。這個通信論壇是 debian-boot@lists.debian.org。訂閱此通信論壇的說明在 Debian Mailing List
Subscription 網頁﹔您也可以線上瀏覽 Debian Mailing List Archives。
E.3
主要貢獻人員
This document was originally written by Bruce Perens, Sven Rudolph, Igor Grobman, James Treacy, and
Adam Di Carlo. Sebastian Ley wrote the Installation Howto.
Miroslav Kuře has documented a lot of the new functionality in Sarge’s debian-installer. Frans Pop
was the main editor and release manager during the Etch, Lenny and Squeeze releases.
Many, many Debian users and developers contributed to this document. Particular note must be
made of Michael Schmitz (m68k support), Frank Neumann (original author of the Amiga install manual),
Arto Astala, Eric Delaunay/Ben Collins (SPARC information), Tapio Lehtonen, and Stéphane Bortzmeyer
for numerous edits and text. We have to thank Pascal Le Bail for useful information about booting from
USB memory sticks.
我們還從下列文件中取得了非常有用的文件和資訊,它們是 Jim Mintha’s 的網路開機 HOWTO(沒有
有效的 URL),Debian 常見問答集,Linux/m68k 常見問答集,Linux for SPARC Processors 常見問答集,
Linux/Alpha 常見問答集,以及其他。這些文件的維護者們提供了豐富的資訊,應該被大家認識。
107
APPENDIX E. 文案
E.4. 商標確認
本手冊中關於以 chroot 安裝的章節乃從版權所屬 Karsten M. Self 之文件中摘錄
The section on installations over plip in this manual (節 D.4) was based on the PLIP-Install-HOWTO
by Gilles Lamiral.
E.4
商標確認
所有商標之所有權歸於該商標的所有者。
108
Appendix F
GNU General Public License(此許可証只
有英文原文具有法律效力)
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
F.1 Preamble
The licenses for most software are designed to take away your freedom to share and change it. By
contrast, the gnu General Public License is intended to guarantee your freedom to share and change
free software —to make sure the software is free for all its users. This General Public License applies to
most of the Free Software Foundation’s software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by the gnu Library General Public
License instead.) You can apply it to your programs, too.
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses
are designed to make sure that you have the freedom to distribute copies of free software (and charge
for this service if you wish), that you receive source code or can get it if you want it, that you can change
the software or use pieces of it in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or
to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether gratis or for a fee, you must give
the recipients all the rights that you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their rights.
We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which
gives you legal permission to copy, distribute and/or modify the software.
Also, for each author’s protection and ours, we want to make certain that everyone understands
that there is no warranty for this free software. If the software is modified by someone else and passed
on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors’ reputations.
Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any patent must be licensed for
everyone’s free use or not licensed at all.
The precise terms and conditions for copying, distribution and modification follow.
109
APPENDIX F. GNU GENERAL PUBLIC LICENSE(此 …
F.2. GNU GENERAL PUBLIC LICENSE
F.2 GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains a notice placed by the copyright
holder saying it may be distributed under the terms of this General Public License. The ”Program”,
below, refers to any such program or work, and a ”work based on the Program” means either the
Program or any derivative work under copyright law: that is to say, a work containing the Program or
a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term ”modification”.) Each licensee is addressed as ”you”.
Activities other than copying, distribution and modification are not covered by this License; they are
outside its scope. The act of running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the Program (independent of having been
made by running the Program). Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program’s source code as you receive it, in
any medium, provided that you conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to
the absence of any warranty; and give any other recipients of the Program a copy of this License along
with the Program.
You may charge a fee for the physical act of transferring a copy, and you may at your option offer
warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion of it, thus forming a work
based on the Program, and copy and distribute such modifications or work under the terms of Section
1 above, provided that you also meet all of these conditions:
a. You must cause the modified files to carry prominent notices stating that you changed the files
and the date of any change.
b. You must cause any work that you distribute or publish, that in whole or in part contains or is
derived from the Program or any part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c. If the modified program normally reads commands interactively when run, you must cause it,
when started running for such interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a notice that there is no warranty
(or else, saying that you provide a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If identifiable sections of that work are
not derived from the Program, and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those sections when you distribute them
as separate works. But when you distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of this License, whose permissions
for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely
by you; rather, the intent is to exercise the right to control the distribution of derivative or collective
works based on the Program.
In addition, mere aggregation of another work not based on the Program with the Program (or with
a work based on the Program) on a volume of a storage or distribution medium does not bring the
other work under the scope of this License.
3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code
or executable form under the terms of Sections 1 and 2 above provided that you also do one of the
following:
a. Accompany it with the complete corresponding machine-readable source code, which must be
distributed under the terms of Sections 1 and 2 above on a medium customarily used for software
interchange; or,
110
APPENDIX F. GNU GENERAL PUBLIC LICENSE(此 …
F.2. GNU GENERAL PUBLIC LICENSE
b. Accompany it with a written offer, valid for at least three years, to give any third party, for a
charge no more than your cost of physically performing source distribution, a complete machinereadable copy of the corresponding source code, to be distributed under the terms of Sections 1
and 2 above on a medium customarily used for software interchange; or,
c. Accompany it with the information you received as to the offer to distribute corresponding source
code. (This alternative is allowed only for noncommercial distribution and only if you received
the program in object code or executable form with such an offer, in accord with Subsection b
above.)
The source code for a work means the preferred form of the work for making modifications to it. For
an executable work, complete source code means all the source code for all modules it contains, plus
any associated interface definition files, plus the scripts used to control compilation and installation of
the executable. However, as a special exception, the source code distributed need not include anything
that is normally distributed (in either source or binary form) with the major components (compiler,
kernel, and so on) of the operating system on which the executable runs, unless that component itself
accompanies the executable.
If distribution of executable or object code is made by offering access to copy from a designated
place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the
object code.
4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided
under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void,
and will automatically terminate your rights under this License. However, parties who have received
copies, or rights, from you under this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not signed it. However, nothing else
grants you permission to modify or distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program
(or any work based on the Program), you indicate your acceptance of this License to do so, and all its
terms and conditions for copying, distributing or modifying the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject
to these terms and conditions. You may not impose any further restrictions on the recipients’ exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement
or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions
of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program
at all. For example, if a patent license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then the only way you could satisfy both
it and this License would be to refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under any particular circumstance,
the balance of the section is intended to apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any patents or other property right
claims or to contest validity of any such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is implemented by public license practices.
Many people have made generous contributions to the wide range of software distributed through
that system in reliance on consistent application of that system; it is up to the author/donor to decide
if he or she is willing to distribute software through any other system and a licensee cannot impose
that choice.
This section is intended to make thoroughly clear what is believed to be a consequence of the rest
of this License.
8. If the distribution and/or use of the Program is restricted in certain countries either by patents
or by copyrighted interfaces, the original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding those countries, so that distribution
111
APPENDIX F. GNU GENERAL PUBLIC LICENSE(此 …
F.3. HOW TO APPLY THESE TERMS TO YOUR …
is permitted only in or among countries not thus excluded. In such case, this License incorporates the
limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions of the General Public
License from time to time. Such new versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns. Each version is given a distinguishing version
number. If the Program specifies a version number of this License which applies to it and ”any later
version”, you have the option of following the terms and conditions either of that version or of any
later version published by the Free Software Foundation. If the Program does not specify a version
number of this License, you may choose any version ever published by the Free Software Foundation.
10. If you wish to incorporate parts of the Program into other free programs whose distribution
conditions are different, write to the author to ask for permission. For software which is copyrighted by
the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions
for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of
our free software and of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING
THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM ”AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL AND
COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM
AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR
LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY
OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY
OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
F.3 How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest possible use to the public, the best
way to achieve this is to make it free software which everyone can redistribute and change under these
terms.
To do so, attach the following notices to the program. It is safest to attach them to the start of each
source file to most effectively convey the exclusion of warranty; and each file should have at least the
”copyright” line and a pointer to where the full notice is found.
one line to give the program’s name and a brief idea of what it does.
Copyright (C) year name of author
This program is
modify it under
as published by
of the License,
free software; you can redistribute it and/or
the terms of the GNU General Public License
the Free Software Foundation; either version 2
or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Also add information on how to contact you by electronic and paper mail.
112
APPENDIX F. GNU GENERAL PUBLIC LICENSE(此 …
F.3. HOW TO APPLY THESE TERMS TO YOUR …
If the program is interactive, make it output a short notice like this when it starts in an interactive
mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with absolutely no warranty; for details
type ‘show w’. This is free software, and you are welcome
to redistribute it under certain conditions; type ‘show c’
for details.
The hypothetical commands ˋshow w’ and ˋshow c’ should show the appropriate parts of the
General Public License. Of course, the commands you use may be called something other than ˋshow
w’ and ˋshow c’; they could even be mouse-clicks or menu items —whatever suits your program.
You should also get your employer (if you work as a programmer) or your school, if any, to sign a
”copyright disclaimer” for the program, if necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
program ‘Gnomovision’ (which makes passes at compilers) written
by James Hacker.
signature of Ty Coon, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into proprietary programs.
If your program is a subroutine library, you may consider it more useful to permit linking proprietary
applications with the library. If this is what you want to do, use the GNU Lesser General Public License
instead of this License.
113
Download PDF
Similar pages