User:Hayato/Drafts/Beginners' Guide

From ArchWiki
Warning: この記事の内容は古くなっており、ここに書かれているとおりに作業を行っても正常に動作しないかもしれません。Archを正しくセットアップするため、必ずオリジナルの英語版を参照してください。

fa:راهنمای_تازه‌کارها

序文

概要

Arch Linuxの世界にようこそ! この文書にはArch Linux――シンプルで軽量で硬派なユーザー向けのGNU/Linuxディストリビューション――のインストールプロセスに必要な情報が含まれています。このガイドはArchを使い始めようとするユーザーを対象にしていますが、全ての人に役に立つような強力なリファレンスと有益な情報を提供するように努力しています。

Arch Linuxの特徴:

  • シンプルなデザインと哲学
  • 全てのパッケージ がi686/x86_64 アーキテクチャ向けにコンパイルされています
  • ローリング・リリースモデルを採用することで再インストールすることなく、インストールされたソフトウェアを最新の安定したバージョンにアップグレードすることができます
  • BSD-style initスクリプトを採用することで、システムの設定が一つのファイルに集約されます
  • mkinitcpio はシンプルで強力なinitramfs作成ツールです
  • パッケージマネージャPacman (日本語) は少ないメモリで軽快に動作します
  • Arch Build System: ports に似たパッケージビルドシステムで、ソースからインストール可能なArchパッケージを作成するためのシンプルなプレームワークです
  • Arch User Repository: 多くのユーザーが作成した大量のビルドスクリプトを提供し、あなたが作成したビルドスクリプトを共有する場所を提供します

ライセンス

Arch Linux, pacman, documentation, and scripts are copyright ©2002-2007 by Judd Vinet, ©2007-2008 by Aaron Griffin and are licensed under the GNU General Public License Version 2.

The Arch Way

The design principles behind Arch are aimed at keeping it simple.

「シンプル」というのは、ここでは「不必要な追加、変更、複雑化を行わない」ということです。要するに、エレガントで最小主義なアプローチだということです。

Some thoughts to keep in mind:

  • " 'Simple' is defined from a technical standpoint, not a usability standpoint. It is better to be technically elegant with a higher learning curve, than to be easy to use and technically [inferior]." -Aaron Griffin
  • Entia non sunt multiplicanda praeter necessitatem or "Entities should not be multiplied unnecessarily." -Occam's razor. The term razor refers to the act of shaving away unnecessary complications to arrive at the simplest explanation, method or theory.
  • "The extraordinary part of [my method] lies in its simplicity..The height of cultivation always runs to simplicity." - Bruce Lee


このガイドについて

Arch wikiは最初に参照すべき優れた資料です。そこで解決できなかった問題については、IRCチャネル(ircs://irc.libera.chat/archlinux )やフォーラムを利用することができます。また、見たことがないコマンドはmanページで確認するといいでしょう。manページはman commandで読むことができます。

Note: Arch Linuxシステムを適切にインストールするには、何よりもこのガイドをしっかり読むことが大切です。インストールに関する作業を実行する前に全ての章を読み終えてからインストールを始めることを強くおすすめします。

このガイド三つの部分に分けて解説しています:

パート1:ベースシステムのインストール

パート2:XのインストールとALSAの設定

パート3:デスクトップ環境のインストール

インストールの準備

Note: 既存のGNU/LinuxディストリビューションまたはLiveCDを内から別のパーティションにインストールする場合、this wiki articleを参照し、手順に従って下さい。リモート接続のVNCまたはSSHを使ってArch Linuxをインストールする場合、特に役立つことでしょう。以下の方法は、従来の手段によってインストールする事を前提としています。

最新のインストールメディアを手に入れる

Archの公式インストールメディアはここで入手できます。最新版は2011.8.19です。

  • Core版にしろ、Netinstall版にしろ、インストールされるのはベースシステムのみです。このベースシステムにGUIは含まれていないことを忘れないでください。そこに含まれているのは主に、GNU toolchain (コンパイラ、アセンブラ、リンカ、ライブラリ、シェル、その他有用なユーティリティ)、Linuxのカーネル、そしていくつかの追加ライブラリや追加モジュールです。
  • Core版を使用するとCDとネットのどちらでもインストールすることが可能です。
  • Netinstall版はCore版よりサイズが小さく、それ自体にパッケージは含まれておりません。インストールはすべてインターネット経由となります。
  • The Arch64 FAQ ( Arch64_FAQ ) は32ビット、もしくは64ビット版を選択する上での手助けになるでしょう。Dual Architecture版は、32ビット、または64ビットコンピュータにインストールするため、いずれのアーキテクチャのパッケージも1枚のCDに収められているものです。
  • 選んだCDイメージに対応するチェックサムファイルをダウンロードするのを忘れないようにしてください。

プレリリース版も利用可能であり、ここからダウンロードできます。 'こちらは正式リリース版ではなく、正式にサポートされるものではありません。'システム上、正式リリース版が、現在のハードウェアで動作しない場合で、新しいイメージが適切なドライバを持っていると考えられる状況のみで使用するべきです。

ダウンロードしたファイルの整合性の確認

端末を開き、ディレクトリをファイルをダウンロードした場所に変更して、CLI(コマンドライン)に以下のように入力してください。

  1. sha1sum --check name_of_checksum_file.txt

これでOKと出るはずです。(その他の行は無視してください。)もしこうならなければ、すべてのファイルをダウンロードし直してください。md5sum も同様の方法で動作します。

CD インストーラ

.isoファイルを好みのCDまたはDVDライターで焼き、#Arch Linux インストーラの起動から続けてください。

Note: CDの質と同様、光学式ドライブには様々なものがありますが、一般的には信頼性を高めるために出来る限り低速で焼くことが推奨されています。ユーザーによっては4倍または2倍速程度を推奨する人もいます。 もしCDが予期しない動作をした場合、システムで保証された最低の速度で焼き直してみてください。

フラッシュメモリーカード又は USBメモリ

USB Installation Mediaでは、より詳細な情報を参照できます。BIOSでカードリーダーまたはUSBポートからの起動が出来るならば、あなたの任意のタイプのフラッシュメディアを使える事でしょう。

*nix 上での方法
Warning: ISOイメージの書き込みには、細心の注意を払ってください。 dd は、あなたがディスク上のデータ損失(あるいはファイルシステムの破損)となる場合であっても、示されたターゲットへ書き込みます。

空または消耗品のフラッシュデバイスを挿入し、そのパスを決定し、使用してデバイスにisoイメージを書き込みます。 dd のプログラムは:

# dd if=/dev/sd''x'' count=''number_of_records'' status=noxfer | md5sum

ここで、 if= は.iso ファイルへのパスであり、of=はフラッシュデバイスです。 /dev/sdx を用い、 /dev/sdx1は用いません。イメージに対して充分な容量のフラッシュデバイスが必要になります。

フラッシュデバイスへの書き込みが正常であるか、整合性確認を実施するため、読み込みおよび書き出しされたレコード(ブロック)数をメモしておき、次のようにチェックを実行します。

# dd if=/dev/sd''x'' count=''number_of_records'' status=noxfer | md5sum

MD5チェックサムは md5sum of the downloaded archlinux image file (2011.08.19); に一致した値を返します。 ミラー配布サイトでmd5sumをファイルにリストされているように、両者が、イメージのmd5sumと一致している必要があります。こんな風に実行していきます。

.isoのドライブへの書き込み

# dd if=archlinux-2011.08.19-core-i686.iso of=/dev/sdc bs=4M
 744973+0 records in
 744973+0 records out
 381426176 bytes (381 MB) copied, 106.611 s, 3.6 MB/s

整合性の確認

# dd if=/dev/sdc count=744973 status=noxfer | md5sum
 4850d533ddd343b80507543536258229  -
 744973+0 records in
 744973+0 records out

Arch Linux インストーラの起動へ進みましょう。

Windows 上での方法

まずはここから Disk Imager をダウンロードしましょう。

USBメモリを挿入した後、Disk Imagerを起動してイメージファイルを選択します。 (ディスクイメージャは*.imgファイルのみを受け付けるので、ファイルを開くダイアログで"*.iso"を設置し、Archのスナップショットを選択します。) USBメモリに割り当てられたドライブレターを選択し、"write"をクリックしてください。

このような方法もあります。ブータブルISOイメージのUSBメモリへの書き込み(英語) もしも、USBメモリが切断されたトラブルの場合は、USBポートの変更やケーブルの交換をお試しください。

Arch Linux インストーラの起動へ進みましょう。

ネットワーク経由でのインストール

ディスクまたはUSBドライブにブートメディアを書き込む代わりに、ISOイメージから起動したあとネットワーク越しで行う方法です。あなたがサーバーを設定するとき、これはうまく動作します。詳細については、この記事を参照し、Arch Linux インストーラの起動へ進みましょう。

仮想マシンへのインストール

現在のオペレーティングシステムを残し、ハードディスクの再パーティション化なしでArch Linuxとそのインストール手順に慣れるために、仮想マシン上へインストールするのは良い方法です。ブラウザで、このBeginners' Guideを開いたまま、インストールの全ての操作が出来るようになります。テスト用の仮想ドライブへ、独立したArch Linuxシステムを使用してみることは、一部のユーザーにとって有利なことでしょう。

仮想化ソフトウェアの例としては、VirtualBoxVMwareQEMUXenParallelsがあります。

仮想マシンを準備するための正確な手順は、ソフトウェアによって異なりますが、一般的に次の手順に従います。

  1. オペレーティングシステムのホストにて、仮想ディスクイメージを作成します。
  2. 仮想マシンのパラメータ、設定を最適化します。
  3. 仮想CDドライブにダウンロードしたisoイメージを起動します。
  4. Arch Linux インストーラの起動に進みます。

次の記事が役に立つかもしれません。

Arch Linux インストーラの起動

Tip: basic install の必要なメモリ容量は、64MB RAMです。
Tip: 全パッケージ選択時の必要なメモリ容量は、160 MB RAM x86_64/i686 (別にスワップパーティションが必要)
Tip: 待機中には、自動でブランクスクリーンになる可能性があります。もしそうなったら、Altキーを押すことで、通常の表示へ安全に復帰出来ます。

メディアからの起動

CDまたはUSBメモリを挿入し、そこから起動します。場合によってはBIOSの設定で起動順序の変更をしたり、POST画面でキー(通常はDelete, F1, F2, F11 or F12)を押す必要があるかもしれません。

メインメニュー:起動出来たら、メインメニューが表示されます。強調表示された箇所を移動するために矢印キーを使用し、Enterキーを押して選択します。メニューは、ISOイメージの種類で若干異なります。

オペレーティングシステムの開始

メインメニューから "Boot Arch Linux"を選んでEnterキーを押し、インストールを開始してください。システムがロードされたら、シェルプロンプトを表示します。あなたは、自動的にrootとしてログに記録されるでしょう。

ブートオプションを直接編集するには Tab キーを押してください。コンソールの表示を読みやすくするためにフレームバッファの解像度を高くしたいユーザも多いことでしょう。その場合は

vga=773

をkernel行に追加し、<ENTER>を押してください。1024x768で表示されるようになります。

Note: SSHによるリモート接続経由でArch Linuxのインストールを続行しようとしているユーザーは、ライブCD環境下で直接SSH接続を有効にするため、この時点で、いくつかの調整を行うことをお勧めします。興味のある方は、Install from SSHを参照してください。
起動時の問題でのトラブルシューティング

Intelビデオチップセット使用してブートプロセスの間にブランクスクリーンになった場合、問題は、おそらくカーネルモードの設定の問題です。再起動後に{Keypress|Tab}を押しGRUBメニューでカーネルオプションを入力する画面に入ります。kernelの行の終わりに、次のように追加します。

i915.modeset=0

更に追加します。

video=SVIDEO-1:d

これにより(もし動作するなら)カーネルモードの設定を無効にすることは無いでしょう。

詳細については、Intelの記事を参照してください。

画面がブランクスクリーンにならない上に、起動プロセスによってカーネルをロードしようとしてはまり、{Keypress|Tab}を押したのであれば、kernel行を編集し、次を追加します:

acpi=off

任意のメニューコマンドに変更を加え終わったら、Enterを入力し、変更された状態で起動します。

キーマップの変更

もしUSキーボード以外のレイアウトを利用しているのであれば、ここでキーマップとコンソールフォントを変更しておきましょう:

# km

または loadkeys コマンドも利用できます:

# loadkeys layout

(layout を "jp106" や "be-latin1"のような自分のレイアウトに置き換えてください)


設定のための資料

インストールを実行中のシステムでは、公式のインストールガイドを利用できます。ただし、公式ガイドではベースシステムのインストールと設定方法についてのみ記述してあります。vc/2(バーチャルコンソール#2) へ <ALT>+F2 で移動し、/usr/bin/less を呼び出します:

# less /arch/docs/official_installation_guide_en

less を利用するとドキュメントのページをめくることができるようになります。 元のコンソール(vc/1)に戻るには、 <ALT>+F1 を押下してください。

vc/2へ移動すれば、いつでも公式ガイドを読むことができます。


Tip: 公式ガイドはインストールと基本的なシステムの設定しか提供していないことを覚えていてください. 一旦、インストールが終わったあとに, it is strongly recommended that you come back here to the wiki to find out more about post-installation considerations and other related issues.(あなたがインストールの問題とそれにに関係する問題を解決するために、ここのwikiに再び戻ってくることをおすすめします)

インストールの開始

rootとなって、vc/1からインストールスクリプトを開始してください:

# /arch/setup

A:インストールソースの選択

After a welcome screen(ウェルカムスクリーン後に), you will be prompted for an installation source(あなたはインストールソースの設定を促されますので). Choose the appropriate source for the installer you are using(インストローラで自分の使う適切なソースを選択してください。).

  • If you chose the CORE installer(もし、あなたがコアインストローラを選択したなら), continue below with (以下に続けてください)B: Set Clock.
  • Netinstall only(ネットインストールのみ): You shall be prompted to load ethernet drivers manually(あなたは恐らく、手動でイーサットドライバをロードすることを促されるでしょう), if desired(もし、ドライバのロードを促されたら). Udev is quite effective at loading the required modules(Udev が要求されたモジュールをロードするのにとても有用です), so you may assume it has already done so. You may verify this by invoking ifconfig -a from vc/3(あなたは、vc/3からifconfig -aを呼び出すことによって、これについて確かめることができます。). (Select OK to continue.{OKを選択して続けてください})

ネットワークの設定(ネットインストール)

Available Interfaces will be presented. If an interface and HWaddr (HardWare address) is listed, then your module has already been loaded. If your interface is not listed(もし、あたなのインターフェイスがリストに無かったとしたら), you may probe it from the installer, or manually do so from another virtual console(恐らく、インストローラや別のバーチャルコンソールから調べなければなりません).

The following screen will prompt you to Select the interface, Probe, or Cancel(次の画面で、Select the interface, Probe,Cancel'という項目を促してくるでしょう). Choose the appropriate interface and continue(適切なインターフェィスを選択して、続けてください).

The installer will then ask if you wish to use DHCP. Choosing Yes will run dhcpcd to discover an available gateway and request an IP address; Choosing No will prompt you for your static IP, netmask, broadcast, gateway DNS IP, HTTP proxy, and FTP proxy. Lastly, you will be presented with an overview to ensure your entries are correct.

(A)DSL接続をライブ環境ですぐに始める(もし、モデムを持っていて (それかルーターのブリッジモードがあり) プロバイダへの接続ができるなら)

他のバーチャルコンソールに移り(<Alt> + F2), rootとしてログインして、下記を実行してください

# pppoe-setup

最終的にすべての設定が上手くできて、プロパイダへの接続ができるなら

# pppoe-start

最初のバーチャルコンソールへ戻ってください <ALT>+F1. 次に続く B: Set Clock

ワイヤレス接続をライブ環境ですぐに始める(もし、インストールのプロセスでワイヤレス接続が必要ならば)

現在のインストールメディアのライブ環境で、ワイヤレスドライバやユーティリリィーが利用出来るようになりました. あなたのワイヤレスハードウェアに関する知識は設定を成功させるための重要な鍵になります。 "ここのインストールで実行されている以下のクイックスタートの手順が、ライブ環境で使用すためにワイヤレスのハードウェアを初期化することに注意してください。"これらの手順(他のワイヤレスハードウェアの設定に関わることを含めて)は、実際にシステムをインストールし、再起動したあとに再び行わなければなりません。

ワイヤレス接続がインストールで必要ないのなら、これらのステップは任意だという事にも注意してください。; ワイヤレス接続の設定は、後にいつでも可能です。

基本的な設定です:

  • お好きなバーチャルコンソールに移動してください, 例).: <ALT>+F3
  • (任意)ワイヤレスインターフェィスとドライバーもジュールを特定します:
# lsmod | grep -i net
  • udevがドライバのロードを確実にします, and that the driver has created a usable wireless kernel interface with /usr/sbin/iwconfig:
# iwconfig

Example output:

lo no wireless extensions.
eth0 no wireless extensions.
wlan0    unassociated  ESSID:""
         Mode:Managed  Channel=0  Access Point: Not-Associated   
         Bit Rate:0 kb/s   Tx-Power=20 dBm   Sensitivity=8/0  
         Retry limit:7   RTS thr:off   Fragment thr:off
         Power Management:off
         Link Quality:0  Signal level:0  Noise level:0
         Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
         Tx excessive retries:0  Invalid misc:0   Missed beacon:0

wlan0 is the available wireless interface in the example.

  • Bring the interface up with /sbin/ifconfig <interface> up.

An example using the wlan0 interface:

# ifconfig wlan0 up

(Remember, your interface may be named something else, depending on your module (driver) and chipset: wlan0, eth1, etc.)

  • If the essid has been forgotten or is unknown, use /sbin/iwlist <interface> scan to scan for nearby networks.
# iwlist wlan0 scan
  • Specify the id of the chosen wireless network with iwconfig <interface> essid "<youressid>" key <your_wep_key> (give the essid (the 'network name') of the network in quotes).
  • An example using WEP and a hexadecimal key:
# iwconfig wlan0 essid "linksys" key 0241baf34c
  • An example using WEP and an ASCII passphrase:
# iwconfig wlan0 essid "linksys" key s:pass1
  • An example using an unsecured network:
# iwconfig wlan0 essid "linksys"
  • Request an IP address with /sbin/dhcpcd <interface> . e.g.:
# dhcpcd wlan0
  • Ensure you can route using /bin/ping:
# ping -c 3 www.google.com

Done.

  • For connecting to a network using WPA, consult the WPA Supplicant article, and continue below.
ワイヤレスチップセットにフォームウェアは必要か?

A small percentage of wireless chipsets also require firmware, in addition to a corresponding driver. If unsure, invoke /usr/bin/dmesg to query the kernel log for a firmware request from the wireless chipset:

# dmesg | grep firmware

Example output from an Intel chipset which requires and has requested firmware from the kernel at boot:

firmware: requesting iwlwifi-5000-1.ucode

If there is no output, it may be concluded that the system's wireless chipset does not require firmware.

Note: Wireless chipset firmware packages (for cards which require them) are pre-installed under /lib/firmware in the live environment, (on CD/USB stick) but must be explicitly installed to your actual system to provide wireless functionality after you reboot into it! Package selection and installation is covered below. Ensure installation of both your wireless module and firmware during the package selection step! See Wireless Setup if you are unsure about the requirement of corresponding firmware installation for your particular chipset. This is a very common error.

After the initial Arch installation is complete, you may wish to refer to Wireless Setup to ensure a permanent configuration solution for your installed system.

Return to vc/1 with <ALT>+F1. Continue with B: Set Clock

B: エディタの設定

C: 時間の設定

  • UTC - インストールするPCで起動するOSがUNIX-likeオペレーティングシステムだけの場合はこちらを選択してください。
  • localtime - Microsoft Windows OS等とマルチブート環境を構築する場合はこちらを選択してください。

D: ハードディスクの準備(Prepare Hard Drive)

Warning: -ハードディスクのパーティーションは該当するハードディスクのデータを破壊する可能性があります。大切なデーターがある場合はバックアップをとることを強く推奨します。
Note: 望むのであれば、Arch Linuxのインストールを始める前に GParted等のツールを使ってあらかじめパーティーションをしておくこともできます。 その場合、Arch Linuxのインストールにおけるパーティーションの条件を満たしている場合に限り Set Filesystem Mountpointsの項目から続きを行って下さい

これからパーティーションをするハードディスクの識別とレイアウトの確認を/sbin/fdiskでします。オプションの-lは小文字のLです。
別の仮想コンソールを開いて(<ALT>+F3)以下のコマンドを実行します:

# fdisk -l

現在のディスク及びパーティーション状況をメモしてインストールに備えてください

インストール画面に<ALT>+F1で戻ります 最初のメニューエントリー "Prepare Hard Drive"を選択してください

  • オプション 1: Auto Prepare(自動パーティーション)

自動パーティーションは以下のような設定にしたがってディスクを分割します:

  • ext2 /boot パーティーション, デフォルト サイズ 32MB. サイズを変更するのであればその値を入力して決定
  • swap パーティーション, デフォルト サイズ 256MB. サイズを変更するのであればその値を入力して決定
  • / と /home パーティーションがそれぞれ作成されます (サイズもそれぞれ指定できます)利用可能なファイルシステムは ext2, ext3, ext4, reiserfs, xfs と jfsです。 以下のことに注意して下さい / と /home パーティーションはともに同じファイルタイプになります。これは現在の自動パーティーションの仕様です。

ここで忠告しておきます!自動パーティーションは選択したハードディスクの内容を完全に消し去ります。インストーラーの表示する注意をよく読んで理解してください。くれぐれも間違ったハードディスクをパーティーションしないでください。

  • オプション 2: (これが推奨です) Partition Hard Drives (と cfdisk)

このオプションは、個人が使用するものとして最も強力なパーティーション能力を提供します。

GNU/Linuxに対する知識が経験豊富なユーザーで自分のシステム環境にそって自らの判断でパーティーションをカスタマイズする人はこの項を飛ばして D: Select Packagesまで進んでください。

Note: USB flashメモリーにインストールしようとしている人は "Installing Arch Linux on a USB key"の項を読んでください

Partition Hard Drives

パーティーション情報(Partition Info)

ディスクのパーティーションをするということは、そのディスク内を任意の区画(パーティーション)としてそれぞれ定義することです。それらは分割したディスクとして振る舞い、それらの上にファイルシステムが構築(フォーマット)されます。

  • 3っのタイプのパーティーション形態があります:
  1. Primary(プライマリ)
  2. Extended(拡張)
  3. Logical(論理)

Primary(プライマリ)パーティーションは起動可能です。 そして一つのディスクもしくはRAIDボリュームに対して4つまでプライマリ パーティションを作成できます。もし、パーティーション計画が4つ以上になる場合はextended(拡張)パーティーションを用いてその中にlogical(論理)パーティーションを内包する形で構成することが必須です。

extended(拡張)パーティーションはそれ自身では使えません; これらは単にlogical(論理)パーティーションの入れ物に過ぎません。必要ならば、一つのハードディスクに一つだけextended(拡張)パーティーションを作ることができ、それをさらにlogical(論理)パーティーションに分割して使います。

ディスクをパーティーションするときは、次のような法則があります。プライマリーパーティーションをsda1からsda2、sda3、と言う順番で番号を振っていき、extended(拡張)パーティーションはsda4になります。その中をlogical(論理)パーティーションがsda5, sda6,.....と言う具合につづきます

スワップパーティーション(Swap Partition)

スワップパーティーションは仮想RAMが実体を持つものとしてハードディスクドライブ上に配置された物で、実際のRAMでは補えないデータをカーネルがディスクを一時的な置き場所として簡単に使える ようにするために作られたものです。

成り立ちの上では、スワップパーティーションは物理的なメモリーの2倍が一般的なルールとして来ましたが、今日ではコンピューターがかつて手に入れることができなかったほど大容量のメモリを得るようになり、このルールは徐々に意味の無い物になってきています。一般に、512MBのRAMを持つマシンではこの"2倍ルール"は十分過ぎるほどです。1GBのRAMを持つマシンでは1倍ルールが妥当でしょう。もし、インストール対象のマシンがものすごく大量のRAM(more than 1024 MB)を持っているのならば、SWAPパーティーションの事はすっかり忘れてしまってもいいぐらいでしょう。とはいえ、こんなことは推奨されません(したの注意を参照して下さい)。1GBのスワップパーティーションは例としてこの様な形で使われます。

Note: サスペンド(ハイバネーション)機能を使うのであれば、スワップパーティーションは最低でもメモリーサイズと同量が必須になります。Archユーザーの中にはバットセクターがあった時のために実際のRAMより10-15%多めにとることが推奨だという人もいます。
パーティーション計画(Partition Scheme)

ディスクのパーティション計画はとても個人の好みによるところが大きいです。 それぞれのユーザーの決定は彼らのコンピュータを使う癖や条件によって様々なものになります。 もし、Arch LinuxとWindowsオペレーティングシステムのデュアルブートシステムを考えているのなら、 Windows and Arch Dual Bootを読んでください

それぞれのパーティーションに割り当てるファイルシステムの候補たち:

/(root)

root(ルート)はすべてのファイルシステムの根本で、ファイルシステムの最上部に位置づけられるものです。すべてのファイルとディレクトリ、物理的に異なったデバイスに保存されたファイルやディレクトリでさえ、ルートディレクトリである/の下に表示されます。ルートディレクトリー(ファイルシステム)の内容には、起動、リストア、復旧、修理等を行う事ができるファイルやプログラムが収められているべきです。
Note: /usr用のパーティションはデフォルトでは提供されていません。やむを得ず分ける必要がある場合は、mkinitcpio#/usr as a separate partitionを読んでください。

/boot

このディレクトリには、カーネルとRAMディスクイメージ、それに加えてブートローダの設定ファイル、ブートローダのstageファイルを含んでいます。また、カーネルがユーザ空間のプログラムを実行するまでのデータを格納します。これによって、保存されたマスターブートセクターとセクターマップファイルを含むかもしれません。このディレクトリは、起動に不可欠ですが、独自の任意のパーティション上に保持することができるという点で独特です。
Warning: /bootはべつにして、システム起動のために必要な基本ディレクトリは/と同じパーティーション上になければなりません。必要なディレクトリは/bin,/etc,/lib,/sbin/usrです。

/home

各システムユーザに対してサブディレクトリが提供されています。それぞれのユーザ自身のデータとアプリケーションのためのユーザ固有の設定ファイルを保存しています。

/usr

 / がファイルシステムの最上に位置するファイルシステムならば、/usr はその次に位置づけられるものです。過半数が複数のユーザーが使うためのユーティリティーとアプリケーションで、/usr は共有可能で読み込み専用です。このことが意味することは、/usr は複数のホスト間で共有可能で、書き込み禁止であるべきです(システムがupdate/upgradeするときは別)。ホスト専用のデーターや、時間の経過とともに変化するようなデーターはどこかよそに保存されるべきです。

/tmp

タスクが完了するまで、それぞれのプログラムの複数のインスタンスを防止するために使用することができる.lckといったファイルの一時記憶を必要とするプログラム用のディレクトリです。タスクが完了すると、.lckというファイルは自動的に削除されます。プログラムは、/tmp内のファイルやディレクトリはプログラムの呼び出しとファイルの間で保存されており、システムがブートされる度に/tmp以下ディレクトリは通常、削除されるということを前提にしてはいけません。

/var

spoolディレクトリやファイルなどの可変データ、管理用のデータおよびログ、pacmanのキャッシュ、ABSツリーなどが含まれます。読み取り専用として/usrをマウントすることを可能にするためにあります。歴史的に、システムの動作中(インストールとソフトウェアメンテナンスではない)に書き込まれている/usrに入ったすべてのものは、/var以下に存在する必要があります。
Note: /varは小さなファイルをたくさん保有します。ファイルシステムのタイプを選択する時にはこのことを念頭において考慮するべきです(/var を独立したパーティーションで作る場)。

全部いっしょにして一つのパーティションにインストールする事に比べて、ファイルシステムを分割することには、いくつかのアドバンテージがあります。:

  • セキュリティー:それぞれのファイルシステムに対してそれぞれの設定'nosuid', 'nodev', 'noexec', 'readonly', etcを /etc/fstabで指定できます
  • 安定性:書き込みのできるユーザーもしくはマルウェアがファイルシステムをゴミファイルでいっぱいにしてしまっても、それ以外のファイルシステム上で動作している重要なプログラムは影響を受けないで稼働できます。
  • スピード:頻繁に書き込みと削除のおこなわれるファイルシステムはファイルのフラグメントが発生します(フラグメントに対して有効な対策は絶対にそのファイルシステムを最大容量までいっぱいにしないことです)。

分割されたファイルシステムはお互いに影響を受けませんし、それぞれ別々にデフラグを実行することもできます。

  • 整合性:万が一ファイルシステムが壊れても分割されたファイルシステムには影響がありません。
  • 多様性:複数のシステムでデーターを共有する場合、独立したファイルシステムを採用した方が有利です。それぞれのファイルシステムの利用方法やデーターの特性に合わせて最適なファイルシステムのタイプを選択できます。

ここの例ではパーティーションを /,  /var,  /home, そして swap に分けるやり方で進めていきます。

パーティーションを分割しないことにも利点はあります。パーティーション計画は多様な条件により一つの正解と言える物がないので、最初から最も正しい選択をすることは大変むずかしく、それ自体が失敗を招く危険もあります。 将来の危険を恐れず、勇敢に一つのパーティションを採用すれば最後の1Mまでディスクを有効に使うことも可能です。 Windowsは誕生から今日まで一度もシステムそれ自身のパーティーションの分割を考慮していませんが立派に生き残っています。               "One for all, All for one." -anonymous 

パーティーションは実際どのくらいの大きさにすればいいの?

この質問に対する答えはそれぞれの個人の必要とするものに応じて違います。 あなたはシンプルにルートパーティーション一つと、swapパーティーション一つとか、ルートパーティーション一つ作ってswapなしにしてしまうか、もしくは下記の例を参考にこのガイドラインに書いてあることを熟慮して下の表のような結論を導き出すでしょう:
"俺のやり方の究極を突き詰めるのならばそれはシンプルであるということだ...シンプルであることは正義であると常に信じている。" - ブルース リー

  •  この例のルート(/)ファイルシステムは /usr を含んでいて、ある程度は大きくなっていくでしょう(あなたがどれだけソフトウェアーをインストールするかによります)。15-20 GBあればほとんどの人にとって十分だと言って間違いありません。
  •  Arch Linuxの /var ファイルシステムはLinuxにおける一般の/var ファイルに加えて以下のArch特有のデーターを保存します。ABS(非常にたくさんの小さなファイルです)。pacmanのキャッシュ。pacmanのキャッシュを保存し続けることはいろいろな面で有効です:必要な時にパッケージのダウングレードを可能にします。/varのサイズの増大は時の経過とともにpacmanのキャッシュが増大することによって引き起こされる傾向にあります。じかし、必要に応じて安全にキャッシュクリアすることもできます。 もしSSDを使っているのなら /varだけ他のHDDに移動してSSDに対する不要な読み込み/書き込みを回避したいと思うかもしれません。デスクトップ用途の/var用には 6-8 GBあれば十分過ぎるでしょう。サーバー用途では/varファイルシステムが極度にお大きくなる可能性があります。
  • /home は一般にユーザーのデーターが置かれるところであり、ダウンロードファイルの保存場所であり、音声/動画を保存する場所でもあります。デスクトップシステムにおいて/home は通常最も大きいファイルシステムであり、最も大きく余裕をとるべきです。 覚えておいてください。もしArch linuxを再インストールする場合、インストールにおいて/homeに保存されたデーターはまったく変更されません(/homeが独立したパーティーションの場合)。
  • これらのそれぞれのファイルシステムに25%ほど足して余裕を持たせておけばシステムの拡張、フラグメントの予防、その他の不確定要素の出来事にも柔軟に対応出来るでしょう。

以上このガイダンスに照らし合わせるとこの例のシステムは(/)パーティーション~15GB 、/var ~7GB、swap 1GB、 /homeに残り全部と言う感じになります

パーティーションの作成:cfdisk

(/) rootを含むプライマリーパーティーションの作成から始めます。

Newを選択して -> Primary そして(/)に希望する数値(サイズ)を入力して、ハードディスクの先頭(beginning of the disk)にパーティーションを作成して下さい。

次にTypeを選択して '83 Linux'を選んでください。作成された/パーティーションはsda1 としてこの例では表示されるでしょう。

今度はプライマリーパーティーション/varを作成します。タイプは同様にType 83 Linuxです。作成された /varはsda2と表示されるでしょう。

次はswapです。適当ななサイズを入力し、ファイルType は 82 (Linux swap / Solaris)を選んでください。作成されたswapはsda3と表示されるでしょう。

最後に、/homeを作成します。4つ目のプラーマリーパーティーションを作成し、同様のやり方で作成して下さい。 Type は83 Linux。作成された/homeはsda4と表示されるでしょう。

Example:

Name    Flags     Part Type    FS Type           [Label]         Size (MB)
-------------------------------------------------------------------------
sda1               Primary     Linux                             15440 #root
sda2               Primary     Linux                             6256  #/var
sda3               Primary     Linux swap / Solaris              1024  #swap
sda4               Primary     Linux                             140480 #/home

Write を選択して'yes'とタイプします。 注意して下さい!この操作はあなたのハードディスク上のデーターを破壊します。 最後にQuitを選択して一つ前の画面に戻り、 Doneを選択してこのメニューを終了してメインメニューの"Set Filesystem Mountpoints"に移ります。

Note: libata と PATA modulesを含む最新のLinux kernelではIDE, SATA と SCSIドライブを sdx'と言う名前で接続します。これは完全に正常な事でこのことに関してなにか心配する必要はありません

ファイルシステムのマウントポイントの設定(Set Filesystem Mountpoints)

まず最初にswapパーティーションをどこに設定するか質問されます。 適切なパーティーションを選んでください(この例ではsda3です)。実際にswapパーティーションを作成していいか質問されるので:yesと答えます。次に、どこに / (root)を設定するか決めます(この例ではsda1)。この時点でどのファイルシステムのタイプにするか設定します。

ファイルシステムファイル(Filesystem Types)

繰り返しになりますが、ファイルシステムタイプの決定はしばしば議論になる事柄で突き詰めれば個人の使用法や好みの問題になります。それぞれに長所と短所があり、それぞれの特質があります。
ここではサポートするファイルシステムタイプのとても簡単な説明をします:

1. ext2 Second Extended Filesystem- 古くからあり、信頼できるGNU/Linuxのファイルシステム。とても安定していますがジャーナリングをサポートしていません。fsckにとても時間がかかるので、おそらくroot (/) と /homeパーティーションには不向きです。ext2ファイルシステムはext3に簡単に変換出来ます。 一般的には/bootのファイルシステムとして良いとされています。

2. ext3 Third Extended Filesystem- 本質的にext2ですがジャーナリングをサポートしています。 ext3はext2と完全に互換があります。 非常に安定していて、成熟しており、多目的な使用において最も適しています。GNU/Linuxのファイルシステムとして開発とサポートがなされています。

High Performance Filesystems:

3. ext4 Fourth Extended Filesystem- ext4はext2とext3に対して後方互換(ext3、ext2をext4としてmountできる)。ボリュームサイズで最大1 exabyte(エクサバイト)、単一のファイルとして最大16 terabyte(テラバイト)までサポート。ext3においてサブディレクトリーが32,000までだったのに対して、ext4では64,000までサポート。 オンラインでデフラグが可能。

Note: ext4 は新しいファイルシステムで十分に検証されていません

4. ReiserFS (V3)- Hans Reiser's high-performance journaling FS uses a very interesting method of data throughput based on an unconventional and creative algorithm. ReiserFS is touted as very fast, especially when dealing with many small files. ReiserFS is fast at formatting, yet comparatively slow at mounting. Quite mature and stable. ReiserFS is not actively developed at this time (Reiser4 is the new Reiser filesystem). Generally regarded as a good choice for /var/.

5. JFS - IBM's Journaled FileSystem- The first filesystem to offer journaling. JFS had many years of use in the IBM AIX® OS before being ported to Linux. JFS currently uses the least CPU resources of any GNU/Linux filesystem. Very fast at formatting, mounting and fsck's, and very good all-around performance, especially in conjunction with the deadline I/O scheduler. (See JFS.) Not as widely supported as ext or ReiserFS, but very mature and stable.

6. XFS - Another early journaling filesystem originally developed by Silicon Graphics for the IRIX OS and ported to Linux. XFS offers very fast throughput on large files and large filesystems. Very fast at formatting and mounting. Generally benchmarked as slower with many small files, in comparison to other filesystems. XFS is very mature and offers online defragmentation ability.

  • JFS and XFS filesystems cannot be shrunk by disk utilities (such as gparted or parted magic)
ジャーナリングについて

All above filesystems, except ext2, utilize journaling. Journaling file systems are fault-resilient file systems that use a journal to log changes before they are committed to the file system to avoid metadata corruption in the event of a crash. Note that not all journaling techniques are alike; specifically, only ext3 and ext4 offer data-mode journaling, (though, not by default), which journals both data and meta-data (but with a significant speed penalty). The others only offer ordered-mode journaling, which journals meta-data only. While all will return your filesystem to a valid state after recovering from a crash, data-mode journaling offers the greatest protection against file system corruption and data loss but can suffer from performance degradation, as all data is written twice (first to the journal, then to the disk). Depending upon how important your data is, this may be a consideration in choosing your filesystem type.

Moving on...

Choose and create the filesystem (format the partition) for / by selecting yes. You will now be prompted to add any additional partitions. In our example, sda2 and sda4 remain. For sda2, choose a filesystem type and mount it as /var. Finally, choose the filesystem type for sda4, and mount it as /home. Return to main menu.

E:パッケージの選択

  • Core ISO: Choose CD as source and select the appropriate CD drive if more than one exist on the installation machine.
  • Netinstall: Select an FTP/HTTP mirror. Note that archlinux.org is throttled to 50KB/s.

Package selection is split into two stages. First, select the package category:

Note: For expedience, all packages in base are selected by default. Use the space-bar to select and de-select packages.
  • Base: The minimal base environment. Always select it and only remove packages that will not be used.
  • Base-devel: Extra tools such as make, automake and wireless-tools as well as wireless firmwares. Most beginners should choose to install it, and will probably need it later.

After category selection, you will be presented with the full lists of packages, allowing you to fine-tune your selections. Use the space bar to select and unselect.

Note: If you are going to require connection to a wireless network with WPA encryption, consider installing netcfg2 (as well as wireless_tools), which will enable you to do so.

Adter selecting the needed packages, leave the selection screen and continue to the next step, Install Packages.

F: インストールパッケージ

Next, choose 'Install Packages'. You will be asked if you wish to keep the packages in the pacman cache. If you choose 'yes', you will have the flexibility to downgrade to previous package versions in the future, so this is recommended (you can always clear the cache in the future). The installer script will now install the selected packages, as well as the default Arch 2.6 kernel, to your system.

  • Netinstall: The Pacman package manager will now download and install your selected packages. (See vc/5 for output, vc/1 to return to the installer)
  • Core image: The packages will be installed from the CD/USB stick.

G: システムの設定

Closely following and understanding these steps is of key importance to ensure a properly configured system.

At this stage of the installation, you will configure the primary configuration files of your Arch Linux base system.

Previous versions of the installer included hwdetect to gather information for your configuration. This has been deprecated, and udev should handle most module loading automatically at boot.

The initramfs

The initial ram filesystem, or initramfs, is a temporary file system used by the kernel during boot. It is used for making preparations like hardware detection and module loading, before the real root file system can be mounted. Therefore, an initramfs allows for the use of a generic modular kernel for a wide variety of hardware, and without the need to compile a custom kernel for each installation.

You will be prompted by a series of questions related to the configuration of your initramfs. You will be asked if you need support for booting from USB devices, FireWire devices, PCMCIA devices, NFS shares, software RAID arrays, LVM2 volumes, encrypted volumes, and DSDT support. Choose yes if you need it; in our example nothing is needed. Choosing 'yes' for any of the above will cause the installer script to place the appropriate hook(s) within the /etc/mkinitcpio.conf file.

Now you will be asked which text editor you want to use; choose nano, joe or vi. You will be presented with a menu including the main configuration files for your system.

Note: It is very important at this point to edit, or at least verify by opening, every configuration file. The installer script relies on your input to create these files on your installation. A common error is to skip over these critical steps of configuration.
インストローラーにシステムの設定を組み込んで、インストールを自動化させることは出来ないのか?

Hiding the process of system configuration is in direct opposition to The Arch Way. While it is true that recent versions of the kernel and hardware probing tools offer excellent hardware support and auto-configuration, Arch presents the user all pertinent configuration files during installation for the purposes of transparency and system resource control. By the time you have finished modifying these files to your specifications, you will have learned the simple method of manual Arch Linux system configuration and become more familiar with the base structure, leaving you better prepared to use and maintain your new installation productively.

Moving on...

/etc/rc.conf

Arch Linux uses the file /etc/rc.conf as the principal location for system configuration. This one file contains a wide range of configuration information, principally used at system startup. As its name directly implies, it also contains settings for and invokes the /etc/rc* files, and is, of course, sourced by these files.

LOCALIZATION section
  • LOCALE=: This sets your system locale, which will be used by all i18n-aware applications and utilities. You can get a list of the available locales by running 'locale -a' from the command line. This setting's default is fine for US English users.
  • HARDWARECLOCK=: Specifies whether the hardware clock, which is synchronized on boot and on shutdown, stores UTC time, or the localtime=: UTC makes sense because it greatly simplifies changing timezones and daylight savings time. localtime is necessary if you dual boot with an operating system such as Windows, that only stores localtime to the hardware clock.
  • USEDIRECTISA=: Use direct I/O request instead of /dev/rtc for hwclock
  • TIMEZONE=: Specify your TIMEZONE. (All available zones are under /usr/share/zoneinfo/).
  • KEYMAP=: The available keymaps are in /usr/share/kbd/keymaps. Please note that this setting is only valid for your TTYs, not any graphical window managers or X.
  • CONSOLEFONT=: Available console fonts reside under /usr/share/kbd/consolefonts/ if you must change. The default (blank) is safe.
  • CONSOLEMAP=: Defines the console map to load with the setfont program at boot. Possible maps are found in /usr/share/kbd/consoletrans, if needed. The default (blank) is safe.
  • USECOLOR=: Select "yes" if you have a color monitor and wish to have colors in your consoles.
LOCALE="en_US.utf8"
HARDWARECLOCK="localtime"
USEDIRECTISA="no"
TIMEZONE="US/Eastern"
KEYMAP="us"
CONSOLEFONT=
CONSOLEMAP=
USECOLOR="yes"
HARDWARE Section
  • MOD_AUTOLOAD=: Setting this to "yes" will use udev to automatically probe hardware and load the appropriate modules during boot, (convenient with the default modular kernel). Setting this to "no" will rely on the user's ability to specify this information manually, or compile their own custom kernel and modules, etc.
  • MOD_BLACKLIST=: This has become deprecated in favor of adding blacklisted modules directly to the MODULES= line below.
  • MODULES=: Specify additional MODULES if you know that an important module is missing. If your system has any floppy drives, add "floppy". If you will be using loopback filesystems, add "loop". Also specify any blacklisted modules by prefixing them with a bang (!). Udev will be forced NOT to load blacklisted modules. In the example, the IPv6 module as well as the annoying pcspeaker are blacklisted.
# Scan hardware and load required modules at boot
MOD_AUTOLOAD="yes"
# Module Blacklist - Deprecated
MOD_BLACKLIST=()
#
MODULES=(!net-pf-10 !snd_pcsp !pcspkr loop)
NETWORKING Section
  • HOSTNAME=:Set your HOSTNAME to your liking.
  • eth0=: 'Ethernet, card 0'. Adjust the interface IP address, netmask and broadcast address if you are using static IP. Set eth0="dhcp" if you want to use DHCP
  • INTERFACES=: Specify all interfaces here.
  • gateway=: If you are using static IP, set the gateway address. If using DHCP, you can usually ignore this variable, though some users have reported the need to define it.
  • ROUTES=: If you are using static IP, remove the ! in front of 'gateway'. If using DHCP, you can usually leave this variable commented out with the bang (!), but again, some users require the gateway and ROUTES defined. If you experience networking issues with pacman, for instance, you may want to return to these variables.
Example, using a dynamically assigned IP address (DHCP)
HOSTNAME="arch"
#eth0="eth0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255"
eth0="dhcp"
INTERFACES=(eth0)
gateway="default gw 192.168.0.1"
ROUTES=(!gateway)
Note: Arch uses the dhcpcd DHCP client. Alternatively, dhclient is available from the [extra] repository via pacman.
Tip: /etc/conf.d/dhcpcd may be edited to keep the dhcpcd daemon from overwriting /etc/resolv.conf. This is useful, for example, if you want a static assignment of search and nameservers.

Example /etc/conf.d/dhcpcd modified to prevent the daemon from overwriting /etc/resolv.conf:

# Arguments to be passed to the DHCP client daemon
# DHCPCD_ARGS="-q"
DHCPCD_ARGS="-C resolv.conf -q"
Example, using a static IP address
HOSTNAME="arch"
eth0="eth0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255"
INTERFACES=(eth0)
gateway="default gw 192.168.0.1"
ROUTES=(gateway)
Tip: If using a non-standard MTU size (a.k.a. jumbo frames) is desired AND the installation machine hardware supports them, see the Jumbo Frames wiki article for further configuration.
Note: In some cases, users will need to modify their /etc/resolv.conf to prevent the dhcpcd daemon from overwriting the DNS entries.

Modify /etc/resolv.conf to contain the DNS servers of choice. Example:

search my.isp.net.
nameserver 4.2.2.1
nameserver 4.2.2.2
nameserver 4.2.2.3
DAEMONS Section

This array simply lists the names of those scripts contained in /etc/rc.d/ which are to be started during the boot process, and the order in which they start.

DAEMONS=(network @syslog-ng netfs @crond)
  • If a script name is prefixed with a bang (!), it is not executed.
  • If a script is prefixed with an "at" symbol (@), it shall be executed in the background; the startup sequence will not wait for successful completion of each daemon before continuing to the next. (Useful for speeding up system boot). Do not background daemons that are needed by other daemons. For example "mpd" depends on "network", therefore backgrounding network may cause mpd to break.
  • Edit this array whenever new system services are installed, if starting them automatically during boot is desired.
Note: This 'BSD-style' init, is the Arch way of handling what other distributions handle with various symlinks to an /etc/init.d directory.
About DAEMONS

The daemons line need not be changed at this time, but it is useful to explain what daemons are, as they will be addressed later in this guide. A daemon is a program that runs in the background, waiting for events to occur and offering services. A good example is a webserver that waits for a request to deliver a page (e.g.:httpd) or an SSH server waiting for a user login (e.g.:sshd). While these are full-featured applications, there are also daemons whose work is not that visible. Examples are a daemon which writes messages into a log file (e.g. syslog, metalog), a daemon which lowers the CPU frequency if the system has nothing to do (e.g.:cpufreq), and a daemon which provides a graphical login (e.g.: gdm, kdm). All these programs can be added to the daemons line and will be started when the system boots. Useful daemons will be presented during this guide.

Historically, the term daemon was coined by the programmers of MIT's Project MAC. They took the name from Maxwell's demon, an imaginary being from a famous thought experiment that constantly works in the background, sorting molecules. UNIX systems inherited this terminology and created the backronym disk and execution monitor.

Tip: All Arch daemons reside under /etc/rc.d/

/etc/fstab

The fstab (for file systems table) is part of the system configuration listing all available disks and disk partitions, and indicating how they are to be initialized or otherwise integrated into the overall system's filesystem. The /etc/fstab file is most commonly used by the mount command. The mount command takes a filesystem on a device, and adds it to the main system hierarchy that you see when you use your system. mount -a is called from /etc/rc.sysinit, about 3/4 of the way through the boot process, and reads /etc/fstab to determine which options should be used when mounting the specified devices therein. If noauto is appended to a filesystem in /etc/fstab, mount -a will not mount it at boot.

An example /etc/fstab
# <file system>        <dir>        <type>        <options>                 <dump>    <pass>
none                   /dev/pts     devpts        defaults                       0         0
none                   /dev/shm     tmpfs         defaults                       0         0
#/dev/cdrom            /media/cdrom   auto        ro,user,noauto,unhide          0         0
#/dev/dvd              /media/dvd     auto        ro,user,noauto,unhide          0         0
#/dev/fd0              /media/fl      auto        user,noauto                    0         0
/dev/disk/by-uuid/0ec-933.. /          jfs        defaults,noatime               0         1
/dev/disk/by-uuid/7ef-223.. /home      jfs        defaults,noatime               0         2
/dev/disk/by-uuid/530-1e-..  swap     swap        defaults                       0         0
/dev/disk/by-uuid/4fe-110.. /var     reiserfs     defaults,noatime,notail        0         2
Note: The 'noatime' option disables writing read access times to the metadata of files and may safely be appended to / and /home regardless of your specified filesystem type for increased speed, performance, and power efficiency. 'notail' disables the ReiserFS tailpacking feature, for added performance at the cost of slightly less efficient disk usage.
Note: It may be beneficial to make a note of the UUID of the root (/) partition, as this may be required during GRUB configuration.
  • <file system>: describes the block device or remote filesystem to be mounted. For regular mounts, this field will contain a link to a block device node (as created by mknod which is called by udev at boot) for the device to be mounted; for instance, '/dev/cdrom' or '/dev/sda1'. Instead of giving the device explicitly, the Arch installer indicates the filesystem that is to be mounted by its UUID by default.
Note: As of 2008-04rc, Arch is now utilizing the UUID, or Universally Unique Identifier naming convention, for consistent device mapping. This is due to active developments in the kernel and also udev, which may randomly change the ordering in which drivers for storage controllers are loaded, yielding an unbootable system/kernel panic. Nearly every motherboard has several controllers (onboard SATA, onboard IDE), and due to the aforementioned development updates, /dev/sda may become /dev/sdb on the next reboot- hence the persistent device naming convention of UUID has been adopted for reliability. If you do not need nor wish to use UUID, simply change your fstab to use whatever naming convention desired. (See this wiki article for more information on persistent block device naming. )

ls -lF /dev/disk/by-uuid/ will list all partitions by UUID, while /sbin/blkid will show a list correlating each partition with its label, filesystem type and UUID.
Note: this command is installed by the e2fsprogs package.

  • <dir>: describes the mount point for the filesystem. For swap partitions, this field should be specified as 'swap'; (Swap partitions are not actually mounted.)
  • <type>: describes the type of the filesystem. The Linux kernel supports many filesystem types. (For the filesystems currently supported by the running kernel, see /proc/filesystems). An entry 'swap' denotes a file or partition to be used for swapping. An entry 'ignore' causes the line to be ignored. This is useful to show disk partitions which are currently unused.
  • <options>: describes the mount options associated with the filesystem. It is formatted as a comma separated list of options with no intervening spaces. It contains at least the type of mount plus any additional options appropriate to the filesystem type. For documentation on the available options for non-nfs file systems, see mount(8).
  • <dump>: used by the dump(8) command to determine which filesystems are to be dumped. dump is a backup utility. If the fifth field is not present, a value of zero is returned and dump will assume that the filesystem does not need to be backed up. Note that dump is not installed by default.
  • <pass>: used by the fsck(8) program to determine the order in which filesystem checks are done at boot time. The root filesystem should be specified with a <pass> of 1, and other filesystems should have a <pass> of 2 or 0. Filesystems within a drive will be checked sequentially, but filesystems on different drives will be checked at the same time to utilize parallelism available in the hardware. If the sixth field is not present or zero, a value of zero is returned and fsck will assume that the filesystem does not need to be checked.
  • If you plan on using hal to automount media such as DVDs, you may wish to comment out the cdrom and dvd entries in preparation for hal, which will be installed later in this guide.

Expanded information available in the Fstab wiki entry.

/etc/mkinitcpio.conf

This file allows further fine-tuning of the initial ram filesystem, or initramfs, (also historically referred to as the initial ramdisk or "initrd") for your system. The initramfs is a gzipped image that is read by the kernel during boot. As explained above, the purpose of the initramfs is to bootstrap the system to the point where it can access the root filesystem. This means it has to load any modules that are required for devices like IDE, SCSI, or SATA drives (or USB/FW, if you are booting off a USB/FW drive). Once the initrramfs loads the proper modules, either manually or through udev, it passes control to the kernel and your boot continues. For this reason, the initramfs only needs to contain the modules necessary to access the root filesystem. It does not need to contain every module you would ever want to use. The majority of your everyday modules will be loaded later on by udev, during the init process.

mkinitcpio is the next generation of initramfs creation. It has many advantages over the old mkinitrd and mkinitramfs scripts.

  • It uses klibc and kinit which are developed by Linux kernel devs to provide a small and lightweight base for early userspace.
  • It can use udev for hardware autodetection at runtime, thus prevents you from having tons of unnecessary modules loaded.
  • Its hook-based init script is easily extendable with custom hooks, which can easily be included in pacman packages without having to modifiy mkinitcpio itself.
  • It already supports lvm2, dm-crypt for both legacy and luks volumes, raid, swsusp and suspend2 resuming and booting from usb mass storage devices.
  • Many features can be configured from the kernel command line without having to rebuild the image.
  • The mkinitcpio script makes it possible to include the image in a kernel, thus making a self-contained kernel image is possible.
  • Its flexibility makes recompiling a kernel unnecessary in many cases.

If you are using a non-US keyboard you may want to add "keymap" to the "HOOKS=" section of /etc/mkinitcpio.conf to load your local keymap during boot, e.g.:

HOOKS="base udev autodetect pata scsi sata filesystems keymap"

Otherwise if boot fails for some reason you will be asked to enter root's password for system maintenance but will be unable to do so.

If you are using a US keyboard editing this configuration should be unnecessary at this point.

mkinitcpio was developed by Aaron Griffin and Tobias Powalowski with some help from the community.

/etc/modprobe.d/modprobe.conf

It is unnecessary to configure this file at this time.

  • modprobe.conf can be used to set special configuration options for the kernel modules
Note: The new module-init-tools 3.8 package changes the location of the configuration file: /etc/modprobe.conf is no longer read, instead /etc/modprobe.d/modprobe.conf is used. link

/etc/resolv.conf (for Static IP)

The resolver is a set of routines in the C library that provide access to the Internet Domain Name System (DNS). One of the main functions of DNS is to translate domain names into IP addresses, to make the Web a friendlier place. The resolver configuration file, or /etc/resolv.conf, contains information that is read by the resolver routines the first time they are invoked by a process.

  • If you are using DHCP, you may safely ignore this file, as by default, it will be dynamically created and destroyed by the dhcpcd daemon. You may change this default behavior if you wish. (See Network).

If you use a static IP, set your DNS servers in /etc/resolv.conf (nameserver <ip-address>). You may have as many as you wish. An example, using OpenDNS:

nameserver 208.67.222.222
nameserver 208.67.220.220

If you are using a router, you will probably want to specify your DNS servers in the router itself, and merely point to it from your /etc/resolv.conf, using your router's IP (which is also your gateway from /etc/rc.conf), e.g.:

nameserver 192.168.1.1

If using DHCP, you may also specify your DNS servers in the router, or allow automatic assignment from your ISP, if your ISP is so equipped.

/etc/hosts

This file associates IP addresses with hostnames and aliases, one line per IP address. For each host a single line should be present with the following information:

<IP-address> <hostname> [aliases...]

Add your hostname, coinciding with the one specified in /etc/rc.conf, as an alias, so that it looks like this:

127.0.0.1   localhost.localdomain   localhost yourhostname
Note: This format, including the 'localhost' and your actual host name, is required for program compatibility! So, if you have named your computer Archhost, then that line above should look like this:
127.0.0.1   localhost.localdomain   localhost Archhost
Errors in this entry may cause poor network performance and/or certain programs to open very slowly, or not work at all. This is a very common error for beginners.

If you use a static IP, add another line using the syntax: <static-IP> <hostname.domainname.org> <hostname> e.g.:

192.168.1.100 yourhostname.domain.org  yourhostname
Tip: For convenience, you may also use /etc/hosts aliases for hosts on your network, and/or on the Web, e.g.:
64.233.169.103   www.google.com   g
192.168.1.90   media
192.168.1.88   data
The above example would allow you to access google simply by typing 'g' into your browser, and access to a media and data server on your network by name and without the need for typing out their respective IP addresses.

/etc/hosts.deny and /etc/hosts.allow

Modify these configurations according to your needs if you plan on using the ssh daemon. The default configuration will reject all incoming connections, not only ssh connections. Edit your /etc/hosts.allow file and add the appropriate parameters:

  • let everyone connect to you
sshd: ALL
  • restrict it to a certain ip
sshd: 192.168.0.1
  • restrict it to your local LAN network (range 192.168.0.0 to 192.168.0.255)
sshd: 192.168.0.
  • OR restrict for an IP range
sshd: 10.0.0.0/255.255.255.0

If you do not plan on using the ssh daemon, leave this file at the default, (empty), for added security.

/etc/locale.gen

The /usr/sbin/locale-gen command reads from /etc/locale.gen to generate specific locales. They can then be used by glibc and any other locale-aware program or library for rendering text, correctly displaying regional monetary values, time and date formats, alphabetic idiosyncrasies, and other locale-specific standards. The ability to setup a default locale is a great built-in privilege of using a UNIX-like operating system.

By default /etc/locale.gen is an empty file with commented documentation. Once edited, the file remains untouched. locale-gen runs on every glibc upgrade, generating all the locales specified in /etc/locale.gen.

Choose the locale(s) you need (remove the # in front of the lines you want), e.g.:

en_US ISO-8859-1
en_US.UTF-8	

The installer will now run the locale-gen script, which will generate the locales you specified. You may change your locale in the future by editing /etc/locale.gen and subsequently running 'locale-gen' as root.

Note: If you fail to choose your locale, this will lead to a "The current locale is invalid..." error. This is perhaps the most common mistake by new Arch users, and also leads to the most commonly asked questions on the forum.

Pacman-Mirror

Choose a mirror repository for pacman.

  • archlinux.org is throttled, limiting downloads to 50KB/s

Root password

Finally, set a root password and make sure that you remember it later. Return to the main menu and continue with installing bootloader.

H: ブートローダのインストール

Because we have no secondary operating system in our example, we will need a bootloader. GNU GRUB is the recommended bootloader. Alternatively, you may choose LILO.

GRUB

The provided GRUB configuration (/boot/grub/menu.lst) should be sufficient, but verify its contents to ensure accuracy (specifically, ensure that the root (/) partition is specified by UUID on line 3). You may want to alter the resolution of the console by adding a vga=<number> kernel argument corresponding to your desired virtual console resolution. (A table of resolutions and the corresponding numbers is printed in the menu.lst.)

Example:

title  Arch Linux (Main)
root   (hd0,0) 
kernel /boot/vmlinuz26 root=/dev/disk/by-uuid/0ec1-9339.. ro vga=773
initrd /boot/kernel26.img
Note: The linux kernel, 'vmlinuz', is so named because it incorporated virtual memory capability early in its development. The z denotes a zipped (compressed) image.

Explanation:

Line 1: title: A printed menu selection. "Arch Linux (Main)" will be printed on the screen as a menu selection.

Line 2: root: GRUB's root; the drive and partition where the kernel (/boot) resides, according to system BIOS. (More accurately, where GRUB's stage2 file resides). NOT necessarily the root (/) file system, as they can reside on separate partitions. GRUB's numbering scheme starts at 0, and uses an hdx,x format regardless of IDE or SATA, and enclosed within parentheses.

The example indicates that /boot is on the first partition of the first drive, according to BIOS, or, (hd0,0).

Line 3: kernel: This line specifies:

  • The path and filename of the kernel relative to GRUB's root.

In the example, /boot is merely a directory residing on the same partition as / and vmlinuz26 is the kernel filename; /boot/vmlinuz26. If /boot were on a separate partition, the path and filename would be simply /vmlinuz26, being relative to GRUB's root.

  • The root= argument to the kernel statement specifies the partition containing the root (/) directory in the booted system, (more accurately, the partition containing /sbin/init). If not already specified, you should enter the name of the partition, according to the UUID numbering scheme, using the /dev/disk/by-uuid/xxxx-xxxx-xxxx format. This UUID was found in the previous section regarding configuration of /etc/fstab.
  • An easy way to distinguish the 2 appearances of 'root' in /boot/grub/menu.lst is to remember that the first root statement informs GRUB where the kernel resides, whereas the second root= kernel argument tells the kernel where the root filesystem (/) resides.
  • Kernel options.

In our example, ro mounts the filesystem as read only during startup, (usually a safe default; you may wish to change this in case it causes problems booting) and the "vga=773" argument will give a 1024x768 framebuffer with 256 color depth.

Line 4: initrd: (For Initial RAM disk) The path and filename of the initial RAM filesystem relative to GRUB's root. Again, in the example, /boot is merely a directory residing on the same partition as / and kernel26.img is the initrd filename; /boot/kernel26.img. If /boot were on a separate partition, the path and filename would be simply /kernel26.img, being relative to GRUB's root.

Install the GRUB bootloader (to the master boot record, sda in our example).

Tip: For more details, see the GRUB wiki page.

I: Reboot

That's it; You have configured and installed your Arch Linux base system. Exit the install, and reboot:

# reboot

(Be sure to remove the installer CD)

パート II: 新しいArch Linuxのべースシステムを設定してアップグレードする

Your new Arch Linux system will boot up and finish with a login prompt (you may want to change the boot order in your BIOS back to booting from hard disk).

Congratulations, and welcome to your new Arch Linux base system!

Your new Arch Linux base system is now a functional GNU/Linux environment ready for customization. From here, you may build this elegant set of tools into whatever you wish or require for your purposes.

Login with the root account. We will configure pacman and update the system as root, then add a normal user.

Note: Virtual consoles 1-6 are available. You may swap between them with ALT+F1...F6

ステップ 1: ネットワークの設定(必要ならば)

  • This section will assist you in configuring most types of networks, if your network configuration is not working for you.

If you properly configured your system, you should have a working network. Try to ping www.google.com to verify this.

# ping -c 3 www.google.com

If you have successfully established a network connection, continue with Update, Sync and Upgrade the system with pacman.

If, after trying to ping www.google.com, an "unknown host" error is received, you may conclude that your network is not properly configured. You may choose to double-check the following files for integrity and proper settings:

/etc/rc.conf # Specifically, check your HOSTNAME= and NETWORKING section for typos and errors.

/etc/hosts # Double-check your format. (See above.)

/etc/resolv.conf # If you are using a static IP. If you are using DHCP, this file will be dynamically created and destroyed by default, but can be changed to your preference. (See Network.)

Tip: Advanced instructions for configuring the network can be found in the Network article.

有線LAN

Check your Ethernet with

# ifconfig -a

All interfaces will be listed. You should see an entry for eth0, or perhaps eth1.

  • 静的IP

If required, you can set a new static IP with:

# ifconfig eth0 <ip address> netmask <netmask> up 

and the default gateway with

# route add default gw <ip address of the gateway>

Verify that /etc/resolv.conf contains your DNS server and add it if it is missing. Check your network again with ping www.google.com. If everything is working now, adjust /etc/rc.conf as described above for static IP.

  • DHCP

If you have a DHCP server/router in your network try:

# dhcpcd eth0

If this is working, adjust /etc/rc.conf as described above, for dynamic IP.

無線LAN

  • Ensure the driver has created a usable interface:
# iwconfig
  • Bring the interface up with ifconfig <interface> up. e.g.:
# ifconfig wlan0 up
  • (Optional) Scan for available access points:
# iwlist wlan0 scan | less
  • Specify the id of the wireless network with iwconfig <interface> essid <youressid>. Or, if using WEP; iwconfig <interface> essid <youressid> key <yourwepkey>, e.g.:
# iwconfig wlan0 essid linksys key ABCDEF01234
  • Request an IP address with dhcpcd <interface>. e.g.:
# dhcpcd wlan0
  • Ensure you can route:
$ ping -c 3 www.google.com

Done.

Detailed setup guide: Wireless Setup

アナログモデム

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 password 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. With udev, your serial ports usually are /dev/tts/0 and /dev/tts/1.

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 indulge 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 will not 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, and available online. The type parameter depends on your card; a list of all possible types can 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/everything.log 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 have confirmed that your card works with certain settings, you can add the module options to your /etc/modprobe.d/modprobe.conf:

alias ippp0 hisax
options hisax type=18 protocol=2

Alternatively, you can add only the options line here, and add hisax to your MODULES array in the rc.conf. It's 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 separated by a colon if you use US NI1.

After you have 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 dial-up connection with

# isdnctrl dial ippp0

as root. If you have any problems, remember to check the logfiles!

DSL (PPPoE)

These instructions are relevant to you only 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 separate 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 pppoe-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' at boot, add adsl to your DAEMONS array, and put a ! before the network entry, since the network is handled by adsl now.

Step 2: Update, Sync, and Upgrade the system with pacman

Now we will update the system using pacman.

pacmanとは何か ?

Pacman is the package manager of Arch Linux. Pacman is written in C and is designed from the ground up to be lightweight with a very modest memory footprint, fast, simple, and versatile. It manages your entire package system and handles installation, removal, package downgrade (through cache), custom compiled package handling, automatic dependency resolution, remote and local searches and much more. Pacman's output is streamlined, very readable and provides ETA for each package download. Arch uses the .tar.gz package format, which further enhances pacman's speed; Gzipped tarballs, though slightly larger, are decompressed many times faster than their Bzipped counterparts, and are therefore installed much more expediently.

We will use pacman to download software packages from remote repositories and install them onto your system.

Pacman is the most important tool in your Arch Linux toolbox for building the base system into whatsoever you please.

Packageリポジトリと /etc/pacman.conf

Arch currently offers the following 4 repositories readily accessible through pacman:

[core]

The simple principle behind [core] is to provide only one of each necessary tool for a base Arch Linux system; The GNU toolchain, the Linux kernel, one editor, one command line browser, etc. (There are a few exceptions to this. For instance, both vi and nano are provided, allowing the user to choose one or both.) It contains all the packages that MUST be in perfect working order to ensure the system remains in a usable state. These are the absolute system-critical packages.

  • Developer maintained
  • All binary packages
  • pacman accessible
  • The Core installation media simply contains an installer script, and a snapshot of the core repository at the time of release.

[extra]

The [extra] repository contains all Arch packages that are not themselves necessary for a base Arch system, but contribute to a more full-featured environment. X, KDE, and Apache, for instance, can be found here.

  • Developer maintained
  • All binary packages
  • pacman accessible

[testing]

The [testing] repository contains packages that are candidates for the [core] or [extra] repositories. New packages go into [testing] if:

* they are expected to break something on update and need to be tested first.

* they require other packages to be rebuilt. In this case, all packages that need to be rebuilt are put into [testing] first and when all rebuilds are done, they are moved back to the other repositories.

  • Developer maintained
  • All binary packages
  • pacman accessible
Note: * [testing] is the only repository that can have name collisions with any of the other official repositories. Therefore, if enabled, [testing] must be the first repo listed in pacman.conf.
Warning: Only experienced users should use [testing].

[community]

The [community] repository is maintained by the Trusted Users (TUs) and is simply the binary branch of the Arch User Repository (AUR). It contains binary packages which originated as PKGBUILDs from AUR [unsupported] that have acquired enough votes and were adopted by a TU. Like all repos listed above, [community] may be readily accessed by pacman.

  • TU maintained
  • All binary packages
  • pacman accessible

AUR (unsupported)

The AUR also contains the unsupported branch, which cannot be accessed directly by pacman*. AUR [unsupported] does not contain binary packages. Rather, it provides more than sixteen thousand PKGBUILD scripts for building packages from source, that may be unavailable through the other repos. When an AUR unsupported package acquires enough popular votes, it may be moved to the AUR [community] binary repo, if a TU is willing to adopt and maintain it there.

  • TU maintained
  • All PKGBUILD bash build scripts
  • Not pacman accessible by default

* pacman wrappers (AUR Helpers) can help you seamlessly access AUR.

/etc/pacman.conf

pacman will attempt to read /etc/pacman.conf each time it is invoked. This configuration file is divided into sections, or repositories. Each section defines a package repository that pacman can use when searching for packages. The exception to this is the options section, which defines global options.

Note that the defaults should work, so modifying at this point may be unnecessary, but verification is always recommended. Further info available in the Mirrors article.

# nano /etc/pacman.conf

Example:

#
# /etc/pacman.conf
#
# See the pacman.conf(5) manpage for option and repository directives

#
# GENERAL OPTIONS
#
[options]
# The following paths are commented out with their default values listed.
# If you wish to use different paths, uncomment and update the paths.
#RootDir     = /
#DBPath      = /var/lib/pacman/
#CacheDir    = /var/cache/pacman/pkg/
#LogFile     = /var/log/pacman.log
HoldPkg     = pacman glibc
# If upgrades are available for these packages they will be asked for first
SyncFirst   = pacman
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
#XferCommand = /usr/bin/curl %u > %o

# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
#IgnorePkg   =
#IgnoreGroup =

#NoUpgrade   =
#NoExtract   =

# Misc options (all disabled by default)
#NoPassiveFtp
#UseSyslog
#ShowSize
#UseDelta
#TotalDownload
#
# REPOSITORIES
#   - can be defined here or included from another file
#   - pacman will search repositories in the order defined here
#   - local/custom mirrors can be added here or in separate files
#   - repositories listed first will take precedence when packages
#     have identical names, regardless of version number
#   - URLs will have $repo replaced by the name of the current repo
#
# Repository entries are of the format:
#       [repo-name]
#       Server = ServerName
#       Include = IncludePath
#
# The header [repo-name] is crucial - it must be present and
# uncommented to enable the repo.
# 

# Testing is disabled by default.  To enable, uncomment the following
# two lines.  You can add preferred servers immediately after the header,
# and they will be used before the default mirrors.
#[testing]
#Include = /etc/pacman.d/mirrorlist

[core]
# Add your preferred servers here, they will be used first
Include = /etc/pacman.d/mirrorlist

[extra]
# Add your preferred servers here, they will be used first
Include = /etc/pacman.d/mirrorlist 

[community]
# Add your preferred servers here, they will be used first
Include = /etc/pacman.d/mirrorlist

# An example of a custom package repository.  See the pacman manpage for
# tips on creating your own repositories.
#[custom]
#Server = file:///home/custompkgs

Enable all desired repositories (remove the # in front of the 'Include =' and '[repository]' lines).


  • When choosing repos, be sure to uncomment both the repository header lines in [brackets] as well as the 'Include =' lines. Failure to do so will result in the selected repository being omitted! This is a very common error.

/etc/pacman.d/mirrorlist

Defines pacman repo mirrors and priorities.

Build a mirrorlist using the rankmirrors script

/usr/bin/rankmirrors is a python script which will attempt to detect the mirrors which are closest to the installation machine based on the mirrors specified in /etc/pacman.d/mirrorlist. Faster mirrors will dramatically improve pacman performance, and the overall Arch Linux experience. This script may be run periodically, especially if the chosen mirrors provide inconsistent throughput and/or updates.

First, use pacman to install python:

# pacman -S python 

cd to the /etc/pacman.d/ directory:

# cd /etc/pacman.d

Backup the existing /etc/pacman.d/mirrorlist:

# cp mirrorlist mirrorlist.backup

Edit mirrorlist.backup and uncomment all mirrors on the same continent or within geographical proximity to test with rankmirrors.

# nano mirrorlist.backup

Run the script against the mirrorlist.backup with the -n switch and redirect output to a new /etc/pacman.d/mirrorlist file:

# rankmirrors -n 6 mirrorlist.backup > mirrorlist

-n 6: rank the 6 fastest mirrors

Force pacman to refresh the package lists

After creating/editing /etc/pacman.d/mirrorlist, (manually or by /usr/bin/rankmirrors) issue the following command:

# pacman -Syy

Passing two --refresh or -y flags forces pacman to refresh all package lists even if they are considered to be up to date. Issuing pacman -Syy whenever a mirror is changed, is good practice and will avoid possible headaches.

Mirrorcheck for up-to-date packages

Some of the official mirrors may contain packages that are out-of-date. ArchLinux Mirrorcheck reports various aspects about the mirrors such as, those experiencing network problems, data collection problems, reports the last time they have been synced, etc.

One may wish to manually inspect the mirrors in the /etc/pacman.d/mirrorlist insuring that it only contains up-to-date mirrors if having the latest package versions is a priority.

パッケージを無視するには

After executing the command "pacman -Syu", the entire system will be updated. It is possible to prevent a package from being upgraded. A typical scenario would be a package for which an upgrade may prove problematic for the system. In this case, there are two options; indicate the package(s) to skip in the pacman command line using the --ignore switch (do pacman -S --help for details) or permanently indicate the package(s) to skip in the /etc/pacman.conf file in the IgnorePkg array. List each package, with one intervening space :

IgnorePkg = wine  

The typical way to use Arch is to use pacman to install all packages unless there is no package available, in which case ABS may be used. Many user-contributed package build scripts are also available in the AUR.

The power user is expected to keep the system up to date with pacman -Syu, rather than selectively upgrading packages. You may diverge from this typical usage as you wish; just be warned that there is a greater chance that things will not work as intended and that it could break your system. The majority of complaints happen when selective upgrading, unusual compilation or improper software installation is performed. Use of IgnorePkg in /etc/pacman.conf is therefore discouraged, and should only be used sparingly, if you know what you are doing.

設定ファイルを無視するには

In the same vein, you can also "protect" your configuration/system files from being overwritten during "pacman -Su" using the following option in your /etc/pacman.conf

NoUpgrade = etc/lilo.conf boot/grub/menu.lst

pacmanに詳しくなるには

pacman is the Arch user's best friend. It is highly recommended to study and learn how to use the pacman(8) tool. Try:

$ man pacman

For more information,please look up the pacman wiki entries at your leisure.

Powerpill, a pacman wrapper script

Before you continue, consider installing Xyne's powerpill (now in [community]) which is a pacman wrapper script that speeds up package retrieval by using aria2c (an external download helper) for concurrent/segmented downloads. In other words, powerpill pulls packages in parallel effectively speeding up your downloads. This is particularly advantageous on new installs when pulling down hundreds of megs of packages.

# pacman -S powerpill

Treat powerpill as pacman as you consider installations, for example, the following will update your system:

# powerpill -Syu

See the Powerpill wiki article for more.

Step 3: Update System

You are now ready to upgrade your entire system. Before you do, read through the news (and optionally the arch-announce mailing list). Often the developers will provide important information about required configurations and modifications for known issues. Consulting these pages before any upgrade is good practice.

Sync, refresh, and upgrade your entire new system with:

# pacman -Syu

or:

# pacman --sync --refresh --sysupgrade

pacman will now download a fresh copy of the master package list from the server(s) defined in pacman.conf(5) and perform all available upgrades. (You may be prompted to upgrade pacman itself at this point. If so, say yes, and then reissue the pacman -Syu command when finished.)

Reboot if a kernel upgrade has occurred.

Note: Occasionally, configuration changes may take place requiring user action during an update; read pacman's output for any pertinent information.

Pacman output is saved in /var/log/pacman.log.

See Package Management FAQs for answers to frequently asked questions regarding updating and managing your packages.

The Arch rolling release model

Keep in mind that Arch is a rolling release distribution. This means there is never a reason to reinstall or perform elaborate system rebuilds to upgrade to the newest version. Simply issuing pacman -Syu periodically keeps your entire system up-to-date and on the bleeding edge. At the end of this upgrade, your system is completely current. Reboot if a kernel upgrade has occurred.

Network Time Protocol

You may wish to set the system time now using OpenNTPD to sync the local clock to remote NTP servers. OpenNTPD may also be added to the DAEMONS= array in /etc/rc.conf to provide this service at each boot. (See the Network Time Protocol article.)

Step 4: Add a user and setup groups

UNIX is a multi-user environment. You should not do your everyday work using the root account. It is more than poor practice; it is dangerous. Root is for administrative tasks. Instead, add a normal, non-root user account using the /usr/sbin/useradd program:

# useradd -m -G [groups] -s [login_shell] [username] 
  • -m Creates user home directory as /home/username. Within their home directory, a user can write files, delete them, install programs, etc. Users' home directories shall contain their data and personal configuration files, the so-called 'dot files' (their name is preceded by a dot), which are 'hidden'. (To view dotfiles, enable the appropriate option in your file manager or run ls with the -a switch.) If there is a conflict between user (under /home/username) and global configuration files, (usually under /etc/) the settings in the user file will prevail. Dotfiles likely to be altered by the end user include .xinitrc and .bashrc files. The configuration files for xinit and Bash respectively. They allow the user the ability to change the window manager to be started upon login and also aliases, user-specified commands and environment variables respectively. When a user is created, their dotfiles shall be taken from the /etc/skel directory where system sample files reside.
  • -G A list of supplementary groups which the user is also a member of. Each group is separated from the next by a comma, with no intervening spaces. The default is for the user to belong only to the initial group (users).
  • -s The path and filename of the user´s default login shell.

Useful groups for your non-root user include:

  • audio - for tasks involving sound card and related software
  • floppy - for access to a floppy if applicable
  • lp - for managing printing tasks
  • optical - for managing tasks pertaining to the optical drive(s)
  • storage - for managing storage devices
  • video - for video tasks and hardware acceleration
  • wheel - for using sudo
  • power - used w/ power options (ie. shutdown w/ off button)

A typical desktop system example, adding a user named "archie" specifying bash as the login shell:

# useradd -m -G users,audio,lp,optical,storage,video,wheel,power -s /bin/bash archie

Next, add a password for your new user using /usr/bin/passwd.

An example for our user, 'archie':

# passwd archie

(You will be prompted to provide the new UNIX password.)

Your new non-root user has now been created, complete with a home directory and a login password.

Alternative method, using /usr/sbin/adduser:

Alternatively, you may use adduser, an interactive user adding program which will prompt you for the above data: (recommended for beginners)

# adduser

Deleting the user account:

In the event of error, or if you wish to delete this user account in favor of a different name or for any other reason, use /usr/sbin/userdel:

# userdel -r [username]
  • -r Files in the user´s home directory will be removed along with the home directory itself and the user´s mail spool.

If you want to change the name of your user or any existing user, see the Change username page of the wiki and/or the User group and User Management articles for further information. You may also check the man pages for usermod(8) and gpasswd(8).

Step 5: Install and setup Sudo (Optional)

Install Sudo and vim:

# pacman -S sudo vim

To add a user as a sudo user (a "sudoer"), the visudo command must be run as root. If you do not know how to use vi, you may set the EDITOR environment variable to the editor of your choice before running visudo. e.g.:

# EDITOR=nano visudo

If you are comfortable using vi, issue the visudo command without the EDITOR=nano variable:

# visudo

This will open the file /etc/sudoers in a special session of vi. visudo copies the file to be edited to a temporary file, edits it with an editor, (vi by default), and subsequently runs a sanity check. If it passes, the temporary file overwrites the original with the correct permissions.

Warning: Do not edit /etc/sudoers directly with an editor; Errors in syntax can cause annoyances (like rendering the root account unusable). You must use the visudo command to edit /etc/sudoers.

To give the user full root privileges when he/she precedes a command with "sudo", add the following line:

USER_NAME   ALL=(ALL) ALL

where USER_NAME is the username of the individual.

For more information, such as sudoer <TAB> completion, see Sudo

Part III: Install X and configure ALSA

Step 1: Configure sound with alsamixer

The Advanced Linux Sound Architecture (known by the acronym ALSA) is a Linux kernel component intended to replace the original Open Sound System (OSS) for providing device drivers for sound cards. Besides the sound device drivers, ALSA also bundles a user space library for application developers who want to use driver features with a higher level API than direct interaction with the kernel drivers.

Note: Alsa is included in the Arch mainline kernel and udev will automatically probe your hardware at boot, loading the corresponding kernel module for your audio card. Therefore, your sound should already be working, but upstream sources mute all channels by default.
Note: OSS4.1 has been released under a free license and is generally considered a significant improvement over older OSS versions. If you have issues with ALSA, or simply wish to explore another option, you may choose OSS4.1 instead. Instructions can be found in OSS

The alsa-utils package contains the alsamixer userspace tool, which allows configuration of the sound device from the console or terminal.

By default the upstream kernel sources ship with snd_pcsp, the alsa pc speaker module. snd_pcsp is usually loaded before your "actual" sound card module. In most cases, it will be more convenient if this module is loaded last, as it will allow alsamixer to correctly control the desired sound card.

To have snd_pcsp load last, add the following to /etc/modprobe.d/modprobe.conf:

options snd-pcsp index=2

Alternatively, if you do not want snd_pcsp to load at all, blacklist it by adding the following to /etc/rc.conf:

MODULES=(... !snd_pcsp)
Note: You will need to unload all your sound modules and reload them for the changes to take effect. It might be easier to reboot. Your choice.

Install the alsa-utils package:

 # pacman -S alsa-utils

Also, you may want to install the alsa-oss package, which wraps applications written for OSS in a compatibility library, allowing them to work with ALSA. To install the alsa-oss package:

# pacman -S alsa-oss   

Did you add your normal user to the audio group? If not, use /usr/bin/gpasswd. As root do:

# gpasswd -a yourusername audio

As normal, non-root user, invoke /usr/bin/alsamixer:

# su - yourusername 
$ alsamixer

Unmute the Master and PCM channels by scrolling to them with cursor left/right and pressing M. Increase the volume levels with the cursor-up key. (70-90 Should be a safe range.) Some machines, (like the Thinkpad T61), have a Speaker channel which must be unmuted and adjusted as well. Leave alsamixer by pressing ESC.

Sound test

Ensure your speakers are properly connected, and test your sound configuration as normal user using /usr/bin/aplay:

$ aplay /usr/share/sounds/alsa/Front_Center.wav

You should hear a very eloquent woman say, "Front, center."

Saving the Sound Settings

Exit your normal user shell and run /usr/sbin/alsactl as root:

$ exit
# alsactl store

This will create the file '/etc/asound.state', saving the alsamixer settings.

Also, add the alsa daemon to your DAEMONS section in /etc/rc.conf to automatically restore the mixer settings at boot.

# nano /etc/rc.conf
DAEMONS=(syslog-ng network crond alsa)

Note that the alsa daemon merely restores your volume mixer levels on boot up by reading /etc/asound.state. It is separate from the alsa audio library (and kernel level API).

Expanded information available in the ALSA wiki entry.

Step 2: Install X

The X Window System version 11 (commonly X11, or just simply X) is a networking and display protocol which provides windowing on bitmap displays. It provides the standard toolkit and protocol to build graphical user interfaces (GUIs) on UNIX-like operating systems.

X provides the basic framework, or primitives, for building GUI environments: drawing and moving windows on the screen and interacting with a mouse and/or keyboard. X does not mandate the user interface — individual client programs handle this.

X is so named because it was preceded by the W Window System, originally developed at Stanford University.

Note: If you plan on using an open-source video driver, and need 3d acceleration, it is recommended to install the libgl library before installing Xorg:
# pacman -S libgl

(Proprietary video drivers provide their own gl library implementations.)

A: Install X

Now we will install the base Xorg packages using pacman. This is the first step in building a GUI.

# pacman -S xorg

The 3d utilities glxgears and glxinfo are included in the mesa package:

# pacman -S mesa

B: Install Video Driver Package

Now we have the base packages we need for running the X Server. You should add the driver for your graphics card now (e.g. xf86-video-<name>). The easiest way to configure X.org is by installing the correct driver packages first, and then generating /etc/X11/xorg.conf using an autoconfiguration script, like Xorg -configure.

You will need knowledge of which video chipset your machine has. If you do not know, use the /usr/sbin/lspci program:

# lspci | grep VGA

If you need a list of all open-source video drivers, do:

# pacman -Ss xf86-video | less

Here is a list of open source drivers, and the corresponding video chipsets.

  • xf86-video-apm — Alliance ProMotion video driver
  • xf86-video-ark — ark video driver
  • xf86-video-ati — ATI(AMD) video driver
    • xf86-video-r128 — ATI(AMD) video driver for X.org ati Rage128 video
    • xf86-video-mach64 — ATI(AMD) video driver for X.org mach64 video
    • xf86-video-radeonhd — open source radeonhd driver
  • xf86-video-chips — Chips and Technologies video driver
  • xf86-video-cirrus — Cirrus Logic video driver
  • xf86-video-dummy — dummy video driver
  • xf86-video-fbdev — framebuffer video driver
  • xf86-video-glint — GLINT/Permedia video driver
  • xf86-video-i128 — Number 0 i128 video driver
  • xf86-video-i740 — Intel i740 video driver
  • xf86-video-i810 — Intel i810/i830/i9xx video drivers (deprecated - use -intel)
  • xf86-video-intel — Newer Version of Intel i810/i830/i9xx video drivers
  • xf86-video-intel-legacy — Legacy-driver for older intel cards as 82865G (xf86-video-intel currently crashes with older cards)
  • xf86-video-imstt — Integrated Micro Solutions Twin Turbo video driver
  • xf86-video-mga — mga video driver (Matrox Graphics Adapter)
  • xf86-video-neomagic — neomagic video driver
  • xf86-video-nv — Nvidia nv video driver
  • xf86-video-nouveau — Open Source 3D acceleration driver for nVidia cards (experimental), check: [1] for Current Status
  • xf86-video-openchrome — VIA/S3G UniChrome, UniChrome Pro and Chrome9 video driver
  • xf86-video-rendition — Rendition video driver
  • xf86-video-s3 — S3 video driver
  • xf86-video-s3virge — S3 Virge video driver
  • xf86-video-savage — savage video driver
  • xf86-video-siliconmotion — siliconmotion video driver
  • xf86-video-sis — SiS video driver
  • xf86-video-sisusb — SiS USB video driver
  • xf86-video-tdfx — tdfx video driver
  • xf86-video-trident — Trident video driver
  • xf86-video-tseng — tseng video driver
  • xf86-video-unichrome — VIA S3 Unichrome video drivers
  • xf86-video-v4l — v4l video driver
  • xf86-video-vesa — vesa video driver
  • xf86-video-vga — VGA 16 color video driver
  • xf86-video-vmware — vmware video driver
  • xf86-video-voodoo — voodoo video driver

Note: The vesa driver is the most generic, and should work with almost any modern video chipset. If you cannot find a suitable driver for your video chipset, vesa should work.

Use pacman to install the appropriate video driver for your video card/onboard video. e.g.:

# pacman -S xf86-video-savage

(for the Savage driver.)

  • If you have an NVIDIA or ATI graphics card you may wish to install the proprietary NVIDIA or ATI drivers. Installing proprietary video drivers is covered below..
  • If you do not want to install the proprietary drivers or do not have an NVIDIA or ATI graphics card, you should skip down to Step 3: Configure X.


NVIDIA Graphics Cards

The NVIDIA proprietary drivers are generally considered to be of good quality, and offer 3D performance, whereas the open source nv driver offers only 2d support at this time.

Before you configure your Graphics Card you will need to know which driver fits. Arch currently has several different driver packages that each match a certain subset of Cards:

1. nvidia-96xx slightly newer cards up to the GF 4.

2. nvidia-173xx Geforce FX series cards

3. nvidia newest GPUs after the GF FX

Note: Nvidia-71xx series proprietary drivers, which are required by extremely old cards like TNT and TNT2, have been removed because they do not work with the new Xorg that Arch makes use of and nvidia has discontinued support for such. You should use the xf86-video-nv or xf86-video-vesa drivers instead.

Consult the NVIDIA website to see which one is for you. The difference is only for the installation; Configuration works the same with every driver.

Select and install the appropriate NVIDIA driver for your card, e.g.:

# pacman -S nvidia-96xx

The NVIDIA package has a utility for updating your existing /etc/X11/xorg.conf for use with the NVIDIA driver:

# nvidia-xconfig

It also has several options which will further specify the contents and options of the xorg.conf file. For example,

# nvidia-xconfig --composite --add-argb-glx-visuals

For more detailed information, see nvidia-xconfig(1).

Some useful tweaking options in the device section are (beware that these may not work on your system):

       Option          "RenderAccel" "true"
       Option          "NoLogo" "true"
       Option          "AGPFastWrite" "true"
       Option          "EnablePageFlip" "true"

Make sure all instances of DRI are commented out:

#    Load        "dri"

Double check your /etc/X11/xorg.conf to make sure your default depth, horizontal sync, vertical refresh, and resolutions are acceptable.

Update kernel module dependencies using /sbin/depmod:

# depmod -a

(A reboot may be necessary.)

Tip: Advanced instructions for NVIDIA configuration can be found in the NVIDIA article.

You may now continue with Step 3: Configure X to familiarize yourself further, or continue the installation process with Test X.

ATI Graphics Cards

ATI owners have multiple options for drivers.

  • The open source radeon driver provided by the xf86-video-ati package.
    • This is the original, reverse-engineered open source driver which fully supports Radeon chipsets up to X1950 (latest R500 chipsets). Cards up to the 9200 series are fully supported, stable, and provide full 2D and 3D acceleration. Cards from 9500 to X1950 feature full 2D acceleration, and good 3D acceleration, but lack certain features provided by the proprietary driver, (for example, powersaving is still in a testing phase). Cards from HD2xxx (R6xx) to the newest are supported by xf86-video-ati, but only offer 2d support at this time.
  • The open source radeonhd driver provided by the xf86-video-radeonhd package.
    • This driver supports ATI R500 chipsets (Radeon X1000 series) and newer. It is written by Novell with specifications provided to the public by AMD. It supports RandR 1.2 and development is currently very active. Therefore, functionality may be inconsistent across the spectrum of cards supported. (Some users report excellent performance and reliability while others experience trouble.) It also supports HDMI, with sound.
  • The proprietary fglrx driver provided by the Catalyst package located in the AUR. The proprietary driver is covered below.

The open-source drivers will usually suit most needs along with being generally less problematic.

Install the radeon ATI Driver with

# pacman -S xf86-video-ati libgl ati-dri

Install the radeonhd ATi Driver with

# pacman -S xf86-video-radeonhd libgl ati-dri

The proprietary ATI driver Catalyst was once a precompiled package offered by Arch in the extra repository, but as of March 2009, official support has been dropped because of dissatisfaction with the quality and speed of development of the proprietary driver.The catalyst driver is now available in AUR. Installation information for Catalyst driver is available here

Warning: The proprietary ATI driver supports only R600 and newer devices (that means, HD2xxx and newer). Older series cards (X1xxx and older) are not supported.
Tip: Advanced instructions for ATI configuration can be found in the ATI wiki article.

C: Install Input Driver Packages

The latest X requires you to install drivers for your input devices, keyboard and mouse included. For a complete list of available input drivers,

# pacman -Ss xf86-input | less

For most users, xf86-input-keyboard and xf86-input-mouse should be sufficient for a basic setup. Use pacman to install your desired drivers for your input devices. e.g.:

# pacman -S xf86-input-keyboard xf86-input-mouse

Step 3: Configure X

A: The xorg.conf file

/etc/X11/xorg.conf is the main configuration file for your X Window System, the foundation of your Graphical User Interface. It is a plain text file ordered into sections and subsections. Important sections are Files, InputDevice, Module, Monitor, Modes, Screen, Device, and ServerLayout. Sections can appear in any order and there may be more than one section of each kind, for example, if you have more than one monitor, or if your laptop has a trackpoint as well as a mouse.

Since X11R7.2 the X.Org X Server features autoconfiguration. Therefore, it can function without an xorg.conf file in many cases. If the autoconfiguration works satisfactorily and you do not need to specify special features such as aiglx, compositing and so forth, you may forgo creating an xorg.conf file.

Standard xorg.conf generation

Advanced users may wish to manually create their own xorg.conf file. You may also use the /usr/bin/Xorg program with the -configure option to generate a basic config file; As root, do:

# Xorg -configure

This will create a config file at /root/xorg.conf.new

Copy the file to /etc/X11/:

# cp /root/xorg.conf.new /etc/X11/xorg.conf
Alternative xorg.conf generation

Newer versions of the Xorg Server(>1.6) do not include the /usr/bin/xorgconfig or /usr/bin/xorgcfg scripts. If you run into problems generating/using an xorg.conf file, you might want to consider using this guide.

See the article on X.Org, section "Without xorg.conf".

  • Note that if you are in possession of a properly configured xorg.conf under another distribution and with the same Xorg version, you may easily copy it over to your current Arch system's /etc/X11/ directory.


Tip: For Intel graphics card, specific configuration may be necessary to get proper 2D or 3D performance, as stated in the Intel wiki article.

B: Input hotplugging

Input hotplugging is supported since the 1.4 version of the X.Org X Server and enabled by default. When enabled, X will utilize hal to allow for the hotplugging and removal of human interface devices without having to restart X.

Warning: Starting the X server using input hotplugging without the HAL daemon installed and running may result in the inability to use the mouse and/or keyboard, and the X server appearing to freeze as a result .

You must decide whether you will use input hotplugging (enabled by default), or disable it. Input hotplugging is convenient for many users, especially those with mobile machines like laptops and netbooks. Other users may wish to disable it in favor of manual or more static device configuration within /etc/xorg.conf.

Tip: See the article on Xorg input hotplugging for full details.
Using input hotplugging

Install HAL, dbus and the evdev input driver:

# pacman -S hal dbus xf86-input-evdev

Set the keyboard layout (if you do not use a standard US keyboard)

# cp /usr/share/hal/fdi/policy/10osvendor/10-keymap.fdi /etc/hal/fdi/policy/
# nano /etc/hal/fdi/policy/10-keymap.fdi

Edit the "input.xkb.layout" key and possibly the "input.xkb.variant" key in this file.

Laptop users will also need the synaptics package to allow X to configure the touchpad:

# pacman -S xf86-input-synaptics
Tip: For instructions on fine tuning or troubleshooting touchpad settings, see the Touchpad Synaptics article.


The HAL daemon

The hal daemon must be started before the X server:

# /etc/rc.d/hal start

Add the hal daemon to the DAEMONS array in /etc/rc.conf to start it at every boot.

Disable input hotplugging

Disabling input hotplugging will skip devices detected by hal and will use the keyboard/mouse configuration from xorg.conf:

# nano /etc/X11/xorg.conf

add the following:

Section "ServerFlags"
    Option "AutoAddDevices" "False"
EndSection
Set the keyboard layout if not using a standard US keyboard

Add option lines in the "InputDevice" section of the /etc/X11/xorg.conf file specifying the keyboard layout and variant:

Option "XkbLayout" "be"
Option "XkbVariant" ""

Alternative method using the setxkbmap command:

# setxkbmap pl 

(with the proper keyboard layout instead of pl of course) should switch your keyboard layout in x. To make this permanent, add this command to /home/<youruser>/.xinitrc before starting the window manager (before command like exec startxfce4).

C: Test X

First, read the warning about input hotplugging in the previous section. At this point, you should have xorg installed, with a suitable video driver and an /etc/X11/xorg.conf configuration file. If you want to test your configuration quickly, to ensure your ability to successfully start X from the command line before installing a complete desktop environment, you can do so by configuring ~/.xinitrc to invoke Xterm. Xterm is a very simple terminal emulator which runs in the X Server environment; it is installed as part of the base xorg packages.

Prepare for the test by configuring ~/.xinitrc

One of the main functions of this file is to dictate what X Window client is invoked with the /usr/bin/startx and/or /usr/bin/xinit program on a per-user basis. (The startx script is merely a front end to the more versatile xinit command.) There are vast amounts of additional configurable specifications and commands that may also be added to ~/.xinitrc as you further customize your system.

Note: .xinitrc is a so-called 'dot' (.) file. Files in a UNIX filesystem which are preceded with a dot (.) are 'hidden', and will not show up with a regular 'ls' command, usually for the sake of keeping directories tidy. Dot files may be seen by issuing ls -a. The 'rc' denotes Run Commands and simply indicates that it is a configuration file. Since it controls how a program runs, it is (although historically incorrect) also said to stand for "Run Control".

startx/xinit will start the X server and clients. To determine the client to run, startx/xinit will first look to parse a .xinitrc file in the user's home directory. In the absence of file ~/.xinitrc, it defaults to the global xinitrc in the xinit library directory; /etc/X11/xinit/xinitrc, which defaults to using the TWM window manager. (Hence, if you invoke startx without a ~/.xinitrc file, a TWM session will start.) Further details in the .xinitrc wiki entry.

Switch to your normal, non-root user:

# su - yourusername
  • /etc/skel/ contains files and directories to provide sane defaults for newly created user accounts. The name skel is derived from the word skeleton, because the files it contains form the basic structure for users' home directories.
  • Sample .xinitrc provided here

Copy the sample xinitrc file from /etc/skel/ to your home directory:

$ cp /etc/skel/.xinitrc ~/

Edit the file:

$ nano ~/.xinitrc

and add "exec xterm" so that it looks like this:

#!/bin/sh
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)
#
# exec wmaker
# exec startkde
# exec icewm
# exec blackbox
# exec fluxbox
#
exec xterm
Note: Be sure to have only one uncommented exec line in ~/.xinitrc for now.

Below, we shall edit this file again to specify the appropriate desktop environment/window manager of your choice.

Perform the test

Test your configurations by starting X as normal, non-root user, with:

$ startx

or

$ xinit

You should have an xterm session open up. You can test your keyboard and its layout in it. You may have to move your mouse around until it enters the xterm area before you see the mouse cursor or xterm responds to your keyboard.

If you prove a properly configured /etc/X11/xorg.conf by successfully running the test, you can be assured that your DE/WM of choice will work smoothly.

Tip: Advanced instructions for Xorg configuration can be found in the Xorg article.


Note: With Xorg 1.6 CTRL-Alt-Backspace has been deprecated and will not work to exit out of this test. A somewhat messy work around is to switch to a different virtual console (CTRL-Alt-F2, for example) and then switch back to the console the test is running in (probably CTRL-Alt-F1). You will then be able to use CTRL-C to kill the X test. You can enable CTRL-Alt-Backspace by editing xorg.conf, as described here.

If the screen goes black, you may still attempt to switch to a different virtual console (CTRL-Alt-F2, for example), and login blindly as root, followed by <Enter>, followed by root's password followed by <enter>. Finally, reboot blindly with:

# reboot

or

# init 6
In case of errors

If you have problems starting X, you can look for errors in the /var/log/Xorg.0.log file and on the console output of the virtual console you started X from.

If using /etc/X11/xorg.conf

Inspect the config file:

# nano /etc/X11/xorg.conf

The video driver may need to be specified. e.g.:

Section "Device"

       ...
       Driver  "savage"
       ...

EndSection

Horizontal sync and vertical refresh specs under section "Monitor" may need to be added:

Section "Monitor"
       Identifier   "Monitor0"
       VendorName   "Monitor Vendor"
       ModelName    "Monitor Model"
       HorizSync     30.0 - 130.0 # Safe for LCD's
       VertRefresh   50.0 - 100.0 # Safe for LCD's and most CRT's.
EndSection

(If these specs are unknown, consult the documentation of the computer monitor.)

Color depth can be specified under section "Screen":

Section "Screen"
       Identifier "Screen0"
       Device     "Card0"
       Monitor    "Monitor0"
       DefaultDepth 24

(Typically, this will be set to 24 for true color.)

Also add desired Modes to the "Display" subsection, at least under the Depth 24 header, e.g.:

 SubSection "Display"
               Viewport   0 0
               Depth     24
               Modes "1024x768" "800x600" "640x480"

Add the following section, if eye candy which requires the composite extension is desired:

Section "Extensions"
 	Option "Composite" "Enable"
EndSection

Try the config again, after modifying:

# startx

or

# xinit

Still having trouble? Detailed instructions are in the Xorg article.

Need Help?

If you are still having trouble after consulting the Xorg article and need assistance via the Arch forums, be sure to install and use wgetpaste:

# pacman -S wgetpaste

Use wgetpaste and provide links for the following files when asking for help in your forum post:

  • ~/.xinitrc
  • /etc/X11/xorg.conf
  • /var/log/Xorg.0.log.old

Use wgetpaste like so:

$ wgetpaste </path/to/file>

Post the corresponding links given within your forum post. Be sure to provide appropriate hardware and driver information as well.

Warning: It is very important to provide detail when troubleshooting X. Please provide all pertinent information as detailed above when asking for assistance on the Arch forums.

Part IV: Installing and configuring a Desktop Environment

While The X Window System provides the basic framework for building a graphical user interface (GUI), a Desktop Environment (DE), works atop and in conjunction with X, to provide a completely functional and dynamic GUI. A DE typically provides a window manager, icons, applets, windows, toolbars, folders, wallpapers, a suite of applications and abilities like drag and drop. The particular functionalities and designs of each DE will uniquely affect your overall environment and experience. Therefore, choosing a DE is a very subjective and personal decision. Choose the best environment for your needs.

  • If you want something full-featured and similar to Windows and Mac OSX, KDE is a good choice
  • If you want something slightly more minimalist, which follows the K.I.S.S. principle more closely, GNOME is a good choice
  • Xfce is generally perceived as similar to GNOME, but lighter and less demanding on system resources, yet still visually pleasing and providing a very complete environment.
  • LXDE is a minimal DE based on the Openbox window manager. It provides most things you need for a modern desktop while keeping relatively low system resource usage. LXDE is a good choice for those who want a quick way of setting up a pre-configured Openbox system.

If you desire a lighter, less demanding GUI to configure manually, you may choose to simply install a Window Manager, or WM. A WM controls the placement and appearance of application windows in conjunction with the X Window System but does NOT include such features as panels, applets, icons, applications, etc., by default.

Step 1: フォントのインストール

At this point, you may wish to save time by installing visually pleasing, true type fonts, before installing a desktop environment/window manager. Dejavu and bitstream-vera are good, general-purpose font sets. You may also want to have the Microsoft font sets, which are especially popular on websites.

Install with:

# pacman -S ttf-ms-fonts ttf-dejavu ttf-bitstream-vera

Refer to Xorg Font Configuration for how to configure fonts.

Step 2: ~/.xinitrc (again)

As non-root user, edit your /home/username/.xinitrc to specify the DE you wish to use. This will allow you to use startx/xinit from the shell, in the future, to open your DE/WM of choice:

$ nano ~/.xinitrc

Uncomment or add the 'exec ..' line of the appropriate desktop environment/window manager. Some examples are below:

For the Xfce4 desktop environment:

 exec startxfce4 

For the KDE desktop environment:

 exec startkde

A startkde or startxfce4 command starts the KDE or Xfce4 desktop environment. This is exactly the same as entering:

$ xinit /usr/bin/startxfce4

or

$ xinit /usr/bin/starkde

from the shell prompt. Note that such a command does not finish until you logout of the DE. Normally the shell would wait for KDE to finish, then run the next command. The "exec" prefix to this command within the ~/.xinitrc file tells the shell that this is the last command, so the shell does not need to wait to run a subsequent command.

In the future, after the DE of choice is installed and if trouble with automounting is experienced, try using the following command in ~/.xinitrc instead. (Replace "startxfce4" with the command that is appropriate for your window manager/DE.)

exec ck-launch-session startxfce4

This will ensure the various environment variables are set correctly by starting a clean consolekit session. ConsoleKit is a framework for keeping track of the various users, sessions, and seats present on a system. It provides a mechanism for software to react to changes of any of these items or of any of the metadata associated with them. It works in conjunction with dbus, and other tools.

Remember to have only one uncommented exec line in your ~/.xinitrc for now.

Step 3:デスクトップ環境をインストールする

Continue below, installing the DE/WM of your choice.

GNOME

GNOMEについて

The GNU Network Object Model Environment. The GNOME project provides two things: The GNOME desktop environment, an intuitive and attractive desktop for end-users, and the GNOME development platform, an extensive framework for building applications that integrate into the rest of the desktop.

インストール

Install the base GNOME environment with:

# pacman -S gnome

Additionally, you can install the extras:

# pacman -S gnome-extra

It's safe to choose all packages shown in the extra package.

便利なGNOMEのデーモンについて

Recall from above that a daemon is a program that runs in the background, waiting for events to occur and offering services. Some users prefer to use the hal daemon. The hal daemon, among other things, will automate the mounting of disks, optical drives, and USB drives/thumbdrives for use in the GUI. The fam daemon will allow real-time representation of file alterations in the GUI, allowing instant access to recently installed programs, or changes in the file system. Both hal and fam can make life easier for the GNOME user. The hal and fam packages are installed when you install GNOME, but must be invoked to become useful.

You may want to install a graphical login manager. For GNOME, the gdm daemon is a good choice.

As root:

# pacman -S gdm

Start hal and fam:

# /etc/rc.d/hal start
# /etc/rc.d/fam start

Add them to your /etc/rc.conf DAEMONS section, so they will be invoked at boot:

# nano /etc/rc.conf
DAEMONS=(syslog-ng network crond alsa hal fam gdm)

(If you prefer to log into the console and manually start X, leave out gdm.)

Then edit your /etc/gdm/custom.conf and in the [servers] section add:

0=Standard vt7

As normal user, start X:

$ startx

or

$ xinit

If ~/.xinitrc is not configured for GNOME, you may always start it with xinit, followed by the path to GNOME:

$ xinit /usr/bin/gnome-session
Tip: Advanced instructions for installing and configuring GNOME can be found in the GNOME article.

Congratulations! Welcome to your GNOME desktop environment on your new Arch Linux system! You may wish to continue by viewing Tweaks and finishing touches, or the rest of the information below. You may also be interested in the Post Installation Tips wiki article.

Eye Candy

By default, GNOME does not come with many themes and icons. You may wish to install some more attractive artwork for GNOME:

A nice gtk (gui widget) theme engine (includes themes) is the murrine engine. Install with:

# pacman -S gtk-engine-murrine

Optional for more themes:

# pacman -S murrine-themes-collection 

Once it has been installed, select it with System -> Preferences -> Appearance -> Theme tab.

The Arch Linux repositories also have a few more nice themes and engines. Install the following to see for yourself:

# pacman -S gtk-engines gtk-aurora-engine gtk-candido-engine gtk-rezlooks-engine

You can find many more themes, icons, and wallpapers at GNOME-Look.

KDE

KDEについて

The K Desktop Environment. KDE is a powerful Free Software graphical desktop environment for GNU/Linux and Unix workstations. It combines ease of use, contemporary functionality, and outstanding graphical design with the technological superiority of Unix-like operating systems.

インストール

Choose one of the following, then continue below with Useful KDE DAEMONS:

1. The package kde is the official and complete vanilla KDE 4.2 residing under the Arch [extra] repo.

Install base kde:

# pacman -S kdebase-workspace

Install the whole Desktop Environment:

# pacman -S kde

or

# pacman -S kde-meta

2. Alternatively, another KDE project exists called KDEmod, part of the Chakra distribution. It is an Arch Linux (and spinoff) exclusive, community-driven package set designed for modularity and offers a choice between KDE 3.5.10 or 4.x.x. KDEmod can be installed with pacman, after adding the proper repositories to /etc/pacman.conf. The project website, including complete installation instructions, can be found at http://www.chakra-project.org/.

便利なKDEのデーモンについて

Recall from above that a daemon is a program that runs in the background, waiting for events to occur and offering services.

KDE will require the hal (Hardware Abstraction Layer) daemon for optimal functionality. The hal daemon, among other things, will facilitate the automatic mounting of disks, optical drives, and USB drives/thumbdrives for use in the GUI. The hal package is installed when you install xorg-server, but must be invoked to become useful.

The kdm daemon is the K Display Manager, which provides a graphical login, if desired.


Start hal:

# /etc/rc.d/hal start
Note: The hal daemon relies on, and will automatically start, the dbus daemon.

Edit your DAEMONS array in /etc/rc.conf:

# nano /etc/rc.conf

Add hal to your DAEMONS array, to invoke it on boot. If you prefer a graphical login, add kdm as well:

DAEMONS=(syslog-ng hal network crond alsa kdm)
Note: If you installed KDEmod3 instead of normal KDE, use kdm3 instead of kdm.
  • This method will start the system at runlevel 3, (/etc/inittab default, multiuser mode), and then start KDM as a daemon.
  • Some users prefer an alternative method of starting a display manager like KDM on boot by utilizing the /etc/inittab method and starting the system at runlevel 5. See Display Manager for more.
  • If you prefer to log into the console at runlevel 3, and manually start X, leave out kdm, or comment it out with a bang, ( ! ).

Now try starting your X Server as normal user:

$ startx

or

$ xinit
Tip: Advanced instructions for installing and configuring KDE can be found in the KDE article.

Congratulations! Welcome to your KDE desktop environment on your new Arch Linux system! You may wish to continue by viewing The Beginners Guide Appendix, or the rest of the information below. You may also be interested in the Post Installation Tips wiki article.

Xfce

Xfceについて

Xfce is another free software desktop environment for Linux. It aims to be fast and lightweight, while still being visually appealing and easy to use. Xfce is modular and reusable. It consists of separately packaged components that together provide the full functionality of the desktop environment, but which can be selected in subsets to create the user's preferred personal working environment. Xfce is mainly used for its ability to run a modern desktop environment on relatively modest hardware. It is based on the GTK+ 2 toolkit (the same as GNOME). It uses the Xfwm window manager, described below. Its configuration is entirely mouse-driven, and the configuration files are hidden from the casual user.

インストール

Install Xfce:

# pacman -S xfce4 

You may also wish to install themes and extras:

# pacman -S xfce4-goodies gtk2-themes-collection

Note: xfce4-xfapplet-plugin (a plugin that allows the use of GNOME applets in the Xfce4 panel) is part of the xfce4-goodies group and depends on gnome-panel, which in turn depends on gnome-desktop. You may wish to take this into consideration before installing, since it represents a significant number of extra dependencies.

If you get errors about dbus-launch then you need to install dbus aswell:

# pacman -S dbus

If you wish to admire 'Tips and Tricks' on login, install the fortune-mod package:

# pacman -S fortune-mod
便利なデーモンについて

Recall from above that a daemon is a program that runs in the background, waiting for events to occur and offering services. Some Xfce users prefer to use the hal daemon. The hal daemon, among other things, will automate the mounting of disks, optical drives, and USB drives/thumbdrives for use in the GUI. The fam daemon will allow real-time representation of file alterations in the GUI, allowing instant access to recently installed programs, or changes in the file system. The hal and fam packages are installed when you install Xfce, but must be invoked to become useful.

Start hal and fam:

# /etc/rc.d/hal start
# /etc/rc.d/fam start
Note: The hal daemon relies on, and will automatically start, the dbus daemon.

Edit your DAEMONS array in /etc/rc.conf:

# nano /etc/rc.conf

Add hal and fam to your DAEMONS array, to invoke them at boot.

Tip: Advanced instructions for installing and configuring Xfce can be found in the Xfce article.

If you wish to install one, see Display Manager. Otherwise you can login in via the console and run:

 $ startxfce4

Congratulations! Welcome to your Xfce desktop environment on your new Arch Linux system! You may also be interested in the Post Installation Tips wiki article.

LXDE

About LXDE

LXDE, (for Lightweight X11 Desktop Environment), is a new project focused on providing a modern desktop environment which aims to be lightweight, fast, intuitive and functional while keeping system resource usage low. LXDE is quite different from other desktop environments, since each component of LXDE is a discrete and independent application, and each can be easily substituted by other programs. This modular design eliminates all unnecessary dependencies and provides more flexibility. Details and screenshots available at: https://lxde.org/

LXDE provides:

  1. The OpenBox windowmanager
  2. PCManFM File manager
  3. LXpanel system panel
  4. LXSession session manager
  5. LXAppearance GTK+ theme switcher
  6. GPicView image viewer
  7. Leafpad simple text editor
  8. XArchiver: Lightweight, fast, and desktop-independent gtk+-based file archiver
  9. LXNM (still under development): Lightweight network manager for LXDE supporting wireless connections

These lightweight and versatile tools combine for quick setup, modularity and simplicity.

Install LXDE with:

# pacman -S lxde
Note: The lxde group DOES_NOT provide openbox as suggested as per 9/17/2009 so it must be installed specifically or you will end up with a desktop with no window management. install it with: pacman -S openbox

Add:

exec startlxde
  • If you plan on running nm-applet, the following command should be used instead
exec ck-launch-session startlxde

to your ~/.xinitrc and start with startx or xinit

Tip: Further information available at the LXDE wiki article.

*box

Fluxbox

Fluxbox is yet another windowmanager for X. It's based on the Blackbox 0.61.1 code. Fluxbox looks like blackbox and handles styles, colors, window placement and similar things exactly like blackbox (100% theme/style compability).

Install Fluxbox using

# pacman -S fluxbox fluxconf

If you use gdm/kdm a new fluxbox session will be automatically added. Otherwise, you should modify your user's ~/.xinitrc and add this to it:

exec startfluxbox 

More information is available in the Fluxbox article.

Openbox

Openbox is a standards compliant, fast, light-weight, extensible window manager.

Openbox works with your applications, and makes your desktop easier to manage. This is because the approach to its development was the opposite of what seems to be the general case for window managers. Openbox was written first to comply with standards and to work properly. Only when that was in place did the team turn to the visual interface.

Openbox is fully functional as a stand-alone working environment, or can be used as a drop-in replacement for the default window manager in the GNOME or KDE desktop environments.

Install openbox using

# pacman -S openbox

Additional configuration tools are also available, if desired:

# pacman -S obconf obmenu

Once openbox is installed you will get a message to move menu.xml & rc.xml to ~/.config/openbox/ in your home directory:

# su - yourusername
$ mkdir -p ~/.config/openbox/
$ cp /etc/xdg/openbox/rc.xml ~/.config/openbox/
$ cp /etc/xdg/openbox/menu.xml ~/.config/openbox/

rc.xml is the main configuration file for OpenBox. It may be manually edited, (or you can use OBconf). menu.xml configures the right-click menu.

You may log into OpenBox via graphical login using KDM/GDM, or from the shell using startx, in which case you will need to edit your ~/.xinitrc (as non-root user) and add the following:

exec openbox-session

NOTE: If you plan on running dbus (which is required by HAL) then make sure your ~/.xinitrc reads:

exec dbus-launch --exit-with-session openbox-session

You may also start OpenBox from the shell using xinit:

$ xinit /usr/bin/openbox-session
  • Openbox may also be used as the window manager for GNOME, KDE, and Xfce.

For KDM there is nothing left to do; openbox is listed in the sessions menu in KDM.

Some useful, lightweight programs for OpenBox are:

  • PyPanel, Tint2, or LXpanel if you want a panel
  • feh if you want to set the background
  • ROX if you want a simple file manager (also provides simple icons)
  • PcmanFM a lightweight but versatile file manager (also provides desktop icon functionality)
  • iDesk (available in the AUR) for providing desktop icons
  • Graveman for burning CD's or DVD's
Tip: More information is available in the Openbox article.

FVWM2

FVWM (F Virtual Window Manager) is an extremely powerful ICCCM-compliant multiple virtual desktop window manager for the X Window system. Development is active, and support is excellent.

Install fvwm2 with

# pacman -S fvwm 

It will install the official version of the WM. However, if you want/need to use some more features than it provides, you can install the patched version from archlinuxfr (see Unofficial user repositories) or AUR.

fvwm will automatically be listed in kdm/gdm in the sessions menu. Otherwise, add

exec fvwm 2 

to your user's ~/.xinitrc.

When you start FVWM2, you will get into the blank configuration. However, when you left-click on the desktop, you will be able to select to configure FVWM. chose wanted modules and you are ready to go. Check out the configs in the https://www.box-look.org. One should also consider checking FVWM forums at https://fvwmforums.org

SLiM is a very good login manager, that does not have many dependencies and acts well with FVWM. Common applications are similar to those suggested for Openbox or Fluxbox.

一般的なアプリケーションや軽量なアプリケーションについて

一般的なアプリケーションや軽量なアプリケーションのリストです Common ApplicationsLightweight Applications, 素晴らしい資料なので是非見てみてください。

補足

これを見てくださいBeginners' Guide Appendix