Arch Linux 0.7 (Wombat)

安裝指南中文版

Sep 19, 2004
Version 1.0.0
Dennis Herbrich dennis@archlinux.org
Judd Vinet judd@archlinux.org
中文版翻譯:wHisKy

概要

這是 Arch Linux 發行套件 0.7 版 (Wombat) 的通用使用者手冊。 這份文件的主題包含了如何取得必備的檔案,如何安裝發行套件和如何設定一個基本,可啟動的系統。此外,這份文件還包含了一些關於系統架構與 Arch 專屬工具程式,例如 pacman 套件管理程式和 ABS 的簡略參考資訊。

目錄

  1. 前言Introduction
    1. 什麼是What is Arch Linux?
    2. 版權宣告License
    3. 貢獻與迴響Credits and Feedback
  2. 安裝Installing Arch Linux
    1. 安裝前的準備Pre-Installation
    2. 使用Using The CD-ROM
    3. 使用Using The Floppies
    4. 通用安裝程序Common Installation Procedure
  3. 系統設定System Configuration
    1. 設定指令檔Configuration Files
    2. 啟動指令檔Boot Scripts
    3. 管理使用者User Management
    4. 網路連線Internet Access
  4. 程式套件的管理Package Management
    1. Pacman
    2. 讀取Accessing Repositories
  5. Arch 建立系統Arch Build System (ABS)
    1. 執行檔 vs 原始碼Binary vs. Source
    2. 同步您的 ABS 樹狀架構Synchronizing Your ABS Tree
    3. 如何建立程式套件How To Build Packages
    4. 程式套件標準指南Package Guidelines
  6. 常見問答集Frequently Asked Questions
    1. 在安裝程式套件時,pacman 無法解決套件 A 的 dependencies 因為套件 B 並不在 package set
    2. 在系統啟動時,我得到了一個 kernel panic 的訊息 : Unable to open initial console
    3. 如何使用 pacman --sync 這個指令來安裝在安裝光碟上的程式套件 (so it resolves dependencies for me)?
    4. 在安裝系統的程序中,我該如何建立多個 swap 分割區?
    5. 如何使用 rescue system 來重新設定 LILO ?
    6. 我無法 ssh 連線到我自己的機器內!
    7. How should I load modules during boot now?
    8. Kernel 核心拒絕啟動因為lost interrupt
    9. 在播放音樂或是讀取 DVD 光碟片時,我得到access denied 的錯誤訊息
    10. 使用 pacman 安裝程式套件時,我得到這個錯誤訊息 : error : xorg conflicts with xfree86

前言Introduction

什麼是What is Arch Linux?

Arch Linux 是個專為 i686 微處理器最佳化過的 linux 發行套件。他一開始是採用另一套 Linux 發行套件 CRUX 的架構。Crux 是一套由 Per Lidén 開發,很棒的 Linux 發行套件。

Arch 代表了 快速fast, 輕巧lightweight, flexible 和簡易 simple. 這些形容詞可能看起來都沒啥吸引人之處,但是他們都是事實。 Arch 是套專為i686 微處理器最佳化的 Linux 發行套件, so you get more for your cpu cycle. 跟 Redhat 等其他 Linux 發行套件相比, Arch 顯得輕巧多了,同時他的簡易設計也讓我們可以輕鬆的擴充他的功能,並依照我們對系統的需求and mold into whatever kind of system you're building.

This is backed by an easy-to-use binary package system that allows you to upgrade your entire system with one command. Arch also uses a ports-like package build system (Arch Build System) to make it easy to build packages, which can also be synchronized with one command. Oh yeah, and you can rebuild your entire system with one command, too. Everything is done quite simply and transparently.

Arch Linux strives to maintain the latest stable version of its software. We currently support a fairly streamlined core package set with a growing collection of extra packages made by users and AL developers.

為了追求簡單和輕巧這兩個目標,一些對 linux 系統執行上沒什麼用處的部分都已經被摒除在外,例如 /usr/doc 和 info pages 等等。在我個人的使用經驗上,這些東西幾乎根本沒有機會被用到,如果你真的需要這些資訊,相同的資料都可以更簡單的從網路上取得。 Manpages all the way...

Arch Linux also strives to use some of the newer features that are available to linux users, 例如對 hotplug 和 udev 的支援。 Arch Linux 0.7 (Wombat) 內定使用 2.6 版的 linux kernel ,並直接支援 XFS/JFS這兩種檔案系統。

版權宣告

Arch Linux, pacman,所有的相關文件與 scripts 的版權 ©2002-2005 都歸 Judd Vinet 所有,並使用 GNU Public License 的版權規定。

貢獻與迴響Credits and Feedback

這一份文件主要採用了This document is heavily based on the works of Judd Vinet judd@archlinux.org. 局部的修正Minor corrections and a good bunch of modifications and additions have been made by Dennis Herbrich dennis@archlinux.org. 任何關於這份文件的修正和迴響都該提交到 bugtracker。 An uncountable lot of people have contributed and will contribute to the evolution of the official Arch Linux Documentation by submitting corrections and suggesting improvement, it's way too unpractical to list them all. However, you know who you are, and without your help this would be near impossible to maintain and improve. Thank you!

繁體中文版本參考了由

ietiland <ietiland2@yahoo.com.tw>
Neil Lin <neil536t@yam.com>

翻譯的 Arch Linux 安裝手冊 0.6 版中文

安裝 Arch Linux

安裝前的準備Pre-Installation

Arch Linux 是個為 i686 微處理器量身訂做的 GNU/Linux 套件。要使用 Arch Linux,您的系統至 少需裝備 pentium II 或是更高階的微處理器。Arch Linux 將無法在任何較低 階的 X86 微處理器 (I386, I486, I586) 上執行。

我們也有一版專為 i586 建立的程式套件組,但是因為人力的關係,這組套件並沒有持續的在更新,有人有興趣出來接嗎?

譯者註 : 在 Arch Linux 的討論版內可以看到有人開始接管這一版專為 i586 訂製的 Arch Linux。

在開始安裝 Arch Linux前,您必須先決定好要您希望用哪一種安裝方式。Arch Linux 提供了一個可開機的 ISO 映象檔讓您可直接使用光碟安裝,您當然也可以使用磁碟片來從 FTP 上安裝。您也可以下載一個只有大概 200 MB 大小,只包含了 base (基本套件組) 和 kernels (核心套件組) 的 base ISO 映象檔 but is otherwise identical.

如果您的系統沒有光碟機,您當然只能使用磁碟片或是透過 FTP 的方法來安裝了。

Otherwise obtain a bootable Arch installation CD, either by downloading and burning the latest ISO from one of the mirrors listed below, or by letting someone else burn a copy if your dialup connection simply doesn't cut it, or you don't own a cd writer. You can also purchase a cd online from OSDisc, shipping nearly world-wide.

您也可以使用光碟透過 FTP 安裝, the floppy variant is really only recommended as a last resort, as it's painfully slow and disks tend to be broken more often than they are intact.

Furthermore you should not worry about using an old ISO for installation, as upgrading the system to the current branch is a breeze once you've got your base system set up. At least if you've got a broadband connection.

安裝的過程中,目前您依然無法透 過 PPP 撥接連線的方式來連接上網,因為使用 ppp 撥接所需的 pppd daemin 和 ISDN 應用程式都沒有包含在 root disk image 內。

For a successful FTP install you must have a gateway in your LAN that is actually connected to the internet and routes any requests from the PC to be installed into the internet and back. Or, alternatively, you can of course have a properly set up FTP server in your LAN to install from. Point is that you cannot attach a modem to your PC and set up a connection with your provider with the Installer. It won't work.

The newbie-friendliest method of installing Arch Linux surely is installing the base system and all you need to get online from the CD, and then run a complete system upgrade and add any other packages you want or need once you set up your internet connection.

Another thing you should know before trying to install Arch Linux is that during the install you're asked a few questions about which hard drive to prepare, what modules to load, and what changes to make to certain system-critical files like lilo.conf and rc.conf. The installer will not hold your hand here and guide you through any potential setup known and unknown to mankind, you are expected to know what to put in and leave out. This is quite a requirement for a newbie, so if this intimidates you already, make sure you read through this whole document to get at least a vague idea what is going to be asked, and check back on IRC, the forums or a linux guru in your neighborhood if anything is not clear to you before you totally mess up your system. You may of course boldly step into the fight and tinker around and try until it works, but don't tell anyone afterwards you haven't been warned. That being said, it's not as bad as it seems. ;)

您將需要什麼

取得 Arch Linux

您可以從 下載網頁 上的列出的任何一個鏡像站下載 Arch Linux。如果您選擇使用從 FTP 來安裝,並下載了磁碟片的映象檔,請選擇一個提供這些程式套件的 mirror。 Likewise, 如果您希望從光碟來安裝,請確定您選擇的鏡像站有提供光碟片的 ISO 映象檔。

下面所列出的 mirrors 只是提供參考用 (請注意有些 mirror 網站可能已經資料過時; 請參閱網站以取得最新的鏡像站名單):

下載 MIRRORS
ftp://cle.linux.org.tw/pub/ArchLinux/
台灣 Taiwan
http://prdownloads.sourceforge.net (ISO only)
美國 USA
ftp://ftp.nethat.com
美國 USA
ftp://ftp.ibiblio.org
美國 USA
ftp://ftp.oit.unc.edu
美國 USA
ftp://ftp-linux.cc.gatech.edu
美國 USA
ftp://ftp.belnet.be
比利時 Belgium
ftp://ftp.kegep.tuc.gr/archlinux/
希臘 Greece
ftp://ftp.du.se (ISO only)
瑞典Sweden
ftp://ftp.fsn.hu
匈牙利 Hungary
http://darkstar.ist.utl.pt
葡萄牙 Portugal
ftp://ftp.parrswood.net
英國 Great Britain
ftp://ftp.nluug.nl
荷蘭 Netherlands
ftp://ftp.surfnet.nl
荷蘭 Netherlands
ftp://ftp.archlinux.de
德國 Germany
ftp://ftp.mpi-sb.mpg.de
德國 Germany
ftp://ftp.tu-chemnitz.de
德國 Germany
ftp://ftp.gwdg.de
德國 Germany
ftp://ftp.rez-gif.supelec.fr
法國 France
http://archlinux.antesis.org
法國 France
ftp://archlinux.creativa.cl
智利 Chile
ftp://saule.mintis.lt
立陶宛 Lithuania
ftp://sunsite.icm.edu.pl
波蘭 Poland
http://mirror.pacific.net.au
澳大利亞 Australia
ftp://gd.tuwien.ac.at
奧地利 Austria

準備安裝媒體 Media

磁片安裝Floppy Install

  1. 下載 images/boot.img (path is relative to the mirror root)
  2. 下載 images/root.img
  3. 下載 any add-on images you need from the images/addons/ 子目錄 :
    ether_pcmcia.img
    PCMCIA 應用程式/模組,乙太網路模組
    fs.img
    XFS/JFS filesystem 應用程式, Ext2 額外應用程式
    keymaps_usb_firewire.img
    Additional keymaps/consolefonts, USB/Firewire 模組
    raid_lvm.img
    RAID/LVM 模組與應用程式
    scsi.img
    SCSI 模組
  4. 找出一些空白的磁碟片,然後將映象檔寫到磁碟片 :
    (插入第一片磁碟)
    # dd if=boot.img of=/dev/fd0
    (插入第二片磁碟)
    # dd if=root.img of=/dev/fd0
    (repeat for any additional add-on images)
    # dd if=scsi.img of=/dev/fd0
    如果您需要在 Windows 環境下寫入這些映象檔,您可以 下載 rawrite.exe 並用這個程式來取代 dd 這個指令和功能。
  5. 記錄並寫下所有您的網路設定參數,以便在之後的安裝程序中直接輸入,如果您希望從 FTP 來安裝 :

光碟安裝CD Install

  1. 下載 0.7/iso/i686/arch-0.7.iso (path relative to mirror root)
  2. 下載 0.7/iso/i686/arch-0.7.md5sum
  3. 使用 md5sum檢驗 .iso 映象的的完整性 :
    # md5sum --check arch-0.7.md5sum
    arch-0.7.iso: OK
  4. 燒錄 .iso 映象檔到空白光碟片上 (這個步驟將會依照您所使用的作業系統/應用程式的不同而異)。
    如果您希望下載 base (基本的) 或是 beta 的 ISO 映象檔,請輸入正確的檔案名稱,例如 : arch-0.7-base.iso 而不是 arch-0.7.iso, likewise for the md5sum.
  5. 記錄並寫下所有您的網路設定參數,以便在之後的安裝程序中直接輸入,如果您希望從 FTP 來安裝 :

使用光碟Using the CD-ROM

如果您不是使用光碟片開機與安裝,您該略過這個章節,直接跳到 磁碟片安裝Floppy Installation instructions 。如果您對開機程序已經很熟悉了,您也可以略過這一段 babble ,直接跳到通用安裝程序Common Install Procedure 一節,在這一章節,我們將會依序介紹安裝ArchLinux 的步驟。

將 ArchLinux 的安裝光碟放到光碟機內後重新啟動您的電腦。請記得先把系統的 BIOS 設定為允許 由光碟機開機。如果您不知道該怎麼設定這一個步驟,請查閱您的主機板的手冊或是向您的系統銷售商詢問相關細節。當系統正確由光碟片開機後,您將會看到一個啟動提示號 (boot prompt) 一直等待您輸入指令,並顯示目前您可以使用的選擇有哪些。如果您要安裝 Arch Linux 到一台裝配 IDE 硬碟的電腦內,請在提示號後直接按一下 <ENTER> 按鍵。如果您的系統使用了 SCSI 的周邊,請輸入 arch-scsi 來載入支援 SCSI 的核心(SCSI-enabled kernel)。您也可以在此鍵入任何 核心參數(kernel parameters)如果您覺得您將有需要。

如果您的光碟因為不明的原因無法啟動,而您所用的光碟機已經有點年紀,同時您使用了 CD-RW 的光碟片來安裝,建議您改用CDR的空片來複製安裝光碟片。一些比較老舊的光碟機 [例如我的這一台 - Dennis] 可能無法正確讀取 CD-RW 光碟片上的資料。

在系統啟動程序結束時,您應該會在電腦螢幕上看到一個 root shell with a handful of instructions filling the upper half of your screen. At this point you are ready to commence the actual installation. Don't let those instructions fool you; When booting from a CD, you don't have to run the loaddisk anymore as it's done automatically during boot.

使用磁碟片Using The Floppies

如果您有_任何_機會使用 ArchLinux 的安裝光碟啟動您的系統,我們_強烈建議_您就直接用安裝光碟來安裝 ArchLinux 了。Not only are the floppies themselves prone to failure, the whole boot process takes much longer, and if you need a handful of modules the disk-juggling is very unnerving. Note that you do not have to boot from floppies to install via FTP, CD-ROM will do just fine.

Reboot your computer with the boot disk in the floppy drive. After some disk-crunching noises, you should come to a boot prompt, waiting eagerly for your input. Press Enter to continue the boot process after adding any potentially needed kernel parameters.

If you are using a USB keyboard, you will need to load USB support automatically at bootup. You can do this by setting the NEEDUSB parameter to your USB bus type. For example, if you have a UHCI bus, you would type arch NEEDUSB=uhci at the boot prompt. After the root disk loads, you will be prompted to load the USB add-on disk, which will be auto-loaded after a 10-second wait. If you're not sure what kind of USB bus you have, try specifying NEEDUSB=auto, which will load all three (UHCI,OHCI,EHCI) bus modules.

Partway through the boot-up process, you will be prompted:

VFS: Insert root floppy disk to be loaded into RAM disk and press ENTER

Insert the root disk in the drive and hit Enter. After some more chunking you will be given a shell. Since you'll be needing your ethernet module for the install, you should now load the modules from the ether_pcmcia disk. Put the disk in the drive and run:

# loaddisk /dev/floppy/0

After a while all ethernet modules will be extracted to the filesystem. If the directory /lib/modules/ is still empty after this command, and/or you got a couple of errors, your disk is most likely gone bad. Create a new modules disk, and try again. You do not need to reboot in this case, just reissue the loaddisk command. Don't be worried if you have several disks failing this way, it's unfortunately quite common. Don't say nobody told you.

You should also load any additional add-on disks that you need, such as SCSI or RAID/LVM. Use the loaddisk command as above for each disk, order does not matter.

If you know which ethernet module you need, you should load it now with the modprobe command. Don't worry too much if you don't, the installer program will probe for the right module automatically.

通用安裝程序Common Installation Procedure

到目前為止,您的系統應該已經正常開機,同時您的At this point your system should be booted, and the hard drive to which you'd like to install, as well as your installation source, must be accessible. 如果有必要,請確定所有必須的模組都已經載入。

安裝步驟 :

  1. 執行Running Setup
  2. 設定網路Configure Network (如果您要從 FTP 安裝FTP Install only)
  3. 準備硬碟Prepare Hard Drive
    1. 自動設定Auto-Prepare
    2. 切割硬碟Partition Hard Drives
    3. 設定Set Filesystem Mountpoints
  4. 選擇軟體套件Select Packages
  5. 安裝軟體套件Install Packages
  6. 安裝核心Install Kernel
  7. 設定系統Configure System
  8. 安裝啟動載入器Install Bootloader
  9. 結束安裝Exit Install

Using the available shell tools, experienced users are also able to prepare the hard drive or any devices needed for the installation before starting the installer. You may simply skip this paragraph if you don't see any immediate need for further manual interaction. Note that the Arch Linux installation media also contains a /arch/quickinst script for experienced users. This script installs the base set of packages to a user-specified destination directory. If you are doing an exotic install with fun things like RAID and LVM, or don't want to use the installer at all, you'll probably want to use the quickinst script.

執行Running Setup

現在您可以執行 /arch/setup 來啟動安裝程式。 After some info messages you will be prompted for the installation method of your choice. 如果您有網路寬頻,您可能會想要從 FTP 來安裝 you might prefer the FTP installation to ensure you get the latest packages instead of using the potentially outdated CD contents. Note that you will probably run into trouble if you have an interesting proxy setup. If you can't use a CD-ROM, this is the only viable method of installing ArchLinux.

When navigating the setup script, make sure that you select DONE from the submenus after performing each step. This saves any settings you make in preparation for the next step. Further, avoid backstepping through previous steps in the installation process as this can also confuse the installer.

It's actually rather easy to set up your own FTP package mirror or create your own bootable installation CD with the packages you need, making the task of installing several instances of ArchLinux across multiple machines rather simple, whilst at the same time saving a lot of mirror bandwidth. Make your and our life's easier, and look into these alternatives!

如果您選擇使用光碟片安裝,您將只能安裝光碟片內包含的軟體,這些軟體的 版本可能都會有點老舊。當然,Of course it has the merit that you won't need an internet connection, and is therefore the recommended choice for dialup users or anyone else who does not feel like downloading about at least 100 MB of packages.

在從兩個選擇中決定您要使用的安裝方法後,您將可在電腦螢幕上看到安裝選單依照必須完成的 順序列出安裝過程必須的步驟。

在安裝中任何時候,您都可以切換顯示到第五個 virtual console (ALT-F5) 來檢視安裝過程中,每個下達的指令的輸出訊息。 使用 (ALT-F1) 來切回到正在執行安裝程式的第一個 console ,如果您有需要手動執行某些指令,在安裝過程中您可以使用任何 F-key 組合鍵來開啟其他的 console。

設定網路Configure Network (如果您要從 FTP 安裝)

Configure Network 將允許您安裝和設定您的網路環境

If no eth0 device is available yet, you will be asked whether you want the installer to probe for a network module. Choose YES here unless that messes up your system horribly (which shouldn't happen), or NO if you want to load the module manually. If the installer fails to find a matching network module, make sure you ran the loaddisk command correctly earlier to make the ethernet modules available. When booting from CD-ROM, this is done automatically for you. If your network card is still not found, make sure your card is properly physically installed and supported by the linux kernel at all.

When the correct module is loaded, you will be given the option to configure your network with DHCP. If you're connected to a DHCP server, hit YES and let the installer do the rest. If you select NO, you will be asked to enter the networking information manually, which you hopefully wrote down as you were told.

This menu entry is only available when choosing FTP Installation, for rather obvious reasons.

準備硬碟Prepare Hard Drive

Prepare Hard Drive 將會將螢幕顯示切換到有兩個選項的子選 單讓您準備要用來安裝 arch Linux 的硬碟。

The first choice is Auto-Prepare, which will automatically partition your hard drive into a /boot, swap, and root partition, and then create filesystems on all three. These partitions will also be automatically mounted in the proper place. To be exact, this option will create a

Actual sizes may vary slightly due to different hard disk geometries. You can choose this option if you don't know much about hard drive partitions, but be warned:

AUTO-PREPARE 自動準備將會把您所選擇的硬碟上的資料完全刪除!

Read the warning presented by the installer very carefully, and make sure the correct device is about to be partitioned!

A way to verify your choice for a device to partition would be to open another terminal (ALT-F2, Enter) and enter

# cfdisk -P s <name of device>

there to display the current partition table of the selected device, which should suffice to identify the hard disk.

If no device name is shown ([nothing] will be COMPLETELY ERASED! ...), and the installer produces an Device not valid error after hitting YES, make sure you loaded all needed modules if it's a SCSI, RAID, etc. device. You can still load any modules now by changing to another terminal and issuing the commands there, then return to the installer process on terminal one (ALT-F1).

If you prefer to do the partitioning manually, use the other two options, Partition Hard Drives and Set Filesystem Mountpoints to prepare the target media according to your specifications as outlined below. Otherwise Return to Main Menu after a successful auto-preparation.

切割硬碟Partition Hard Drives

Partition Hard Drives should be skipped if you chose Auto-Prepare already.

Otherwise you should select the disc(s) you want to partition, and you'll be dropped into the cfdisk program where you can freely modify the partitioning information until you [Write] and [Quit].

您至少需要一個 swap 和一個 root 分割區來繼續下一步的安裝步驟。

設定Set Filesystem Mountpoints

Set Filesystem Mountpoints should also be skipped if you chose to Auto-Prepare your hard drive. You should select this choice once the partition information is edited to your liking with the previous menu selection, or already existent through whatever other means.

The first question to answer is what partition to use as swap. Select the previously created swap partition from the list, and select the partition that is supposed to become your root partition in the next step.

Every time you specify a partition to mount, you will be asked if you want to create a filesystem on the respective partition. If you select YES, you will be asked what filesystem to create (a matter of taste, really. Choose ext2 if you have no clue), and the partition will be formatted with the chosen filesystem, destroying all data in the process. It should be no problem, however, to say NO at this point to preserve any existing files on the partition.

If you want to preserve existing data on a partition, you are strongly advised to create backups instead of hoping that nothing will go wrong during the install. Don't say I didn't warn you!

You will not be asked for a filesystem to use on your swap partition, as this partition uses a specific filesystem of it's own.

If you want to mount any other partitions, for example a seperate /boot or /home partition, you will be able to do so now. Simply

Repeat these steps until you're satisfied, then select DONE to create any filesystems and mount the partitions in their respective places. After formatting and mounting all partitions, you will be dropped into the Main Menu, ready to proceed.

Do not mount /tmp on a seperate partition just yet, as it will badly confuse the installer! Simply leave the designated /tmp partition alone until the installation is done, and configure the partition manually after you have a running system if you must have a seperate partition for /tmp.

選擇軟體套件Select Packages

Select Packages 這個指令將可允許你從 CD 或是 FTP 鏡像站選擇你要安裝的軟體套件。

If you chose CD-ROM installation, you have to tell the installer whether it should try to mount the CD itself, or whether you already mounted the source media in /src. Select the option according to what you need; Normally you will want to choose CD, after which you will be given the possibility to choose a CDROM drive from the list of all detected devices.

If your CD-ROM drive is not displayed in the list, make sure you loaded any modules that may be needed, like SCSI or USB storage support.

If you chose FTP Installation, you will be asked to choose a mirror close to you from a list, or select CUSTOM to enter your own fully qualified FTP path to an installation source, ie. a prepared server in your LAN, or a mirror that's not listed for whatever reason.

Whatever source you chose, after fetching the package list you'll be dropped into the package category selection screen.

If you are presented an error while fetching the package database, you should either choose another FTP mirror, make sure your network is working at all, and you didn't slip any typos into your custom server address. You might also have goofed mounting of your source media in the /src directory, if you chose that option.

Now, once that is tackled, you have the opportunity to specify whole package groups from which you'd generally like to install packages, then fine-tune your coarse selection by (de)selecting individual packages.

Any packages in the BASE category should stay selected under all circumstances, and you should select any other group which contains a package you might need. Please note that the upcoming individual package selection screen will only offer packages which are in the categories you select here, so if you only select BASE, you won't be able to add any other packages than those in the BASE category.

If you want to only select the bare minimum for installation, but be able to browse through all available packages nevertheless to see if anything interesting is there to add, you should select all package categories, but choose to NOT select all packages by default.

The Select all packages by default? question can be easily misunderstood; Basically you are asked whether you want all the packages in the categories you just chose to be selected or not.
If you select YES, the whole list of packages contained in the chosen categories will be displayed and selected, and your job will be to deselect what you do not want.
If you select NO, the same list of packages will displayed, but only packages of the BASE category will be selected, and you'll have to explicitly select any other packages you want to install.

選擇 NO helps to install a lean system!

It is recommended that you install all the BASE packages, but not anything else at this point. Don't worry about getting all the packages you want - you can easily install more of them once the basic system boots by itself. The only exception to this rule is installing any packages you need for setting up internet connectivity. These packages usually are:

dhcpcd (base)
加入這一項如果你的機器是 DHCP client.
isdn4k-utils (network)
加入這一項如果你使用 ISDN 撥接來上網
ppp (daemons)
加入這一項如果你使用類比數據機 analog modem 來撥接上網
rp-pppoe (network)
加入這一項如果你使用 DSL 來模擬 pseudo-dialup.
我們提供下載的基本 ISO 映象檔並不包含任何除了 BASE category 以外的套件,所以如果你需要撥接程式相關的套件,你必須要下載完整版的安裝光碟映象檔!

Once you're done selecting the packages you need, leave the selection screen and continue to the next step, Install Packages.

安裝軟體套件Install Packages

Install Packages 將開始安裝 pacman 和其他的程式套件 you selected with resolved dependencies onto your harddisk.

If you skipped preparation of your hard drive, you will be asked where your root partition has been mounted. This should only happen to people who partitioned and created filesystems on the target devices manually. Those people will have to enter the root directory where the packages shall be installed. By default, the installer mounts the root partition in /mnt, and any extra partitions below.

Error messages and debugging output is output to terminal five (ALT-F5). After the packages are installed, proceed to the next step, Install Kernel.

安裝核心Install Kernel

Install Kernel 將詢問您要安裝哪一版的核心映象檔到硬碟內。

2.6 IDE
Install the stock 2.6.x kernel with IDE support only. Note that with the 2.6.x series, it is now possible to use ATAPI cd writers and USB storage without SCSI emulation.
2.6 SCSI
Install the stock 2.6.x kernel with IDE and SCSI support. Choose this if you have any SCSI drives installed. When in doubt, take this kernel as a slightly slower and larger, but rather failsafe default.
2.4 IDE
Install the stock 2.4.x kernel with IDE support only.
2.4 SCSI
Install the stock 2.4.x kernel with IDE and SCSI support. Choose this if you have any SCSI drives installed, or need SCSI emulation for an IDE CD-Writer drive or USB Storage devices.
2.6 SRC
Uncompress the 2.6 kernel sources to allow you to build your own kernel right now. Not for the faint of heart, as you're pretty much on your own. Don't choose this.
2.4 SRC
Build a 2.4 kernel from source. Again, it's recommended to wait with kernel fiddling (if it's necessary at all to deviate from the stock kernel) until your base system is up and running.
請注意,ArchLinux 預設使用 2.6 版的核心。這其實不是很重要,但是我還是想先告訴您一聲。

設定系統Configure System

Configure System allows you to edit the configuration files crucial for your newly installed system.

If you're in a real hurry, you may skip this step entirely and hope the defaults will work, but it's strongly recommended to iterate through the list of config file presented here and change options accordingly. Please refer to the System Configuration section for detailed instructions.

安裝啟動載入器Install Bootloader

Install Bootloader will install a bootloader on your hard drive, either GRUB (recommended) or LILO, depending on your personal preference.

Make sure you've edited the appropriate configuration file before selecting this, or at least checked whether the chosen defaults are sane.

If you choose to install LILO, the bootloader will be automatically installed according to your settings in the configuration file, whilst GRUB demands the selection of a partition to install the bootloader to. Here you should choose what you would enter as the boot option of LILO, which is usually the entry named [...]/disc, as it refers the master boot record of the respective hard disk. Detailed error messages can be found as usual on VT5, if anything goes wrong.

If you plan on setting up a multiboot system, it might be a better option to install the bootloader in your root or /boot partition, and refer to that boot sector from whatever other boot loader you want to reside in the master boot record.

Installing a boot loader in the MBR will relentlessly overwrite any existing bootloader! Make sure you understand the implications of that if you're running a multiboot system, or want to preserve an installed bootloader from another OS!

結束安裝Exit Install

現在請選擇 Exit Install,將安裝光碟片移出光碟機,然後在命令輸入列上鍵入 reboot 並開始禱告吧 !

如果您的系統成功啟動,您可以以 root 的身份登入而且不需要任何密碼,所以您第一個該做的事情就是,在成功登入後,馬上使用 passwd 這個指令設定一個密碼root ,依照 使用者管理User Management 這一章節的說明,新增一位使用者,然後設定您的網路連線Internet Connection

恭喜您! Now you can proceed getting into the nitty-gritty of configuring the interesting parts of your system.

系統設定System Configuration

這些都是 Arch Linux 的核心系統設定檔。 You should be comfortable hand-editing these files with a text-editor, because there aren't any GUI apps to help you out. Only the most basic configuration files are listed here. If you need help configuring a specific service, please read the appropriate manpage or refer to any online documentation.

Arch Linux 並不使用任何 abstraction layer 來幫助您管理您的系統。因此, you can usually stick to any instructions published by the author of a software, or whatever you find in a search engine of your choice, and it'll work out without confusing your system, because your system just does not care.

系統設定檔Configuration Files

在嘗試啟動您新安裝好的系統前,您至少應該先看一下這些檔案並確認他們並沒 too far off.

系統設定檔清單List of Configuration Files

  1. /etc/rc.conf
  2. /boot/grub/menu.lst
  3. /etc/lilo.conf
  4. /etc/hosts
  5. /etc/fstab
  6. /etc/modprobe.conf
  7. /etc/modules.conf
  8. /etc/resolv.conf
  9. /etc/conf.d/*
  10. /etc/profile

/etc/rc.conf

This is the main configuration file for Arch Linux. It allows you to set your keyboard, timezone, hostname, network, daemons to run and modules to load at bootup, profiles, and more. You should read through all the settings in this file and make sure you understand them:

HARDWARECLOCK
Either UTC if your BIOS clock is set to UTC or GMT, or localtime if your BIOS clock is set to your local time. If you have an OS installed which cannot handle UTC BIOS times correctly, like Windows, choose localtime here, otherwise prefer UTC, which makes daylight savings time a non-issue and has a few other positive aspects.
TIMEZONE
指定您用的時區。 Possible time zones are the relative path to a zoneinfo file starting from the directory /usr/share/zoneinfo. For example, a german timezone would be Europe/Berlin, which refers to the file /usr/share/zoneinfo/Europe/Berlin. If you don't know the exact name of your timezone file, worry about it later.
KEYMAP
Defines the keymap to load with the loadkeys program on bootup. Possible keymaps are found in /usr/share/kbd/keymaps. Please note that this setting is only valid for your TTYs, not any graphical window managers or X.
CONSOLEFONT
Defines the console font to load with the setfont program on bootup. Possible fonts are found in /usr/share/kbd/consolefonts.
USECOLOR
啟用 (或是 禁用) colorized status messages during boot-up.
USELVM
Set to "YES" to run a vgchange during sysinit, thus activating any LVM groups. If you have no idea what this means, don't bother.
HOSTNAME
Set this to the hostname of the machine, without the domain part. This is totally your choice, as long as you stick to letters, digits and a few common special characters like the dash. Don't be too creative here, though.
MODULES
In this array you can list the names of modules you want to load during bootup without the need to bind them to a hardware device as in the modprobe.conf (or modules.conf, if you're using kernel 2.4.x). Simply add the name of the module here, and put any options into the modprobe.conf if need be. Prepending a module with a bang ('!') will not load the module during bootup.
INTERFACES
Here you define the settings for your networking interfaces. The default lines and the included comments explain the setup well enough. If you do not use DHCP to configure a device, just keep in mind that the value of the variable (whose name must be equal to the name of the device which is supposed to be configured) equals the line which would be appended to the ifconfig command if you were to configure the device manually in the shell.
ROUTES
You can define your own static network routes with arbitrary names here. Look at the example for a default gateway to get the idea. Basically the quoted part is passed exactly as you pass it to the route add command, therefore reading man route is recommended if you don't know what to write here.
DAEMONS
This array simply lists the names of those scripts contained in /etc/rc.d/ which are supposed to be started during the boot process. If a script name is prefixed with a bang (!), it is not executed. Usually you do not need to change the defaults to get a running system, but will edit this array quite often once you install system services like sshd.

/boot/grub/menu.lst

GRUB is the default bootloader for Arch Linux. You should check and modify this file to accomodate your boot setup if you want to use GRUB, otherwise read on about the LILO configuration.

GRUB 的設定其實蠻簡單的,最大的問題只是 the biggest hurdle is that it uses yet another device naming scheme different from DevFS and /dev; Your hard disks as a whole are referred to as (hd0), (hd1), etc., sequentially numbered in order of appearance on the IDE/SCSI bus, just like the disc0, disc1, etc. subdirectories in DevFS. The partitions of a disk are referred to with (hd0,0), (hd0,1) and so on, with 0 meaning the first partition. A few conversion examples are included in the default menu.lst to aid your understanding.

當您融會貫通 device naming 的概念後,您所需要作的只是幫您的啟動區段選擇一個不錯的標題supply the correct partition device as a parameter to the root option to have it mounted as / on bootup, and create a kernel line that includes the partition and path where the kernel is located as well as any boot parameters. You should be fine with the defaults, just check whether the partition information is correct in the root and kernel line.

要建立一個可載入其他 OS 的啟動區塊 (bootsector) 的啟動選項,下面這個例子應該會很有幫助。依照這個例子,您應該可以成功的設定並啟動任何 Microsoft-based 的作業系統, just add this block to the file after any other sections, and modify the partition device accordingly to refer to the partition containing the bootsector of the OS you are intending to boot.

# (1) Other OS
title My Other OS
rootnoverify (hd0,1)
makeactive
chainloader +1

關於其他作業系統 (OS) 的進階設定,請參閱 GRUB 的線上使用手冊

/etc/lilo.conf

這個檔案是 LILO Bootloader 的設定檔。如果您想使用 LILO 來啟動您的系統,請先檢查並正確設定這個檔案的內容。如果您需要其他說明與幫助,請參閱 LILO 說明手冊

Things you should check are the root= lines in the image sections and the boot= line right at the beginning of the file. The root lines specify the device which shall be mounted as the root filesystem on bootup. If you don't know what is supposed to be entered here, change to another terminal and type mount to see a list of all currently mounted drives, and look for the line which displays a device name mounted on /mnt type [...]. The device path at the beginning of this very line should be entered in the root lines of your lilo.conf. Change if necessary.

The boot line should be okay by default in most cases. Unless you have a weird boot manager setup in mind with multiple OSes, the device referenced here should be having the same disc number your root lines have, but not end with part1 or something other but a mere disc. This references the disc as a whole, not only one of it's partitions, and therefore instructs LILO to write into the Master Boot Record, which is what you usually want. If not, you can repair the overwritten boot sector of another OS later.

To prevent some serious grief, you should make sure you know how to restore the bootsector of your other OSes, for example with Windows's FIXBOOT/FIXMBR tools.

To be on the safe side, you should keep the option lba32 right below the prompt line. This will prevent some geometry issues from happening.

In some cases, depending on your BIOS, LILO will not run on bootup and spill out an error code infinitely. In most cases you either removed the lba32 option, or your hardware setup is a little special, meaning that maybe your CD-ROM drive is primary master and the hard disk you installed secondary slave. This can very well irritiate your BIOS, and prevent a boot up. To prevent that you can try and make the install drive the primary master on your IDE bus. If you've got a mixed IDE and SCSI system and the problem persists, you'll probably need some experimentation with the disk and bios options of LILO to provide a working mapping; The disk drives in your system are numbered sequentially by your BIOS, starting with 0x80. If you're lucky your SCSI controller tells you which drive has which BIOS ID, but usually you're not. How the drives are effectively numbered is depending on your BIOS, so in the worst case you can only guess until it works. A typical disk line would look like this:

boot=/dev/discs0/disc0/disc
disk=/dev/discs0/disc0/disc bios=0x80

The disk option maps a BIOS ID to the disk device known to linux. Note that there is still no guarantee that things will work as other things can be wrong, so do not despair if all your tries fail, but rather try rearranging your hardware in a way that's not totally odd. In this area too much can go wrong and needs special handling to be explained here. In most cases the lba32 option will suffice anyway. Old hard drives will usually need a little more special care until they do as told.

Don't become fidgety when reading this section, I (Dennis) just happened to stumble over this problem when experimenting with a rather odd system, and figured it'd be a good idea to mention this show stopper and workarounds here. You probably won't ever experience this, and if you do, use GRUB. ;)

How to recreate a LILO boot sector with only a rescue disk is explained later in this document.

/etc/hosts

This is where you stick hostname/ip pairs of other computers on your network. If a hostname isn't part of DNS, you can add it here. You usually don't need to change anything here, but you might want to add the hostname and hostname + domain of the machine to this file, resolving to the IP of your network interface. If you don't know what you're doing, leave this file alone until you read man hosts.

/etc/fstab

Your filesystem settings and mountpoints are configured here. The install program should have created the necessary entries for you, but you should look over it and make sure it's right.

/etc/modprobe.conf

這個檔案只有對 2.6.x kernels 有用。

This tells the kernel which modules it needs to load for system devices. For example, to have the kernel load your Realtek 8139 ethernet module when it starts the network (ie. tries to setup eth0), use this line:

alias eth0 8139too

The syntax of this file is nearly identical to the old modules.conf scheme, unless you use some of the more exotic options like post-install. Then you should invest a little time into reading man modprobe.conf.

/etc/modules.conf

這個檔案只有對2.4.x kernels 有用。

This tells the kernel which modules it needs to load for system devices. For example, to have the kernel load your Realtek 8139 ethernet module when it starts the network (ie. tries to setup eth0), use this line:

alias eth0 8139too

/etc/resolv.conf

使用這個檔案來設定您的 nameserver(s) that you will use. 基本上他的內容應該如下 :

search domain.tld
nameserver 192.168.0.1
nameserver 192.168.0.2

Replace domain.tld and the ip addresses with your settings. The so called search domain specifies the default domain that is appended to unqualified hostnames automatically. Setting this, a ping myhost will effectively become a ping myhost.domain.tld with the above values. These settings usually aren't mighty important, though, and most people should leave them alone for now. If you use DHCP, this file will be fed with the correct values automatically when networking is started, meaning you can and should happily ignore this file altogether.

/etc/conf.d/*

During setup, this is totally unimportant. Consider this as reference for the interested.

Some daemon scripts will have a matching configuration file in this directory that contains some more or less useful default values. When a daemon is started, it will first source the settings from it's config file within this directory, and then source the /etc/rc.conf. This means you can easily centralize all your daemon configuration options in the rc.conf simply by setting an appropriate variable value, or split up your configuration over multiple files if you prefer a decentralized approach to this issue. Ain't life great if it's all just simple scripting?

/etc/profile

This script is run on each user login to initialize the system. It is kept quite simple under Arch Linux (most things are). You may wish to edit or customize it to suit your needs.

Specifically, if you want to change your language settings (the default is English), you may wish to edit the line that says export LANG=my_locale in /etc/profile. To obtain a list of possible locales on your system, take a look at the output of the locale -a command. Choose the one that suits you best and update the value of the LANG variable to reflect this choice.

啟動Boot Scripts

Arch Linux uses a fairly simple bootup sequence quite similar to *BSDs. The first boot script to run is /etc/rc.sysinit. When it's done, /etc/rc.multi will be called (in a normal bootup). The last script to run will be /etc/rc.local. When started in runlevel 1, the single user mode, the script /etc/rc.single is run instead of /etc/rc.multi. You will not find an endless symlink collection in the /etc/rc?.d/ directories to define the bootup sequence for all possible runleves. In fact, due to this approach Arch only really has three runlevels, if you take starting up X in runlevel 5 into account. The boot scripts are using the variables and definitions found in the /etc/rc.conf file and also a set of general functions defined in the /etc/rc.d/functions script. If you plan to write your own daemon files, you should consider having a look at this file and existing daemon scripts.

Boot Script Overview

  1. /etc/rc.sysinit
  2. /etc/rc.single
  3. /etc/rc.multi
  4. /etc/rc.local
  5. /etc/rc.shutdown
  6. /etc/rc.d/*

/etc/rc.sysinit

The main system boot script. It does boot-critical things like mounting filesystems, running devfsd, activating swap, loading modules, setting localization parameters, etc. You will most likely never need to edit this file!

/etc/rc.single

Single-user startup. Not used in a normal boot-up. If the system is started in single-user mode, for example with the kernel parameter 1 before booting or during normal multi-user operation with the command init 1, this script makes sure no daemons are running except for the bare minimum; syslogd, klogd and devfsd. The single-user mode is useful if you need to make any changes to the system while making sure that no remote user can do anything that might cause data loss or damage.

For desktop users, this mode usually is useless as crud. You'll probably never need to edit this script, either.

/etc/rc.multi

Multi-user startup script. It starts all daemons you configured in the DAEMONS array (set in /etc/rc.conf) after which it calls /etc/rc.local. You shouldn't feel a pressing need to edit this file.

/etc/rc.local

Local multi-user startup script. It is a good place to put any last-minute commands you want the system to run at the end of the bootup process. This is finally the one and only script you should modify if needed, and you have total freedom on what to add to this script.

Most common system configuration tasks, like loading modules, changing the console font or setting up devices, usually have a dedicated place where they belong. To avoid confusion, you should make sure that whatever you intend to add to your rc.local isn't feeling just as home in /etc/profile.d/ or any other already existant config location instead.

/etc/rc.shutdown

System shutdown script. It stops daemons, unmounts filesystems, deactivates the swap, etc. Just don't touch.

/etc/rc.d/*

This directory contains the daemon scripts referred to from the rc.conf's DAEMONS array. In addition to being called on bootup, you can use these scripts when the system is running to manage the services of your system. For example the command

# /etc/rc.d/postfix stop

will stop the postfix daemon. Of course a script only exists when the appropriate package has been installed (in this case postfix). With a basic system install, you don't have many scripts in here, but rest assured that all relevant daemon scripts end up here. This directory is pretty much the equivalent to the /etc/rc3.d/ or /etc/init.d/ directories of other distributions, without all the symlink hassle.

使用者管理User Management

Users and groups can be added and deleted with the standard commands provided in the util-linux package: useradd, userdel, groupadd, groupdel, passwd, and gpasswd. The typical way of adding a user is similar to this procedure:

# useradd -m -s /bin/bash johndoe
# passwd johndoe

The first command will add the user named johndoe to the system, create a home directory for him at /home/johndoe, and place some default login files in his home directory. It will also set his login shell to be /bin/bash. The second command will ask you for a password for the johndoe user. A password is required to activate the account.

As an alternative to the useradd command, the adduser script is also available to interactively create new users on your system simply by answering questions.

See the manpages for more information on the remaining commands. It is a good idea to create one or multiple normal users for your day-to-day work to fully use the available security features and minimize potential damage that may be the result of using the root user for anything but system administration tasks.

網路連線Internet Access

Due to a lack of developers for dialup issues, connecting Arch to the Internet with a dialup line is requiring a lot of manual setup. If at all possible, set up a dedicated router which you can then use as a default gateway on the Arch box.

There are quite a few dialup related documents in the Arch Linux Wiki

Analog Modem

To be able to use a Hayes-compatible, external, analog modem, you need to at least have the ppp package installed. Modify the file /etc/ppp/options to suit your needs and according to man pppd. You will need to define a chat script to supply your username and passwort to the ISP after the initial connection has been established. The manpages for pppd and chat have examples in them that should suffice to get a connection up and running if you're either experienced or stubborn enough. In DevFS, your serial ports usually are /dev/cua0 and /dev/cua1.

Instead of fighting a glorious battle with the plain pppd, you may opt to install wvdial or a similar tool to ease the setup process considerably.

In case you're using a so called WinModem, which is basically a PCI plugin card working as an internal analog modem, you should endulge in the vast information found on the LinModem homepage.

ISDN

Setting up ISDN is done in three steps:

  1. Install and configure hardware
  2. Install and configure the ISDN utilities
  3. Add settings for your ISP

The current Arch stock kernels include the necessary ISDN modules, meaning that you won't need to recompile your kernel unless you're about to use rather odd ISDN hardware. After physically installing your ISDN card in your machine or plugging in your USB ISDN-Box, you can try loading the modules with modprobe. Nearly all passive ISDN PCI cards are handled by the hisax module which needs two parameters; type and protocol. You must set protocol to '1' if your country uses the 1TR6 standard, '2' if it uses EuroISDN (EDSS1), '3' if you're hooked to a so called leased-line without D-channel, and '4' for US NI1.

Details on all those settings and how to set them is included in the kernel documentation, more specifically in the isdn subdirectory, or available online. The type parameter depends on your card; A list of all possible types is to be found in the README.HiSax kernel documentation. Choose your card and load the module with the appropriate options like this:

# modprobe hisax type=18 protocol=2

This will load the hisax module for my ELSA Quickstep 1000PCI, being used in Germany with the EDSS1 protocol. You should find helpful debugging output in your /var/log/debug file in which you should see your card being prepared for action. Please note that you will probably need to load some usb modules before you can work with an external USB ISDN Adapter.

Once you confirmed that your card works with certain settings, you can add the module options to your /etc/modprobe.conf (or /etc/modules.conf if you're using kernel 2.4.x):

alias ippp0 hisax
options hisax type=18 protocol=2

Alternatively you can only add the options line here, and add hisax to your MODULES array in the rc.conf. Your choice, really, but this example has the advantage that the module will not be loaded until it's really needed.

That being done you should have working, supported hardware. Now you need the basic utilities to actually use it!

Install the isdn4k-utils package, and read the manpage to isdnctrl, it'll get you started. Further down in the manpage you will find explanations on how to create a configuration file that can be parsed by isdnctrl, as well as some helpful setup examples.

Please note that you have to add your SPID to your MSN setting seperated by a colon if you use US NI1.

After you configured your ISDN card with the isdnctrl utility, you should be able to dial into the machine you specified with the PHONE_OUT parameter, but fail the username and password authentication. To make this work add your username and password to /etc/ppp/pap-secrets or /etc/ppp/chap-secrets as if you were configuring a normal analogous PPP link, depending on which protocol your ISP uses for authentication. If in doubt, put your data into both files.

If you set up everything correctly, you should now be able to establish a dialup connection with isdnctrl dial ippp0 as root. If you have any problems, remember to check the logfiles!

DSL (PPPoE)

These instructions are only relevant to you if your PC itself is supposed to manage the connection to your ISP. You do not need to do anything but define a correct default gateway if you are using a seperate router of some sort to do the grunt work.

Before you can use your DSL online connection, you will have to physically install the network card that is supposed to be connected to the DSL-Modem into your computer. After adding your newly installed network card to the modules.conf/modprobe.conf or the MODULES array, you should install the rp-pppoe package and run the adsl-setup script to configure your connection. After you have entered all the data, you can connect and disconnect your line with

# /etc/rc.d/adsl start

and

# /etc/rc.d/adsl stop

respectively. The setup usually is rather easy and straightforward, but feel free to read the manpages for hints. If you want to automatically dial in on bootup, add adsl to your DAEMONS array.

軟體套件管理Package Management

Pacman

pacman 是個is the package manager which tracks all the software installed on your system. It has simple dependency support and uses the standard tar-gz archive format for all packages. Some common tasks are explained below with the respective commands in long and short option form. For an up to date explanation of pacman's options, read man pacman. This overview is merely scratching the surface of pacman's current capabilities.

常見的工作Typical tasks:

  1. 從套件壓縮檔新增套件Adding a new package with a package file
  2. 從套件壓縮檔更新套件Upgrading a package with a package file
  3. 移除套件Removing packages
  4. 更新套件清單Refreshing the package list
  5. 更新系統Upgrading the system
  6. 從 repositories 新增/更新套件 Adding/Upgrading a package from the repositories
  7. 列出安裝的套件清單List installed packages
  8. 檢查某個特定套件是否已經安裝Check if a specific package is installed
  9. 顯示某個特定套件的相關資訊Display specific package info
  10. 顯示某個套件內包含的所有檔案的清單Display list of files contained in package
  11. 查出某個特定的檔案是屬於哪一個套件的Find out which package a specific file belongs to

從套件壓縮檔新增套件Adding a new package with a package file

# pacman --add foo.pkg.tar.gz
# pacman -A foo.pkg.tar.gz

This will install the foo.pkg.tar.gz package on the system. If dependencies are missing, pacman will exit with an error and report the missing deps, but not attempt to resolve the dependencies automatically. Look at the --sync option if you expect this functionality.

從套件壓縮檔更新套件Upgrading a package with a package file

# pacman --upgrade foo.pkg.tar.gz
# pacman -U foo.pkg.tar.gz

This does essentially the same as the --add operation, but will additionally upgrade an already-installed package at no extra cost. I can personally not imagine a case where you'd prefer --add over this --upgrade function.

移除套件Removing packages

# pacman --remove foo
# pacman -R foo

This will remove all files belonging to the package named foo, except for configuration files that have been edited. Only supply the name of the package to this command, without the pkg.tar.gz suffix.

To remove any and all trace of a package, add the --nosave option to the above command.

更新套件清單Refreshing the package list

# pacman --sync --refresh
# pacman -Sy

This will retrieve a fresh master package list from the repositories defined in the /etc/pacman.conf file and uncompress it into the database area. You should use this before using --sysupgrade to make sure you get the newest packages. Depending on your pacman.conf settings, this command may require a working internet connection to access FTP-based repositories. This option is quite similar to Debian's apt-get update command.

更新系統Upgrading the system

# pacman --sync --sysupgrade
# pacman -Su

This command will upgrade all packages that are out-of-date on your system by comparing the local package version to the versions in the master package list that gets downloaded with the --refresh command. It's a good idea to run this every now and then to keep your system up to date. Note that this command does NOT implicitly refresh the master package list, so it's usually wiser to combine both commands into one:

# pacman --sync --refresh --sysupgrade
# pacman -Syu

With these options pacman will automatically retrieve the current master package list and do a full system upgrade to the latest packages with all dependencies being automagically resolved. You will want to run this quite often.

由 repositories 新增/更新某個套件Adding/Upgrading a package from the repositories

# pacman --sync foo
# pacman -S foo

Retrieve and install package foo, complete with all dependencies it requires. Before using any sync option, make sure you refreshed the package list, or add --refresh or -y to the options to do it before the installation attempt. Unlike --add, the --sync option does not differ between installing and upgrading packages. Depending on your pacman.conf settings this function requires working internet access.

列出所有已經安裝的套件名單List installed packages

# pacman --query
# pacman -Q

Displays the list of all installed packages in the system.

檢查某個程式套件是否已經安裝Check if a specific package is installed

# pacman --query foo
# pacman -Q foo

Instead of grepping the full list for a name, you can append the name of the package you are looking for to the query command. This command will display the name and version of the foo package if it is installed, nothing otherwise.

顯示特定的程式套件的資訊Display specific package info

# pacman --query --info foo
# pacman -Qi foo

Displays information on the installed package foo (size, install date, build date, dependencies, conflicts, etc.). To display this information for a package file that is not yet installed, add the --file or -p option, respectively:

# pacman --query --info --file foo.pkg.tar.gz
# pacman -Qip foo.pkg.tar.gz

Display list of files contained in package

# pacman --query --list foo
# pacman -Ql foo

Lists all files belonging to package foo.

找出某個特定檔案是屬於哪一個程式套件的

# pacman --query --owns /path/to/file
# pacman -Qo /path/to/file

This query displays the name and version of the package which contains the file referenced by it's full path as a parameter.

Accessing Repositories

A package repository is a collection of packages and a package meta-info file that can reside in a local directory or on a remote FTP/HTTP server. The default repository for an Arch system is the current repository. This is kept up to date with the latest version of most software and stays fairly bleeding-edge.

Many users also choose to activate the extra package repository which contains more packages that are not part of Arch's core package set. You can activate this repo by uncommenting the appropriate lines in your /etc/pacman.conf. This repository is activated by default.

You can also build, maintain and use your own package repositories. See the pacman manpage for instructions.

If you install from a CD and end up having a problem accessing the Internet, you may need to install additional packages from the CD. You can locate the packages on the cd and install them manually using pacman -A packagename.pkg.tar.gz Alternatively, you can temporarily set up a local repository to access the CD. Mount the CD on /mnt/cd using the command mount /mnt/cd (assuming your fstab is properly set up). Then add the following lines to your /etc/pacman.conf:

[cd]
Server = file:///mnt/cd/arch/pkg

You will then be able to install additional packages to help you get your Internet access set up.

Arch Build System (ABS)

執行檔 vs. 原始碼 Binary vs. Source

Where pacman is responsible for the binary side of the package world, ABS is responsible for the source side: It helps you to build your own custom packages from source code, also letting you rebuild Arch Linux packages with your own customizations. The procedure usually goes as follows:

  1. Synchronize your ABS tree with the server (run abs as root)
  2. Create a new directory in /var/abs/local/ named after the package you are going to create
  3. Copy the PKGBUILD.proto prototype from /var/abs/ into your newly created directory, remove the proto, suffix, and edit it for the new package.
  4. Run makepkg in the working directory with the PKGBUILD file.
  5. Install the newly built package with pacman.
  6. Send the package to your friends for bragging rights (or give it to an Archer so s/he can stick it in the master ABS tree).

同步您的Synchronizing Your ABS Tree

You can synchronize all the PKGBUILD files in /var/abs by running the abs script as root. It requires the cvsup package to operate and will complain if you don't have it installed. Using CVS as the transfer medium allows you to follow different version trees within ABS - this can be configured in /etc/abs/supfile.arch. For example, the default supfile is set to track the current package tree, which is bleeding-edge and the recommended source to follow. You can also follow specific versions. See the comments in the supfiles for more info.

ABS supports multiple repositories, which can be enabled or disabled from /etc/abs/abs.conf. By default abs will follow the current and extra repositories, but not unstable.

You will also see an /etc/abs/supfile.extra file. This will give you access to all the unofficial build scripts that were not included in the main ABS repository. If you do not want to use this repository, you can delete the file, but usually it makes more sense to edit abs.conf accordingly instead.

如何包裝一個套件How to Build Packages

包裝套件的程序已經在 thoroughly explained in the makepkg manpage. See it for instructions on building your own packages. If that's not helping you, keep your eyes peeled for tutorials in the Wiki, or ask for help in the forums or IRC.

套件包裝守則Package Guidelines

當您要為 Arch Linux 包裝一個套件時,您必須遵守下面所列出的套件包裝守則,尤其是如果您想把您所包裝好的套件回饋 contribute 到 Arch Linux 時。

套件的命名Package Naming

目錄Directories

Configuration files 必須放在 /etc 這個目錄下。如果有超過一個以上的 configuration file,一般我們都會使用一個子目錄來保持 /etc 盡可能的 clean。使用 /etc/{pkgname}/ 其中 {pkgname} 表示你的套件的名稱 (或是其他合適的名稱,例如,apache 可以使用 /etc/httpd/).

Package files should follow these general directory guidelines:

/etc System-essential configuration files
/usr/bin Application binaries
/usr/sbin System binaries
/usr/lib Libraries
/usr/include Header files
/usr/lib/{pkg} Modules, plugins, etc.
/usr/man Manpages
/usr/share/{pkg} Application data
/etc/{pkg} Configuration files for {pkg}
/opt Large self-contained packages such as KDE, Mozilla, etc.

makepkg Duties

如果您使用 makepkg 來包裝您的套件,makepkg 將會自動執行下列的動作 :

  1. 檢查程式套件的 依存關係 dependencies 是否符合are installed
  2. 從伺服器上 下載源碼檔案
  3. 解壓縮 (解包) 源碼檔
  4. 執行任何需要的 patching
  5. Builds 程式並安裝到一個虛假的 root 內
  6. 移除套件內的 /usr/doc/usr/info/usr/share/doc,和 /usr/share/info
  7. 移除Strips symbols from binaries
  8. 移除Strips 程式庫內的除錯 symbols
  9. 建立Generates the package meta file which is included with each package
  10. Compresses the fake root into the package file
  11. Stores the package file in the configured destination directory (cwd by default)

其他Other

避免加入新的變數 variables 在你的 PKGBUILD 安裝 scripts內,因為這些變數可能會和 makepkg 自己的變數起衝突

避免使用 /usr/libexec/ for anything. 請直接使用 /usr/lib/{pkg}

The Packager field from the package meta file can be customized by the package builder by modifying the appropriate option in the /etc/makepkg.conf file, or alternatively by exporting the PACKAGER environment variable before building packages with makepkg:

# export PACKAGER="John Doe <your.email>"

提交包裝好的套件Submitting Packages

在提交出您包好的套件前,請注意下列幾點 :

  1. 請依照下面的格式,在您的 PKGBUILD 檔案一開始的地方加入一行註解 :
    # Contributor: Your Name <your.email>
  2. 檢查程式套件的依存性 dependencies (例如,執行 ldd on 動態執行程式,檢查 scripts 執行時所需要的工具程式,等等)。使用 Jason Chu 寫的 namcap 這個應用程式也是個不錯的方法,這個程式主要是用來檢查你包裝的套件的 the sanity 。 namcap 將會告訴你任何可能存在的 permissions 錯誤,依存性錯誤,多餘的依存關係,和任何其他一般的錯誤。你可以使用 pacman 來安裝 namcap 這個套件。
  3. 所有的程式套件都必須放在一個目錄下並壓縮成單一 tar 檔案。目錄內必須包含新built packagePKGBUILDfilelist,和其他檔案additional files (patches, install, ...)。壓縮檔的名稱必須至少包含了程式套件的名稱。
  4. Watch for announcements regarding the actual submission of packages, as a new implementation of the whole procedure is currently being discussed among the developers. If you think your package is too important to wait, you may of course ask a Trusted User if he would be willing to take your package for inclusion in his repository.

常見問答集Frequently Asked Questions

這份 FAQ 在這邊只列出關於啟動或是安裝 Arch Linux 系統時你可能會遇到的問題與答案。如果你有關於系統應用程式的使用問題, XFree86 的設定問題,等等。或著如何是定你的硬體,請參考 Wiki 上的相關章節。如果你覺得有些問題應該在這邊出現卻沒出現,請知會這份文件的作者,你可以在這份文件一開始的地方找到他們的聯絡方法。

在安裝程式套件時, pacman 無法解決套件 A 的依賴關係 dependencies 因為套件 B 並不在 package set

Unless something is very broken and thus very likely to be reported by multiple people soon, you probably just forgot to mount your target partitions properly. This causes pacman to decompress the package database into the initial ramdisk, which fills up quite nicely and ultimatively leads to this error.

Make sure that you use the DONE and not the CANCEL option offered by the Filesystem Mountpoints menu to apply your choices. This error should not happen if you use the Auto-Prepare feature; please report this as a bug.

當系統啟動時,我得到一個 kernel panic 的錯誤訊息 : Unable to open initial console

你可能編譯了自己設定過的核心同時又忘記加入 DevFS 的支援設定。在設定你的核心時,請記得開啟對 /dev 檔案系統的支援然後在系統啟動時 *自動* 掛載他們。You'll also need Prompt for development and/or incomplete code/drivers to see these option at all.

要怎麼使用 pacman --sync 來安裝在 CD 上的程式套件 (so it resolves dependencies for me)?

如果你不想從網路上下載更新的套件,希望從光碟上安裝程式套件,你需要先把安裝 CD 掛載在某個地方 (例如,/mnt/cd) 然後在 /etc/pacman.conf 內的 [current] 這一行下加入下面這一行指令 :

Server = file:///mnt/cd

/mnt/cd 用你選擇的掛載點取代。然後使用指令 pacman --sync 就像你平常更新套件清單時一樣 - 套件管理程式將會先檢查在 /mnt/cd 這個目錄下的程式套件。

在安裝的過程中,如何建立多個 swap 分割區?

如果你想要建立和使用多個 swap 分割區,你當然無法使用安裝程式提供的 Auto-Prepare 這個功能。您必須自己手動來設定,隨便您想設定多少個,就設定多少個。Go through the rest of the install, don't mind that you're only asked for one swap partition during the mount-point setting. Once you're through with the install and are about to edit your system configuration files, you can edit the fstab file and include a line for every swap device you created earlier. Simply copy the automatically generated swap line, and modify the referenced device according to your setup. The additional swaps will be activated after the bootup when swapon -a is being run by the initscripts.

如果,為了不知名的任何理由,你不能等到系統完全安裝完畢後才啟動其他的 swap 分割區或是檔案,你必須先在其他的虛擬終端機上開啟一個 shell 然後為每一個你之前已經切割好/準備好的 swap 分割區或是檔案鍵入 swapon <device> 這個指令。然後接著上面的解釋繼續完成安裝的程序。

如果你真的真的計畫設定多個 swap 檔案或是分割區,你必須明白一點,一個需要很多 swap 空間的系統核心其實是在哭訴他需要更多的記憶體,而不是真的需要更多的 swap 空間。請記得好好的餵飽你的小企鵝,謝謝。

如何從急救系統 (rescue system)來重新設定 LILO ?

As a first step you simply boot from the Arch Install CD or disks. 如果您的分割區都依然完整同時也不需要任何檢查, you should supply the root= kernel boot parameter as the instructions tell you. That will boot directly into your system, and you can skip all but the last step of actually reconfiguring and running lilo.

If you cannot boot your old root directly, boot the CD as if you were going to start an installation. Once you're in a shell, you mount the root partition of your harddisk into the /mnt directory, for example like this:

# mount /dev/discs/disc0/part3 /mnt

Then you mount any other partitions to their respective mount points within that root of yours, for example a /boot partition:

# mount /dev/discs/disc0/part1 /mnt/boot

Now you need to mount your DevFS directory in the /mnt area, where lilo will be able to find it:

# /mnt/bin/mount --bind /dev /mnt/dev

Once everything is mounted, make this /mnt directory your new root with the chroot /mnt command. This will start a new shell and drop you into the /mnt directory, which will be considered your / from then on.

Now you can edit /etc/lilo.conf to your liking and run lilo to fix anything that needs fixing. Simply type exit when you want to break out of this root again, back into the original file tree. You can now reboot and test your changes.

我無法 ssh 連線到我自己的機器內 !

請先編輯您的 /etc/hosts.deny 檔案。 系統預設的設定將拒絕所有 incoming 連線要求。

在啟動時如何載入模組How should I load modules during boot now?

If you want to load a module unconditionally without a specific device binding, add the name of the module to the MODULES array of your /etc/rc.conf. For on demand loading on device access, add it as usual with the alias command to your /etc/modprobe.conf (/etc/modules.conf for 2.4 kernels). To pass any options to a module you want to load through the MODULES array, only add the appropriateoptions line to the /etc/modprobe.conf.

Kernel 核心拒絕啟動因為 lost interrupt

Kernel 核心拒絕啟動。系統整個卡在 :

IRQ probe failed for hda
hda lost interrupt

這個錯誤發生在 2.6.X 核心和某些硬碟控制卡上。一個可行的解決方法就是在系統啟動時,鍵入 acpi=off 這個指令。

I get access denied errors trying to play sound or read DVDs

請將您的使用者帳號加入 opticalaudio 群組.

# gpasswd -a johndoe optical
# gpasswd -a johndoe audio
登出,然後重新登入Logout, then login as your regular user (eg, johndoe) so the group changes can take effect.

如果您有一台 DVD 光碟機,您可能需要建立一個 /dev/dvd symlink 連接到您的真實 DVD 光碟機。

例如,如果您使用 udev 然後您的 DVD 光碟機是在 /dev/hdc ,您可以在 root 的身份下輸入下列指令 :

# cat >>/etc/udev/rules.d/00.rules <<EOF
> KERNEL="hdc", NAME="hdc", SYMLINK="dvd"
> EOF
# /etc/start_udev
# mount /dev/pts
# mount /dev/shm

使用 pacman 安裝 packages 時, 我得到這個錯誤訊息 : error : xorg conflicts with xfree86

這是個暫時性的問題,因為我們正將正個系統轉移到 xorg 環境下。目前,還有一些 packages 依然要求ll depend on xfree86 specifically,所以 pacman 有時會搞不清楚狀況。

你可以清楚要求系統先安裝 xorg ,然後再安裝其他的 packages 來解決這個問題。

# pacman -S xorg
# pacman -S otherpkg1 otherpkg2 ...

附錄 - 翻譯對照表

為了方便閱讀與之後的維護工作,這裡列出了一些單字的翻譯對照表。很多翻譯名詞可能都不是非常 conventional,因為我對很多名詞的中文(台灣)慣用語不是很清楚。翻譯時為了求效率(其實也拖了很久),就沒有去仔細推敲每個名詞的正確中文翻譯。

如果你對下面這份對照表內的單字和翻譯有疑問,歡迎你寫信來告知我,或是在 ArchLinux@CLE 的論壇提出討論。

- A -

- B -
boot :
boot loader :

- C -

- D -
dependency : 相依性
distribution : 發行套件

- E -

- F -
file system : 檔案系統

- G -

- H -

- I -
image/ISO : 映象檔

- J -

- K -
kernel : 核心

- L -
library : 程式庫

- M -
mirror : 鏡像站
module : 模組
mount/mount point : 掛載/掛載點

- N -

- O -

- P -
package : (程式/發行)套件
partition : 分割區
plug-in : 外掛

- Q -

- R -
reposirory :

- S -
source/source file :

- T -

- U -

- V -

- W -

- X -

- Y -

- Z -