https://wiki.archlinux.org/api.php?action=feedcontributions&user=Flydragon&feedformat=atom
ArchWiki - User contributions [en]
2024-03-29T11:00:31Z
User contributions
MediaWiki 1.41.0
https://wiki.archlinux.org/index.php?title=General_recommendations_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=92166
General recommendations (简体中文)
2010-01-14T12:18:23Z
<p>Flydragon: /* Start X at boot */</p>
<hr />
<div>[[Category:Getting and installing Arch (简体中文)]]<br />
[[Category:HOWTOs (简体中文)]]<br />
{{i18n|General Recommendations}}<br />
{{Article summary start}}<br />
{{Article summary text|提供一个给高级用户和菜鸟们的涉及各种课题的有用的文章列表或索引}}<br />
{{Article summary heading|相关文章}}<br />
{{Article summary wiki|Common Applications}}<br />
{{Article summary wiki|Lightweight Applications}}<br />
{{Article summary end}}<br />
<br />
这篇文章是一个关于各种常用或受欢迎的文章的详细索引.<br />
大多数软件需要用 [[pacman]] 来安装, 包括 [[Official Repositories]], 那些在 [[Arch User Repository]] 里的非正式发布或不稳定的软件, 则需要 [[makepkg]] 参见 [[AUR helper]]. 总而言之, 继续阅读的同学们最好对ArchLinux里的软件安装已经很熟悉.<br />
<br />
有些软件或话题是基于你有一个完美安装的系统. 比如如果是图形界面软件, 你当然需要已经阅读和安装 [[Xorg]] X窗口系统, 打印相关的软件你当然已经搞定 [[CUPS]] 等等, 所有看官要对文件系统有个概念, 建议参阅 [[FHS]].<br />
<br />
所以说你最好已经仔细看过 [[Arch 新手安装指南 (简体中文)]] 或者 [[Official Arch Linux Install Guide]] 来获得一个对ArchLinux安装的常识.<br />
<br />
文章标题按字母排序.<br />
<br />
==外观美化==<br />
''本栏将讨论ArchLinux界面的美化和外观方案等. 更多信息请参考 [[:Category:Eye candy (English)]].''<br />
<br />
===彩色字符===<br />
虽然已经有一部分软件具有输出彩色字符的能力, 使用通用的彩色字过滤器也是另一种方法. 安装 {{package AUR|cope}} 或 {{package AUR|cope-git}}, 经常更新的 [[Git]] 版本, 可以从 [[AUR]]安装. {{Package AUR|acoc}} 和 {{Package AUR|cw}} 也是类似的选择.<br />
<br />
====字符界面====<br />
字符界面 (PS1) 可以被灵活的定制. 参考 [http://bbs.archlinux.org/viewtopic.php?id=50885 What's your PS1?] 论坛里的帖子. 也可参阅 [[Color Bash Prompt]] 或 [[Zsh#Prompts]] 如果你使用 Bash 或 Zsh 的话.<br />
<br />
====核心工具====<br />
详细讨论核心工具例如 '''grep''' and '''ls''' 参见 [[Core Utilities]] 文章.<br />
<br />
====Emacs外壳====<br />
Emacs 总所周知地在普通的字处理以外还具有很多高级功能, 其中包括一个全功能外壳. 参见 [[Emacs#Colored output issues]] 获知如何处理彩色字符带来的显示问题.<br />
<br />
====帮助文档====<br />
帮助文档是GNU/Linux用户能找到的最有用的信息资源之一. 为了提高可读性, 可以配置帮助文档来显示彩色字符参见 [[Man Page#Colored man pages]].<br />
<br />
===字体===<br />
超多关于字体的信息可以在 [[Fonts]] 和 [[Font Configuration]] 文章中找到.<br />
<br />
====终端字体====<br />
如果你大部分时间是在使用虚拟终端 (也就是在 X 窗口以外的字符界面), 你可能想美化一下终端的字体参考 [[Fonts#Console fonts]].<br />
<br />
====LCD液晶字体====<br />
在笔记本和液晶显示器上可使用一些补丁包来实现字体平滑优化功能, 参见 [[Font Configuration#LCD filter patched packages]].<br />
<br />
==启动==<br />
''本栏讨论启动过程中的问题. ArchLinux启动过程的详情可在这里找到 [[Arch Boot Process]]. 更多信息参考 [[:Category:Boot process (English)]].''<br />
<br />
===幕后进程===<br />
幕后进程是在背景运行的程序, 通常在操作系统启动时就开始运行了. 为了加快系统启动速度, 有些进程可以被幕后启动, 也就是说系统启动不会等待该进程启动结束再继续, 而是并行启动. 在 [[Daemon]] 里有详细的解释.<br />
<br />
===硬件自动识别===<br />
硬件应该默认在系统启动过程中自动被 [[udev]] 检测到. <br />
<br />
为了加快启动速度, 可以关掉自动加载模块, 然后手动指定需要的模块, 参见 [[rc.conf#Hardware]]. <br />
<br />
另外X窗口 [[Xorg]] 应该能依靠 [[HAL]]自动检测到驱动, 不过同样用户可以手动指定选项, 参见 [[Xorg Input Hotplugging]].<br />
<br />
===LILO 速度优化===<br />
除了 [[GRUB]], LILO 是最众所周知的 Linux 引导管理器. 照着 [[LILO#Sample setup]] 里的步骤来充分使用它的功能.<br />
<br />
===开机激活数字小键盘===<br />
大多数键盘都有数字小键盘和数字键盘开关键. 设置开机激活数字键盘, 参见 [[Activating Numlock on Bootup]].<br />
<br />
===保留引导信息===<br />
一旦引导结束, 提示符出现并清屏, 用户将无法获得启动过程中的反馈信息. [[Disable clearing of boot messages]] 告诉你改如何避免.<br />
<br />
===启动后进入X窗口图形界面===<br />
安装了 [[X]] 窗口图形界面服务后, 用户可能想在系统启动后直接进入图形界面而不是需要在登录后手动运行. 启用图形登录参见 [[Display Manager]] 或 [[Start X at boot]] 不用图形登录管理器直接进入X窗口.<br />
<br />
==Console improvements==<br />
''This section applies to small modifications that better console program's practicality. For more, please see [[:Category:Command shells (English)]] and [[:Category:Utilities (English)]].''<br />
<br />
===Aliases===<br />
Users can define shortcuts for frequently-used commands using a built-in shell command. Common time-saving aliases can be found in [[Core Utilities#alias]].<br />
<br />
===Bash additions===<br />
A list of miscellaneous Bash settings, including completion enhancements, history search and readline macros is available in [[Bash#Extended usage]].<br />
<br />
===Compressed files===<br />
====Browsing compressed files====<br />
====Extracting compressed files====<br />
<br />
===Control echo===<br />
<br />
===Mouse support===<br />
Using a mouse with the console for copy-paste operations can be preferred over [[screen]]'s traditional copy mode. Refer to [[Console Mouse Support]] for comprehensive directions.<br />
<br />
==Input==<br />
''This section contains popular input device configuration tips. For more, please see [[:Category:Input devices (English)]].''<br />
<br />
===Configure all mouse buttons===<br />
Owners of advanced or unusual mice may find that not all mouse buttons are recognized by default, or may wish to assign different actions for extra buttons. Instructions can be found in [[Get All Mouse Buttons Working]].<br />
<br />
===Keyboard layouts===<br />
Non-English or otherwise non-standard keyboards may not function as expected by default. To define the keymap in virtual consoles, the [[KEYMAP]] variable must be set in [[rc.conf]]. For [[Xorg]] users, the required changes are described in [[Xorg#Keyboard layout]].<br />
<br />
===Laptop touchpads===<br />
Many laptops use [http://www.synaptics.com/ Synaptics] or [http://www.alps.com/ ALPS] "touchpad" pointing devices. These, and several other touchpad models, use the Synaptics input driver; see [[Touchpad Synaptics]] for installation and configuration details.<br />
<br />
==Package management==<br />
''This section contains helpful information related to package management. All users should at least be familiar with the [[pacman]] package manager. For more, please see [[:Category:Package management (English)]].''<br />
<br />
===Aliases for pacman===<br />
Aliasing a command, or a group thereof, is a way of saving time when using the console. This is specially helpful for repetitive tasks that don't need significant alteration to their parameters between executions. Various time saving pacman aliases are organized in [[pacman Tips]], besides other suggested tools.<br />
<br />
===Arch Build System===<br />
''Ports'' is a system initially used by BSD distributions consisting of build scripts that reside in a directory tree on the local system. Simply put, each port contains a script within a directory intuitively named after the installable third-party application.<br />
<br />
The [[ABS]] tree offers the same functionality by providing build scripts called [[PKGBUILD]]s, which are populated with information for a given piece of software; integrity hashes, project URL, version, license and build instructions. These PKGBUILDs are later parsed by [[makepkg]], the actual program that generates packages cleanly manageable by pacman.<br />
<br />
Every package in the repositories along with those present in the AUR are subject to recompilation with makepkg.<br />
<br />
===Arch User Repository===<br />
While the [[ABS]] tree allows the ability of building software available in the official repositories, the [[AUR]] is the equivalent for user submitted packages. It is an unsupported repository of build scripts accessible through the [http://aur.archlinux.org/index.php web interface] or by an [[AUR helper]].<br />
<br />
AUR helpers like [[Yaourt]] and [[aurbuild]] add seamless access to the AUR. They may vary in features, but all ease in searching, fetching, building, and installing from over 18,673 PKGBUILDs found in the unofficial repository.<br />
<br />
===Mirrors===<br />
Visit [[Mirrors]] for steps on taking full advantage of using the fastest and most up to date pacman mirrors. As explained in the article, a particularly good advice is to routinely check [http://users.archlinux.de/~gerbra/mirrorcheck.html Mirrorcheck] and/or [http://www.archlinux.de/?page=MirrorStatus Mirror status] for a list of mirrors that have been recently synced.<br />
<br />
==Power management==<br />
''This section may be of use to laptop owners or users otherwise seeking power management controls. For more, please see [[:Category:Power management (English)]].''<br />
<br />
===acpid===<br />
Users can configure how the system reacts to ACPI events such as pressing the power button or closing a laptop's lid using [[acpid]].<br />
<br />
===CPU frequency scaling===<br />
Modern processors can decrease their frequency and voltage to reduce heat and power consumption. Less heat leads to a quieter system and prolongs the life of hardware. [[cpufrequtils]] is a set of utilities designed to assist CPU frequency scaling.<br />
<br />
===Laptops===<br />
For articles related to portable computing along with model-specific installation guides, please see [[:Category:Laptops (English)]]. For a general overview of laptop-related articles and recommendations, see [[Laptop]].<br />
<br />
===Suspending and hibernation===<br />
Several options are available to users desiring suspend-to-RAM (sleep/stand-by) and suspend-to-disk (hibernate) functionality. [[pm-utils]] describes one popular method, while [[hibernate-script]] is an older alternative that does not depend on Xorg packages.<br />
<br />
==Networking==<br />
''This section is confined to small networking procedures. Head over to [[Network]] for a full guide. For more, please see [[:Category:Networking (English)]].''<br />
<br />
===Disable IPv6===<br />
Not only does the module take around 250k of memory, it has also been reported that disabling it notoriously speeds up network access for programs that erroneously try to query servers with it. Incidentally, [[Firefox]] is listed among the affected applications. So until the widespread adoption of IPv6, it may be beneficial to [[IPv6 - Disabling the Module|disable it]].<br />
<br />
===DNS speed improvement===<br />
To improve load time by caching queries, use [[pdnsd]], a very simple program that does not attempt to fill every need. Or install [[dnsmasq]], a broader choice which also supports turning the system into a DHCP server.<br />
<br />
==System administration==<br />
''This section deals with administrative tasks and system management. For more, please see [[:Category:System administration (English)]].''<br />
<br />
===Privilege escalation===<br />
A new installation leaves users with only the super user account, better known as root. Logging in as root for prolonged periods of time is widely considered to be foolish and insecure. Instead, users should [[User Management|create]] and use unprivileged user accounts for most tasks, only using the root account for system administration. The [[su]] (substitute user) command allows assuming the identity of another user on the system (usually root) from an existing login, whereas the [[sudo]] command grants temporary privilege escalation for a specific command.<br />
<br />
===Windows networking===<br />
To enable communication between Windows and Arch Linux machines across a network, users can use [[Samba]]; a re-implementation of the SMB/CIFS networking protocol.<br />
<br />
==System services==<br />
''This section relates to daemons. For more, please see [[:Category:Daemons and system services (English)]].''<br />
<br />
===HAL===<br />
After having installed a desktop environment or window manager, installing [[HAL]] seems like a natural follow-up since it enables plug-and-play functionality for mobile phones, MP3 players, external HDDs, and other hardware. Often, HAL is used to mount the device and make an icon on a convenient place, like the desktop or in 'My Computer', allowing access to the peripheral soon after it has been plugged in. Altogether, this avoids manual [[fstab]] configuration or making [[udev]] rules for each and every new device.<br />
<br />
[[KDE]], [[GNOME]] and [[Xfce]] all use [[HAL]].<br />
<br />
===Local mail delivery===<br />
A default base setup bestows no means for mail syncing. To configure postfix for simple local mailbox delivery, see [[Local Mail Delivery with Postfix]]. Other options are [[SSMTP]], [[MSMTP]] and [[fdm]].</div>
Flydragon
https://wiki.archlinux.org/index.php?title=General_recommendations_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=92165
General recommendations (简体中文)
2010-01-14T12:10:22Z
<p>Flydragon: /* Retaining boot messages */</p>
<hr />
<div>[[Category:Getting and installing Arch (简体中文)]]<br />
[[Category:HOWTOs (简体中文)]]<br />
{{i18n|General Recommendations}}<br />
{{Article summary start}}<br />
{{Article summary text|提供一个给高级用户和菜鸟们的涉及各种课题的有用的文章列表或索引}}<br />
{{Article summary heading|相关文章}}<br />
{{Article summary wiki|Common Applications}}<br />
{{Article summary wiki|Lightweight Applications}}<br />
{{Article summary end}}<br />
<br />
这篇文章是一个关于各种常用或受欢迎的文章的详细索引.<br />
大多数软件需要用 [[pacman]] 来安装, 包括 [[Official Repositories]], 那些在 [[Arch User Repository]] 里的非正式发布或不稳定的软件, 则需要 [[makepkg]] 参见 [[AUR helper]]. 总而言之, 继续阅读的同学们最好对ArchLinux里的软件安装已经很熟悉.<br />
<br />
有些软件或话题是基于你有一个完美安装的系统. 比如如果是图形界面软件, 你当然需要已经阅读和安装 [[Xorg]] X窗口系统, 打印相关的软件你当然已经搞定 [[CUPS]] 等等, 所有看官要对文件系统有个概念, 建议参阅 [[FHS]].<br />
<br />
所以说你最好已经仔细看过 [[Arch 新手安装指南 (简体中文)]] 或者 [[Official Arch Linux Install Guide]] 来获得一个对ArchLinux安装的常识.<br />
<br />
文章标题按字母排序.<br />
<br />
==外观美化==<br />
''本栏将讨论ArchLinux界面的美化和外观方案等. 更多信息请参考 [[:Category:Eye candy (English)]].''<br />
<br />
===彩色字符===<br />
虽然已经有一部分软件具有输出彩色字符的能力, 使用通用的彩色字过滤器也是另一种方法. 安装 {{package AUR|cope}} 或 {{package AUR|cope-git}}, 经常更新的 [[Git]] 版本, 可以从 [[AUR]]安装. {{Package AUR|acoc}} 和 {{Package AUR|cw}} 也是类似的选择.<br />
<br />
====字符界面====<br />
字符界面 (PS1) 可以被灵活的定制. 参考 [http://bbs.archlinux.org/viewtopic.php?id=50885 What's your PS1?] 论坛里的帖子. 也可参阅 [[Color Bash Prompt]] 或 [[Zsh#Prompts]] 如果你使用 Bash 或 Zsh 的话.<br />
<br />
====核心工具====<br />
详细讨论核心工具例如 '''grep''' and '''ls''' 参见 [[Core Utilities]] 文章.<br />
<br />
====Emacs外壳====<br />
Emacs 总所周知地在普通的字处理以外还具有很多高级功能, 其中包括一个全功能外壳. 参见 [[Emacs#Colored output issues]] 获知如何处理彩色字符带来的显示问题.<br />
<br />
====帮助文档====<br />
帮助文档是GNU/Linux用户能找到的最有用的信息资源之一. 为了提高可读性, 可以配置帮助文档来显示彩色字符参见 [[Man Page#Colored man pages]].<br />
<br />
===字体===<br />
超多关于字体的信息可以在 [[Fonts]] 和 [[Font Configuration]] 文章中找到.<br />
<br />
====终端字体====<br />
如果你大部分时间是在使用虚拟终端 (也就是在 X 窗口以外的字符界面), 你可能想美化一下终端的字体参考 [[Fonts#Console fonts]].<br />
<br />
====LCD液晶字体====<br />
在笔记本和液晶显示器上可使用一些补丁包来实现字体平滑优化功能, 参见 [[Font Configuration#LCD filter patched packages]].<br />
<br />
==启动==<br />
''本栏讨论启动过程中的问题. ArchLinux启动过程的详情可在这里找到 [[Arch Boot Process]]. 更多信息参考 [[:Category:Boot process (English)]].''<br />
<br />
===幕后进程===<br />
幕后进程是在背景运行的程序, 通常在操作系统启动时就开始运行了. 为了加快系统启动速度, 有些进程可以被幕后启动, 也就是说系统启动不会等待该进程启动结束再继续, 而是并行启动. 在 [[Daemon]] 里有详细的解释.<br />
<br />
===硬件自动识别===<br />
硬件应该默认在系统启动过程中自动被 [[udev]] 检测到. <br />
<br />
为了加快启动速度, 可以关掉自动加载模块, 然后手动指定需要的模块, 参见 [[rc.conf#Hardware]]. <br />
<br />
另外X窗口 [[Xorg]] 应该能依靠 [[HAL]]自动检测到驱动, 不过同样用户可以手动指定选项, 参见 [[Xorg Input Hotplugging]].<br />
<br />
===LILO 速度优化===<br />
除了 [[GRUB]], LILO 是最众所周知的 Linux 引导管理器. 照着 [[LILO#Sample setup]] 里的步骤来充分使用它的功能.<br />
<br />
===开机激活数字小键盘===<br />
大多数键盘都有数字小键盘和数字键盘开关键. 设置开机激活数字键盘, 参见 [[Activating Numlock on Bootup]].<br />
<br />
===保留引导信息===<br />
一旦引导结束, 提示符出现并清屏, 用户将无法获得启动过程中的反馈信息. [[Disable clearing of boot messages]] 告诉你改如何避免.<br />
<br />
===Start X at boot===<br />
If utilizing an [[X]] server to provide a graphical user interface, users may wish to start this server during the boot process rather than starting it manually after login. See [[Display Manager]] if desiring a graphical login or [[Start X at boot]] for methods that do not involve a display manager.<br />
<br />
==Console improvements==<br />
''This section applies to small modifications that better console program's practicality. For more, please see [[:Category:Command shells (English)]] and [[:Category:Utilities (English)]].''<br />
<br />
===Aliases===<br />
Users can define shortcuts for frequently-used commands using a built-in shell command. Common time-saving aliases can be found in [[Core Utilities#alias]].<br />
<br />
===Bash additions===<br />
A list of miscellaneous Bash settings, including completion enhancements, history search and readline macros is available in [[Bash#Extended usage]].<br />
<br />
===Compressed files===<br />
====Browsing compressed files====<br />
====Extracting compressed files====<br />
<br />
===Control echo===<br />
<br />
===Mouse support===<br />
Using a mouse with the console for copy-paste operations can be preferred over [[screen]]'s traditional copy mode. Refer to [[Console Mouse Support]] for comprehensive directions.<br />
<br />
==Input==<br />
''This section contains popular input device configuration tips. For more, please see [[:Category:Input devices (English)]].''<br />
<br />
===Configure all mouse buttons===<br />
Owners of advanced or unusual mice may find that not all mouse buttons are recognized by default, or may wish to assign different actions for extra buttons. Instructions can be found in [[Get All Mouse Buttons Working]].<br />
<br />
===Keyboard layouts===<br />
Non-English or otherwise non-standard keyboards may not function as expected by default. To define the keymap in virtual consoles, the [[KEYMAP]] variable must be set in [[rc.conf]]. For [[Xorg]] users, the required changes are described in [[Xorg#Keyboard layout]].<br />
<br />
===Laptop touchpads===<br />
Many laptops use [http://www.synaptics.com/ Synaptics] or [http://www.alps.com/ ALPS] "touchpad" pointing devices. These, and several other touchpad models, use the Synaptics input driver; see [[Touchpad Synaptics]] for installation and configuration details.<br />
<br />
==Package management==<br />
''This section contains helpful information related to package management. All users should at least be familiar with the [[pacman]] package manager. For more, please see [[:Category:Package management (English)]].''<br />
<br />
===Aliases for pacman===<br />
Aliasing a command, or a group thereof, is a way of saving time when using the console. This is specially helpful for repetitive tasks that don't need significant alteration to their parameters between executions. Various time saving pacman aliases are organized in [[pacman Tips]], besides other suggested tools.<br />
<br />
===Arch Build System===<br />
''Ports'' is a system initially used by BSD distributions consisting of build scripts that reside in a directory tree on the local system. Simply put, each port contains a script within a directory intuitively named after the installable third-party application.<br />
<br />
The [[ABS]] tree offers the same functionality by providing build scripts called [[PKGBUILD]]s, which are populated with information for a given piece of software; integrity hashes, project URL, version, license and build instructions. These PKGBUILDs are later parsed by [[makepkg]], the actual program that generates packages cleanly manageable by pacman.<br />
<br />
Every package in the repositories along with those present in the AUR are subject to recompilation with makepkg.<br />
<br />
===Arch User Repository===<br />
While the [[ABS]] tree allows the ability of building software available in the official repositories, the [[AUR]] is the equivalent for user submitted packages. It is an unsupported repository of build scripts accessible through the [http://aur.archlinux.org/index.php web interface] or by an [[AUR helper]].<br />
<br />
AUR helpers like [[Yaourt]] and [[aurbuild]] add seamless access to the AUR. They may vary in features, but all ease in searching, fetching, building, and installing from over 18,673 PKGBUILDs found in the unofficial repository.<br />
<br />
===Mirrors===<br />
Visit [[Mirrors]] for steps on taking full advantage of using the fastest and most up to date pacman mirrors. As explained in the article, a particularly good advice is to routinely check [http://users.archlinux.de/~gerbra/mirrorcheck.html Mirrorcheck] and/or [http://www.archlinux.de/?page=MirrorStatus Mirror status] for a list of mirrors that have been recently synced.<br />
<br />
==Power management==<br />
''This section may be of use to laptop owners or users otherwise seeking power management controls. For more, please see [[:Category:Power management (English)]].''<br />
<br />
===acpid===<br />
Users can configure how the system reacts to ACPI events such as pressing the power button or closing a laptop's lid using [[acpid]].<br />
<br />
===CPU frequency scaling===<br />
Modern processors can decrease their frequency and voltage to reduce heat and power consumption. Less heat leads to a quieter system and prolongs the life of hardware. [[cpufrequtils]] is a set of utilities designed to assist CPU frequency scaling.<br />
<br />
===Laptops===<br />
For articles related to portable computing along with model-specific installation guides, please see [[:Category:Laptops (English)]]. For a general overview of laptop-related articles and recommendations, see [[Laptop]].<br />
<br />
===Suspending and hibernation===<br />
Several options are available to users desiring suspend-to-RAM (sleep/stand-by) and suspend-to-disk (hibernate) functionality. [[pm-utils]] describes one popular method, while [[hibernate-script]] is an older alternative that does not depend on Xorg packages.<br />
<br />
==Networking==<br />
''This section is confined to small networking procedures. Head over to [[Network]] for a full guide. For more, please see [[:Category:Networking (English)]].''<br />
<br />
===Disable IPv6===<br />
Not only does the module take around 250k of memory, it has also been reported that disabling it notoriously speeds up network access for programs that erroneously try to query servers with it. Incidentally, [[Firefox]] is listed among the affected applications. So until the widespread adoption of IPv6, it may be beneficial to [[IPv6 - Disabling the Module|disable it]].<br />
<br />
===DNS speed improvement===<br />
To improve load time by caching queries, use [[pdnsd]], a very simple program that does not attempt to fill every need. Or install [[dnsmasq]], a broader choice which also supports turning the system into a DHCP server.<br />
<br />
==System administration==<br />
''This section deals with administrative tasks and system management. For more, please see [[:Category:System administration (English)]].''<br />
<br />
===Privilege escalation===<br />
A new installation leaves users with only the super user account, better known as root. Logging in as root for prolonged periods of time is widely considered to be foolish and insecure. Instead, users should [[User Management|create]] and use unprivileged user accounts for most tasks, only using the root account for system administration. The [[su]] (substitute user) command allows assuming the identity of another user on the system (usually root) from an existing login, whereas the [[sudo]] command grants temporary privilege escalation for a specific command.<br />
<br />
===Windows networking===<br />
To enable communication between Windows and Arch Linux machines across a network, users can use [[Samba]]; a re-implementation of the SMB/CIFS networking protocol.<br />
<br />
==System services==<br />
''This section relates to daemons. For more, please see [[:Category:Daemons and system services (English)]].''<br />
<br />
===HAL===<br />
After having installed a desktop environment or window manager, installing [[HAL]] seems like a natural follow-up since it enables plug-and-play functionality for mobile phones, MP3 players, external HDDs, and other hardware. Often, HAL is used to mount the device and make an icon on a convenient place, like the desktop or in 'My Computer', allowing access to the peripheral soon after it has been plugged in. Altogether, this avoids manual [[fstab]] configuration or making [[udev]] rules for each and every new device.<br />
<br />
[[KDE]], [[GNOME]] and [[Xfce]] all use [[HAL]].<br />
<br />
===Local mail delivery===<br />
A default base setup bestows no means for mail syncing. To configure postfix for simple local mailbox delivery, see [[Local Mail Delivery with Postfix]]. Other options are [[SSMTP]], [[MSMTP]] and [[fdm]].</div>
Flydragon
https://wiki.archlinux.org/index.php?title=General_recommendations_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=92164
General recommendations (简体中文)
2010-01-14T12:06:47Z
<p>Flydragon: /* Num Lock activation at boot */</p>
<hr />
<div>[[Category:Getting and installing Arch (简体中文)]]<br />
[[Category:HOWTOs (简体中文)]]<br />
{{i18n|General Recommendations}}<br />
{{Article summary start}}<br />
{{Article summary text|提供一个给高级用户和菜鸟们的涉及各种课题的有用的文章列表或索引}}<br />
{{Article summary heading|相关文章}}<br />
{{Article summary wiki|Common Applications}}<br />
{{Article summary wiki|Lightweight Applications}}<br />
{{Article summary end}}<br />
<br />
这篇文章是一个关于各种常用或受欢迎的文章的详细索引.<br />
大多数软件需要用 [[pacman]] 来安装, 包括 [[Official Repositories]], 那些在 [[Arch User Repository]] 里的非正式发布或不稳定的软件, 则需要 [[makepkg]] 参见 [[AUR helper]]. 总而言之, 继续阅读的同学们最好对ArchLinux里的软件安装已经很熟悉.<br />
<br />
有些软件或话题是基于你有一个完美安装的系统. 比如如果是图形界面软件, 你当然需要已经阅读和安装 [[Xorg]] X窗口系统, 打印相关的软件你当然已经搞定 [[CUPS]] 等等, 所有看官要对文件系统有个概念, 建议参阅 [[FHS]].<br />
<br />
所以说你最好已经仔细看过 [[Arch 新手安装指南 (简体中文)]] 或者 [[Official Arch Linux Install Guide]] 来获得一个对ArchLinux安装的常识.<br />
<br />
文章标题按字母排序.<br />
<br />
==外观美化==<br />
''本栏将讨论ArchLinux界面的美化和外观方案等. 更多信息请参考 [[:Category:Eye candy (English)]].''<br />
<br />
===彩色字符===<br />
虽然已经有一部分软件具有输出彩色字符的能力, 使用通用的彩色字过滤器也是另一种方法. 安装 {{package AUR|cope}} 或 {{package AUR|cope-git}}, 经常更新的 [[Git]] 版本, 可以从 [[AUR]]安装. {{Package AUR|acoc}} 和 {{Package AUR|cw}} 也是类似的选择.<br />
<br />
====字符界面====<br />
字符界面 (PS1) 可以被灵活的定制. 参考 [http://bbs.archlinux.org/viewtopic.php?id=50885 What's your PS1?] 论坛里的帖子. 也可参阅 [[Color Bash Prompt]] 或 [[Zsh#Prompts]] 如果你使用 Bash 或 Zsh 的话.<br />
<br />
====核心工具====<br />
详细讨论核心工具例如 '''grep''' and '''ls''' 参见 [[Core Utilities]] 文章.<br />
<br />
====Emacs外壳====<br />
Emacs 总所周知地在普通的字处理以外还具有很多高级功能, 其中包括一个全功能外壳. 参见 [[Emacs#Colored output issues]] 获知如何处理彩色字符带来的显示问题.<br />
<br />
====帮助文档====<br />
帮助文档是GNU/Linux用户能找到的最有用的信息资源之一. 为了提高可读性, 可以配置帮助文档来显示彩色字符参见 [[Man Page#Colored man pages]].<br />
<br />
===字体===<br />
超多关于字体的信息可以在 [[Fonts]] 和 [[Font Configuration]] 文章中找到.<br />
<br />
====终端字体====<br />
如果你大部分时间是在使用虚拟终端 (也就是在 X 窗口以外的字符界面), 你可能想美化一下终端的字体参考 [[Fonts#Console fonts]].<br />
<br />
====LCD液晶字体====<br />
在笔记本和液晶显示器上可使用一些补丁包来实现字体平滑优化功能, 参见 [[Font Configuration#LCD filter patched packages]].<br />
<br />
==启动==<br />
''本栏讨论启动过程中的问题. ArchLinux启动过程的详情可在这里找到 [[Arch Boot Process]]. 更多信息参考 [[:Category:Boot process (English)]].''<br />
<br />
===幕后进程===<br />
幕后进程是在背景运行的程序, 通常在操作系统启动时就开始运行了. 为了加快系统启动速度, 有些进程可以被幕后启动, 也就是说系统启动不会等待该进程启动结束再继续, 而是并行启动. 在 [[Daemon]] 里有详细的解释.<br />
<br />
===硬件自动识别===<br />
硬件应该默认在系统启动过程中自动被 [[udev]] 检测到. <br />
<br />
为了加快启动速度, 可以关掉自动加载模块, 然后手动指定需要的模块, 参见 [[rc.conf#Hardware]]. <br />
<br />
另外X窗口 [[Xorg]] 应该能依靠 [[HAL]]自动检测到驱动, 不过同样用户可以手动指定选项, 参见 [[Xorg Input Hotplugging]].<br />
<br />
===LILO 速度优化===<br />
除了 [[GRUB]], LILO 是最众所周知的 Linux 引导管理器. 照着 [[LILO#Sample setup]] 里的步骤来充分使用它的功能.<br />
<br />
===开机激活数字小键盘===<br />
大多数键盘都有数字小键盘和数字键盘开关键. 设置开机激活数字键盘, 参见 [[Activating Numlock on Bootup]].<br />
<br />
===Retaining boot messages===<br />
Once it concludes, the screen is cleared and the login prompt appears, leaving users unable to gather feedback from the boot process. [[Disable clearing of boot messages]] to overcome this limitation.<br />
<br />
===Start X at boot===<br />
If utilizing an [[X]] server to provide a graphical user interface, users may wish to start this server during the boot process rather than starting it manually after login. See [[Display Manager]] if desiring a graphical login or [[Start X at boot]] for methods that do not involve a display manager.<br />
<br />
==Console improvements==<br />
''This section applies to small modifications that better console program's practicality. For more, please see [[:Category:Command shells (English)]] and [[:Category:Utilities (English)]].''<br />
<br />
===Aliases===<br />
Users can define shortcuts for frequently-used commands using a built-in shell command. Common time-saving aliases can be found in [[Core Utilities#alias]].<br />
<br />
===Bash additions===<br />
A list of miscellaneous Bash settings, including completion enhancements, history search and readline macros is available in [[Bash#Extended usage]].<br />
<br />
===Compressed files===<br />
====Browsing compressed files====<br />
====Extracting compressed files====<br />
<br />
===Control echo===<br />
<br />
===Mouse support===<br />
Using a mouse with the console for copy-paste operations can be preferred over [[screen]]'s traditional copy mode. Refer to [[Console Mouse Support]] for comprehensive directions.<br />
<br />
==Input==<br />
''This section contains popular input device configuration tips. For more, please see [[:Category:Input devices (English)]].''<br />
<br />
===Configure all mouse buttons===<br />
Owners of advanced or unusual mice may find that not all mouse buttons are recognized by default, or may wish to assign different actions for extra buttons. Instructions can be found in [[Get All Mouse Buttons Working]].<br />
<br />
===Keyboard layouts===<br />
Non-English or otherwise non-standard keyboards may not function as expected by default. To define the keymap in virtual consoles, the [[KEYMAP]] variable must be set in [[rc.conf]]. For [[Xorg]] users, the required changes are described in [[Xorg#Keyboard layout]].<br />
<br />
===Laptop touchpads===<br />
Many laptops use [http://www.synaptics.com/ Synaptics] or [http://www.alps.com/ ALPS] "touchpad" pointing devices. These, and several other touchpad models, use the Synaptics input driver; see [[Touchpad Synaptics]] for installation and configuration details.<br />
<br />
==Package management==<br />
''This section contains helpful information related to package management. All users should at least be familiar with the [[pacman]] package manager. For more, please see [[:Category:Package management (English)]].''<br />
<br />
===Aliases for pacman===<br />
Aliasing a command, or a group thereof, is a way of saving time when using the console. This is specially helpful for repetitive tasks that don't need significant alteration to their parameters between executions. Various time saving pacman aliases are organized in [[pacman Tips]], besides other suggested tools.<br />
<br />
===Arch Build System===<br />
''Ports'' is a system initially used by BSD distributions consisting of build scripts that reside in a directory tree on the local system. Simply put, each port contains a script within a directory intuitively named after the installable third-party application.<br />
<br />
The [[ABS]] tree offers the same functionality by providing build scripts called [[PKGBUILD]]s, which are populated with information for a given piece of software; integrity hashes, project URL, version, license and build instructions. These PKGBUILDs are later parsed by [[makepkg]], the actual program that generates packages cleanly manageable by pacman.<br />
<br />
Every package in the repositories along with those present in the AUR are subject to recompilation with makepkg.<br />
<br />
===Arch User Repository===<br />
While the [[ABS]] tree allows the ability of building software available in the official repositories, the [[AUR]] is the equivalent for user submitted packages. It is an unsupported repository of build scripts accessible through the [http://aur.archlinux.org/index.php web interface] or by an [[AUR helper]].<br />
<br />
AUR helpers like [[Yaourt]] and [[aurbuild]] add seamless access to the AUR. They may vary in features, but all ease in searching, fetching, building, and installing from over 18,673 PKGBUILDs found in the unofficial repository.<br />
<br />
===Mirrors===<br />
Visit [[Mirrors]] for steps on taking full advantage of using the fastest and most up to date pacman mirrors. As explained in the article, a particularly good advice is to routinely check [http://users.archlinux.de/~gerbra/mirrorcheck.html Mirrorcheck] and/or [http://www.archlinux.de/?page=MirrorStatus Mirror status] for a list of mirrors that have been recently synced.<br />
<br />
==Power management==<br />
''This section may be of use to laptop owners or users otherwise seeking power management controls. For more, please see [[:Category:Power management (English)]].''<br />
<br />
===acpid===<br />
Users can configure how the system reacts to ACPI events such as pressing the power button or closing a laptop's lid using [[acpid]].<br />
<br />
===CPU frequency scaling===<br />
Modern processors can decrease their frequency and voltage to reduce heat and power consumption. Less heat leads to a quieter system and prolongs the life of hardware. [[cpufrequtils]] is a set of utilities designed to assist CPU frequency scaling.<br />
<br />
===Laptops===<br />
For articles related to portable computing along with model-specific installation guides, please see [[:Category:Laptops (English)]]. For a general overview of laptop-related articles and recommendations, see [[Laptop]].<br />
<br />
===Suspending and hibernation===<br />
Several options are available to users desiring suspend-to-RAM (sleep/stand-by) and suspend-to-disk (hibernate) functionality. [[pm-utils]] describes one popular method, while [[hibernate-script]] is an older alternative that does not depend on Xorg packages.<br />
<br />
==Networking==<br />
''This section is confined to small networking procedures. Head over to [[Network]] for a full guide. For more, please see [[:Category:Networking (English)]].''<br />
<br />
===Disable IPv6===<br />
Not only does the module take around 250k of memory, it has also been reported that disabling it notoriously speeds up network access for programs that erroneously try to query servers with it. Incidentally, [[Firefox]] is listed among the affected applications. So until the widespread adoption of IPv6, it may be beneficial to [[IPv6 - Disabling the Module|disable it]].<br />
<br />
===DNS speed improvement===<br />
To improve load time by caching queries, use [[pdnsd]], a very simple program that does not attempt to fill every need. Or install [[dnsmasq]], a broader choice which also supports turning the system into a DHCP server.<br />
<br />
==System administration==<br />
''This section deals with administrative tasks and system management. For more, please see [[:Category:System administration (English)]].''<br />
<br />
===Privilege escalation===<br />
A new installation leaves users with only the super user account, better known as root. Logging in as root for prolonged periods of time is widely considered to be foolish and insecure. Instead, users should [[User Management|create]] and use unprivileged user accounts for most tasks, only using the root account for system administration. The [[su]] (substitute user) command allows assuming the identity of another user on the system (usually root) from an existing login, whereas the [[sudo]] command grants temporary privilege escalation for a specific command.<br />
<br />
===Windows networking===<br />
To enable communication between Windows and Arch Linux machines across a network, users can use [[Samba]]; a re-implementation of the SMB/CIFS networking protocol.<br />
<br />
==System services==<br />
''This section relates to daemons. For more, please see [[:Category:Daemons and system services (English)]].''<br />
<br />
===HAL===<br />
After having installed a desktop environment or window manager, installing [[HAL]] seems like a natural follow-up since it enables plug-and-play functionality for mobile phones, MP3 players, external HDDs, and other hardware. Often, HAL is used to mount the device and make an icon on a convenient place, like the desktop or in 'My Computer', allowing access to the peripheral soon after it has been plugged in. Altogether, this avoids manual [[fstab]] configuration or making [[udev]] rules for each and every new device.<br />
<br />
[[KDE]], [[GNOME]] and [[Xfce]] all use [[HAL]].<br />
<br />
===Local mail delivery===<br />
A default base setup bestows no means for mail syncing. To configure postfix for simple local mailbox delivery, see [[Local Mail Delivery with Postfix]]. Other options are [[SSMTP]], [[MSMTP]] and [[fdm]].</div>
Flydragon
https://wiki.archlinux.org/index.php?title=General_recommendations_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=92163
General recommendations (简体中文)
2010-01-14T11:41:33Z
<p>Flydragon: /* LILO speed improvement */</p>
<hr />
<div>[[Category:Getting and installing Arch (简体中文)]]<br />
[[Category:HOWTOs (简体中文)]]<br />
{{i18n|General Recommendations}}<br />
{{Article summary start}}<br />
{{Article summary text|提供一个给高级用户和菜鸟们的涉及各种课题的有用的文章列表或索引}}<br />
{{Article summary heading|相关文章}}<br />
{{Article summary wiki|Common Applications}}<br />
{{Article summary wiki|Lightweight Applications}}<br />
{{Article summary end}}<br />
<br />
这篇文章是一个关于各种常用或受欢迎的文章的详细索引.<br />
大多数软件需要用 [[pacman]] 来安装, 包括 [[Official Repositories]], 那些在 [[Arch User Repository]] 里的非正式发布或不稳定的软件, 则需要 [[makepkg]] 参见 [[AUR helper]]. 总而言之, 继续阅读的同学们最好对ArchLinux里的软件安装已经很熟悉.<br />
<br />
有些软件或话题是基于你有一个完美安装的系统. 比如如果是图形界面软件, 你当然需要已经阅读和安装 [[Xorg]] X窗口系统, 打印相关的软件你当然已经搞定 [[CUPS]] 等等, 所有看官要对文件系统有个概念, 建议参阅 [[FHS]].<br />
<br />
所以说你最好已经仔细看过 [[Arch 新手安装指南 (简体中文)]] 或者 [[Official Arch Linux Install Guide]] 来获得一个对ArchLinux安装的常识.<br />
<br />
文章标题按字母排序.<br />
<br />
==外观美化==<br />
''本栏将讨论ArchLinux界面的美化和外观方案等. 更多信息请参考 [[:Category:Eye candy (English)]].''<br />
<br />
===彩色字符===<br />
虽然已经有一部分软件具有输出彩色字符的能力, 使用通用的彩色字过滤器也是另一种方法. 安装 {{package AUR|cope}} 或 {{package AUR|cope-git}}, 经常更新的 [[Git]] 版本, 可以从 [[AUR]]安装. {{Package AUR|acoc}} 和 {{Package AUR|cw}} 也是类似的选择.<br />
<br />
====字符界面====<br />
字符界面 (PS1) 可以被灵活的定制. 参考 [http://bbs.archlinux.org/viewtopic.php?id=50885 What's your PS1?] 论坛里的帖子. 也可参阅 [[Color Bash Prompt]] 或 [[Zsh#Prompts]] 如果你使用 Bash 或 Zsh 的话.<br />
<br />
====核心工具====<br />
详细讨论核心工具例如 '''grep''' and '''ls''' 参见 [[Core Utilities]] 文章.<br />
<br />
====Emacs外壳====<br />
Emacs 总所周知地在普通的字处理以外还具有很多高级功能, 其中包括一个全功能外壳. 参见 [[Emacs#Colored output issues]] 获知如何处理彩色字符带来的显示问题.<br />
<br />
====帮助文档====<br />
帮助文档是GNU/Linux用户能找到的最有用的信息资源之一. 为了提高可读性, 可以配置帮助文档来显示彩色字符参见 [[Man Page#Colored man pages]].<br />
<br />
===字体===<br />
超多关于字体的信息可以在 [[Fonts]] 和 [[Font Configuration]] 文章中找到.<br />
<br />
====终端字体====<br />
如果你大部分时间是在使用虚拟终端 (也就是在 X 窗口以外的字符界面), 你可能想美化一下终端的字体参考 [[Fonts#Console fonts]].<br />
<br />
====LCD液晶字体====<br />
在笔记本和液晶显示器上可使用一些补丁包来实现字体平滑优化功能, 参见 [[Font Configuration#LCD filter patched packages]].<br />
<br />
==启动==<br />
''本栏讨论启动过程中的问题. ArchLinux启动过程的详情可在这里找到 [[Arch Boot Process]]. 更多信息参考 [[:Category:Boot process (English)]].''<br />
<br />
===幕后进程===<br />
幕后进程是在背景运行的程序, 通常在操作系统启动时就开始运行了. 为了加快系统启动速度, 有些进程可以被幕后启动, 也就是说系统启动不会等待该进程启动结束再继续, 而是并行启动. 在 [[Daemon]] 里有详细的解释.<br />
<br />
===硬件自动识别===<br />
硬件应该默认在系统启动过程中自动被 [[udev]] 检测到. <br />
<br />
为了加快启动速度, 可以关掉自动加载模块, 然后手动指定需要的模块, 参见 [[rc.conf#Hardware]]. <br />
<br />
另外X窗口 [[Xorg]] 应该能依靠 [[HAL]]自动检测到驱动, 不过同样用户可以手动指定选项, 参见 [[Xorg Input Hotplugging]].<br />
<br />
===LILO 速度优化===<br />
除了 [[GRUB]], LILO 是最众所周知的 Linux 引导管理器. 照着 [[LILO#Sample setup]] 里的步骤来充分使用它的功能.<br />
<br />
===Num Lock activation at boot===<br />
Num Lock is a toggle key found in most keyboards. For activating Num Lock's number key-assignment during startup, see [[Activating Numlock on Bootup]].<br />
<br />
===Retaining boot messages===<br />
Once it concludes, the screen is cleared and the login prompt appears, leaving users unable to gather feedback from the boot process. [[Disable clearing of boot messages]] to overcome this limitation.<br />
<br />
===Start X at boot===<br />
If utilizing an [[X]] server to provide a graphical user interface, users may wish to start this server during the boot process rather than starting it manually after login. See [[Display Manager]] if desiring a graphical login or [[Start X at boot]] for methods that do not involve a display manager.<br />
<br />
==Console improvements==<br />
''This section applies to small modifications that better console program's practicality. For more, please see [[:Category:Command shells (English)]] and [[:Category:Utilities (English)]].''<br />
<br />
===Aliases===<br />
Users can define shortcuts for frequently-used commands using a built-in shell command. Common time-saving aliases can be found in [[Core Utilities#alias]].<br />
<br />
===Bash additions===<br />
A list of miscellaneous Bash settings, including completion enhancements, history search and readline macros is available in [[Bash#Extended usage]].<br />
<br />
===Compressed files===<br />
====Browsing compressed files====<br />
====Extracting compressed files====<br />
<br />
===Control echo===<br />
<br />
===Mouse support===<br />
Using a mouse with the console for copy-paste operations can be preferred over [[screen]]'s traditional copy mode. Refer to [[Console Mouse Support]] for comprehensive directions.<br />
<br />
==Input==<br />
''This section contains popular input device configuration tips. For more, please see [[:Category:Input devices (English)]].''<br />
<br />
===Configure all mouse buttons===<br />
Owners of advanced or unusual mice may find that not all mouse buttons are recognized by default, or may wish to assign different actions for extra buttons. Instructions can be found in [[Get All Mouse Buttons Working]].<br />
<br />
===Keyboard layouts===<br />
Non-English or otherwise non-standard keyboards may not function as expected by default. To define the keymap in virtual consoles, the [[KEYMAP]] variable must be set in [[rc.conf]]. For [[Xorg]] users, the required changes are described in [[Xorg#Keyboard layout]].<br />
<br />
===Laptop touchpads===<br />
Many laptops use [http://www.synaptics.com/ Synaptics] or [http://www.alps.com/ ALPS] "touchpad" pointing devices. These, and several other touchpad models, use the Synaptics input driver; see [[Touchpad Synaptics]] for installation and configuration details.<br />
<br />
==Package management==<br />
''This section contains helpful information related to package management. All users should at least be familiar with the [[pacman]] package manager. For more, please see [[:Category:Package management (English)]].''<br />
<br />
===Aliases for pacman===<br />
Aliasing a command, or a group thereof, is a way of saving time when using the console. This is specially helpful for repetitive tasks that don't need significant alteration to their parameters between executions. Various time saving pacman aliases are organized in [[pacman Tips]], besides other suggested tools.<br />
<br />
===Arch Build System===<br />
''Ports'' is a system initially used by BSD distributions consisting of build scripts that reside in a directory tree on the local system. Simply put, each port contains a script within a directory intuitively named after the installable third-party application.<br />
<br />
The [[ABS]] tree offers the same functionality by providing build scripts called [[PKGBUILD]]s, which are populated with information for a given piece of software; integrity hashes, project URL, version, license and build instructions. These PKGBUILDs are later parsed by [[makepkg]], the actual program that generates packages cleanly manageable by pacman.<br />
<br />
Every package in the repositories along with those present in the AUR are subject to recompilation with makepkg.<br />
<br />
===Arch User Repository===<br />
While the [[ABS]] tree allows the ability of building software available in the official repositories, the [[AUR]] is the equivalent for user submitted packages. It is an unsupported repository of build scripts accessible through the [http://aur.archlinux.org/index.php web interface] or by an [[AUR helper]].<br />
<br />
AUR helpers like [[Yaourt]] and [[aurbuild]] add seamless access to the AUR. They may vary in features, but all ease in searching, fetching, building, and installing from over 18,673 PKGBUILDs found in the unofficial repository.<br />
<br />
===Mirrors===<br />
Visit [[Mirrors]] for steps on taking full advantage of using the fastest and most up to date pacman mirrors. As explained in the article, a particularly good advice is to routinely check [http://users.archlinux.de/~gerbra/mirrorcheck.html Mirrorcheck] and/or [http://www.archlinux.de/?page=MirrorStatus Mirror status] for a list of mirrors that have been recently synced.<br />
<br />
==Power management==<br />
''This section may be of use to laptop owners or users otherwise seeking power management controls. For more, please see [[:Category:Power management (English)]].''<br />
<br />
===acpid===<br />
Users can configure how the system reacts to ACPI events such as pressing the power button or closing a laptop's lid using [[acpid]].<br />
<br />
===CPU frequency scaling===<br />
Modern processors can decrease their frequency and voltage to reduce heat and power consumption. Less heat leads to a quieter system and prolongs the life of hardware. [[cpufrequtils]] is a set of utilities designed to assist CPU frequency scaling.<br />
<br />
===Laptops===<br />
For articles related to portable computing along with model-specific installation guides, please see [[:Category:Laptops (English)]]. For a general overview of laptop-related articles and recommendations, see [[Laptop]].<br />
<br />
===Suspending and hibernation===<br />
Several options are available to users desiring suspend-to-RAM (sleep/stand-by) and suspend-to-disk (hibernate) functionality. [[pm-utils]] describes one popular method, while [[hibernate-script]] is an older alternative that does not depend on Xorg packages.<br />
<br />
==Networking==<br />
''This section is confined to small networking procedures. Head over to [[Network]] for a full guide. For more, please see [[:Category:Networking (English)]].''<br />
<br />
===Disable IPv6===<br />
Not only does the module take around 250k of memory, it has also been reported that disabling it notoriously speeds up network access for programs that erroneously try to query servers with it. Incidentally, [[Firefox]] is listed among the affected applications. So until the widespread adoption of IPv6, it may be beneficial to [[IPv6 - Disabling the Module|disable it]].<br />
<br />
===DNS speed improvement===<br />
To improve load time by caching queries, use [[pdnsd]], a very simple program that does not attempt to fill every need. Or install [[dnsmasq]], a broader choice which also supports turning the system into a DHCP server.<br />
<br />
==System administration==<br />
''This section deals with administrative tasks and system management. For more, please see [[:Category:System administration (English)]].''<br />
<br />
===Privilege escalation===<br />
A new installation leaves users with only the super user account, better known as root. Logging in as root for prolonged periods of time is widely considered to be foolish and insecure. Instead, users should [[User Management|create]] and use unprivileged user accounts for most tasks, only using the root account for system administration. The [[su]] (substitute user) command allows assuming the identity of another user on the system (usually root) from an existing login, whereas the [[sudo]] command grants temporary privilege escalation for a specific command.<br />
<br />
===Windows networking===<br />
To enable communication between Windows and Arch Linux machines across a network, users can use [[Samba]]; a re-implementation of the SMB/CIFS networking protocol.<br />
<br />
==System services==<br />
''This section relates to daemons. For more, please see [[:Category:Daemons and system services (English)]].''<br />
<br />
===HAL===<br />
After having installed a desktop environment or window manager, installing [[HAL]] seems like a natural follow-up since it enables plug-and-play functionality for mobile phones, MP3 players, external HDDs, and other hardware. Often, HAL is used to mount the device and make an icon on a convenient place, like the desktop or in 'My Computer', allowing access to the peripheral soon after it has been plugged in. Altogether, this avoids manual [[fstab]] configuration or making [[udev]] rules for each and every new device.<br />
<br />
[[KDE]], [[GNOME]] and [[Xfce]] all use [[HAL]].<br />
<br />
===Local mail delivery===<br />
A default base setup bestows no means for mail syncing. To configure postfix for simple local mailbox delivery, see [[Local Mail Delivery with Postfix]]. Other options are [[SSMTP]], [[MSMTP]] and [[fdm]].</div>
Flydragon
https://wiki.archlinux.org/index.php?title=Talk:Template;i18n&diff=92018
Talk:Template;i18n
2010-01-13T11:04:01Z
<p>Flydragon: </p>
<hr />
<div>Wrapping seems working now, thanks!<br />
Another issue is, I'm confused about the Language list, I don't think it's sorted by ASCII code at the moment, would you please help to double check and sort it out?<br />
Like Czech is start with 142, simplified chinese is start with code 135, japanese is start with 145, but simplified chinese is far behide...<br />
Refer to: [http://www.asciitable.com/]<br />
Thanks in advance,<br />
--[[User:Flydragon|flydragon]] 18:48, 12 January 2010 (EST)<br />
<br />
:I've based the order upon the Wikipedia table sorting algorithm. Visit [[Help:i18n#Languages]] and try sorting the table by "Localized" spellings to see where this comes from (click the >< box beside the column heading.)<br />
<br />
:I'd gladly change the order if this is incorrect, but the ordering must not be "arbitrary".<br />
<br />
:-- [[User:Pointone|pointone]] 19:33, 12 January 2010 (EST)<br />
<br />
Not sure why it's sorting like that, but ok, I give up. Sorry I changed it at first, I didn't know how it sorted, I'm new here, :)<br />
Forget about it then, cheers,<br />
--[[User:Flydragon|flydragon]] 06:04, 13 January 2010 (EST)<br />
<br />
----<br />
<br />
I need help about this, the language list is not wrap line, it's so long that it goes out of my browser window.<br />
I tried in sandbox to break the line, but seems all doesn't work, including <br><br />
<br />
How to get the list to 2 lines, so people can easily see the other languages?<br />
<br />
Thanks,<br />
--[[User:Flydragon|flydragon]] 17:31, 12 January 2010 (EST)<br />
<br />
:Could you please confirm what browser you're using? I've just tested and have the same problem you describe when viewing the page with Internet Explorer. It is rendered properly via Opera, though.<br />
<br />
:I'll play around with this now that I can reproduce the problem...<br />
<br />
:-- [[User:Pointone|pointone]] 18:19, 12 January 2010 (EST)<br />
<br />
I'm using chrome in windows, I tried chromium in ArchLinux and Firefox 3.5 too, all Not wrapping.<br />
--[[User:Flydragon|flydragon]] 18:42, 12 January 2010 (EST)<br />
<br />
Wrapping seems working now, thanks!<br />
--[[User:Flydragon|flydragon]] 19:09, 12 January 2010 (EST)</div>
Flydragon
https://wiki.archlinux.org/index.php?title=Talk:Template;i18n&diff=91945
Talk:Template;i18n
2010-01-13T00:09:42Z
<p>Flydragon: </p>
<hr />
<div>Wrapping seems working now, thanks!<br />
Another issue is, I'm confused about the Language list, I don't think it's sorted by ASCII code at the moment, would you please help to double check and sort it out?<br />
Like Czech is start with 142, simplified chinese is start with code 135, japanese is start with 145, but simplified chinese is far behide...<br />
Refer to: [http://www.asciitable.com/]<br />
Thanks in advance,<br />
--[[User:Flydragon|flydragon]] 18:48, 12 January 2010 (EST)<br />
<br />
----<br />
<br />
I need help about this, the language list is not wrap line, it's so long that it goes out of my browser window.<br />
I tried in sandbox to break the line, but seems all doesn't work, including <br><br />
<br />
How to get the list to 2 lines, so people can easily see the other languages?<br />
<br />
Thanks,<br />
--[[User:Flydragon|flydragon]] 17:31, 12 January 2010 (EST)<br />
<br />
:Could you please confirm what browser you're using? I've just tested and have the same problem you describe when viewing the page with Internet Explorer. It is rendered properly via Opera, though.<br />
<br />
:I'll play around with this now that I can reproduce the problem...<br />
<br />
:-- [[User:Pointone|pointone]] 18:19, 12 January 2010 (EST)<br />
<br />
I'm using chrome in windows, I tried chromium in ArchLinux and Firefox 3.5 too, all Not wrapping.<br />
--[[User:Flydragon|flydragon]] 18:42, 12 January 2010 (EST)<br />
<br />
Wrapping seems working now, thanks!<br />
--[[User:Flydragon|flydragon]] 19:09, 12 January 2010 (EST)</div>
Flydragon
https://wiki.archlinux.org/index.php?title=General_recommendations_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=91944
General recommendations (简体中文)
2010-01-13T00:05:24Z
<p>Flydragon: /* Hardware auto-recognition */</p>
<hr />
<div>[[Category:Getting and installing Arch (简体中文)]]<br />
[[Category:HOWTOs (简体中文)]]<br />
{{i18n|General Recommendations}}<br />
{{Article summary start}}<br />
{{Article summary text|提供一个给高级用户和菜鸟们的涉及各种课题的有用的文章列表或索引}}<br />
{{Article summary heading|相关文章}}<br />
{{Article summary wiki|Common Applications}}<br />
{{Article summary wiki|Lightweight Applications}}<br />
{{Article summary end}}<br />
<br />
这篇文章是一个关于各种常用或受欢迎的文章的详细索引.<br />
大多数软件需要用 [[pacman]] 来安装, 包括 [[Official Repositories]], 那些在 [[Arch User Repository]] 里的非正式发布或不稳定的软件, 则需要 [[makepkg]] 参见 [[AUR helper]]. 总而言之, 继续阅读的同学们最好对ArchLinux里的软件安装已经很熟悉.<br />
<br />
有些软件或话题是基于你有一个完美安装的系统. 比如如果是图形界面软件, 你当然需要已经阅读和安装 [[Xorg]] X窗口系统, 打印相关的软件你当然已经搞定 [[CUPS]] 等等, 所有看官要对文件系统有个概念, 建议参阅 [[FHS]].<br />
<br />
所以说你最好已经仔细看过 [[Arch 新手安装指南 (简体中文)]] 或者 [[Official Arch Linux Install Guide]] 来获得一个对ArchLinux安装的常识.<br />
<br />
文章标题按字母排序.<br />
<br />
==外观美化==<br />
''本栏将讨论ArchLinux界面的美化和外观方案等. 更多信息请参考 [[:Category:Eye candy (English)]].''<br />
<br />
===彩色字符===<br />
虽然已经有一部分软件具有输出彩色字符的能力, 使用通用的彩色字过滤器也是另一种方法. 安装 {{package AUR|cope}} 或 {{package AUR|cope-git}}, 经常更新的 [[Git]] 版本, 可以从 [[AUR]]安装. {{Package AUR|acoc}} 和 {{Package AUR|cw}} 也是类似的选择.<br />
<br />
====字符界面====<br />
字符界面 (PS1) 可以被灵活的定制. 参考 [http://bbs.archlinux.org/viewtopic.php?id=50885 What's your PS1?] 论坛里的帖子. 也可参阅 [[Color Bash Prompt]] 或 [[Zsh#Prompts]] 如果你使用 Bash 或 Zsh 的话.<br />
<br />
====核心工具====<br />
详细讨论核心工具例如 '''grep''' and '''ls''' 参见 [[Core Utilities]] 文章.<br />
<br />
====Emacs外壳====<br />
Emacs 总所周知地在普通的字处理以外还具有很多高级功能, 其中包括一个全功能外壳. 参见 [[Emacs#Colored output issues]] 获知如何处理彩色字符带来的显示问题.<br />
<br />
====帮助文档====<br />
帮助文档是GNU/Linux用户能找到的最有用的信息资源之一. 为了提高可读性, 可以配置帮助文档来显示彩色字符参见 [[Man Page#Colored man pages]].<br />
<br />
===字体===<br />
超多关于字体的信息可以在 [[Fonts]] 和 [[Font Configuration]] 文章中找到.<br />
<br />
====终端字体====<br />
如果你大部分时间是在使用虚拟终端 (也就是在 X 窗口以外的字符界面), 你可能想美化一下终端的字体参考 [[Fonts#Console fonts]].<br />
<br />
====LCD液晶字体====<br />
在笔记本和液晶显示器上可使用一些补丁包来实现字体平滑优化功能, 参见 [[Font Configuration#LCD filter patched packages]].<br />
<br />
==启动==<br />
''本栏讨论启动过程中的问题. ArchLinux启动过程的详情可在这里找到 [[Arch Boot Process]]. 更多信息参考 [[:Category:Boot process (English)]].''<br />
<br />
===幕后进程===<br />
幕后进程是在背景运行的程序, 通常在操作系统启动时就开始运行了. 为了加快系统启动速度, 有些进程可以被幕后启动, 也就是说系统启动不会等待该进程启动结束再继续, 而是并行启动. 在 [[Daemon]] 里有详细的解释.<br />
<br />
===硬件自动识别===<br />
硬件应该默认在系统启动过程中自动被 [[udev]] 检测到. <br />
<br />
为了加快启动速度, 可以关掉自动加载模块, 然后手动指定需要的模块, 参见 [[rc.conf#Hardware]]. <br />
<br />
另外X窗口 [[Xorg]] 应该能依靠 [[HAL]]自动检测到驱动, 不过同样用户可以手动指定选项, 参见 [[Xorg Input Hotplugging]].<br />
<br />
===LILO speed improvement===<br />
Besides [[GRUB]], LILO is the most widely known Linux boot loader, legacy or not. Follow instructions shown in [[LILO#Sample setup]] for making the most out of its features.<br />
<br />
===Num Lock activation at boot===<br />
Num Lock is a toggle key found in most keyboards. For activating Num Lock's number key-assignment during startup, see [[Activating Numlock on Bootup]].<br />
<br />
===Retaining boot messages===<br />
Once it concludes, the screen is cleared and the login prompt appears, leaving users unable to gather feedback from the boot process. [[Disable clearing of boot messages]] to overcome this limitation.<br />
<br />
===Start X at boot===<br />
If utilizing an [[X]] server to provide a graphical user interface, users may wish to start this server during the boot process rather than starting it manually after login. See [[Display Manager]] if desiring a graphical login or [[Start X at boot]] for methods that do not involve a display manager.<br />
<br />
==Console improvements==<br />
''This section applies to small modifications that better console program's practicality. For more, please see [[:Category:Command shells (English)]] and [[:Category:Utilities (English)]].''<br />
<br />
===Aliases===<br />
Users can define shortcuts for frequently-used commands using a built-in shell command. Common time-saving aliases can be found in [[Core Utilities#alias]].<br />
<br />
===Bash additions===<br />
A list of miscellaneous Bash settings, including completion enhancements, history search and readline macros is available in [[Bash#Extended usage]].<br />
<br />
===Compressed files===<br />
====Browsing compressed files====<br />
====Extracting compressed files====<br />
<br />
===Control echo===<br />
<br />
===Mouse support===<br />
Using a mouse with the console for copy-paste operations can be preferred over [[screen]]'s traditional copy mode. Refer to [[Console Mouse Support]] for comprehensive directions.<br />
<br />
==Input==<br />
''This section contains popular input device configuration tips. For more, please see [[:Category:Input devices (English)]].''<br />
<br />
===Configure all mouse buttons===<br />
Owners of advanced or unusual mice may find that not all mouse buttons are recognized by default, or may wish to assign different actions for extra buttons. Instructions can be found in [[Get All Mouse Buttons Working]].<br />
<br />
===Keyboard layouts===<br />
Non-English or otherwise non-standard keyboards may not function as expected by default. To define the keymap in virtual consoles, the [[KEYMAP]] variable must be set in [[rc.conf]]. For [[Xorg]] users, the required changes are described in [[Xorg#Keyboard layout]].<br />
<br />
===Laptop touchpads===<br />
Many laptops use [http://www.synaptics.com/ Synaptics] or [http://www.alps.com/ ALPS] "touchpad" pointing devices. These, and several other touchpad models, use the Synaptics input driver; see [[Touchpad Synaptics]] for installation and configuration details.<br />
<br />
==Package management==<br />
''This section contains helpful information related to package management. All users should at least be familiar with the [[pacman]] package manager. For more, please see [[:Category:Package management (English)]].''<br />
<br />
===Aliases for pacman===<br />
Aliasing a command, or a group thereof, is a way of saving time when using the console. This is specially helpful for repetitive tasks that don't need significant alteration to their parameters between executions. Various time saving pacman aliases are organized in [[pacman Tips]], besides other suggested tools.<br />
<br />
===Arch Build System===<br />
''Ports'' is a system initially used by BSD distributions consisting of build scripts that reside in a directory tree on the local system. Simply put, each port contains a script within a directory intuitively named after the installable third-party application.<br />
<br />
The [[ABS]] tree offers the same functionality by providing build scripts called [[PKGBUILD]]s, which are populated with information for a given piece of software; integrity hashes, project URL, version, license and build instructions. These PKGBUILDs are later parsed by [[makepkg]], the actual program that generates packages cleanly manageable by pacman.<br />
<br />
Every package in the repositories along with those present in the AUR are subject to recompilation with makepkg.<br />
<br />
===Arch User Repository===<br />
While the [[ABS]] tree allows the ability of building software available in the official repositories, the [[AUR]] is the equivalent for user submitted packages. It is an unsupported repository of build scripts accessible through the [http://aur.archlinux.org/index.php web interface] or by an [[AUR helper]].<br />
<br />
AUR helpers like [[Yaourt]] and [[aurbuild]] add seamless access to the AUR. They may vary in features, but all ease in searching, fetching, building, and installing from over 18,673 PKGBUILDs found in the unofficial repository.<br />
<br />
===Mirrors===<br />
Visit [[Mirrors]] for steps on taking full advantage of using the fastest and most up to date pacman mirrors. As explained in the article, a particularly good advice is to routinely check [http://users.archlinux.de/~gerbra/mirrorcheck.html Mirrorcheck] and/or [http://www.archlinux.de/?page=MirrorStatus Mirror status] for a list of mirrors that have been recently synced.<br />
<br />
==Power management==<br />
''This section may be of use to laptop owners or users otherwise seeking power management controls. For more, please see [[:Category:Power management (English)]].''<br />
<br />
===acpid===<br />
Users can configure how the system reacts to ACPI events such as pressing the power button or closing a laptop's lid using [[acpid]].<br />
<br />
===CPU frequency scaling===<br />
Modern processors can decrease their frequency and voltage to reduce heat and power consumption. Less heat leads to a quieter system and prolongs the life of hardware. [[cpufrequtils]] is a set of utilities designed to assist CPU frequency scaling.<br />
<br />
===Laptops===<br />
For articles related to portable computing along with model-specific installation guides, please see [[:Category:Laptops (English)]]. For a general overview of laptop-related articles and recommendations, see [[Laptop]].<br />
<br />
===Suspending and hibernation===<br />
Several options are available to users desiring suspend-to-RAM (sleep/stand-by) and suspend-to-disk (hibernate) functionality. [[pm-utils]] describes one popular method, while [[hibernate-script]] is an older alternative that does not depend on Xorg packages.<br />
<br />
==Networking==<br />
''This section is confined to small networking procedures. Head over to [[Network]] for a full guide. For more, please see [[:Category:Networking (English)]].''<br />
<br />
===Disable IPv6===<br />
Not only does the module take around 250k of memory, it has also been reported that disabling it notoriously speeds up network access for programs that erroneously try to query servers with it. Incidentally, [[Firefox]] is listed among the affected applications. So until the widespread adoption of IPv6, it may be beneficial to [[IPv6 - Disabling the Module|disable it]].<br />
<br />
===DNS speed improvement===<br />
To improve load time by caching queries, use [[pdnsd]], a very simple program that does not attempt to fill every need. Or install [[dnsmasq]], a broader choice which also supports turning the system into a DHCP server.<br />
<br />
==System administration==<br />
''This section deals with administrative tasks and system management. For more, please see [[:Category:System administration (English)]].''<br />
<br />
===Privilege escalation===<br />
A new installation leaves users with only the super user account, better known as root. Logging in as root for prolonged periods of time is widely considered to be foolish and insecure. Instead, users should [[User Management|create]] and use unprivileged user accounts for most tasks, only using the root account for system administration. The [[su]] (substitute user) command allows assuming the identity of another user on the system (usually root) from an existing login, whereas the [[sudo]] command grants temporary privilege escalation for a specific command.<br />
<br />
===Windows networking===<br />
To enable communication between Windows and Arch Linux machines across a network, users can use [[Samba]]; a re-implementation of the SMB/CIFS networking protocol.<br />
<br />
==System services==<br />
''This section relates to daemons. For more, please see [[:Category:Daemons and system services (English)]].''<br />
<br />
===HAL===<br />
After having installed a desktop environment or window manager, installing [[HAL]] seems like a natural follow-up since it enables plug-and-play functionality for mobile phones, MP3 players, external HDDs, and other hardware. Often, HAL is used to mount the device and make an icon on a convenient place, like the desktop or in 'My Computer', allowing access to the peripheral soon after it has been plugged in. Altogether, this avoids manual [[fstab]] configuration or making [[udev]] rules for each and every new device.<br />
<br />
[[KDE]], [[GNOME]] and [[Xfce]] all use [[HAL]].<br />
<br />
===Local mail delivery===<br />
A default base setup bestows no means for mail syncing. To configure postfix for simple local mailbox delivery, see [[Local Mail Delivery with Postfix]]. Other options are [[SSMTP]], [[MSMTP]] and [[fdm]].</div>
Flydragon
https://wiki.archlinux.org/index.php?title=Talk:Template;i18n&diff=91941
Talk:Template;i18n
2010-01-12T23:49:14Z
<p>Flydragon: </p>
<hr />
<div>I need help about this, the language list is not wrap line, it's so long that it goes out of my browser window.<br />
I tried in sandbox to break the line, but seems all doesn't work, including <br><br />
<br />
How to get the list to 2 lines, so people can easily see the other languages?<br />
<br />
Thanks,<br />
--[[User:Flydragon|flydragon]] 17:31, 12 January 2010 (EST)<br />
<br />
:Could you please confirm what browser you're using? I've just tested and have the same problem you describe when viewing the page with Internet Explorer. It is rendered properly via Opera, though.<br />
<br />
:I'll play around with this now that I can reproduce the problem...<br />
<br />
:-- [[User:Pointone|pointone]] 18:19, 12 January 2010 (EST)<br />
<br />
I'm using chrome in windows, I tried chromium in ArchLinux and Firefox 3.5 too, all Not wrapping.<br />
--[[User:Flydragon|flydragon]] 18:42, 12 January 2010 (EST)<br />
<br />
----<br />
<br />
Another issue is, I'm confused about the Language list, I don't think it's sorted by ASCII code at the moment, would you please help to double check and sort it out?<br />
Like Czech is start with 142, simplified chinese is start with code 135, japanese is start with 145, but simplified chinese is far behide...<br />
Refer to: [http://www.asciitable.com/]<br />
Thanks in advance,<br />
--[[User:Flydragon|flydragon]] 18:48, 12 January 2010 (EST)</div>
Flydragon
https://wiki.archlinux.org/index.php?title=Talk:Template;i18n&diff=91940
Talk:Template;i18n
2010-01-12T23:48:54Z
<p>Flydragon: </p>
<hr />
<div>I need help about this, the language list is not wrap line, it's so long that it goes out of my browser window.<br />
I tried in sandbox to break the line, but seems all doesn't work, including <br><br />
<br />
How to get the list to 2 lines, so people can easily see the other languages?<br />
<br />
Thanks,<br />
--[[User:Flydragon|flydragon]] 17:31, 12 January 2010 (EST)<br />
<br />
:Could you please confirm what browser you're using? I've just tested and have the same problem you describe when viewing the page with Internet Explorer. It is rendered properly via Opera, though.<br />
<br />
:I'll play around with this now that I can reproduce the problem...<br />
<br />
:-- [[User:Pointone|pointone]] 18:19, 12 January 2010 (EST)<br />
<br />
I'm using chrome in windows, I tried chromium in ArchLinux and Firefox 3.5 too, all Not wrapping.<br />
--[[User:Flydragon|flydragon]] 18:42, 12 January 2010 (EST)<br />
<br />
Another issue is, I'm confused about the Language list, I don't think it's sorted by ASCII code at the moment, would you please help to double check and sort it out?<br />
Like Czech is start with 142, simplified chinese is start with code 135, japanese is start with 145, but simplified chinese is far behide...<br />
Refer to: [http://www.asciitable.com/]<br />
Thanks in advance,<br />
--[[User:Flydragon|flydragon]] 18:48, 12 January 2010 (EST)</div>
Flydragon
https://wiki.archlinux.org/index.php?title=User_talk:Pointone&diff=91939
User talk:Pointone
2010-01-12T23:47:46Z
<p>Flydragon: </p>
<hr />
<div>Hi and thanks for the good work wrt templates.<br />
I wanted first to get the green/red light for my idea and then proceed w/ adding the templates to the articles that beg for them. Many wiki pages are just a wall of grey text.<br />
<br />
[[User:Karol|Karol]] 17:05, 31 May 2009 (EDT)<br />
<br />
----<br />
<br />
Thanks for fixing Compact TOC! I don't know much about templates/markup. [[User:Manolo|manolo]] 18:49, 10 November 2009 (EST)<br />
<br />
----<br />
<br />
Kudos for cleaning up package-building articles! --[[User:Bhobbit|Bhobbit]] 00:57, 26 November 2009 (EST)<br />
<br />
----<br />
<br />
Really good cleanup and update on Fake RAID article. Thanks. --[[User:Loosec|Loosec]] 12:28, 4 December 2009 (CET)<br />
<br />
----<br />
<br />
I noticed your user page the list of potential protected pages, and was wondering if [[Irc]] has been considered?<br />
--[[User:Gen2ly|Gen2ly]] 10:12, 11 December 2009 (EST)<br />
<br />
:For clarification; my list of consists of protected pages I've wished to edit -- not a complete list of protected pages ([[Special:ProtectedPages]]). [[IRC Channel]] is tagged with an ominous warning against editing! ;)<br />
<br />
:-- [[User:Pointone|pointone]] 18:01, 11 December 2009 (EST)<br />
<br />
----<br />
<br />
Got dayum, pointione. Good work ;) [[User:Pwd|pwd]] 23:01, 15 December 2009 (EST)<br />
<br />
==Section-specific request templates==<br />
:"''e.g. Template:ExpandSection, Template:MoveSection? Would such templates be useful?''"<br />
Splitting templates like that adds to more work when keeping up with the wiki's status on what needs to be done. Simply alter the existing expand/move article templates so that they refer to ''article/section'' instead of just ''article''. [[User:Pwd|pwd]] 22:43, 17 December 2009 (EST)</div>
Flydragon
https://wiki.archlinux.org/index.php?title=Talk:Template;i18n&diff=91938
Talk:Template;i18n
2010-01-12T23:42:40Z
<p>Flydragon: </p>
<hr />
<div>I need help about this, the language list is not wrap line, it's so long that it goes out of my browser window.<br />
I tried in sandbox to break the line, but seems all doesn't work, including <br><br />
<br />
How to get the list to 2 lines, so people can easily see the other languages?<br />
<br />
Thanks,<br />
--[[User:Flydragon|flydragon]] 17:31, 12 January 2010 (EST)<br />
<br />
:Could you please confirm what browser you're using? I've just tested and have the same problem you describe when viewing the page with Internet Explorer. It is rendered properly via Opera, though.<br />
<br />
:I'll play around with this now that I can reproduce the problem...<br />
<br />
:-- [[User:Pointone|pointone]] 18:19, 12 January 2010 (EST)<br />
<br />
I'm using chrome in windows, I tried chromium in ArchLinux and Firefox 3.5 too, all Not wrapping.<br />
--[[User:Flydragon|flydragon]] 18:42, 12 January 2010 (EST)</div>
Flydragon
https://wiki.archlinux.org/index.php?title=General_recommendations_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=91936
General recommendations (简体中文)
2010-01-12T23:32:45Z
<p>Flydragon: /* Backgrounding daemons */</p>
<hr />
<div>[[Category:Getting and installing Arch (简体中文)]]<br />
[[Category:HOWTOs (简体中文)]]<br />
{{i18n|General Recommendations}}<br />
{{Article summary start}}<br />
{{Article summary text|提供一个给高级用户和菜鸟们的涉及各种课题的有用的文章列表或索引}}<br />
{{Article summary heading|相关文章}}<br />
{{Article summary wiki|Common Applications}}<br />
{{Article summary wiki|Lightweight Applications}}<br />
{{Article summary end}}<br />
<br />
这篇文章是一个关于各种常用或受欢迎的文章的详细索引.<br />
大多数软件需要用 [[pacman]] 来安装, 包括 [[Official Repositories]], 那些在 [[Arch User Repository]] 里的非正式发布或不稳定的软件, 则需要 [[makepkg]] 参见 [[AUR helper]]. 总而言之, 继续阅读的同学们最好对ArchLinux里的软件安装已经很熟悉.<br />
<br />
有些软件或话题是基于你有一个完美安装的系统. 比如如果是图形界面软件, 你当然需要已经阅读和安装 [[Xorg]] X窗口系统, 打印相关的软件你当然已经搞定 [[CUPS]] 等等, 所有看官要对文件系统有个概念, 建议参阅 [[FHS]].<br />
<br />
所以说你最好已经仔细看过 [[Arch 新手安装指南 (简体中文)]] 或者 [[Official Arch Linux Install Guide]] 来获得一个对ArchLinux安装的常识.<br />
<br />
文章标题按字母排序.<br />
<br />
==外观美化==<br />
''本栏将讨论ArchLinux界面的美化和外观方案等. 更多信息请参考 [[:Category:Eye candy (English)]].''<br />
<br />
===彩色字符===<br />
虽然已经有一部分软件具有输出彩色字符的能力, 使用通用的彩色字过滤器也是另一种方法. 安装 {{package AUR|cope}} 或 {{package AUR|cope-git}}, 经常更新的 [[Git]] 版本, 可以从 [[AUR]]安装. {{Package AUR|acoc}} 和 {{Package AUR|cw}} 也是类似的选择.<br />
<br />
====字符界面====<br />
字符界面 (PS1) 可以被灵活的定制. 参考 [http://bbs.archlinux.org/viewtopic.php?id=50885 What's your PS1?] 论坛里的帖子. 也可参阅 [[Color Bash Prompt]] 或 [[Zsh#Prompts]] 如果你使用 Bash 或 Zsh 的话.<br />
<br />
====核心工具====<br />
详细讨论核心工具例如 '''grep''' and '''ls''' 参见 [[Core Utilities]] 文章.<br />
<br />
====Emacs外壳====<br />
Emacs 总所周知地在普通的字处理以外还具有很多高级功能, 其中包括一个全功能外壳. 参见 [[Emacs#Colored output issues]] 获知如何处理彩色字符带来的显示问题.<br />
<br />
====帮助文档====<br />
帮助文档是GNU/Linux用户能找到的最有用的信息资源之一. 为了提高可读性, 可以配置帮助文档来显示彩色字符参见 [[Man Page#Colored man pages]].<br />
<br />
===字体===<br />
超多关于字体的信息可以在 [[Fonts]] 和 [[Font Configuration]] 文章中找到.<br />
<br />
====终端字体====<br />
如果你大部分时间是在使用虚拟终端 (也就是在 X 窗口以外的字符界面), 你可能想美化一下终端的字体参考 [[Fonts#Console fonts]].<br />
<br />
====LCD液晶字体====<br />
在笔记本和液晶显示器上可使用一些补丁包来实现字体平滑优化功能, 参见 [[Font Configuration#LCD filter patched packages]].<br />
<br />
==启动==<br />
''本栏讨论启动过程中的问题. ArchLinux启动过程的详情可在这里找到 [[Arch Boot Process]]. 更多信息参考 [[:Category:Boot process (English)]].''<br />
<br />
===幕后进程===<br />
幕后进程是在背景运行的程序, 通常在操作系统启动时就开始运行了. 为了加快系统启动速度, 有些进程可以被幕后启动, 也就是说系统启动不会等待该进程启动结束再继续, 而是并行启动. 在 [[Daemon]] 里有详细的解释.<br />
<br />
===Hardware auto-recognition===<br />
Hardware should be auto-detected by [[udev]] during the boot process by default. A potential improvement in boot time can be achieved by disabling module auto-loading and specifying required modules manually, as described in [[rc.conf#Hardware]]. Additionally [[Xorg]] should be able to auto-detect required drivers using [[HAL]], but users have the option to configure the X server manually, too; see [[Xorg Input Hotplugging]].<br />
<br />
===LILO speed improvement===<br />
Besides [[GRUB]], LILO is the most widely known Linux boot loader, legacy or not. Follow instructions shown in [[LILO#Sample setup]] for making the most out of its features.<br />
<br />
===Num Lock activation at boot===<br />
Num Lock is a toggle key found in most keyboards. For activating Num Lock's number key-assignment during startup, see [[Activating Numlock on Bootup]].<br />
<br />
===Retaining boot messages===<br />
Once it concludes, the screen is cleared and the login prompt appears, leaving users unable to gather feedback from the boot process. [[Disable clearing of boot messages]] to overcome this limitation.<br />
<br />
===Start X at boot===<br />
If utilizing an [[X]] server to provide a graphical user interface, users may wish to start this server during the boot process rather than starting it manually after login. See [[Display Manager]] if desiring a graphical login or [[Start X at boot]] for methods that do not involve a display manager.<br />
<br />
==Console improvements==<br />
''This section applies to small modifications that better console program's practicality. For more, please see [[:Category:Command shells (English)]] and [[:Category:Utilities (English)]].''<br />
<br />
===Aliases===<br />
Users can define shortcuts for frequently-used commands using a built-in shell command. Common time-saving aliases can be found in [[Core Utilities#alias]].<br />
<br />
===Bash additions===<br />
A list of miscellaneous Bash settings, including completion enhancements, history search and readline macros is available in [[Bash#Extended usage]].<br />
<br />
===Compressed files===<br />
====Browsing compressed files====<br />
====Extracting compressed files====<br />
<br />
===Control echo===<br />
<br />
===Mouse support===<br />
Using a mouse with the console for copy-paste operations can be preferred over [[screen]]'s traditional copy mode. Refer to [[Console Mouse Support]] for comprehensive directions.<br />
<br />
==Input==<br />
''This section contains popular input device configuration tips. For more, please see [[:Category:Input devices (English)]].''<br />
<br />
===Configure all mouse buttons===<br />
Owners of advanced or unusual mice may find that not all mouse buttons are recognized by default, or may wish to assign different actions for extra buttons. Instructions can be found in [[Get All Mouse Buttons Working]].<br />
<br />
===Keyboard layouts===<br />
Non-English or otherwise non-standard keyboards may not function as expected by default. To define the keymap in virtual consoles, the [[KEYMAP]] variable must be set in [[rc.conf]]. For [[Xorg]] users, the required changes are described in [[Xorg#Keyboard layout]].<br />
<br />
===Laptop touchpads===<br />
Many laptops use [http://www.synaptics.com/ Synaptics] or [http://www.alps.com/ ALPS] "touchpad" pointing devices. These, and several other touchpad models, use the Synaptics input driver; see [[Touchpad Synaptics]] for installation and configuration details.<br />
<br />
==Package management==<br />
''This section contains helpful information related to package management. All users should at least be familiar with the [[pacman]] package manager. For more, please see [[:Category:Package management (English)]].''<br />
<br />
===Aliases for pacman===<br />
Aliasing a command, or a group thereof, is a way of saving time when using the console. This is specially helpful for repetitive tasks that don't need significant alteration to their parameters between executions. Various time saving pacman aliases are organized in [[pacman Tips]], besides other suggested tools.<br />
<br />
===Arch Build System===<br />
''Ports'' is a system initially used by BSD distributions consisting of build scripts that reside in a directory tree on the local system. Simply put, each port contains a script within a directory intuitively named after the installable third-party application.<br />
<br />
The [[ABS]] tree offers the same functionality by providing build scripts called [[PKGBUILD]]s, which are populated with information for a given piece of software; integrity hashes, project URL, version, license and build instructions. These PKGBUILDs are later parsed by [[makepkg]], the actual program that generates packages cleanly manageable by pacman.<br />
<br />
Every package in the repositories along with those present in the AUR are subject to recompilation with makepkg.<br />
<br />
===Arch User Repository===<br />
While the [[ABS]] tree allows the ability of building software available in the official repositories, the [[AUR]] is the equivalent for user submitted packages. It is an unsupported repository of build scripts accessible through the [http://aur.archlinux.org/index.php web interface] or by an [[AUR helper]].<br />
<br />
AUR helpers like [[Yaourt]] and [[aurbuild]] add seamless access to the AUR. They may vary in features, but all ease in searching, fetching, building, and installing from over 18,673 PKGBUILDs found in the unofficial repository.<br />
<br />
===Mirrors===<br />
Visit [[Mirrors]] for steps on taking full advantage of using the fastest and most up to date pacman mirrors. As explained in the article, a particularly good advice is to routinely check [http://users.archlinux.de/~gerbra/mirrorcheck.html Mirrorcheck] and/or [http://www.archlinux.de/?page=MirrorStatus Mirror status] for a list of mirrors that have been recently synced.<br />
<br />
==Power management==<br />
''This section may be of use to laptop owners or users otherwise seeking power management controls. For more, please see [[:Category:Power management (English)]].''<br />
<br />
===acpid===<br />
Users can configure how the system reacts to ACPI events such as pressing the power button or closing a laptop's lid using [[acpid]].<br />
<br />
===CPU frequency scaling===<br />
Modern processors can decrease their frequency and voltage to reduce heat and power consumption. Less heat leads to a quieter system and prolongs the life of hardware. [[cpufrequtils]] is a set of utilities designed to assist CPU frequency scaling.<br />
<br />
===Laptops===<br />
For articles related to portable computing along with model-specific installation guides, please see [[:Category:Laptops (English)]]. For a general overview of laptop-related articles and recommendations, see [[Laptop]].<br />
<br />
===Suspending and hibernation===<br />
Several options are available to users desiring suspend-to-RAM (sleep/stand-by) and suspend-to-disk (hibernate) functionality. [[pm-utils]] describes one popular method, while [[hibernate-script]] is an older alternative that does not depend on Xorg packages.<br />
<br />
==Networking==<br />
''This section is confined to small networking procedures. Head over to [[Network]] for a full guide. For more, please see [[:Category:Networking (English)]].''<br />
<br />
===Disable IPv6===<br />
Not only does the module take around 250k of memory, it has also been reported that disabling it notoriously speeds up network access for programs that erroneously try to query servers with it. Incidentally, [[Firefox]] is listed among the affected applications. So until the widespread adoption of IPv6, it may be beneficial to [[IPv6 - Disabling the Module|disable it]].<br />
<br />
===DNS speed improvement===<br />
To improve load time by caching queries, use [[pdnsd]], a very simple program that does not attempt to fill every need. Or install [[dnsmasq]], a broader choice which also supports turning the system into a DHCP server.<br />
<br />
==System administration==<br />
''This section deals with administrative tasks and system management. For more, please see [[:Category:System administration (English)]].''<br />
<br />
===Privilege escalation===<br />
A new installation leaves users with only the super user account, better known as root. Logging in as root for prolonged periods of time is widely considered to be foolish and insecure. Instead, users should [[User Management|create]] and use unprivileged user accounts for most tasks, only using the root account for system administration. The [[su]] (substitute user) command allows assuming the identity of another user on the system (usually root) from an existing login, whereas the [[sudo]] command grants temporary privilege escalation for a specific command.<br />
<br />
===Windows networking===<br />
To enable communication between Windows and Arch Linux machines across a network, users can use [[Samba]]; a re-implementation of the SMB/CIFS networking protocol.<br />
<br />
==System services==<br />
''This section relates to daemons. For more, please see [[:Category:Daemons and system services (English)]].''<br />
<br />
===HAL===<br />
After having installed a desktop environment or window manager, installing [[HAL]] seems like a natural follow-up since it enables plug-and-play functionality for mobile phones, MP3 players, external HDDs, and other hardware. Often, HAL is used to mount the device and make an icon on a convenient place, like the desktop or in 'My Computer', allowing access to the peripheral soon after it has been plugged in. Altogether, this avoids manual [[fstab]] configuration or making [[udev]] rules for each and every new device.<br />
<br />
[[KDE]], [[GNOME]] and [[Xfce]] all use [[HAL]].<br />
<br />
===Local mail delivery===<br />
A default base setup bestows no means for mail syncing. To configure postfix for simple local mailbox delivery, see [[Local Mail Delivery with Postfix]]. Other options are [[SSMTP]], [[MSMTP]] and [[fdm]].</div>
Flydragon
https://wiki.archlinux.org/index.php?title=User_talk:Pointone&diff=91934
User talk:Pointone
2010-01-12T22:54:55Z
<p>Flydragon: </p>
<hr />
<div>Hi, I'm confused about the Language list, I don't think it's sorted by ASCII code at the moment, would you please help to double check and sort it out?<br />
Like Czech is start with 142, simplified chinese is start with code 135, japanese is start with 145, but simplified chinese is far behide...<br />
Refer to: [http://www.asciitable.com/]<br />
Thanks in advance,<br />
--[[User:Flydragon|flydragon]] 17:54, 12 January 2010 (EST)<br />
<br />
Hi and thanks for the good work wrt templates.<br />
I wanted first to get the green/red light for my idea and then proceed w/ adding the templates to the articles that beg for them. Many wiki pages are just a wall of grey text.<br />
<br />
[[User:Karol|Karol]] 17:05, 31 May 2009 (EDT)<br />
<br />
----<br />
<br />
Thanks for fixing Compact TOC! I don't know much about templates/markup. [[User:Manolo|manolo]] 18:49, 10 November 2009 (EST)<br />
<br />
----<br />
<br />
Kudos for cleaning up package-building articles! --[[User:Bhobbit|Bhobbit]] 00:57, 26 November 2009 (EST)<br />
<br />
----<br />
<br />
Really good cleanup and update on Fake RAID article. Thanks. --[[User:Loosec|Loosec]] 12:28, 4 December 2009 (CET)<br />
<br />
----<br />
<br />
I noticed your user page the list of potential protected pages, and was wondering if [[Irc]] has been considered?<br />
--[[User:Gen2ly|Gen2ly]] 10:12, 11 December 2009 (EST)<br />
<br />
:For clarification; my list of consists of protected pages I've wished to edit -- not a complete list of protected pages ([[Special:ProtectedPages]]). [[IRC Channel]] is tagged with an ominous warning against editing! ;)<br />
<br />
:-- [[User:Pointone|pointone]] 18:01, 11 December 2009 (EST)<br />
<br />
----<br />
<br />
Got dayum, pointione. Good work ;) [[User:Pwd|pwd]] 23:01, 15 December 2009 (EST)<br />
<br />
==Section-specific request templates==<br />
:"''e.g. Template:ExpandSection, Template:MoveSection? Would such templates be useful?''"<br />
Splitting templates like that adds to more work when keeping up with the wiki's status on what needs to be done. Simply alter the existing expand/move article templates so that they refer to ''article/section'' instead of just ''article''. [[User:Pwd|pwd]] 22:43, 17 December 2009 (EST)</div>
Flydragon
https://wiki.archlinux.org/index.php?title=Talk:Template;i18n&diff=91931
Talk:Template;i18n
2010-01-12T22:31:02Z
<p>Flydragon: Created page with 'I need help about this, the language list is not wrap line, it's so long that it goes out of my browser window. I tried in sandbox to break the line, but seems all doesn't work, …'</p>
<hr />
<div>I need help about this, the language list is not wrap line, it's so long that it goes out of my browser window.<br />
I tried in sandbox to break the line, but seems all doesn't work, including <br><br />
<br />
How to get the list to 2 lines, so people can easily see the other languages?<br />
<br />
Thanks,<br />
--[[User:Flydragon|flydragon]] 17:31, 12 January 2010 (EST)</div>
Flydragon
https://wiki.archlinux.org/index.php?title=General_recommendations_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=91826
General recommendations (简体中文)
2010-01-12T07:13:47Z
<p>Flydragon: /* Booting */</p>
<hr />
<div>[[Category:Getting and installing Arch (简体中文)]]<br />
[[Category:HOWTOs (简体中文)]]<br />
{{i18n|General Recommendations}}<br />
{{Article summary start}}<br />
{{Article summary text|提供一个给高级用户和菜鸟们的涉及各种课题的有用的文章列表或索引}}<br />
{{Article summary heading|相关文章}}<br />
{{Article summary wiki|Common Applications}}<br />
{{Article summary wiki|Lightweight Applications}}<br />
{{Article summary end}}<br />
<br />
这篇文章是一个关于各种常用或受欢迎的文章的详细索引.<br />
大多数软件需要用 [[pacman]] 来安装, 包括 [[Official Repositories]], 那些在 [[Arch User Repository]] 里的非正式发布或不稳定的软件, 则需要 [[makepkg]] 参见 [[AUR helper]]. 总而言之, 继续阅读的同学们最好对ArchLinux里的软件安装已经很熟悉.<br />
<br />
有些软件或话题是基于你有一个完美安装的系统. 比如如果是图形界面软件, 你当然需要已经阅读和安装 [[Xorg]] X窗口系统, 打印相关的软件你当然已经搞定 [[CUPS]] 等等, 所有看官要对文件系统有个概念, 建议参阅 [[FHS]].<br />
<br />
所以说你最好已经仔细看过 [[Arch 新手安装指南 (简体中文)]] 或者 [[Official Arch Linux Install Guide]] 来获得一个对ArchLinux安装的常识.<br />
<br />
文章标题按字母排序.<br />
<br />
==外观美化==<br />
''本栏将讨论ArchLinux界面的美化和外观方案等. 更多信息请参考 [[:Category:Eye candy (English)]].''<br />
<br />
===彩色字符===<br />
虽然已经有一部分软件具有输出彩色字符的能力, 使用通用的彩色字过滤器也是另一种方法. 安装 {{package AUR|cope}} 或 {{package AUR|cope-git}}, 经常更新的 [[Git]] 版本, 可以从 [[AUR]]安装. {{Package AUR|acoc}} 和 {{Package AUR|cw}} 也是类似的选择.<br />
<br />
====字符界面====<br />
字符界面 (PS1) 可以被灵活的定制. 参考 [http://bbs.archlinux.org/viewtopic.php?id=50885 What's your PS1?] 论坛里的帖子. 也可参阅 [[Color Bash Prompt]] 或 [[Zsh#Prompts]] 如果你使用 Bash 或 Zsh 的话.<br />
<br />
====核心工具====<br />
详细讨论核心工具例如 '''grep''' and '''ls''' 参见 [[Core Utilities]] 文章.<br />
<br />
====Emacs外壳====<br />
Emacs 总所周知地在普通的字处理以外还具有很多高级功能, 其中包括一个全功能外壳. 参见 [[Emacs#Colored output issues]] 获知如何处理彩色字符带来的显示问题.<br />
<br />
====帮助文档====<br />
帮助文档是GNU/Linux用户能找到的最有用的信息资源之一. 为了提高可读性, 可以配置帮助文档来显示彩色字符参见 [[Man Page#Colored man pages]].<br />
<br />
===字体===<br />
超多关于字体的信息可以在 [[Fonts]] 和 [[Font Configuration]] 文章中找到.<br />
<br />
====终端字体====<br />
如果你大部分时间是在使用虚拟终端 (也就是在 X 窗口以外的字符界面), 你可能想美化一下终端的字体参考 [[Fonts#Console fonts]].<br />
<br />
====LCD液晶字体====<br />
在笔记本和液晶显示器上可使用一些补丁包来实现字体平滑优化功能, 参见 [[Font Configuration#LCD filter patched packages]].<br />
<br />
==启动==<br />
''本栏讨论启动过程中的问题. ArchLinux启动过程的详情可在这里找到 [[Arch Boot Process]]. 更多信息参考 [[:Category:Boot process (English)]].''<br />
<br />
===Backgrounding daemons===<br />
Daemons are programs that run in the background, and are typically started during boot. In order to speed up the boot process, certain daemons can be ''backgrounded'', allowing the boot process to continue whilst the daemon loads. See [[Daemon]] for a complete explanation.<br />
<br />
===Hardware auto-recognition===<br />
Hardware should be auto-detected by [[udev]] during the boot process by default. A potential improvement in boot time can be achieved by disabling module auto-loading and specifying required modules manually, as described in [[rc.conf#Hardware]]. Additionally [[Xorg]] should be able to auto-detect required drivers using [[HAL]], but users have the option to configure the X server manually, too; see [[Xorg Input Hotplugging]].<br />
<br />
===LILO speed improvement===<br />
Besides [[GRUB]], LILO is the most widely known Linux boot loader, legacy or not. Follow instructions shown in [[LILO#Sample setup]] for making the most out of its features.<br />
<br />
===Num Lock activation at boot===<br />
Num Lock is a toggle key found in most keyboards. For activating Num Lock's number key-assignment during startup, see [[Activating Numlock on Bootup]].<br />
<br />
===Retaining boot messages===<br />
Once it concludes, the screen is cleared and the login prompt appears, leaving users unable to gather feedback from the boot process. [[Disable clearing of boot messages]] to overcome this limitation.<br />
<br />
===Start X at boot===<br />
If utilizing an [[X]] server to provide a graphical user interface, users may wish to start this server during the boot process rather than starting it manually after login. See [[Display Manager]] if desiring a graphical login or [[Start X at boot]] for methods that do not involve a display manager.<br />
<br />
==Console improvements==<br />
''This section applies to small modifications that better console program's practicality. For more, please see [[:Category:Command shells (English)]] and [[:Category:Utilities (English)]].''<br />
<br />
===Aliases===<br />
Users can define shortcuts for frequently-used commands using a built-in shell command. Common time-saving aliases can be found in [[Core Utilities#alias]].<br />
<br />
===Bash additions===<br />
A list of miscellaneous Bash settings, including completion enhancements, history search and readline macros is available in [[Bash#Extended usage]].<br />
<br />
===Compressed files===<br />
====Browsing compressed files====<br />
====Extracting compressed files====<br />
<br />
===Control echo===<br />
<br />
===Mouse support===<br />
Using a mouse with the console for copy-paste operations can be preferred over [[screen]]'s traditional copy mode. Refer to [[Console Mouse Support]] for comprehensive directions.<br />
<br />
==Input==<br />
''This section contains popular input device configuration tips. For more, please see [[:Category:Input devices (English)]].''<br />
<br />
===Configure all mouse buttons===<br />
Owners of advanced or unusual mice may find that not all mouse buttons are recognized by default, or may wish to assign different actions for extra buttons. Instructions can be found in [[Get All Mouse Buttons Working]].<br />
<br />
===Keyboard layouts===<br />
Non-English or otherwise non-standard keyboards may not function as expected by default. To define the keymap in virtual consoles, the [[KEYMAP]] variable must be set in [[rc.conf]]. For [[Xorg]] users, the required changes are described in [[Xorg#Keyboard layout]].<br />
<br />
===Laptop touchpads===<br />
Many laptops use [http://www.synaptics.com/ Synaptics] or [http://www.alps.com/ ALPS] "touchpad" pointing devices. These, and several other touchpad models, use the Synaptics input driver; see [[Touchpad Synaptics]] for installation and configuration details.<br />
<br />
==Package management==<br />
''This section contains helpful information related to package management. All users should at least be familiar with the [[pacman]] package manager. For more, please see [[:Category:Package management (English)]].''<br />
<br />
===Aliases for pacman===<br />
Aliasing a command, or a group thereof, is a way of saving time when using the console. This is specially helpful for repetitive tasks that don't need significant alteration to their parameters between executions. Various time saving pacman aliases are organized in [[pacman Tips]], besides other suggested tools.<br />
<br />
===Arch Build System===<br />
''Ports'' is a system initially used by BSD distributions consisting of build scripts that reside in a directory tree on the local system. Simply put, each port contains a script within a directory intuitively named after the installable third-party application.<br />
<br />
The [[ABS]] tree offers the same functionality by providing build scripts called [[PKGBUILD]]s, which are populated with information for a given piece of software; integrity hashes, project URL, version, license and build instructions. These PKGBUILDs are later parsed by [[makepkg]], the actual program that generates packages cleanly manageable by pacman.<br />
<br />
Every package in the repositories along with those present in the AUR are subject to recompilation with makepkg.<br />
<br />
===Arch User Repository===<br />
While the [[ABS]] tree allows the ability of building software available in the official repositories, the [[AUR]] is the equivalent for user submitted packages. It is an unsupported repository of build scripts accessible through the [http://aur.archlinux.org/index.php web interface] or by an [[AUR helper]].<br />
<br />
AUR helpers like [[Yaourt]] and [[aurbuild]] add seamless access to the AUR. They may vary in features, but all ease in searching, fetching, building, and installing from over 18,673 PKGBUILDs found in the unofficial repository.<br />
<br />
===Mirrors===<br />
Visit [[Mirrors]] for steps on taking full advantage of using the fastest and most up to date pacman mirrors. As explained in the article, a particularly good advice is to routinely check [http://users.archlinux.de/~gerbra/mirrorcheck.html Mirrorcheck] and/or [http://www.archlinux.de/?page=MirrorStatus Mirror status] for a list of mirrors that have been recently synced.<br />
<br />
==Power management==<br />
''This section may be of use to laptop owners or users otherwise seeking power management controls. For more, please see [[:Category:Power management (English)]].''<br />
<br />
===acpid===<br />
Users can configure how the system reacts to ACPI events such as pressing the power button or closing a laptop's lid using [[acpid]].<br />
<br />
===CPU frequency scaling===<br />
Modern processors can decrease their frequency and voltage to reduce heat and power consumption. Less heat leads to a quieter system and prolongs the life of hardware. [[cpufrequtils]] is a set of utilities designed to assist CPU frequency scaling.<br />
<br />
===Laptops===<br />
For articles related to portable computing along with model-specific installation guides, please see [[:Category:Laptops (English)]]. For a general overview of laptop-related articles and recommendations, see [[Laptop]].<br />
<br />
===Suspending and hibernation===<br />
Several options are available to users desiring suspend-to-RAM (sleep/stand-by) and suspend-to-disk (hibernate) functionality. [[pm-utils]] describes one popular method, while [[hibernate-script]] is an older alternative that does not depend on Xorg packages.<br />
<br />
==Networking==<br />
''This section is confined to small networking procedures. Head over to [[Network]] for a full guide. For more, please see [[:Category:Networking (English)]].''<br />
<br />
===Disable IPv6===<br />
Not only does the module take around 250k of memory, it has also been reported that disabling it notoriously speeds up network access for programs that erroneously try to query servers with it. Incidentally, [[Firefox]] is listed among the affected applications. So until the widespread adoption of IPv6, it may be beneficial to [[IPv6 - Disabling the Module|disable it]].<br />
<br />
===DNS speed improvement===<br />
To improve load time by caching queries, use [[pdnsd]], a very simple program that does not attempt to fill every need. Or install [[dnsmasq]], a broader choice which also supports turning the system into a DHCP server.<br />
<br />
==System administration==<br />
''This section deals with administrative tasks and system management. For more, please see [[:Category:System administration (English)]].''<br />
<br />
===Privilege escalation===<br />
A new installation leaves users with only the super user account, better known as root. Logging in as root for prolonged periods of time is widely considered to be foolish and insecure. Instead, users should [[User Management|create]] and use unprivileged user accounts for most tasks, only using the root account for system administration. The [[su]] (substitute user) command allows assuming the identity of another user on the system (usually root) from an existing login, whereas the [[sudo]] command grants temporary privilege escalation for a specific command.<br />
<br />
===Windows networking===<br />
To enable communication between Windows and Arch Linux machines across a network, users can use [[Samba]]; a re-implementation of the SMB/CIFS networking protocol.<br />
<br />
==System services==<br />
''This section relates to daemons. For more, please see [[:Category:Daemons and system services (English)]].''<br />
<br />
===HAL===<br />
After having installed a desktop environment or window manager, installing [[HAL]] seems like a natural follow-up since it enables plug-and-play functionality for mobile phones, MP3 players, external HDDs, and other hardware. Often, HAL is used to mount the device and make an icon on a convenient place, like the desktop or in 'My Computer', allowing access to the peripheral soon after it has been plugged in. Altogether, this avoids manual [[fstab]] configuration or making [[udev]] rules for each and every new device.<br />
<br />
[[KDE]], [[GNOME]] and [[Xfce]] all use [[HAL]].<br />
<br />
===Local mail delivery===<br />
A default base setup bestows no means for mail syncing. To configure postfix for simple local mailbox delivery, see [[Local Mail Delivery with Postfix]]. Other options are [[SSMTP]], [[MSMTP]] and [[fdm]].</div>
Flydragon
https://wiki.archlinux.org/index.php?title=General_recommendations_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=91825
General recommendations (简体中文)
2010-01-12T07:12:01Z
<p>Flydragon: /* Fonts */</p>
<hr />
<div>[[Category:Getting and installing Arch (简体中文)]]<br />
[[Category:HOWTOs (简体中文)]]<br />
{{i18n|General Recommendations}}<br />
{{Article summary start}}<br />
{{Article summary text|提供一个给高级用户和菜鸟们的涉及各种课题的有用的文章列表或索引}}<br />
{{Article summary heading|相关文章}}<br />
{{Article summary wiki|Common Applications}}<br />
{{Article summary wiki|Lightweight Applications}}<br />
{{Article summary end}}<br />
<br />
这篇文章是一个关于各种常用或受欢迎的文章的详细索引.<br />
大多数软件需要用 [[pacman]] 来安装, 包括 [[Official Repositories]], 那些在 [[Arch User Repository]] 里的非正式发布或不稳定的软件, 则需要 [[makepkg]] 参见 [[AUR helper]]. 总而言之, 继续阅读的同学们最好对ArchLinux里的软件安装已经很熟悉.<br />
<br />
有些软件或话题是基于你有一个完美安装的系统. 比如如果是图形界面软件, 你当然需要已经阅读和安装 [[Xorg]] X窗口系统, 打印相关的软件你当然已经搞定 [[CUPS]] 等等, 所有看官要对文件系统有个概念, 建议参阅 [[FHS]].<br />
<br />
所以说你最好已经仔细看过 [[Arch 新手安装指南 (简体中文)]] 或者 [[Official Arch Linux Install Guide]] 来获得一个对ArchLinux安装的常识.<br />
<br />
文章标题按字母排序.<br />
<br />
==外观美化==<br />
''本栏将讨论ArchLinux界面的美化和外观方案等. 更多信息请参考 [[:Category:Eye candy (English)]].''<br />
<br />
===彩色字符===<br />
虽然已经有一部分软件具有输出彩色字符的能力, 使用通用的彩色字过滤器也是另一种方法. 安装 {{package AUR|cope}} 或 {{package AUR|cope-git}}, 经常更新的 [[Git]] 版本, 可以从 [[AUR]]安装. {{Package AUR|acoc}} 和 {{Package AUR|cw}} 也是类似的选择.<br />
<br />
====字符界面====<br />
字符界面 (PS1) 可以被灵活的定制. 参考 [http://bbs.archlinux.org/viewtopic.php?id=50885 What's your PS1?] 论坛里的帖子. 也可参阅 [[Color Bash Prompt]] 或 [[Zsh#Prompts]] 如果你使用 Bash 或 Zsh 的话.<br />
<br />
====核心工具====<br />
详细讨论核心工具例如 '''grep''' and '''ls''' 参见 [[Core Utilities]] 文章.<br />
<br />
====Emacs外壳====<br />
Emacs 总所周知地在普通的字处理以外还具有很多高级功能, 其中包括一个全功能外壳. 参见 [[Emacs#Colored output issues]] 获知如何处理彩色字符带来的显示问题.<br />
<br />
====帮助文档====<br />
帮助文档是GNU/Linux用户能找到的最有用的信息资源之一. 为了提高可读性, 可以配置帮助文档来显示彩色字符参见 [[Man Page#Colored man pages]].<br />
<br />
===字体===<br />
超多关于字体的信息可以在 [[Fonts]] 和 [[Font Configuration]] 文章中找到.<br />
<br />
====终端字体====<br />
如果你大部分时间是在使用虚拟终端 (也就是在 X 窗口以外的字符界面), 你可能想美化一下终端的字体参考 [[Fonts#Console fonts]].<br />
<br />
====LCD液晶字体====<br />
在笔记本和液晶显示器上可使用一些补丁包来实现字体平滑优化功能, 参见 [[Font Configuration#LCD filter patched packages]].<br />
<br />
==Booting==<br />
''This section contains information pertaining to the boot process. An overview of the Arch boot process can be found at [[Arch Boot Process]]. For more, please see [[:Category:Boot process (English)]].''<br />
<br />
===Backgrounding daemons===<br />
Daemons are programs that run in the background, and are typically started during boot. In order to speed up the boot process, certain daemons can be ''backgrounded'', allowing the boot process to continue whilst the daemon loads. See [[Daemon]] for a complete explanation.<br />
<br />
===Hardware auto-recognition===<br />
Hardware should be auto-detected by [[udev]] during the boot process by default. A potential improvement in boot time can be achieved by disabling module auto-loading and specifying required modules manually, as described in [[rc.conf#Hardware]]. Additionally [[Xorg]] should be able to auto-detect required drivers using [[HAL]], but users have the option to configure the X server manually, too; see [[Xorg Input Hotplugging]].<br />
<br />
===LILO speed improvement===<br />
Besides [[GRUB]], LILO is the most widely known Linux boot loader, legacy or not. Follow instructions shown in [[LILO#Sample setup]] for making the most out of its features.<br />
<br />
===Num Lock activation at boot===<br />
Num Lock is a toggle key found in most keyboards. For activating Num Lock's number key-assignment during startup, see [[Activating Numlock on Bootup]].<br />
<br />
===Retaining boot messages===<br />
Once it concludes, the screen is cleared and the login prompt appears, leaving users unable to gather feedback from the boot process. [[Disable clearing of boot messages]] to overcome this limitation.<br />
<br />
===Start X at boot===<br />
If utilizing an [[X]] server to provide a graphical user interface, users may wish to start this server during the boot process rather than starting it manually after login. See [[Display Manager]] if desiring a graphical login or [[Start X at boot]] for methods that do not involve a display manager.<br />
<br />
==Console improvements==<br />
''This section applies to small modifications that better console program's practicality. For more, please see [[:Category:Command shells (English)]] and [[:Category:Utilities (English)]].''<br />
<br />
===Aliases===<br />
Users can define shortcuts for frequently-used commands using a built-in shell command. Common time-saving aliases can be found in [[Core Utilities#alias]].<br />
<br />
===Bash additions===<br />
A list of miscellaneous Bash settings, including completion enhancements, history search and readline macros is available in [[Bash#Extended usage]].<br />
<br />
===Compressed files===<br />
====Browsing compressed files====<br />
====Extracting compressed files====<br />
<br />
===Control echo===<br />
<br />
===Mouse support===<br />
Using a mouse with the console for copy-paste operations can be preferred over [[screen]]'s traditional copy mode. Refer to [[Console Mouse Support]] for comprehensive directions.<br />
<br />
==Input==<br />
''This section contains popular input device configuration tips. For more, please see [[:Category:Input devices (English)]].''<br />
<br />
===Configure all mouse buttons===<br />
Owners of advanced or unusual mice may find that not all mouse buttons are recognized by default, or may wish to assign different actions for extra buttons. Instructions can be found in [[Get All Mouse Buttons Working]].<br />
<br />
===Keyboard layouts===<br />
Non-English or otherwise non-standard keyboards may not function as expected by default. To define the keymap in virtual consoles, the [[KEYMAP]] variable must be set in [[rc.conf]]. For [[Xorg]] users, the required changes are described in [[Xorg#Keyboard layout]].<br />
<br />
===Laptop touchpads===<br />
Many laptops use [http://www.synaptics.com/ Synaptics] or [http://www.alps.com/ ALPS] "touchpad" pointing devices. These, and several other touchpad models, use the Synaptics input driver; see [[Touchpad Synaptics]] for installation and configuration details.<br />
<br />
==Package management==<br />
''This section contains helpful information related to package management. All users should at least be familiar with the [[pacman]] package manager. For more, please see [[:Category:Package management (English)]].''<br />
<br />
===Aliases for pacman===<br />
Aliasing a command, or a group thereof, is a way of saving time when using the console. This is specially helpful for repetitive tasks that don't need significant alteration to their parameters between executions. Various time saving pacman aliases are organized in [[pacman Tips]], besides other suggested tools.<br />
<br />
===Arch Build System===<br />
''Ports'' is a system initially used by BSD distributions consisting of build scripts that reside in a directory tree on the local system. Simply put, each port contains a script within a directory intuitively named after the installable third-party application.<br />
<br />
The [[ABS]] tree offers the same functionality by providing build scripts called [[PKGBUILD]]s, which are populated with information for a given piece of software; integrity hashes, project URL, version, license and build instructions. These PKGBUILDs are later parsed by [[makepkg]], the actual program that generates packages cleanly manageable by pacman.<br />
<br />
Every package in the repositories along with those present in the AUR are subject to recompilation with makepkg.<br />
<br />
===Arch User Repository===<br />
While the [[ABS]] tree allows the ability of building software available in the official repositories, the [[AUR]] is the equivalent for user submitted packages. It is an unsupported repository of build scripts accessible through the [http://aur.archlinux.org/index.php web interface] or by an [[AUR helper]].<br />
<br />
AUR helpers like [[Yaourt]] and [[aurbuild]] add seamless access to the AUR. They may vary in features, but all ease in searching, fetching, building, and installing from over 18,673 PKGBUILDs found in the unofficial repository.<br />
<br />
===Mirrors===<br />
Visit [[Mirrors]] for steps on taking full advantage of using the fastest and most up to date pacman mirrors. As explained in the article, a particularly good advice is to routinely check [http://users.archlinux.de/~gerbra/mirrorcheck.html Mirrorcheck] and/or [http://www.archlinux.de/?page=MirrorStatus Mirror status] for a list of mirrors that have been recently synced.<br />
<br />
==Power management==<br />
''This section may be of use to laptop owners or users otherwise seeking power management controls. For more, please see [[:Category:Power management (English)]].''<br />
<br />
===acpid===<br />
Users can configure how the system reacts to ACPI events such as pressing the power button or closing a laptop's lid using [[acpid]].<br />
<br />
===CPU frequency scaling===<br />
Modern processors can decrease their frequency and voltage to reduce heat and power consumption. Less heat leads to a quieter system and prolongs the life of hardware. [[cpufrequtils]] is a set of utilities designed to assist CPU frequency scaling.<br />
<br />
===Laptops===<br />
For articles related to portable computing along with model-specific installation guides, please see [[:Category:Laptops (English)]]. For a general overview of laptop-related articles and recommendations, see [[Laptop]].<br />
<br />
===Suspending and hibernation===<br />
Several options are available to users desiring suspend-to-RAM (sleep/stand-by) and suspend-to-disk (hibernate) functionality. [[pm-utils]] describes one popular method, while [[hibernate-script]] is an older alternative that does not depend on Xorg packages.<br />
<br />
==Networking==<br />
''This section is confined to small networking procedures. Head over to [[Network]] for a full guide. For more, please see [[:Category:Networking (English)]].''<br />
<br />
===Disable IPv6===<br />
Not only does the module take around 250k of memory, it has also been reported that disabling it notoriously speeds up network access for programs that erroneously try to query servers with it. Incidentally, [[Firefox]] is listed among the affected applications. So until the widespread adoption of IPv6, it may be beneficial to [[IPv6 - Disabling the Module|disable it]].<br />
<br />
===DNS speed improvement===<br />
To improve load time by caching queries, use [[pdnsd]], a very simple program that does not attempt to fill every need. Or install [[dnsmasq]], a broader choice which also supports turning the system into a DHCP server.<br />
<br />
==System administration==<br />
''This section deals with administrative tasks and system management. For more, please see [[:Category:System administration (English)]].''<br />
<br />
===Privilege escalation===<br />
A new installation leaves users with only the super user account, better known as root. Logging in as root for prolonged periods of time is widely considered to be foolish and insecure. Instead, users should [[User Management|create]] and use unprivileged user accounts for most tasks, only using the root account for system administration. The [[su]] (substitute user) command allows assuming the identity of another user on the system (usually root) from an existing login, whereas the [[sudo]] command grants temporary privilege escalation for a specific command.<br />
<br />
===Windows networking===<br />
To enable communication between Windows and Arch Linux machines across a network, users can use [[Samba]]; a re-implementation of the SMB/CIFS networking protocol.<br />
<br />
==System services==<br />
''This section relates to daemons. For more, please see [[:Category:Daemons and system services (English)]].''<br />
<br />
===HAL===<br />
After having installed a desktop environment or window manager, installing [[HAL]] seems like a natural follow-up since it enables plug-and-play functionality for mobile phones, MP3 players, external HDDs, and other hardware. Often, HAL is used to mount the device and make an icon on a convenient place, like the desktop or in 'My Computer', allowing access to the peripheral soon after it has been plugged in. Altogether, this avoids manual [[fstab]] configuration or making [[udev]] rules for each and every new device.<br />
<br />
[[KDE]], [[GNOME]] and [[Xfce]] all use [[HAL]].<br />
<br />
===Local mail delivery===<br />
A default base setup bestows no means for mail syncing. To configure postfix for simple local mailbox delivery, see [[Local Mail Delivery with Postfix]]. Other options are [[SSMTP]], [[MSMTP]] and [[fdm]].</div>
Flydragon
https://wiki.archlinux.org/index.php?title=General_recommendations_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=91824
General recommendations (简体中文)
2010-01-12T07:05:55Z
<p>Flydragon: /* Man pages */</p>
<hr />
<div>[[Category:Getting and installing Arch (简体中文)]]<br />
[[Category:HOWTOs (简体中文)]]<br />
{{i18n|General Recommendations}}<br />
{{Article summary start}}<br />
{{Article summary text|提供一个给高级用户和菜鸟们的涉及各种课题的有用的文章列表或索引}}<br />
{{Article summary heading|相关文章}}<br />
{{Article summary wiki|Common Applications}}<br />
{{Article summary wiki|Lightweight Applications}}<br />
{{Article summary end}}<br />
<br />
这篇文章是一个关于各种常用或受欢迎的文章的详细索引.<br />
大多数软件需要用 [[pacman]] 来安装, 包括 [[Official Repositories]], 那些在 [[Arch User Repository]] 里的非正式发布或不稳定的软件, 则需要 [[makepkg]] 参见 [[AUR helper]]. 总而言之, 继续阅读的同学们最好对ArchLinux里的软件安装已经很熟悉.<br />
<br />
有些软件或话题是基于你有一个完美安装的系统. 比如如果是图形界面软件, 你当然需要已经阅读和安装 [[Xorg]] X窗口系统, 打印相关的软件你当然已经搞定 [[CUPS]] 等等, 所有看官要对文件系统有个概念, 建议参阅 [[FHS]].<br />
<br />
所以说你最好已经仔细看过 [[Arch 新手安装指南 (简体中文)]] 或者 [[Official Arch Linux Install Guide]] 来获得一个对ArchLinux安装的常识.<br />
<br />
文章标题按字母排序.<br />
<br />
==外观美化==<br />
''本栏将讨论ArchLinux界面的美化和外观方案等. 更多信息请参考 [[:Category:Eye candy (English)]].''<br />
<br />
===彩色字符===<br />
虽然已经有一部分软件具有输出彩色字符的能力, 使用通用的彩色字过滤器也是另一种方法. 安装 {{package AUR|cope}} 或 {{package AUR|cope-git}}, 经常更新的 [[Git]] 版本, 可以从 [[AUR]]安装. {{Package AUR|acoc}} 和 {{Package AUR|cw}} 也是类似的选择.<br />
<br />
====字符界面====<br />
字符界面 (PS1) 可以被灵活的定制. 参考 [http://bbs.archlinux.org/viewtopic.php?id=50885 What's your PS1?] 论坛里的帖子. 也可参阅 [[Color Bash Prompt]] 或 [[Zsh#Prompts]] 如果你使用 Bash 或 Zsh 的话.<br />
<br />
====核心工具====<br />
详细讨论核心工具例如 '''grep''' and '''ls''' 参见 [[Core Utilities]] 文章.<br />
<br />
====Emacs外壳====<br />
Emacs 总所周知地在普通的字处理以外还具有很多高级功能, 其中包括一个全功能外壳. 参见 [[Emacs#Colored output issues]] 获知如何处理彩色字符带来的显示问题.<br />
<br />
====帮助文档====<br />
帮助文档是GNU/Linux用户能找到的最有用的信息资源之一. 为了提高可读性, 可以配置帮助文档来显示彩色字符参见 [[Man Page#Colored man pages]].<br />
<br />
===Fonts===<br />
A plethora of information on the subject can be found in the [[Fonts]] and [[Font Configuration]] articles.<br />
<br />
====Console fonts====<br />
If spending a significant amount of time working from the virtual console (i.e. outside an X server), users may wish to change the console font to improve readability; see [[Fonts#Console fonts]].<br />
<br />
====LCD filtered fonts====<br />
Font rendering software can be patched to provide smoother fonts on LCD monitors by taking advantage of sub-pixel elements; see [[Font Configuration#LCD filter patched packages]].<br />
<br />
==Booting==<br />
''This section contains information pertaining to the boot process. An overview of the Arch boot process can be found at [[Arch Boot Process]]. For more, please see [[:Category:Boot process (English)]].''<br />
<br />
===Backgrounding daemons===<br />
Daemons are programs that run in the background, and are typically started during boot. In order to speed up the boot process, certain daemons can be ''backgrounded'', allowing the boot process to continue whilst the daemon loads. See [[Daemon]] for a complete explanation.<br />
<br />
===Hardware auto-recognition===<br />
Hardware should be auto-detected by [[udev]] during the boot process by default. A potential improvement in boot time can be achieved by disabling module auto-loading and specifying required modules manually, as described in [[rc.conf#Hardware]]. Additionally [[Xorg]] should be able to auto-detect required drivers using [[HAL]], but users have the option to configure the X server manually, too; see [[Xorg Input Hotplugging]].<br />
<br />
===LILO speed improvement===<br />
Besides [[GRUB]], LILO is the most widely known Linux boot loader, legacy or not. Follow instructions shown in [[LILO#Sample setup]] for making the most out of its features.<br />
<br />
===Num Lock activation at boot===<br />
Num Lock is a toggle key found in most keyboards. For activating Num Lock's number key-assignment during startup, see [[Activating Numlock on Bootup]].<br />
<br />
===Retaining boot messages===<br />
Once it concludes, the screen is cleared and the login prompt appears, leaving users unable to gather feedback from the boot process. [[Disable clearing of boot messages]] to overcome this limitation.<br />
<br />
===Start X at boot===<br />
If utilizing an [[X]] server to provide a graphical user interface, users may wish to start this server during the boot process rather than starting it manually after login. See [[Display Manager]] if desiring a graphical login or [[Start X at boot]] for methods that do not involve a display manager.<br />
<br />
==Console improvements==<br />
''This section applies to small modifications that better console program's practicality. For more, please see [[:Category:Command shells (English)]] and [[:Category:Utilities (English)]].''<br />
<br />
===Aliases===<br />
Users can define shortcuts for frequently-used commands using a built-in shell command. Common time-saving aliases can be found in [[Core Utilities#alias]].<br />
<br />
===Bash additions===<br />
A list of miscellaneous Bash settings, including completion enhancements, history search and readline macros is available in [[Bash#Extended usage]].<br />
<br />
===Compressed files===<br />
====Browsing compressed files====<br />
====Extracting compressed files====<br />
<br />
===Control echo===<br />
<br />
===Mouse support===<br />
Using a mouse with the console for copy-paste operations can be preferred over [[screen]]'s traditional copy mode. Refer to [[Console Mouse Support]] for comprehensive directions.<br />
<br />
==Input==<br />
''This section contains popular input device configuration tips. For more, please see [[:Category:Input devices (English)]].''<br />
<br />
===Configure all mouse buttons===<br />
Owners of advanced or unusual mice may find that not all mouse buttons are recognized by default, or may wish to assign different actions for extra buttons. Instructions can be found in [[Get All Mouse Buttons Working]].<br />
<br />
===Keyboard layouts===<br />
Non-English or otherwise non-standard keyboards may not function as expected by default. To define the keymap in virtual consoles, the [[KEYMAP]] variable must be set in [[rc.conf]]. For [[Xorg]] users, the required changes are described in [[Xorg#Keyboard layout]].<br />
<br />
===Laptop touchpads===<br />
Many laptops use [http://www.synaptics.com/ Synaptics] or [http://www.alps.com/ ALPS] "touchpad" pointing devices. These, and several other touchpad models, use the Synaptics input driver; see [[Touchpad Synaptics]] for installation and configuration details.<br />
<br />
==Package management==<br />
''This section contains helpful information related to package management. All users should at least be familiar with the [[pacman]] package manager. For more, please see [[:Category:Package management (English)]].''<br />
<br />
===Aliases for pacman===<br />
Aliasing a command, or a group thereof, is a way of saving time when using the console. This is specially helpful for repetitive tasks that don't need significant alteration to their parameters between executions. Various time saving pacman aliases are organized in [[pacman Tips]], besides other suggested tools.<br />
<br />
===Arch Build System===<br />
''Ports'' is a system initially used by BSD distributions consisting of build scripts that reside in a directory tree on the local system. Simply put, each port contains a script within a directory intuitively named after the installable third-party application.<br />
<br />
The [[ABS]] tree offers the same functionality by providing build scripts called [[PKGBUILD]]s, which are populated with information for a given piece of software; integrity hashes, project URL, version, license and build instructions. These PKGBUILDs are later parsed by [[makepkg]], the actual program that generates packages cleanly manageable by pacman.<br />
<br />
Every package in the repositories along with those present in the AUR are subject to recompilation with makepkg.<br />
<br />
===Arch User Repository===<br />
While the [[ABS]] tree allows the ability of building software available in the official repositories, the [[AUR]] is the equivalent for user submitted packages. It is an unsupported repository of build scripts accessible through the [http://aur.archlinux.org/index.php web interface] or by an [[AUR helper]].<br />
<br />
AUR helpers like [[Yaourt]] and [[aurbuild]] add seamless access to the AUR. They may vary in features, but all ease in searching, fetching, building, and installing from over 18,673 PKGBUILDs found in the unofficial repository.<br />
<br />
===Mirrors===<br />
Visit [[Mirrors]] for steps on taking full advantage of using the fastest and most up to date pacman mirrors. As explained in the article, a particularly good advice is to routinely check [http://users.archlinux.de/~gerbra/mirrorcheck.html Mirrorcheck] and/or [http://www.archlinux.de/?page=MirrorStatus Mirror status] for a list of mirrors that have been recently synced.<br />
<br />
==Power management==<br />
''This section may be of use to laptop owners or users otherwise seeking power management controls. For more, please see [[:Category:Power management (English)]].''<br />
<br />
===acpid===<br />
Users can configure how the system reacts to ACPI events such as pressing the power button or closing a laptop's lid using [[acpid]].<br />
<br />
===CPU frequency scaling===<br />
Modern processors can decrease their frequency and voltage to reduce heat and power consumption. Less heat leads to a quieter system and prolongs the life of hardware. [[cpufrequtils]] is a set of utilities designed to assist CPU frequency scaling.<br />
<br />
===Laptops===<br />
For articles related to portable computing along with model-specific installation guides, please see [[:Category:Laptops (English)]]. For a general overview of laptop-related articles and recommendations, see [[Laptop]].<br />
<br />
===Suspending and hibernation===<br />
Several options are available to users desiring suspend-to-RAM (sleep/stand-by) and suspend-to-disk (hibernate) functionality. [[pm-utils]] describes one popular method, while [[hibernate-script]] is an older alternative that does not depend on Xorg packages.<br />
<br />
==Networking==<br />
''This section is confined to small networking procedures. Head over to [[Network]] for a full guide. For more, please see [[:Category:Networking (English)]].''<br />
<br />
===Disable IPv6===<br />
Not only does the module take around 250k of memory, it has also been reported that disabling it notoriously speeds up network access for programs that erroneously try to query servers with it. Incidentally, [[Firefox]] is listed among the affected applications. So until the widespread adoption of IPv6, it may be beneficial to [[IPv6 - Disabling the Module|disable it]].<br />
<br />
===DNS speed improvement===<br />
To improve load time by caching queries, use [[pdnsd]], a very simple program that does not attempt to fill every need. Or install [[dnsmasq]], a broader choice which also supports turning the system into a DHCP server.<br />
<br />
==System administration==<br />
''This section deals with administrative tasks and system management. For more, please see [[:Category:System administration (English)]].''<br />
<br />
===Privilege escalation===<br />
A new installation leaves users with only the super user account, better known as root. Logging in as root for prolonged periods of time is widely considered to be foolish and insecure. Instead, users should [[User Management|create]] and use unprivileged user accounts for most tasks, only using the root account for system administration. The [[su]] (substitute user) command allows assuming the identity of another user on the system (usually root) from an existing login, whereas the [[sudo]] command grants temporary privilege escalation for a specific command.<br />
<br />
===Windows networking===<br />
To enable communication between Windows and Arch Linux machines across a network, users can use [[Samba]]; a re-implementation of the SMB/CIFS networking protocol.<br />
<br />
==System services==<br />
''This section relates to daemons. For more, please see [[:Category:Daemons and system services (English)]].''<br />
<br />
===HAL===<br />
After having installed a desktop environment or window manager, installing [[HAL]] seems like a natural follow-up since it enables plug-and-play functionality for mobile phones, MP3 players, external HDDs, and other hardware. Often, HAL is used to mount the device and make an icon on a convenient place, like the desktop or in 'My Computer', allowing access to the peripheral soon after it has been plugged in. Altogether, this avoids manual [[fstab]] configuration or making [[udev]] rules for each and every new device.<br />
<br />
[[KDE]], [[GNOME]] and [[Xfce]] all use [[HAL]].<br />
<br />
===Local mail delivery===<br />
A default base setup bestows no means for mail syncing. To configure postfix for simple local mailbox delivery, see [[Local Mail Delivery with Postfix]]. Other options are [[SSMTP]], [[MSMTP]] and [[fdm]].</div>
Flydragon
https://wiki.archlinux.org/index.php?title=General_recommendations_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=91823
General recommendations (简体中文)
2010-01-12T07:03:06Z
<p>Flydragon: /* Emacs外壳 */</p>
<hr />
<div>[[Category:Getting and installing Arch (简体中文)]]<br />
[[Category:HOWTOs (简体中文)]]<br />
{{i18n|General Recommendations}}<br />
{{Article summary start}}<br />
{{Article summary text|提供一个给高级用户和菜鸟们的涉及各种课题的有用的文章列表或索引}}<br />
{{Article summary heading|相关文章}}<br />
{{Article summary wiki|Common Applications}}<br />
{{Article summary wiki|Lightweight Applications}}<br />
{{Article summary end}}<br />
<br />
这篇文章是一个关于各种常用或受欢迎的文章的详细索引.<br />
大多数软件需要用 [[pacman]] 来安装, 包括 [[Official Repositories]], 那些在 [[Arch User Repository]] 里的非正式发布或不稳定的软件, 则需要 [[makepkg]] 参见 [[AUR helper]]. 总而言之, 继续阅读的同学们最好对ArchLinux里的软件安装已经很熟悉.<br />
<br />
有些软件或话题是基于你有一个完美安装的系统. 比如如果是图形界面软件, 你当然需要已经阅读和安装 [[Xorg]] X窗口系统, 打印相关的软件你当然已经搞定 [[CUPS]] 等等, 所有看官要对文件系统有个概念, 建议参阅 [[FHS]].<br />
<br />
所以说你最好已经仔细看过 [[Arch 新手安装指南 (简体中文)]] 或者 [[Official Arch Linux Install Guide]] 来获得一个对ArchLinux安装的常识.<br />
<br />
文章标题按字母排序.<br />
<br />
==外观美化==<br />
''本栏将讨论ArchLinux界面的美化和外观方案等. 更多信息请参考 [[:Category:Eye candy (English)]].''<br />
<br />
===彩色字符===<br />
虽然已经有一部分软件具有输出彩色字符的能力, 使用通用的彩色字过滤器也是另一种方法. 安装 {{package AUR|cope}} 或 {{package AUR|cope-git}}, 经常更新的 [[Git]] 版本, 可以从 [[AUR]]安装. {{Package AUR|acoc}} 和 {{Package AUR|cw}} 也是类似的选择.<br />
<br />
====字符界面====<br />
字符界面 (PS1) 可以被灵活的定制. 参考 [http://bbs.archlinux.org/viewtopic.php?id=50885 What's your PS1?] 论坛里的帖子. 也可参阅 [[Color Bash Prompt]] 或 [[Zsh#Prompts]] 如果你使用 Bash 或 Zsh 的话.<br />
<br />
====核心工具====<br />
详细讨论核心工具例如 '''grep''' and '''ls''' 参见 [[Core Utilities]] 文章.<br />
<br />
====Emacs外壳====<br />
Emacs 总所周知地在普通的字处理以外还具有很多高级功能, 其中包括一个全功能外壳. 参见 [[Emacs#Colored output issues]] 获知如何处理彩色字符带来的显示问题.<br />
<br />
====Man pages====<br />
Man pages (or manual pages) are one of the most useful resources available to GNU/Linux users. To aid readability, the pager can be configured to render colored text as explained in [[Man Page#Colored man pages]].<br />
<br />
===Fonts===<br />
A plethora of information on the subject can be found in the [[Fonts]] and [[Font Configuration]] articles.<br />
<br />
====Console fonts====<br />
If spending a significant amount of time working from the virtual console (i.e. outside an X server), users may wish to change the console font to improve readability; see [[Fonts#Console fonts]].<br />
<br />
====LCD filtered fonts====<br />
Font rendering software can be patched to provide smoother fonts on LCD monitors by taking advantage of sub-pixel elements; see [[Font Configuration#LCD filter patched packages]].<br />
<br />
==Booting==<br />
''This section contains information pertaining to the boot process. An overview of the Arch boot process can be found at [[Arch Boot Process]]. For more, please see [[:Category:Boot process (English)]].''<br />
<br />
===Backgrounding daemons===<br />
Daemons are programs that run in the background, and are typically started during boot. In order to speed up the boot process, certain daemons can be ''backgrounded'', allowing the boot process to continue whilst the daemon loads. See [[Daemon]] for a complete explanation.<br />
<br />
===Hardware auto-recognition===<br />
Hardware should be auto-detected by [[udev]] during the boot process by default. A potential improvement in boot time can be achieved by disabling module auto-loading and specifying required modules manually, as described in [[rc.conf#Hardware]]. Additionally [[Xorg]] should be able to auto-detect required drivers using [[HAL]], but users have the option to configure the X server manually, too; see [[Xorg Input Hotplugging]].<br />
<br />
===LILO speed improvement===<br />
Besides [[GRUB]], LILO is the most widely known Linux boot loader, legacy or not. Follow instructions shown in [[LILO#Sample setup]] for making the most out of its features.<br />
<br />
===Num Lock activation at boot===<br />
Num Lock is a toggle key found in most keyboards. For activating Num Lock's number key-assignment during startup, see [[Activating Numlock on Bootup]].<br />
<br />
===Retaining boot messages===<br />
Once it concludes, the screen is cleared and the login prompt appears, leaving users unable to gather feedback from the boot process. [[Disable clearing of boot messages]] to overcome this limitation.<br />
<br />
===Start X at boot===<br />
If utilizing an [[X]] server to provide a graphical user interface, users may wish to start this server during the boot process rather than starting it manually after login. See [[Display Manager]] if desiring a graphical login or [[Start X at boot]] for methods that do not involve a display manager.<br />
<br />
==Console improvements==<br />
''This section applies to small modifications that better console program's practicality. For more, please see [[:Category:Command shells (English)]] and [[:Category:Utilities (English)]].''<br />
<br />
===Aliases===<br />
Users can define shortcuts for frequently-used commands using a built-in shell command. Common time-saving aliases can be found in [[Core Utilities#alias]].<br />
<br />
===Bash additions===<br />
A list of miscellaneous Bash settings, including completion enhancements, history search and readline macros is available in [[Bash#Extended usage]].<br />
<br />
===Compressed files===<br />
====Browsing compressed files====<br />
====Extracting compressed files====<br />
<br />
===Control echo===<br />
<br />
===Mouse support===<br />
Using a mouse with the console for copy-paste operations can be preferred over [[screen]]'s traditional copy mode. Refer to [[Console Mouse Support]] for comprehensive directions.<br />
<br />
==Input==<br />
''This section contains popular input device configuration tips. For more, please see [[:Category:Input devices (English)]].''<br />
<br />
===Configure all mouse buttons===<br />
Owners of advanced or unusual mice may find that not all mouse buttons are recognized by default, or may wish to assign different actions for extra buttons. Instructions can be found in [[Get All Mouse Buttons Working]].<br />
<br />
===Keyboard layouts===<br />
Non-English or otherwise non-standard keyboards may not function as expected by default. To define the keymap in virtual consoles, the [[KEYMAP]] variable must be set in [[rc.conf]]. For [[Xorg]] users, the required changes are described in [[Xorg#Keyboard layout]].<br />
<br />
===Laptop touchpads===<br />
Many laptops use [http://www.synaptics.com/ Synaptics] or [http://www.alps.com/ ALPS] "touchpad" pointing devices. These, and several other touchpad models, use the Synaptics input driver; see [[Touchpad Synaptics]] for installation and configuration details.<br />
<br />
==Package management==<br />
''This section contains helpful information related to package management. All users should at least be familiar with the [[pacman]] package manager. For more, please see [[:Category:Package management (English)]].''<br />
<br />
===Aliases for pacman===<br />
Aliasing a command, or a group thereof, is a way of saving time when using the console. This is specially helpful for repetitive tasks that don't need significant alteration to their parameters between executions. Various time saving pacman aliases are organized in [[pacman Tips]], besides other suggested tools.<br />
<br />
===Arch Build System===<br />
''Ports'' is a system initially used by BSD distributions consisting of build scripts that reside in a directory tree on the local system. Simply put, each port contains a script within a directory intuitively named after the installable third-party application.<br />
<br />
The [[ABS]] tree offers the same functionality by providing build scripts called [[PKGBUILD]]s, which are populated with information for a given piece of software; integrity hashes, project URL, version, license and build instructions. These PKGBUILDs are later parsed by [[makepkg]], the actual program that generates packages cleanly manageable by pacman.<br />
<br />
Every package in the repositories along with those present in the AUR are subject to recompilation with makepkg.<br />
<br />
===Arch User Repository===<br />
While the [[ABS]] tree allows the ability of building software available in the official repositories, the [[AUR]] is the equivalent for user submitted packages. It is an unsupported repository of build scripts accessible through the [http://aur.archlinux.org/index.php web interface] or by an [[AUR helper]].<br />
<br />
AUR helpers like [[Yaourt]] and [[aurbuild]] add seamless access to the AUR. They may vary in features, but all ease in searching, fetching, building, and installing from over 18,673 PKGBUILDs found in the unofficial repository.<br />
<br />
===Mirrors===<br />
Visit [[Mirrors]] for steps on taking full advantage of using the fastest and most up to date pacman mirrors. As explained in the article, a particularly good advice is to routinely check [http://users.archlinux.de/~gerbra/mirrorcheck.html Mirrorcheck] and/or [http://www.archlinux.de/?page=MirrorStatus Mirror status] for a list of mirrors that have been recently synced.<br />
<br />
==Power management==<br />
''This section may be of use to laptop owners or users otherwise seeking power management controls. For more, please see [[:Category:Power management (English)]].''<br />
<br />
===acpid===<br />
Users can configure how the system reacts to ACPI events such as pressing the power button or closing a laptop's lid using [[acpid]].<br />
<br />
===CPU frequency scaling===<br />
Modern processors can decrease their frequency and voltage to reduce heat and power consumption. Less heat leads to a quieter system and prolongs the life of hardware. [[cpufrequtils]] is a set of utilities designed to assist CPU frequency scaling.<br />
<br />
===Laptops===<br />
For articles related to portable computing along with model-specific installation guides, please see [[:Category:Laptops (English)]]. For a general overview of laptop-related articles and recommendations, see [[Laptop]].<br />
<br />
===Suspending and hibernation===<br />
Several options are available to users desiring suspend-to-RAM (sleep/stand-by) and suspend-to-disk (hibernate) functionality. [[pm-utils]] describes one popular method, while [[hibernate-script]] is an older alternative that does not depend on Xorg packages.<br />
<br />
==Networking==<br />
''This section is confined to small networking procedures. Head over to [[Network]] for a full guide. For more, please see [[:Category:Networking (English)]].''<br />
<br />
===Disable IPv6===<br />
Not only does the module take around 250k of memory, it has also been reported that disabling it notoriously speeds up network access for programs that erroneously try to query servers with it. Incidentally, [[Firefox]] is listed among the affected applications. So until the widespread adoption of IPv6, it may be beneficial to [[IPv6 - Disabling the Module|disable it]].<br />
<br />
===DNS speed improvement===<br />
To improve load time by caching queries, use [[pdnsd]], a very simple program that does not attempt to fill every need. Or install [[dnsmasq]], a broader choice which also supports turning the system into a DHCP server.<br />
<br />
==System administration==<br />
''This section deals with administrative tasks and system management. For more, please see [[:Category:System administration (English)]].''<br />
<br />
===Privilege escalation===<br />
A new installation leaves users with only the super user account, better known as root. Logging in as root for prolonged periods of time is widely considered to be foolish and insecure. Instead, users should [[User Management|create]] and use unprivileged user accounts for most tasks, only using the root account for system administration. The [[su]] (substitute user) command allows assuming the identity of another user on the system (usually root) from an existing login, whereas the [[sudo]] command grants temporary privilege escalation for a specific command.<br />
<br />
===Windows networking===<br />
To enable communication between Windows and Arch Linux machines across a network, users can use [[Samba]]; a re-implementation of the SMB/CIFS networking protocol.<br />
<br />
==System services==<br />
''This section relates to daemons. For more, please see [[:Category:Daemons and system services (English)]].''<br />
<br />
===HAL===<br />
After having installed a desktop environment or window manager, installing [[HAL]] seems like a natural follow-up since it enables plug-and-play functionality for mobile phones, MP3 players, external HDDs, and other hardware. Often, HAL is used to mount the device and make an icon on a convenient place, like the desktop or in 'My Computer', allowing access to the peripheral soon after it has been plugged in. Altogether, this avoids manual [[fstab]] configuration or making [[udev]] rules for each and every new device.<br />
<br />
[[KDE]], [[GNOME]] and [[Xfce]] all use [[HAL]].<br />
<br />
===Local mail delivery===<br />
A default base setup bestows no means for mail syncing. To configure postfix for simple local mailbox delivery, see [[Local Mail Delivery with Postfix]]. Other options are [[SSMTP]], [[MSMTP]] and [[fdm]].</div>
Flydragon
https://wiki.archlinux.org/index.php?title=General_recommendations_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=91822
General recommendations (简体中文)
2010-01-12T07:01:57Z
<p>Flydragon: /* Emacs shell */</p>
<hr />
<div>[[Category:Getting and installing Arch (简体中文)]]<br />
[[Category:HOWTOs (简体中文)]]<br />
{{i18n|General Recommendations}}<br />
{{Article summary start}}<br />
{{Article summary text|提供一个给高级用户和菜鸟们的涉及各种课题的有用的文章列表或索引}}<br />
{{Article summary heading|相关文章}}<br />
{{Article summary wiki|Common Applications}}<br />
{{Article summary wiki|Lightweight Applications}}<br />
{{Article summary end}}<br />
<br />
这篇文章是一个关于各种常用或受欢迎的文章的详细索引.<br />
大多数软件需要用 [[pacman]] 来安装, 包括 [[Official Repositories]], 那些在 [[Arch User Repository]] 里的非正式发布或不稳定的软件, 则需要 [[makepkg]] 参见 [[AUR helper]]. 总而言之, 继续阅读的同学们最好对ArchLinux里的软件安装已经很熟悉.<br />
<br />
有些软件或话题是基于你有一个完美安装的系统. 比如如果是图形界面软件, 你当然需要已经阅读和安装 [[Xorg]] X窗口系统, 打印相关的软件你当然已经搞定 [[CUPS]] 等等, 所有看官要对文件系统有个概念, 建议参阅 [[FHS]].<br />
<br />
所以说你最好已经仔细看过 [[Arch 新手安装指南 (简体中文)]] 或者 [[Official Arch Linux Install Guide]] 来获得一个对ArchLinux安装的常识.<br />
<br />
文章标题按字母排序.<br />
<br />
==外观美化==<br />
''本栏将讨论ArchLinux界面的美化和外观方案等. 更多信息请参考 [[:Category:Eye candy (English)]].''<br />
<br />
===彩色字符===<br />
虽然已经有一部分软件具有输出彩色字符的能力, 使用通用的彩色字过滤器也是另一种方法. 安装 {{package AUR|cope}} 或 {{package AUR|cope-git}}, 经常更新的 [[Git]] 版本, 可以从 [[AUR]]安装. {{Package AUR|acoc}} 和 {{Package AUR|cw}} 也是类似的选择.<br />
<br />
====字符界面====<br />
字符界面 (PS1) 可以被灵活的定制. 参考 [http://bbs.archlinux.org/viewtopic.php?id=50885 What's your PS1?] 论坛里的帖子. 也可参阅 [[Color Bash Prompt]] 或 [[Zsh#Prompts]] 如果你使用 Bash 或 Zsh 的话.<br />
<br />
====核心工具====<br />
详细讨论核心工具例如 '''grep''' and '''ls''' 参见 [[Core Utilities]] 文章.<br />
<br />
====Emacs外壳====<br />
Emacs 总所周知地在普通的字处理以外还具有很多高级功能, 其中包括一个全功能外壳. 参见 [[Emacs#Colored output issues]] 获知如何处理彩色字符带来的乱码问题.<br />
<br />
====Man pages====<br />
Man pages (or manual pages) are one of the most useful resources available to GNU/Linux users. To aid readability, the pager can be configured to render colored text as explained in [[Man Page#Colored man pages]].<br />
<br />
===Fonts===<br />
A plethora of information on the subject can be found in the [[Fonts]] and [[Font Configuration]] articles.<br />
<br />
====Console fonts====<br />
If spending a significant amount of time working from the virtual console (i.e. outside an X server), users may wish to change the console font to improve readability; see [[Fonts#Console fonts]].<br />
<br />
====LCD filtered fonts====<br />
Font rendering software can be patched to provide smoother fonts on LCD monitors by taking advantage of sub-pixel elements; see [[Font Configuration#LCD filter patched packages]].<br />
<br />
==Booting==<br />
''This section contains information pertaining to the boot process. An overview of the Arch boot process can be found at [[Arch Boot Process]]. For more, please see [[:Category:Boot process (English)]].''<br />
<br />
===Backgrounding daemons===<br />
Daemons are programs that run in the background, and are typically started during boot. In order to speed up the boot process, certain daemons can be ''backgrounded'', allowing the boot process to continue whilst the daemon loads. See [[Daemon]] for a complete explanation.<br />
<br />
===Hardware auto-recognition===<br />
Hardware should be auto-detected by [[udev]] during the boot process by default. A potential improvement in boot time can be achieved by disabling module auto-loading and specifying required modules manually, as described in [[rc.conf#Hardware]]. Additionally [[Xorg]] should be able to auto-detect required drivers using [[HAL]], but users have the option to configure the X server manually, too; see [[Xorg Input Hotplugging]].<br />
<br />
===LILO speed improvement===<br />
Besides [[GRUB]], LILO is the most widely known Linux boot loader, legacy or not. Follow instructions shown in [[LILO#Sample setup]] for making the most out of its features.<br />
<br />
===Num Lock activation at boot===<br />
Num Lock is a toggle key found in most keyboards. For activating Num Lock's number key-assignment during startup, see [[Activating Numlock on Bootup]].<br />
<br />
===Retaining boot messages===<br />
Once it concludes, the screen is cleared and the login prompt appears, leaving users unable to gather feedback from the boot process. [[Disable clearing of boot messages]] to overcome this limitation.<br />
<br />
===Start X at boot===<br />
If utilizing an [[X]] server to provide a graphical user interface, users may wish to start this server during the boot process rather than starting it manually after login. See [[Display Manager]] if desiring a graphical login or [[Start X at boot]] for methods that do not involve a display manager.<br />
<br />
==Console improvements==<br />
''This section applies to small modifications that better console program's practicality. For more, please see [[:Category:Command shells (English)]] and [[:Category:Utilities (English)]].''<br />
<br />
===Aliases===<br />
Users can define shortcuts for frequently-used commands using a built-in shell command. Common time-saving aliases can be found in [[Core Utilities#alias]].<br />
<br />
===Bash additions===<br />
A list of miscellaneous Bash settings, including completion enhancements, history search and readline macros is available in [[Bash#Extended usage]].<br />
<br />
===Compressed files===<br />
====Browsing compressed files====<br />
====Extracting compressed files====<br />
<br />
===Control echo===<br />
<br />
===Mouse support===<br />
Using a mouse with the console for copy-paste operations can be preferred over [[screen]]'s traditional copy mode. Refer to [[Console Mouse Support]] for comprehensive directions.<br />
<br />
==Input==<br />
''This section contains popular input device configuration tips. For more, please see [[:Category:Input devices (English)]].''<br />
<br />
===Configure all mouse buttons===<br />
Owners of advanced or unusual mice may find that not all mouse buttons are recognized by default, or may wish to assign different actions for extra buttons. Instructions can be found in [[Get All Mouse Buttons Working]].<br />
<br />
===Keyboard layouts===<br />
Non-English or otherwise non-standard keyboards may not function as expected by default. To define the keymap in virtual consoles, the [[KEYMAP]] variable must be set in [[rc.conf]]. For [[Xorg]] users, the required changes are described in [[Xorg#Keyboard layout]].<br />
<br />
===Laptop touchpads===<br />
Many laptops use [http://www.synaptics.com/ Synaptics] or [http://www.alps.com/ ALPS] "touchpad" pointing devices. These, and several other touchpad models, use the Synaptics input driver; see [[Touchpad Synaptics]] for installation and configuration details.<br />
<br />
==Package management==<br />
''This section contains helpful information related to package management. All users should at least be familiar with the [[pacman]] package manager. For more, please see [[:Category:Package management (English)]].''<br />
<br />
===Aliases for pacman===<br />
Aliasing a command, or a group thereof, is a way of saving time when using the console. This is specially helpful for repetitive tasks that don't need significant alteration to their parameters between executions. Various time saving pacman aliases are organized in [[pacman Tips]], besides other suggested tools.<br />
<br />
===Arch Build System===<br />
''Ports'' is a system initially used by BSD distributions consisting of build scripts that reside in a directory tree on the local system. Simply put, each port contains a script within a directory intuitively named after the installable third-party application.<br />
<br />
The [[ABS]] tree offers the same functionality by providing build scripts called [[PKGBUILD]]s, which are populated with information for a given piece of software; integrity hashes, project URL, version, license and build instructions. These PKGBUILDs are later parsed by [[makepkg]], the actual program that generates packages cleanly manageable by pacman.<br />
<br />
Every package in the repositories along with those present in the AUR are subject to recompilation with makepkg.<br />
<br />
===Arch User Repository===<br />
While the [[ABS]] tree allows the ability of building software available in the official repositories, the [[AUR]] is the equivalent for user submitted packages. It is an unsupported repository of build scripts accessible through the [http://aur.archlinux.org/index.php web interface] or by an [[AUR helper]].<br />
<br />
AUR helpers like [[Yaourt]] and [[aurbuild]] add seamless access to the AUR. They may vary in features, but all ease in searching, fetching, building, and installing from over 18,673 PKGBUILDs found in the unofficial repository.<br />
<br />
===Mirrors===<br />
Visit [[Mirrors]] for steps on taking full advantage of using the fastest and most up to date pacman mirrors. As explained in the article, a particularly good advice is to routinely check [http://users.archlinux.de/~gerbra/mirrorcheck.html Mirrorcheck] and/or [http://www.archlinux.de/?page=MirrorStatus Mirror status] for a list of mirrors that have been recently synced.<br />
<br />
==Power management==<br />
''This section may be of use to laptop owners or users otherwise seeking power management controls. For more, please see [[:Category:Power management (English)]].''<br />
<br />
===acpid===<br />
Users can configure how the system reacts to ACPI events such as pressing the power button or closing a laptop's lid using [[acpid]].<br />
<br />
===CPU frequency scaling===<br />
Modern processors can decrease their frequency and voltage to reduce heat and power consumption. Less heat leads to a quieter system and prolongs the life of hardware. [[cpufrequtils]] is a set of utilities designed to assist CPU frequency scaling.<br />
<br />
===Laptops===<br />
For articles related to portable computing along with model-specific installation guides, please see [[:Category:Laptops (English)]]. For a general overview of laptop-related articles and recommendations, see [[Laptop]].<br />
<br />
===Suspending and hibernation===<br />
Several options are available to users desiring suspend-to-RAM (sleep/stand-by) and suspend-to-disk (hibernate) functionality. [[pm-utils]] describes one popular method, while [[hibernate-script]] is an older alternative that does not depend on Xorg packages.<br />
<br />
==Networking==<br />
''This section is confined to small networking procedures. Head over to [[Network]] for a full guide. For more, please see [[:Category:Networking (English)]].''<br />
<br />
===Disable IPv6===<br />
Not only does the module take around 250k of memory, it has also been reported that disabling it notoriously speeds up network access for programs that erroneously try to query servers with it. Incidentally, [[Firefox]] is listed among the affected applications. So until the widespread adoption of IPv6, it may be beneficial to [[IPv6 - Disabling the Module|disable it]].<br />
<br />
===DNS speed improvement===<br />
To improve load time by caching queries, use [[pdnsd]], a very simple program that does not attempt to fill every need. Or install [[dnsmasq]], a broader choice which also supports turning the system into a DHCP server.<br />
<br />
==System administration==<br />
''This section deals with administrative tasks and system management. For more, please see [[:Category:System administration (English)]].''<br />
<br />
===Privilege escalation===<br />
A new installation leaves users with only the super user account, better known as root. Logging in as root for prolonged periods of time is widely considered to be foolish and insecure. Instead, users should [[User Management|create]] and use unprivileged user accounts for most tasks, only using the root account for system administration. The [[su]] (substitute user) command allows assuming the identity of another user on the system (usually root) from an existing login, whereas the [[sudo]] command grants temporary privilege escalation for a specific command.<br />
<br />
===Windows networking===<br />
To enable communication between Windows and Arch Linux machines across a network, users can use [[Samba]]; a re-implementation of the SMB/CIFS networking protocol.<br />
<br />
==System services==<br />
''This section relates to daemons. For more, please see [[:Category:Daemons and system services (English)]].''<br />
<br />
===HAL===<br />
After having installed a desktop environment or window manager, installing [[HAL]] seems like a natural follow-up since it enables plug-and-play functionality for mobile phones, MP3 players, external HDDs, and other hardware. Often, HAL is used to mount the device and make an icon on a convenient place, like the desktop or in 'My Computer', allowing access to the peripheral soon after it has been plugged in. Altogether, this avoids manual [[fstab]] configuration or making [[udev]] rules for each and every new device.<br />
<br />
[[KDE]], [[GNOME]] and [[Xfce]] all use [[HAL]].<br />
<br />
===Local mail delivery===<br />
A default base setup bestows no means for mail syncing. To configure postfix for simple local mailbox delivery, see [[Local Mail Delivery with Postfix]]. Other options are [[SSMTP]], [[MSMTP]] and [[fdm]].</div>
Flydragon
https://wiki.archlinux.org/index.php?title=General_recommendations_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=91821
General recommendations (简体中文)
2010-01-12T06:56:36Z
<p>Flydragon: /* Core utilities */</p>
<hr />
<div>[[Category:Getting and installing Arch (简体中文)]]<br />
[[Category:HOWTOs (简体中文)]]<br />
{{i18n|General Recommendations}}<br />
{{Article summary start}}<br />
{{Article summary text|提供一个给高级用户和菜鸟们的涉及各种课题的有用的文章列表或索引}}<br />
{{Article summary heading|相关文章}}<br />
{{Article summary wiki|Common Applications}}<br />
{{Article summary wiki|Lightweight Applications}}<br />
{{Article summary end}}<br />
<br />
这篇文章是一个关于各种常用或受欢迎的文章的详细索引.<br />
大多数软件需要用 [[pacman]] 来安装, 包括 [[Official Repositories]], 那些在 [[Arch User Repository]] 里的非正式发布或不稳定的软件, 则需要 [[makepkg]] 参见 [[AUR helper]]. 总而言之, 继续阅读的同学们最好对ArchLinux里的软件安装已经很熟悉.<br />
<br />
有些软件或话题是基于你有一个完美安装的系统. 比如如果是图形界面软件, 你当然需要已经阅读和安装 [[Xorg]] X窗口系统, 打印相关的软件你当然已经搞定 [[CUPS]] 等等, 所有看官要对文件系统有个概念, 建议参阅 [[FHS]].<br />
<br />
所以说你最好已经仔细看过 [[Arch 新手安装指南 (简体中文)]] 或者 [[Official Arch Linux Install Guide]] 来获得一个对ArchLinux安装的常识.<br />
<br />
文章标题按字母排序.<br />
<br />
==外观美化==<br />
''本栏将讨论ArchLinux界面的美化和外观方案等. 更多信息请参考 [[:Category:Eye candy (English)]].''<br />
<br />
===彩色字符===<br />
虽然已经有一部分软件具有输出彩色字符的能力, 使用通用的彩色字过滤器也是另一种方法. 安装 {{package AUR|cope}} 或 {{package AUR|cope-git}}, 经常更新的 [[Git]] 版本, 可以从 [[AUR]]安装. {{Package AUR|acoc}} 和 {{Package AUR|cw}} 也是类似的选择.<br />
<br />
====字符界面====<br />
字符界面 (PS1) 可以被灵活的定制. 参考 [http://bbs.archlinux.org/viewtopic.php?id=50885 What's your PS1?] 论坛里的帖子. 也可参阅 [[Color Bash Prompt]] 或 [[Zsh#Prompts]] 如果你使用 Bash 或 Zsh 的话.<br />
<br />
====核心工具====<br />
详细讨论核心工具例如 '''grep''' and '''ls''' 参见 [[Core Utilities]] 文章.<br />
<br />
====Emacs shell====<br />
Emacs is known for featuring options beyond the duties of regular text editing, one of these being a full shell replacement. Consult [[Emacs#Colored output issues]] for a fix regarding garbled characters that may result from enabling colored output.<br />
<br />
====Man pages====<br />
Man pages (or manual pages) are one of the most useful resources available to GNU/Linux users. To aid readability, the pager can be configured to render colored text as explained in [[Man Page#Colored man pages]].<br />
<br />
===Fonts===<br />
A plethora of information on the subject can be found in the [[Fonts]] and [[Font Configuration]] articles.<br />
<br />
====Console fonts====<br />
If spending a significant amount of time working from the virtual console (i.e. outside an X server), users may wish to change the console font to improve readability; see [[Fonts#Console fonts]].<br />
<br />
====LCD filtered fonts====<br />
Font rendering software can be patched to provide smoother fonts on LCD monitors by taking advantage of sub-pixel elements; see [[Font Configuration#LCD filter patched packages]].<br />
<br />
==Booting==<br />
''This section contains information pertaining to the boot process. An overview of the Arch boot process can be found at [[Arch Boot Process]]. For more, please see [[:Category:Boot process (English)]].''<br />
<br />
===Backgrounding daemons===<br />
Daemons are programs that run in the background, and are typically started during boot. In order to speed up the boot process, certain daemons can be ''backgrounded'', allowing the boot process to continue whilst the daemon loads. See [[Daemon]] for a complete explanation.<br />
<br />
===Hardware auto-recognition===<br />
Hardware should be auto-detected by [[udev]] during the boot process by default. A potential improvement in boot time can be achieved by disabling module auto-loading and specifying required modules manually, as described in [[rc.conf#Hardware]]. Additionally [[Xorg]] should be able to auto-detect required drivers using [[HAL]], but users have the option to configure the X server manually, too; see [[Xorg Input Hotplugging]].<br />
<br />
===LILO speed improvement===<br />
Besides [[GRUB]], LILO is the most widely known Linux boot loader, legacy or not. Follow instructions shown in [[LILO#Sample setup]] for making the most out of its features.<br />
<br />
===Num Lock activation at boot===<br />
Num Lock is a toggle key found in most keyboards. For activating Num Lock's number key-assignment during startup, see [[Activating Numlock on Bootup]].<br />
<br />
===Retaining boot messages===<br />
Once it concludes, the screen is cleared and the login prompt appears, leaving users unable to gather feedback from the boot process. [[Disable clearing of boot messages]] to overcome this limitation.<br />
<br />
===Start X at boot===<br />
If utilizing an [[X]] server to provide a graphical user interface, users may wish to start this server during the boot process rather than starting it manually after login. See [[Display Manager]] if desiring a graphical login or [[Start X at boot]] for methods that do not involve a display manager.<br />
<br />
==Console improvements==<br />
''This section applies to small modifications that better console program's practicality. For more, please see [[:Category:Command shells (English)]] and [[:Category:Utilities (English)]].''<br />
<br />
===Aliases===<br />
Users can define shortcuts for frequently-used commands using a built-in shell command. Common time-saving aliases can be found in [[Core Utilities#alias]].<br />
<br />
===Bash additions===<br />
A list of miscellaneous Bash settings, including completion enhancements, history search and readline macros is available in [[Bash#Extended usage]].<br />
<br />
===Compressed files===<br />
====Browsing compressed files====<br />
====Extracting compressed files====<br />
<br />
===Control echo===<br />
<br />
===Mouse support===<br />
Using a mouse with the console for copy-paste operations can be preferred over [[screen]]'s traditional copy mode. Refer to [[Console Mouse Support]] for comprehensive directions.<br />
<br />
==Input==<br />
''This section contains popular input device configuration tips. For more, please see [[:Category:Input devices (English)]].''<br />
<br />
===Configure all mouse buttons===<br />
Owners of advanced or unusual mice may find that not all mouse buttons are recognized by default, or may wish to assign different actions for extra buttons. Instructions can be found in [[Get All Mouse Buttons Working]].<br />
<br />
===Keyboard layouts===<br />
Non-English or otherwise non-standard keyboards may not function as expected by default. To define the keymap in virtual consoles, the [[KEYMAP]] variable must be set in [[rc.conf]]. For [[Xorg]] users, the required changes are described in [[Xorg#Keyboard layout]].<br />
<br />
===Laptop touchpads===<br />
Many laptops use [http://www.synaptics.com/ Synaptics] or [http://www.alps.com/ ALPS] "touchpad" pointing devices. These, and several other touchpad models, use the Synaptics input driver; see [[Touchpad Synaptics]] for installation and configuration details.<br />
<br />
==Package management==<br />
''This section contains helpful information related to package management. All users should at least be familiar with the [[pacman]] package manager. For more, please see [[:Category:Package management (English)]].''<br />
<br />
===Aliases for pacman===<br />
Aliasing a command, or a group thereof, is a way of saving time when using the console. This is specially helpful for repetitive tasks that don't need significant alteration to their parameters between executions. Various time saving pacman aliases are organized in [[pacman Tips]], besides other suggested tools.<br />
<br />
===Arch Build System===<br />
''Ports'' is a system initially used by BSD distributions consisting of build scripts that reside in a directory tree on the local system. Simply put, each port contains a script within a directory intuitively named after the installable third-party application.<br />
<br />
The [[ABS]] tree offers the same functionality by providing build scripts called [[PKGBUILD]]s, which are populated with information for a given piece of software; integrity hashes, project URL, version, license and build instructions. These PKGBUILDs are later parsed by [[makepkg]], the actual program that generates packages cleanly manageable by pacman.<br />
<br />
Every package in the repositories along with those present in the AUR are subject to recompilation with makepkg.<br />
<br />
===Arch User Repository===<br />
While the [[ABS]] tree allows the ability of building software available in the official repositories, the [[AUR]] is the equivalent for user submitted packages. It is an unsupported repository of build scripts accessible through the [http://aur.archlinux.org/index.php web interface] or by an [[AUR helper]].<br />
<br />
AUR helpers like [[Yaourt]] and [[aurbuild]] add seamless access to the AUR. They may vary in features, but all ease in searching, fetching, building, and installing from over 18,673 PKGBUILDs found in the unofficial repository.<br />
<br />
===Mirrors===<br />
Visit [[Mirrors]] for steps on taking full advantage of using the fastest and most up to date pacman mirrors. As explained in the article, a particularly good advice is to routinely check [http://users.archlinux.de/~gerbra/mirrorcheck.html Mirrorcheck] and/or [http://www.archlinux.de/?page=MirrorStatus Mirror status] for a list of mirrors that have been recently synced.<br />
<br />
==Power management==<br />
''This section may be of use to laptop owners or users otherwise seeking power management controls. For more, please see [[:Category:Power management (English)]].''<br />
<br />
===acpid===<br />
Users can configure how the system reacts to ACPI events such as pressing the power button or closing a laptop's lid using [[acpid]].<br />
<br />
===CPU frequency scaling===<br />
Modern processors can decrease their frequency and voltage to reduce heat and power consumption. Less heat leads to a quieter system and prolongs the life of hardware. [[cpufrequtils]] is a set of utilities designed to assist CPU frequency scaling.<br />
<br />
===Laptops===<br />
For articles related to portable computing along with model-specific installation guides, please see [[:Category:Laptops (English)]]. For a general overview of laptop-related articles and recommendations, see [[Laptop]].<br />
<br />
===Suspending and hibernation===<br />
Several options are available to users desiring suspend-to-RAM (sleep/stand-by) and suspend-to-disk (hibernate) functionality. [[pm-utils]] describes one popular method, while [[hibernate-script]] is an older alternative that does not depend on Xorg packages.<br />
<br />
==Networking==<br />
''This section is confined to small networking procedures. Head over to [[Network]] for a full guide. For more, please see [[:Category:Networking (English)]].''<br />
<br />
===Disable IPv6===<br />
Not only does the module take around 250k of memory, it has also been reported that disabling it notoriously speeds up network access for programs that erroneously try to query servers with it. Incidentally, [[Firefox]] is listed among the affected applications. So until the widespread adoption of IPv6, it may be beneficial to [[IPv6 - Disabling the Module|disable it]].<br />
<br />
===DNS speed improvement===<br />
To improve load time by caching queries, use [[pdnsd]], a very simple program that does not attempt to fill every need. Or install [[dnsmasq]], a broader choice which also supports turning the system into a DHCP server.<br />
<br />
==System administration==<br />
''This section deals with administrative tasks and system management. For more, please see [[:Category:System administration (English)]].''<br />
<br />
===Privilege escalation===<br />
A new installation leaves users with only the super user account, better known as root. Logging in as root for prolonged periods of time is widely considered to be foolish and insecure. Instead, users should [[User Management|create]] and use unprivileged user accounts for most tasks, only using the root account for system administration. The [[su]] (substitute user) command allows assuming the identity of another user on the system (usually root) from an existing login, whereas the [[sudo]] command grants temporary privilege escalation for a specific command.<br />
<br />
===Windows networking===<br />
To enable communication between Windows and Arch Linux machines across a network, users can use [[Samba]]; a re-implementation of the SMB/CIFS networking protocol.<br />
<br />
==System services==<br />
''This section relates to daemons. For more, please see [[:Category:Daemons and system services (English)]].''<br />
<br />
===HAL===<br />
After having installed a desktop environment or window manager, installing [[HAL]] seems like a natural follow-up since it enables plug-and-play functionality for mobile phones, MP3 players, external HDDs, and other hardware. Often, HAL is used to mount the device and make an icon on a convenient place, like the desktop or in 'My Computer', allowing access to the peripheral soon after it has been plugged in. Altogether, this avoids manual [[fstab]] configuration or making [[udev]] rules for each and every new device.<br />
<br />
[[KDE]], [[GNOME]] and [[Xfce]] all use [[HAL]].<br />
<br />
===Local mail delivery===<br />
A default base setup bestows no means for mail syncing. To configure postfix for simple local mailbox delivery, see [[Local Mail Delivery with Postfix]]. Other options are [[SSMTP]], [[MSMTP]] and [[fdm]].</div>
Flydragon
https://wiki.archlinux.org/index.php?title=General_recommendations_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=91820
General recommendations (简体中文)
2010-01-12T06:47:39Z
<p>Flydragon: </p>
<hr />
<div>[[Category:Getting and installing Arch (简体中文)]]<br />
[[Category:HOWTOs (简体中文)]]<br />
{{i18n|General Recommendations}}<br />
{{Article summary start}}<br />
{{Article summary text|提供一个给高级用户和菜鸟们的涉及各种课题的有用的文章列表或索引}}<br />
{{Article summary heading|相关文章}}<br />
{{Article summary wiki|Common Applications}}<br />
{{Article summary wiki|Lightweight Applications}}<br />
{{Article summary end}}<br />
<br />
这篇文章是一个关于各种常用或受欢迎的文章的详细索引.<br />
大多数软件需要用 [[pacman]] 来安装, 包括 [[Official Repositories]], 那些在 [[Arch User Repository]] 里的非正式发布或不稳定的软件, 则需要 [[makepkg]] 参见 [[AUR helper]]. 总而言之, 继续阅读的同学们最好对ArchLinux里的软件安装已经很熟悉.<br />
<br />
有些软件或话题是基于你有一个完美安装的系统. 比如如果是图形界面软件, 你当然需要已经阅读和安装 [[Xorg]] X窗口系统, 打印相关的软件你当然已经搞定 [[CUPS]] 等等, 所有看官要对文件系统有个概念, 建议参阅 [[FHS]].<br />
<br />
所以说你最好已经仔细看过 [[Arch 新手安装指南 (简体中文)]] 或者 [[Official Arch Linux Install Guide]] 来获得一个对ArchLinux安装的常识.<br />
<br />
文章标题按字母排序.<br />
<br />
==外观美化==<br />
''本栏将讨论ArchLinux界面的美化和外观方案等. 更多信息请参考 [[:Category:Eye candy (English)]].''<br />
<br />
===彩色字符===<br />
虽然已经有一部分软件具有输出彩色字符的能力, 使用通用的彩色字过滤器也是另一种方法. 安装 {{package AUR|cope}} 或 {{package AUR|cope-git}}, 经常更新的 [[Git]] 版本, 可以从 [[AUR]]安装. {{Package AUR|acoc}} 和 {{Package AUR|cw}} 也是类似的选择.<br />
<br />
====字符界面====<br />
字符界面 (PS1) 可以被灵活的定制. 参考 [http://bbs.archlinux.org/viewtopic.php?id=50885 What's your PS1?] 论坛里的帖子. 也可参阅 [[Color Bash Prompt]] 或 [[Zsh#Prompts]] 如果你使用 Bash 或 Zsh 的话.<br />
<br />
====Core utilities====<br />
Colorizing the output of specific core utilities such as '''grep''' and '''ls''' is covered in the [[Core Utilities]] article.<br />
<br />
====Emacs shell====<br />
Emacs is known for featuring options beyond the duties of regular text editing, one of these being a full shell replacement. Consult [[Emacs#Colored output issues]] for a fix regarding garbled characters that may result from enabling colored output.<br />
<br />
====Man pages====<br />
Man pages (or manual pages) are one of the most useful resources available to GNU/Linux users. To aid readability, the pager can be configured to render colored text as explained in [[Man Page#Colored man pages]].<br />
<br />
===Fonts===<br />
A plethora of information on the subject can be found in the [[Fonts]] and [[Font Configuration]] articles.<br />
<br />
====Console fonts====<br />
If spending a significant amount of time working from the virtual console (i.e. outside an X server), users may wish to change the console font to improve readability; see [[Fonts#Console fonts]].<br />
<br />
====LCD filtered fonts====<br />
Font rendering software can be patched to provide smoother fonts on LCD monitors by taking advantage of sub-pixel elements; see [[Font Configuration#LCD filter patched packages]].<br />
<br />
==Booting==<br />
''This section contains information pertaining to the boot process. An overview of the Arch boot process can be found at [[Arch Boot Process]]. For more, please see [[:Category:Boot process (English)]].''<br />
<br />
===Backgrounding daemons===<br />
Daemons are programs that run in the background, and are typically started during boot. In order to speed up the boot process, certain daemons can be ''backgrounded'', allowing the boot process to continue whilst the daemon loads. See [[Daemon]] for a complete explanation.<br />
<br />
===Hardware auto-recognition===<br />
Hardware should be auto-detected by [[udev]] during the boot process by default. A potential improvement in boot time can be achieved by disabling module auto-loading and specifying required modules manually, as described in [[rc.conf#Hardware]]. Additionally [[Xorg]] should be able to auto-detect required drivers using [[HAL]], but users have the option to configure the X server manually, too; see [[Xorg Input Hotplugging]].<br />
<br />
===LILO speed improvement===<br />
Besides [[GRUB]], LILO is the most widely known Linux boot loader, legacy or not. Follow instructions shown in [[LILO#Sample setup]] for making the most out of its features.<br />
<br />
===Num Lock activation at boot===<br />
Num Lock is a toggle key found in most keyboards. For activating Num Lock's number key-assignment during startup, see [[Activating Numlock on Bootup]].<br />
<br />
===Retaining boot messages===<br />
Once it concludes, the screen is cleared and the login prompt appears, leaving users unable to gather feedback from the boot process. [[Disable clearing of boot messages]] to overcome this limitation.<br />
<br />
===Start X at boot===<br />
If utilizing an [[X]] server to provide a graphical user interface, users may wish to start this server during the boot process rather than starting it manually after login. See [[Display Manager]] if desiring a graphical login or [[Start X at boot]] for methods that do not involve a display manager.<br />
<br />
==Console improvements==<br />
''This section applies to small modifications that better console program's practicality. For more, please see [[:Category:Command shells (English)]] and [[:Category:Utilities (English)]].''<br />
<br />
===Aliases===<br />
Users can define shortcuts for frequently-used commands using a built-in shell command. Common time-saving aliases can be found in [[Core Utilities#alias]].<br />
<br />
===Bash additions===<br />
A list of miscellaneous Bash settings, including completion enhancements, history search and readline macros is available in [[Bash#Extended usage]].<br />
<br />
===Compressed files===<br />
====Browsing compressed files====<br />
====Extracting compressed files====<br />
<br />
===Control echo===<br />
<br />
===Mouse support===<br />
Using a mouse with the console for copy-paste operations can be preferred over [[screen]]'s traditional copy mode. Refer to [[Console Mouse Support]] for comprehensive directions.<br />
<br />
==Input==<br />
''This section contains popular input device configuration tips. For more, please see [[:Category:Input devices (English)]].''<br />
<br />
===Configure all mouse buttons===<br />
Owners of advanced or unusual mice may find that not all mouse buttons are recognized by default, or may wish to assign different actions for extra buttons. Instructions can be found in [[Get All Mouse Buttons Working]].<br />
<br />
===Keyboard layouts===<br />
Non-English or otherwise non-standard keyboards may not function as expected by default. To define the keymap in virtual consoles, the [[KEYMAP]] variable must be set in [[rc.conf]]. For [[Xorg]] users, the required changes are described in [[Xorg#Keyboard layout]].<br />
<br />
===Laptop touchpads===<br />
Many laptops use [http://www.synaptics.com/ Synaptics] or [http://www.alps.com/ ALPS] "touchpad" pointing devices. These, and several other touchpad models, use the Synaptics input driver; see [[Touchpad Synaptics]] for installation and configuration details.<br />
<br />
==Package management==<br />
''This section contains helpful information related to package management. All users should at least be familiar with the [[pacman]] package manager. For more, please see [[:Category:Package management (English)]].''<br />
<br />
===Aliases for pacman===<br />
Aliasing a command, or a group thereof, is a way of saving time when using the console. This is specially helpful for repetitive tasks that don't need significant alteration to their parameters between executions. Various time saving pacman aliases are organized in [[pacman Tips]], besides other suggested tools.<br />
<br />
===Arch Build System===<br />
''Ports'' is a system initially used by BSD distributions consisting of build scripts that reside in a directory tree on the local system. Simply put, each port contains a script within a directory intuitively named after the installable third-party application.<br />
<br />
The [[ABS]] tree offers the same functionality by providing build scripts called [[PKGBUILD]]s, which are populated with information for a given piece of software; integrity hashes, project URL, version, license and build instructions. These PKGBUILDs are later parsed by [[makepkg]], the actual program that generates packages cleanly manageable by pacman.<br />
<br />
Every package in the repositories along with those present in the AUR are subject to recompilation with makepkg.<br />
<br />
===Arch User Repository===<br />
While the [[ABS]] tree allows the ability of building software available in the official repositories, the [[AUR]] is the equivalent for user submitted packages. It is an unsupported repository of build scripts accessible through the [http://aur.archlinux.org/index.php web interface] or by an [[AUR helper]].<br />
<br />
AUR helpers like [[Yaourt]] and [[aurbuild]] add seamless access to the AUR. They may vary in features, but all ease in searching, fetching, building, and installing from over 18,673 PKGBUILDs found in the unofficial repository.<br />
<br />
===Mirrors===<br />
Visit [[Mirrors]] for steps on taking full advantage of using the fastest and most up to date pacman mirrors. As explained in the article, a particularly good advice is to routinely check [http://users.archlinux.de/~gerbra/mirrorcheck.html Mirrorcheck] and/or [http://www.archlinux.de/?page=MirrorStatus Mirror status] for a list of mirrors that have been recently synced.<br />
<br />
==Power management==<br />
''This section may be of use to laptop owners or users otherwise seeking power management controls. For more, please see [[:Category:Power management (English)]].''<br />
<br />
===acpid===<br />
Users can configure how the system reacts to ACPI events such as pressing the power button or closing a laptop's lid using [[acpid]].<br />
<br />
===CPU frequency scaling===<br />
Modern processors can decrease their frequency and voltage to reduce heat and power consumption. Less heat leads to a quieter system and prolongs the life of hardware. [[cpufrequtils]] is a set of utilities designed to assist CPU frequency scaling.<br />
<br />
===Laptops===<br />
For articles related to portable computing along with model-specific installation guides, please see [[:Category:Laptops (English)]]. For a general overview of laptop-related articles and recommendations, see [[Laptop]].<br />
<br />
===Suspending and hibernation===<br />
Several options are available to users desiring suspend-to-RAM (sleep/stand-by) and suspend-to-disk (hibernate) functionality. [[pm-utils]] describes one popular method, while [[hibernate-script]] is an older alternative that does not depend on Xorg packages.<br />
<br />
==Networking==<br />
''This section is confined to small networking procedures. Head over to [[Network]] for a full guide. For more, please see [[:Category:Networking (English)]].''<br />
<br />
===Disable IPv6===<br />
Not only does the module take around 250k of memory, it has also been reported that disabling it notoriously speeds up network access for programs that erroneously try to query servers with it. Incidentally, [[Firefox]] is listed among the affected applications. So until the widespread adoption of IPv6, it may be beneficial to [[IPv6 - Disabling the Module|disable it]].<br />
<br />
===DNS speed improvement===<br />
To improve load time by caching queries, use [[pdnsd]], a very simple program that does not attempt to fill every need. Or install [[dnsmasq]], a broader choice which also supports turning the system into a DHCP server.<br />
<br />
==System administration==<br />
''This section deals with administrative tasks and system management. For more, please see [[:Category:System administration (English)]].''<br />
<br />
===Privilege escalation===<br />
A new installation leaves users with only the super user account, better known as root. Logging in as root for prolonged periods of time is widely considered to be foolish and insecure. Instead, users should [[User Management|create]] and use unprivileged user accounts for most tasks, only using the root account for system administration. The [[su]] (substitute user) command allows assuming the identity of another user on the system (usually root) from an existing login, whereas the [[sudo]] command grants temporary privilege escalation for a specific command.<br />
<br />
===Windows networking===<br />
To enable communication between Windows and Arch Linux machines across a network, users can use [[Samba]]; a re-implementation of the SMB/CIFS networking protocol.<br />
<br />
==System services==<br />
''This section relates to daemons. For more, please see [[:Category:Daemons and system services (English)]].''<br />
<br />
===HAL===<br />
After having installed a desktop environment or window manager, installing [[HAL]] seems like a natural follow-up since it enables plug-and-play functionality for mobile phones, MP3 players, external HDDs, and other hardware. Often, HAL is used to mount the device and make an icon on a convenient place, like the desktop or in 'My Computer', allowing access to the peripheral soon after it has been plugged in. Altogether, this avoids manual [[fstab]] configuration or making [[udev]] rules for each and every new device.<br />
<br />
[[KDE]], [[GNOME]] and [[Xfce]] all use [[HAL]].<br />
<br />
===Local mail delivery===<br />
A default base setup bestows no means for mail syncing. To configure postfix for simple local mailbox delivery, see [[Local Mail Delivery with Postfix]]. Other options are [[SSMTP]], [[MSMTP]] and [[fdm]].</div>
Flydragon
https://wiki.archlinux.org/index.php?title=General_recommendations_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=91819
General recommendations (简体中文)
2010-01-12T06:46:37Z
<p>Flydragon: </p>
<hr />
<div>[[Category:Getting and installing Arch (简体中文)]]<br />
[[Category:HOWTOs (简体中文)]]<br />
{{i18n|General Recommendations}}<br />
{{Article summary start}}<br />
{{Article summary text|提供一个给高级用户和菜鸟们的涉及各种课题的有用的文章列表或索引}}<br />
{{Article summary heading|相关文章}}<br />
{{Article summary wiki|Common Applications}}<br />
{{Article summary wiki|Lightweight Applications}}<br />
{{Article summary end}}<br />
<br />
这篇文章是一个关于各种常用或受欢迎的文章的详细索引.<br />
大多数软件需要用 [[pacman]] 来安装, 包括 [[Official Repositories]], 那些在 [[Arch User Repository]] 里的非正式发布或不稳定的软件, 则需要 [[makepkg]] 参见 [[AUR helper]]. 总而言之, 继续阅读的同学们最好对ArchLinux里的软件安装已经很熟悉.<br />
<br />
有些软件或话题是基于你有一个完美安装的系统. 比如如果是图形界面软件, 你当然需要已经阅读和安装 [[Xorg]] X窗口系统, 打印相关的软件你当然已经搞定 [[CUPS]] 等等, 所有看官要对文件系统有个概念, 建议参阅 [[FHS]].<br />
<br />
所以说你最好已经仔细看过 [[Arch 新手安装指南 (简体中文)]] 或者 [[Official Arch Linux Install Guide]] 来获得一个对ArchLinux安装的常识.<br />
<br />
文章标题按字母排序.<br />
<br />
==Appearance (外观)==<br />
''本栏将讨论ArchLinux界面的美化和外观方案等. 更多信息请参考 [[:Category:Eye candy (English)]].''<br />
<br />
===Colored output (彩色字符输出)===<br />
虽然已经有一部分软件具有输出彩色字符的能力, 使用通用的彩色字过滤器也是另一种方法. 安装 {{package AUR|cope}} 或 {{package AUR|cope-git}}, 经常更新的 [[Git]] 版本, 可以从 [[AUR]]安装. {{Package AUR|acoc}} 和 {{Package AUR|cw}} 也是类似的选择.<br />
<br />
====Console prompt (字符界面)====<br />
字符界面 (PS1) 可以被灵活的定制. 参考 [http://bbs.archlinux.org/viewtopic.php?id=50885 What's your PS1?] 论坛里的帖子. 也可参阅 [[Color Bash Prompt]] 或 [[Zsh#Prompts]] 如果你使用 Bash 或 Zsh 的话.<br />
<br />
====Core utilities====<br />
Colorizing the output of specific core utilities such as '''grep''' and '''ls''' is covered in the [[Core Utilities]] article.<br />
<br />
====Emacs shell====<br />
Emacs is known for featuring options beyond the duties of regular text editing, one of these being a full shell replacement. Consult [[Emacs#Colored output issues]] for a fix regarding garbled characters that may result from enabling colored output.<br />
<br />
====Man pages====<br />
Man pages (or manual pages) are one of the most useful resources available to GNU/Linux users. To aid readability, the pager can be configured to render colored text as explained in [[Man Page#Colored man pages]].<br />
<br />
===Fonts===<br />
A plethora of information on the subject can be found in the [[Fonts]] and [[Font Configuration]] articles.<br />
<br />
====Console fonts====<br />
If spending a significant amount of time working from the virtual console (i.e. outside an X server), users may wish to change the console font to improve readability; see [[Fonts#Console fonts]].<br />
<br />
====LCD filtered fonts====<br />
Font rendering software can be patched to provide smoother fonts on LCD monitors by taking advantage of sub-pixel elements; see [[Font Configuration#LCD filter patched packages]].<br />
<br />
==Booting==<br />
''This section contains information pertaining to the boot process. An overview of the Arch boot process can be found at [[Arch Boot Process]]. For more, please see [[:Category:Boot process (English)]].''<br />
<br />
===Backgrounding daemons===<br />
Daemons are programs that run in the background, and are typically started during boot. In order to speed up the boot process, certain daemons can be ''backgrounded'', allowing the boot process to continue whilst the daemon loads. See [[Daemon]] for a complete explanation.<br />
<br />
===Hardware auto-recognition===<br />
Hardware should be auto-detected by [[udev]] during the boot process by default. A potential improvement in boot time can be achieved by disabling module auto-loading and specifying required modules manually, as described in [[rc.conf#Hardware]]. Additionally [[Xorg]] should be able to auto-detect required drivers using [[HAL]], but users have the option to configure the X server manually, too; see [[Xorg Input Hotplugging]].<br />
<br />
===LILO speed improvement===<br />
Besides [[GRUB]], LILO is the most widely known Linux boot loader, legacy or not. Follow instructions shown in [[LILO#Sample setup]] for making the most out of its features.<br />
<br />
===Num Lock activation at boot===<br />
Num Lock is a toggle key found in most keyboards. For activating Num Lock's number key-assignment during startup, see [[Activating Numlock on Bootup]].<br />
<br />
===Retaining boot messages===<br />
Once it concludes, the screen is cleared and the login prompt appears, leaving users unable to gather feedback from the boot process. [[Disable clearing of boot messages]] to overcome this limitation.<br />
<br />
===Start X at boot===<br />
If utilizing an [[X]] server to provide a graphical user interface, users may wish to start this server during the boot process rather than starting it manually after login. See [[Display Manager]] if desiring a graphical login or [[Start X at boot]] for methods that do not involve a display manager.<br />
<br />
==Console improvements==<br />
''This section applies to small modifications that better console program's practicality. For more, please see [[:Category:Command shells (English)]] and [[:Category:Utilities (English)]].''<br />
<br />
===Aliases===<br />
Users can define shortcuts for frequently-used commands using a built-in shell command. Common time-saving aliases can be found in [[Core Utilities#alias]].<br />
<br />
===Bash additions===<br />
A list of miscellaneous Bash settings, including completion enhancements, history search and readline macros is available in [[Bash#Extended usage]].<br />
<br />
===Compressed files===<br />
====Browsing compressed files====<br />
====Extracting compressed files====<br />
<br />
===Control echo===<br />
<br />
===Mouse support===<br />
Using a mouse with the console for copy-paste operations can be preferred over [[screen]]'s traditional copy mode. Refer to [[Console Mouse Support]] for comprehensive directions.<br />
<br />
==Input==<br />
''This section contains popular input device configuration tips. For more, please see [[:Category:Input devices (English)]].''<br />
<br />
===Configure all mouse buttons===<br />
Owners of advanced or unusual mice may find that not all mouse buttons are recognized by default, or may wish to assign different actions for extra buttons. Instructions can be found in [[Get All Mouse Buttons Working]].<br />
<br />
===Keyboard layouts===<br />
Non-English or otherwise non-standard keyboards may not function as expected by default. To define the keymap in virtual consoles, the [[KEYMAP]] variable must be set in [[rc.conf]]. For [[Xorg]] users, the required changes are described in [[Xorg#Keyboard layout]].<br />
<br />
===Laptop touchpads===<br />
Many laptops use [http://www.synaptics.com/ Synaptics] or [http://www.alps.com/ ALPS] "touchpad" pointing devices. These, and several other touchpad models, use the Synaptics input driver; see [[Touchpad Synaptics]] for installation and configuration details.<br />
<br />
==Package management==<br />
''This section contains helpful information related to package management. All users should at least be familiar with the [[pacman]] package manager. For more, please see [[:Category:Package management (English)]].''<br />
<br />
===Aliases for pacman===<br />
Aliasing a command, or a group thereof, is a way of saving time when using the console. This is specially helpful for repetitive tasks that don't need significant alteration to their parameters between executions. Various time saving pacman aliases are organized in [[pacman Tips]], besides other suggested tools.<br />
<br />
===Arch Build System===<br />
''Ports'' is a system initially used by BSD distributions consisting of build scripts that reside in a directory tree on the local system. Simply put, each port contains a script within a directory intuitively named after the installable third-party application.<br />
<br />
The [[ABS]] tree offers the same functionality by providing build scripts called [[PKGBUILD]]s, which are populated with information for a given piece of software; integrity hashes, project URL, version, license and build instructions. These PKGBUILDs are later parsed by [[makepkg]], the actual program that generates packages cleanly manageable by pacman.<br />
<br />
Every package in the repositories along with those present in the AUR are subject to recompilation with makepkg.<br />
<br />
===Arch User Repository===<br />
While the [[ABS]] tree allows the ability of building software available in the official repositories, the [[AUR]] is the equivalent for user submitted packages. It is an unsupported repository of build scripts accessible through the [http://aur.archlinux.org/index.php web interface] or by an [[AUR helper]].<br />
<br />
AUR helpers like [[Yaourt]] and [[aurbuild]] add seamless access to the AUR. They may vary in features, but all ease in searching, fetching, building, and installing from over 18,673 PKGBUILDs found in the unofficial repository.<br />
<br />
===Mirrors===<br />
Visit [[Mirrors]] for steps on taking full advantage of using the fastest and most up to date pacman mirrors. As explained in the article, a particularly good advice is to routinely check [http://users.archlinux.de/~gerbra/mirrorcheck.html Mirrorcheck] and/or [http://www.archlinux.de/?page=MirrorStatus Mirror status] for a list of mirrors that have been recently synced.<br />
<br />
==Power management==<br />
''This section may be of use to laptop owners or users otherwise seeking power management controls. For more, please see [[:Category:Power management (English)]].''<br />
<br />
===acpid===<br />
Users can configure how the system reacts to ACPI events such as pressing the power button or closing a laptop's lid using [[acpid]].<br />
<br />
===CPU frequency scaling===<br />
Modern processors can decrease their frequency and voltage to reduce heat and power consumption. Less heat leads to a quieter system and prolongs the life of hardware. [[cpufrequtils]] is a set of utilities designed to assist CPU frequency scaling.<br />
<br />
===Laptops===<br />
For articles related to portable computing along with model-specific installation guides, please see [[:Category:Laptops (English)]]. For a general overview of laptop-related articles and recommendations, see [[Laptop]].<br />
<br />
===Suspending and hibernation===<br />
Several options are available to users desiring suspend-to-RAM (sleep/stand-by) and suspend-to-disk (hibernate) functionality. [[pm-utils]] describes one popular method, while [[hibernate-script]] is an older alternative that does not depend on Xorg packages.<br />
<br />
==Networking==<br />
''This section is confined to small networking procedures. Head over to [[Network]] for a full guide. For more, please see [[:Category:Networking (English)]].''<br />
<br />
===Disable IPv6===<br />
Not only does the module take around 250k of memory, it has also been reported that disabling it notoriously speeds up network access for programs that erroneously try to query servers with it. Incidentally, [[Firefox]] is listed among the affected applications. So until the widespread adoption of IPv6, it may be beneficial to [[IPv6 - Disabling the Module|disable it]].<br />
<br />
===DNS speed improvement===<br />
To improve load time by caching queries, use [[pdnsd]], a very simple program that does not attempt to fill every need. Or install [[dnsmasq]], a broader choice which also supports turning the system into a DHCP server.<br />
<br />
==System administration==<br />
''This section deals with administrative tasks and system management. For more, please see [[:Category:System administration (English)]].''<br />
<br />
===Privilege escalation===<br />
A new installation leaves users with only the super user account, better known as root. Logging in as root for prolonged periods of time is widely considered to be foolish and insecure. Instead, users should [[User Management|create]] and use unprivileged user accounts for most tasks, only using the root account for system administration. The [[su]] (substitute user) command allows assuming the identity of another user on the system (usually root) from an existing login, whereas the [[sudo]] command grants temporary privilege escalation for a specific command.<br />
<br />
===Windows networking===<br />
To enable communication between Windows and Arch Linux machines across a network, users can use [[Samba]]; a re-implementation of the SMB/CIFS networking protocol.<br />
<br />
==System services==<br />
''This section relates to daemons. For more, please see [[:Category:Daemons and system services (English)]].''<br />
<br />
===HAL===<br />
After having installed a desktop environment or window manager, installing [[HAL]] seems like a natural follow-up since it enables plug-and-play functionality for mobile phones, MP3 players, external HDDs, and other hardware. Often, HAL is used to mount the device and make an icon on a convenient place, like the desktop or in 'My Computer', allowing access to the peripheral soon after it has been plugged in. Altogether, this avoids manual [[fstab]] configuration or making [[udev]] rules for each and every new device.<br />
<br />
[[KDE]], [[GNOME]] and [[Xfce]] all use [[HAL]].<br />
<br />
===Local mail delivery===<br />
A default base setup bestows no means for mail syncing. To configure postfix for simple local mailbox delivery, see [[Local Mail Delivery with Postfix]]. Other options are [[SSMTP]], [[MSMTP]] and [[fdm]].</div>
Flydragon
https://wiki.archlinux.org/index.php?title=General_recommendations_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=91818
General recommendations (简体中文)
2010-01-12T06:34:14Z
<p>Flydragon: </p>
<hr />
<div>[[Category:Getting and installing Arch (简体中文)]]<br />
[[Category:HOWTOs (简体中文)]]<br />
{{i18n|General Recommendations}}<br />
{{Article summary start}}<br />
{{Article summary text|提供一个给高级用户和菜鸟们的涉及各种课题的有用的文章列表或索引}}<br />
{{Article summary heading|相关文章}}<br />
{{Article summary wiki|Common Applications}}<br />
{{Article summary wiki|Lightweight Applications}}<br />
{{Article summary end}}<br />
<br />
这篇文章是一个关于各种常用或受欢迎的文章的详细索引.<br />
大多数软件需要用 [[pacman]] 来安装, 包括 [[Official Repositories]], 那些在 [[Arch User Repository]] 里的非正式发布或不稳定的软件, 则需要 [[makepkg]] 参见 [[AUR helper]]. 总而言之, 继续阅读的同学们最好对ArchLinux里的软件安装已经很熟悉.<br />
<br />
有些软件或话题是基于你有一个完美安装的系统. 比如如果是图形界面软件, 你当然需要已经阅读和安装 [[Xorg]] X窗口系统, 打印相关的软件你当然已经搞定 [[CUPS]] 等等, 所有看官要对文件系统有个概念, 建议参阅 [[FHS]].<br />
<br />
所以说你最好已经仔细看过 [[Arch 新手安装指南 (简体中文)]] 或者 [[Official Arch Linux Install Guide]] 来获得一个对ArchLinux安装的常识.<br />
<br />
文章标题按字母排序.<br />
<br />
==Appearance==<br />
''This section contains frequently-sought "eye candy" tweaks for an aesthetically pleasing Arch experience. For more, please see [[:Category:Eye candy (English)]].''<br />
<br />
===Colored output===<br />
Even though a number of applications have built-in color capabilities, using a general-purpose, colorizing wrapper such as cope is another route. Install {{package AUR|cope}} or {{package AUR|cope-git}}, the more often updated [[Git]] version, from the [[AUR]]. {{Package AUR|acoc}} and {{Package AUR|cw}} are similar alternatives.<br />
<br />
====Console prompt====<br />
The console prompt (PS1) can be customized to a great extent. See the [http://bbs.archlinux.org/viewtopic.php?id=50885 What's your PS1?] forum thread for ideas. Also see [[Color Bash Prompt]] or [[Zsh#Prompts]] if using Bash or Zsh, respectively.<br />
<br />
====Core utilities====<br />
Colorizing the output of specific core utilities such as '''grep''' and '''ls''' is covered in the [[Core Utilities]] article.<br />
<br />
====Emacs shell====<br />
Emacs is known for featuring options beyond the duties of regular text editing, one of these being a full shell replacement. Consult [[Emacs#Colored output issues]] for a fix regarding garbled characters that may result from enabling colored output.<br />
<br />
====Man pages====<br />
Man pages (or manual pages) are one of the most useful resources available to GNU/Linux users. To aid readability, the pager can be configured to render colored text as explained in [[Man Page#Colored man pages]].<br />
<br />
===Fonts===<br />
A plethora of information on the subject can be found in the [[Fonts]] and [[Font Configuration]] articles.<br />
<br />
====Console fonts====<br />
If spending a significant amount of time working from the virtual console (i.e. outside an X server), users may wish to change the console font to improve readability; see [[Fonts#Console fonts]].<br />
<br />
====LCD filtered fonts====<br />
Font rendering software can be patched to provide smoother fonts on LCD monitors by taking advantage of sub-pixel elements; see [[Font Configuration#LCD filter patched packages]].<br />
<br />
==Booting==<br />
''This section contains information pertaining to the boot process. An overview of the Arch boot process can be found at [[Arch Boot Process]]. For more, please see [[:Category:Boot process (English)]].''<br />
<br />
===Backgrounding daemons===<br />
Daemons are programs that run in the background, and are typically started during boot. In order to speed up the boot process, certain daemons can be ''backgrounded'', allowing the boot process to continue whilst the daemon loads. See [[Daemon]] for a complete explanation.<br />
<br />
===Hardware auto-recognition===<br />
Hardware should be auto-detected by [[udev]] during the boot process by default. A potential improvement in boot time can be achieved by disabling module auto-loading and specifying required modules manually, as described in [[rc.conf#Hardware]]. Additionally [[Xorg]] should be able to auto-detect required drivers using [[HAL]], but users have the option to configure the X server manually, too; see [[Xorg Input Hotplugging]].<br />
<br />
===LILO speed improvement===<br />
Besides [[GRUB]], LILO is the most widely known Linux boot loader, legacy or not. Follow instructions shown in [[LILO#Sample setup]] for making the most out of its features.<br />
<br />
===Num Lock activation at boot===<br />
Num Lock is a toggle key found in most keyboards. For activating Num Lock's number key-assignment during startup, see [[Activating Numlock on Bootup]].<br />
<br />
===Retaining boot messages===<br />
Once it concludes, the screen is cleared and the login prompt appears, leaving users unable to gather feedback from the boot process. [[Disable clearing of boot messages]] to overcome this limitation.<br />
<br />
===Start X at boot===<br />
If utilizing an [[X]] server to provide a graphical user interface, users may wish to start this server during the boot process rather than starting it manually after login. See [[Display Manager]] if desiring a graphical login or [[Start X at boot]] for methods that do not involve a display manager.<br />
<br />
==Console improvements==<br />
''This section applies to small modifications that better console program's practicality. For more, please see [[:Category:Command shells (English)]] and [[:Category:Utilities (English)]].''<br />
<br />
===Aliases===<br />
Users can define shortcuts for frequently-used commands using a built-in shell command. Common time-saving aliases can be found in [[Core Utilities#alias]].<br />
<br />
===Bash additions===<br />
A list of miscellaneous Bash settings, including completion enhancements, history search and readline macros is available in [[Bash#Extended usage]].<br />
<br />
===Compressed files===<br />
====Browsing compressed files====<br />
====Extracting compressed files====<br />
<br />
===Control echo===<br />
<br />
===Mouse support===<br />
Using a mouse with the console for copy-paste operations can be preferred over [[screen]]'s traditional copy mode. Refer to [[Console Mouse Support]] for comprehensive directions.<br />
<br />
==Input==<br />
''This section contains popular input device configuration tips. For more, please see [[:Category:Input devices (English)]].''<br />
<br />
===Configure all mouse buttons===<br />
Owners of advanced or unusual mice may find that not all mouse buttons are recognized by default, or may wish to assign different actions for extra buttons. Instructions can be found in [[Get All Mouse Buttons Working]].<br />
<br />
===Keyboard layouts===<br />
Non-English or otherwise non-standard keyboards may not function as expected by default. To define the keymap in virtual consoles, the [[KEYMAP]] variable must be set in [[rc.conf]]. For [[Xorg]] users, the required changes are described in [[Xorg#Keyboard layout]].<br />
<br />
===Laptop touchpads===<br />
Many laptops use [http://www.synaptics.com/ Synaptics] or [http://www.alps.com/ ALPS] "touchpad" pointing devices. These, and several other touchpad models, use the Synaptics input driver; see [[Touchpad Synaptics]] for installation and configuration details.<br />
<br />
==Package management==<br />
''This section contains helpful information related to package management. All users should at least be familiar with the [[pacman]] package manager. For more, please see [[:Category:Package management (English)]].''<br />
<br />
===Aliases for pacman===<br />
Aliasing a command, or a group thereof, is a way of saving time when using the console. This is specially helpful for repetitive tasks that don't need significant alteration to their parameters between executions. Various time saving pacman aliases are organized in [[pacman Tips]], besides other suggested tools.<br />
<br />
===Arch Build System===<br />
''Ports'' is a system initially used by BSD distributions consisting of build scripts that reside in a directory tree on the local system. Simply put, each port contains a script within a directory intuitively named after the installable third-party application.<br />
<br />
The [[ABS]] tree offers the same functionality by providing build scripts called [[PKGBUILD]]s, which are populated with information for a given piece of software; integrity hashes, project URL, version, license and build instructions. These PKGBUILDs are later parsed by [[makepkg]], the actual program that generates packages cleanly manageable by pacman.<br />
<br />
Every package in the repositories along with those present in the AUR are subject to recompilation with makepkg.<br />
<br />
===Arch User Repository===<br />
While the [[ABS]] tree allows the ability of building software available in the official repositories, the [[AUR]] is the equivalent for user submitted packages. It is an unsupported repository of build scripts accessible through the [http://aur.archlinux.org/index.php web interface] or by an [[AUR helper]].<br />
<br />
AUR helpers like [[Yaourt]] and [[aurbuild]] add seamless access to the AUR. They may vary in features, but all ease in searching, fetching, building, and installing from over 18,673 PKGBUILDs found in the unofficial repository.<br />
<br />
===Mirrors===<br />
Visit [[Mirrors]] for steps on taking full advantage of using the fastest and most up to date pacman mirrors. As explained in the article, a particularly good advice is to routinely check [http://users.archlinux.de/~gerbra/mirrorcheck.html Mirrorcheck] and/or [http://www.archlinux.de/?page=MirrorStatus Mirror status] for a list of mirrors that have been recently synced.<br />
<br />
==Power management==<br />
''This section may be of use to laptop owners or users otherwise seeking power management controls. For more, please see [[:Category:Power management (English)]].''<br />
<br />
===acpid===<br />
Users can configure how the system reacts to ACPI events such as pressing the power button or closing a laptop's lid using [[acpid]].<br />
<br />
===CPU frequency scaling===<br />
Modern processors can decrease their frequency and voltage to reduce heat and power consumption. Less heat leads to a quieter system and prolongs the life of hardware. [[cpufrequtils]] is a set of utilities designed to assist CPU frequency scaling.<br />
<br />
===Laptops===<br />
For articles related to portable computing along with model-specific installation guides, please see [[:Category:Laptops (English)]]. For a general overview of laptop-related articles and recommendations, see [[Laptop]].<br />
<br />
===Suspending and hibernation===<br />
Several options are available to users desiring suspend-to-RAM (sleep/stand-by) and suspend-to-disk (hibernate) functionality. [[pm-utils]] describes one popular method, while [[hibernate-script]] is an older alternative that does not depend on Xorg packages.<br />
<br />
==Networking==<br />
''This section is confined to small networking procedures. Head over to [[Network]] for a full guide. For more, please see [[:Category:Networking (English)]].''<br />
<br />
===Disable IPv6===<br />
Not only does the module take around 250k of memory, it has also been reported that disabling it notoriously speeds up network access for programs that erroneously try to query servers with it. Incidentally, [[Firefox]] is listed among the affected applications. So until the widespread adoption of IPv6, it may be beneficial to [[IPv6 - Disabling the Module|disable it]].<br />
<br />
===DNS speed improvement===<br />
To improve load time by caching queries, use [[pdnsd]], a very simple program that does not attempt to fill every need. Or install [[dnsmasq]], a broader choice which also supports turning the system into a DHCP server.<br />
<br />
==System administration==<br />
''This section deals with administrative tasks and system management. For more, please see [[:Category:System administration (English)]].''<br />
<br />
===Privilege escalation===<br />
A new installation leaves users with only the super user account, better known as root. Logging in as root for prolonged periods of time is widely considered to be foolish and insecure. Instead, users should [[User Management|create]] and use unprivileged user accounts for most tasks, only using the root account for system administration. The [[su]] (substitute user) command allows assuming the identity of another user on the system (usually root) from an existing login, whereas the [[sudo]] command grants temporary privilege escalation for a specific command.<br />
<br />
===Windows networking===<br />
To enable communication between Windows and Arch Linux machines across a network, users can use [[Samba]]; a re-implementation of the SMB/CIFS networking protocol.<br />
<br />
==System services==<br />
''This section relates to daemons. For more, please see [[:Category:Daemons and system services (English)]].''<br />
<br />
===HAL===<br />
After having installed a desktop environment or window manager, installing [[HAL]] seems like a natural follow-up since it enables plug-and-play functionality for mobile phones, MP3 players, external HDDs, and other hardware. Often, HAL is used to mount the device and make an icon on a convenient place, like the desktop or in 'My Computer', allowing access to the peripheral soon after it has been plugged in. Altogether, this avoids manual [[fstab]] configuration or making [[udev]] rules for each and every new device.<br />
<br />
[[KDE]], [[GNOME]] and [[Xfce]] all use [[HAL]].<br />
<br />
===Local mail delivery===<br />
A default base setup bestows no means for mail syncing. To configure postfix for simple local mailbox delivery, see [[Local Mail Delivery with Postfix]]. Other options are [[SSMTP]], [[MSMTP]] and [[fdm]].</div>
Flydragon
https://wiki.archlinux.org/index.php?title=General_recommendations_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=91817
General recommendations (简体中文)
2010-01-12T06:32:36Z
<p>Flydragon: </p>
<hr />
<div>[[Category:Getting and installing Arch (简体中文)]]<br />
[[Category:HOWTOs (简体中文)]]<br />
{{i18n|General Recommendations}}<br />
{{Article summary start}}<br />
{{Article summary text|提供一个给高级用户和菜鸟们的涉及各种课题的有用的文章列表或索引}}<br />
{{Article summary heading|相关文章}}<br />
{{Article summary wiki|Common Applications}}<br />
{{Article summary wiki|Lightweight Applications}}<br />
{{Article summary end}}<br />
<br />
这篇文章是一个关于各种常用或受欢迎的文章的详细索引.<br />
大多数软件需要用 [[pacman]] 来安装, 包括 [[Official Repositories]], 那些在 [[Arch User Repository]] 里的非正式发布或不稳定的软件, 则需要 [[makepkg]] 参见 [[AUR helper]]. 总而言之, 继续阅读的同学们最好对ArchLinux里的软件安装已经很熟悉.<br />
<br />
有些软件或话题是基于你有一个完美安装的系统. 比如如果是图形界面软件, 你当然需要已经阅读和安装 [[Xorg]] X窗口系统, 打印相关的软件你当然已经搞定 [[CUPS]] 等等, 所有看官要对文件系统有个概念, 建议参阅 [[FHS]].<br />
<br />
所以说你最好已经仔细看过 [[Beginners' Guide]] 或者 [[Official Arch Linux Install Guide]] 来获得一个对ArchLinux安装的常识.<br />
<br />
文章标题按字母排序.<br />
<br />
==Appearance==<br />
''This section contains frequently-sought "eye candy" tweaks for an aesthetically pleasing Arch experience. For more, please see [[:Category:Eye candy (English)]].''<br />
<br />
===Colored output===<br />
Even though a number of applications have built-in color capabilities, using a general-purpose, colorizing wrapper such as cope is another route. Install {{package AUR|cope}} or {{package AUR|cope-git}}, the more often updated [[Git]] version, from the [[AUR]]. {{Package AUR|acoc}} and {{Package AUR|cw}} are similar alternatives.<br />
<br />
====Console prompt====<br />
The console prompt (PS1) can be customized to a great extent. See the [http://bbs.archlinux.org/viewtopic.php?id=50885 What's your PS1?] forum thread for ideas. Also see [[Color Bash Prompt]] or [[Zsh#Prompts]] if using Bash or Zsh, respectively.<br />
<br />
====Core utilities====<br />
Colorizing the output of specific core utilities such as '''grep''' and '''ls''' is covered in the [[Core Utilities]] article.<br />
<br />
====Emacs shell====<br />
Emacs is known for featuring options beyond the duties of regular text editing, one of these being a full shell replacement. Consult [[Emacs#Colored output issues]] for a fix regarding garbled characters that may result from enabling colored output.<br />
<br />
====Man pages====<br />
Man pages (or manual pages) are one of the most useful resources available to GNU/Linux users. To aid readability, the pager can be configured to render colored text as explained in [[Man Page#Colored man pages]].<br />
<br />
===Fonts===<br />
A plethora of information on the subject can be found in the [[Fonts]] and [[Font Configuration]] articles.<br />
<br />
====Console fonts====<br />
If spending a significant amount of time working from the virtual console (i.e. outside an X server), users may wish to change the console font to improve readability; see [[Fonts#Console fonts]].<br />
<br />
====LCD filtered fonts====<br />
Font rendering software can be patched to provide smoother fonts on LCD monitors by taking advantage of sub-pixel elements; see [[Font Configuration#LCD filter patched packages]].<br />
<br />
==Booting==<br />
''This section contains information pertaining to the boot process. An overview of the Arch boot process can be found at [[Arch Boot Process]]. For more, please see [[:Category:Boot process (English)]].''<br />
<br />
===Backgrounding daemons===<br />
Daemons are programs that run in the background, and are typically started during boot. In order to speed up the boot process, certain daemons can be ''backgrounded'', allowing the boot process to continue whilst the daemon loads. See [[Daemon]] for a complete explanation.<br />
<br />
===Hardware auto-recognition===<br />
Hardware should be auto-detected by [[udev]] during the boot process by default. A potential improvement in boot time can be achieved by disabling module auto-loading and specifying required modules manually, as described in [[rc.conf#Hardware]]. Additionally [[Xorg]] should be able to auto-detect required drivers using [[HAL]], but users have the option to configure the X server manually, too; see [[Xorg Input Hotplugging]].<br />
<br />
===LILO speed improvement===<br />
Besides [[GRUB]], LILO is the most widely known Linux boot loader, legacy or not. Follow instructions shown in [[LILO#Sample setup]] for making the most out of its features.<br />
<br />
===Num Lock activation at boot===<br />
Num Lock is a toggle key found in most keyboards. For activating Num Lock's number key-assignment during startup, see [[Activating Numlock on Bootup]].<br />
<br />
===Retaining boot messages===<br />
Once it concludes, the screen is cleared and the login prompt appears, leaving users unable to gather feedback from the boot process. [[Disable clearing of boot messages]] to overcome this limitation.<br />
<br />
===Start X at boot===<br />
If utilizing an [[X]] server to provide a graphical user interface, users may wish to start this server during the boot process rather than starting it manually after login. See [[Display Manager]] if desiring a graphical login or [[Start X at boot]] for methods that do not involve a display manager.<br />
<br />
==Console improvements==<br />
''This section applies to small modifications that better console program's practicality. For more, please see [[:Category:Command shells (English)]] and [[:Category:Utilities (English)]].''<br />
<br />
===Aliases===<br />
Users can define shortcuts for frequently-used commands using a built-in shell command. Common time-saving aliases can be found in [[Core Utilities#alias]].<br />
<br />
===Bash additions===<br />
A list of miscellaneous Bash settings, including completion enhancements, history search and readline macros is available in [[Bash#Extended usage]].<br />
<br />
===Compressed files===<br />
====Browsing compressed files====<br />
====Extracting compressed files====<br />
<br />
===Control echo===<br />
<br />
===Mouse support===<br />
Using a mouse with the console for copy-paste operations can be preferred over [[screen]]'s traditional copy mode. Refer to [[Console Mouse Support]] for comprehensive directions.<br />
<br />
==Input==<br />
''This section contains popular input device configuration tips. For more, please see [[:Category:Input devices (English)]].''<br />
<br />
===Configure all mouse buttons===<br />
Owners of advanced or unusual mice may find that not all mouse buttons are recognized by default, or may wish to assign different actions for extra buttons. Instructions can be found in [[Get All Mouse Buttons Working]].<br />
<br />
===Keyboard layouts===<br />
Non-English or otherwise non-standard keyboards may not function as expected by default. To define the keymap in virtual consoles, the [[KEYMAP]] variable must be set in [[rc.conf]]. For [[Xorg]] users, the required changes are described in [[Xorg#Keyboard layout]].<br />
<br />
===Laptop touchpads===<br />
Many laptops use [http://www.synaptics.com/ Synaptics] or [http://www.alps.com/ ALPS] "touchpad" pointing devices. These, and several other touchpad models, use the Synaptics input driver; see [[Touchpad Synaptics]] for installation and configuration details.<br />
<br />
==Package management==<br />
''This section contains helpful information related to package management. All users should at least be familiar with the [[pacman]] package manager. For more, please see [[:Category:Package management (English)]].''<br />
<br />
===Aliases for pacman===<br />
Aliasing a command, or a group thereof, is a way of saving time when using the console. This is specially helpful for repetitive tasks that don't need significant alteration to their parameters between executions. Various time saving pacman aliases are organized in [[pacman Tips]], besides other suggested tools.<br />
<br />
===Arch Build System===<br />
''Ports'' is a system initially used by BSD distributions consisting of build scripts that reside in a directory tree on the local system. Simply put, each port contains a script within a directory intuitively named after the installable third-party application.<br />
<br />
The [[ABS]] tree offers the same functionality by providing build scripts called [[PKGBUILD]]s, which are populated with information for a given piece of software; integrity hashes, project URL, version, license and build instructions. These PKGBUILDs are later parsed by [[makepkg]], the actual program that generates packages cleanly manageable by pacman.<br />
<br />
Every package in the repositories along with those present in the AUR are subject to recompilation with makepkg.<br />
<br />
===Arch User Repository===<br />
While the [[ABS]] tree allows the ability of building software available in the official repositories, the [[AUR]] is the equivalent for user submitted packages. It is an unsupported repository of build scripts accessible through the [http://aur.archlinux.org/index.php web interface] or by an [[AUR helper]].<br />
<br />
AUR helpers like [[Yaourt]] and [[aurbuild]] add seamless access to the AUR. They may vary in features, but all ease in searching, fetching, building, and installing from over 18,673 PKGBUILDs found in the unofficial repository.<br />
<br />
===Mirrors===<br />
Visit [[Mirrors]] for steps on taking full advantage of using the fastest and most up to date pacman mirrors. As explained in the article, a particularly good advice is to routinely check [http://users.archlinux.de/~gerbra/mirrorcheck.html Mirrorcheck] and/or [http://www.archlinux.de/?page=MirrorStatus Mirror status] for a list of mirrors that have been recently synced.<br />
<br />
==Power management==<br />
''This section may be of use to laptop owners or users otherwise seeking power management controls. For more, please see [[:Category:Power management (English)]].''<br />
<br />
===acpid===<br />
Users can configure how the system reacts to ACPI events such as pressing the power button or closing a laptop's lid using [[acpid]].<br />
<br />
===CPU frequency scaling===<br />
Modern processors can decrease their frequency and voltage to reduce heat and power consumption. Less heat leads to a quieter system and prolongs the life of hardware. [[cpufrequtils]] is a set of utilities designed to assist CPU frequency scaling.<br />
<br />
===Laptops===<br />
For articles related to portable computing along with model-specific installation guides, please see [[:Category:Laptops (English)]]. For a general overview of laptop-related articles and recommendations, see [[Laptop]].<br />
<br />
===Suspending and hibernation===<br />
Several options are available to users desiring suspend-to-RAM (sleep/stand-by) and suspend-to-disk (hibernate) functionality. [[pm-utils]] describes one popular method, while [[hibernate-script]] is an older alternative that does not depend on Xorg packages.<br />
<br />
==Networking==<br />
''This section is confined to small networking procedures. Head over to [[Network]] for a full guide. For more, please see [[:Category:Networking (English)]].''<br />
<br />
===Disable IPv6===<br />
Not only does the module take around 250k of memory, it has also been reported that disabling it notoriously speeds up network access for programs that erroneously try to query servers with it. Incidentally, [[Firefox]] is listed among the affected applications. So until the widespread adoption of IPv6, it may be beneficial to [[IPv6 - Disabling the Module|disable it]].<br />
<br />
===DNS speed improvement===<br />
To improve load time by caching queries, use [[pdnsd]], a very simple program that does not attempt to fill every need. Or install [[dnsmasq]], a broader choice which also supports turning the system into a DHCP server.<br />
<br />
==System administration==<br />
''This section deals with administrative tasks and system management. For more, please see [[:Category:System administration (English)]].''<br />
<br />
===Privilege escalation===<br />
A new installation leaves users with only the super user account, better known as root. Logging in as root for prolonged periods of time is widely considered to be foolish and insecure. Instead, users should [[User Management|create]] and use unprivileged user accounts for most tasks, only using the root account for system administration. The [[su]] (substitute user) command allows assuming the identity of another user on the system (usually root) from an existing login, whereas the [[sudo]] command grants temporary privilege escalation for a specific command.<br />
<br />
===Windows networking===<br />
To enable communication between Windows and Arch Linux machines across a network, users can use [[Samba]]; a re-implementation of the SMB/CIFS networking protocol.<br />
<br />
==System services==<br />
''This section relates to daemons. For more, please see [[:Category:Daemons and system services (English)]].''<br />
<br />
===HAL===<br />
After having installed a desktop environment or window manager, installing [[HAL]] seems like a natural follow-up since it enables plug-and-play functionality for mobile phones, MP3 players, external HDDs, and other hardware. Often, HAL is used to mount the device and make an icon on a convenient place, like the desktop or in 'My Computer', allowing access to the peripheral soon after it has been plugged in. Altogether, this avoids manual [[fstab]] configuration or making [[udev]] rules for each and every new device.<br />
<br />
[[KDE]], [[GNOME]] and [[Xfce]] all use [[HAL]].<br />
<br />
===Local mail delivery===<br />
A default base setup bestows no means for mail syncing. To configure postfix for simple local mailbox delivery, see [[Local Mail Delivery with Postfix]]. Other options are [[SSMTP]], [[MSMTP]] and [[fdm]].</div>
Flydragon
https://wiki.archlinux.org/index.php?title=General_recommendations_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=91816
General recommendations (简体中文)
2010-01-12T06:16:57Z
<p>Flydragon: Created page with 'Category:Getting and installing Arch (简体中文) Category:HOWTOs (简体中文) {{i18n|General Recommendations}} {{Article summary start}} {{Article summary text|提…'</p>
<hr />
<div>[[Category:Getting and installing Arch (简体中文)]]<br />
[[Category:HOWTOs (简体中文)]]<br />
{{i18n|General Recommendations}}<br />
{{Article summary start}}<br />
{{Article summary text|提供一个给高级用户和菜鸟们的涉及各种课题的有用的文章列表或索引}}<br />
{{Article summary heading|相关文章}}<br />
{{Article summary wiki|Common Applications}}<br />
{{Article summary wiki|Lightweight Applications}}<br />
{{Article summary end}}<br />
<br />
This document is an annotated index of other popular articles and commonly wanted information. Various pages listed here will require using [[pacman]] to install additional packages present in the [[Official Repositories]], and those in the unofficial [[Arch User Repository]] by employing [[makepkg]] with the optional aid of an [[AUR helper]]. As such, the concept of package management should be fully understood before continuing.<br />
<br />
Besides the aforementioned subjects, there are others that are normally considered crucial requirements for a functional system. If a graphical interface is desired, please read [[Xorg]] first, whereas those interested in printing should make reviewing [[CUPS]] a priority, and lastly, all users can familiarize themselves with the file system by heeding [[FHS]]' illustration.<br />
<br />
Furthermore, readers are assumed to have read and followed the [[Beginners' Guide]] or [[Official Arch Linux Install Guide]] to obtain a basic Arch Linux installation.<br />
<br />
That said, please keep headings alphabetical.<br />
<br />
==Appearance==<br />
''This section contains frequently-sought "eye candy" tweaks for an aesthetically pleasing Arch experience. For more, please see [[:Category:Eye candy (English)]].''<br />
<br />
===Colored output===<br />
Even though a number of applications have built-in color capabilities, using a general-purpose, colorizing wrapper such as cope is another route. Install {{package AUR|cope}} or {{package AUR|cope-git}}, the more often updated [[Git]] version, from the [[AUR]]. {{Package AUR|acoc}} and {{Package AUR|cw}} are similar alternatives.<br />
<br />
====Console prompt====<br />
The console prompt (PS1) can be customized to a great extent. See the [http://bbs.archlinux.org/viewtopic.php?id=50885 What's your PS1?] forum thread for ideas. Also see [[Color Bash Prompt]] or [[Zsh#Prompts]] if using Bash or Zsh, respectively.<br />
<br />
====Core utilities====<br />
Colorizing the output of specific core utilities such as '''grep''' and '''ls''' is covered in the [[Core Utilities]] article.<br />
<br />
====Emacs shell====<br />
Emacs is known for featuring options beyond the duties of regular text editing, one of these being a full shell replacement. Consult [[Emacs#Colored output issues]] for a fix regarding garbled characters that may result from enabling colored output.<br />
<br />
====Man pages====<br />
Man pages (or manual pages) are one of the most useful resources available to GNU/Linux users. To aid readability, the pager can be configured to render colored text as explained in [[Man Page#Colored man pages]].<br />
<br />
===Fonts===<br />
A plethora of information on the subject can be found in the [[Fonts]] and [[Font Configuration]] articles.<br />
<br />
====Console fonts====<br />
If spending a significant amount of time working from the virtual console (i.e. outside an X server), users may wish to change the console font to improve readability; see [[Fonts#Console fonts]].<br />
<br />
====LCD filtered fonts====<br />
Font rendering software can be patched to provide smoother fonts on LCD monitors by taking advantage of sub-pixel elements; see [[Font Configuration#LCD filter patched packages]].<br />
<br />
==Booting==<br />
''This section contains information pertaining to the boot process. An overview of the Arch boot process can be found at [[Arch Boot Process]]. For more, please see [[:Category:Boot process (English)]].''<br />
<br />
===Backgrounding daemons===<br />
Daemons are programs that run in the background, and are typically started during boot. In order to speed up the boot process, certain daemons can be ''backgrounded'', allowing the boot process to continue whilst the daemon loads. See [[Daemon]] for a complete explanation.<br />
<br />
===Hardware auto-recognition===<br />
Hardware should be auto-detected by [[udev]] during the boot process by default. A potential improvement in boot time can be achieved by disabling module auto-loading and specifying required modules manually, as described in [[rc.conf#Hardware]]. Additionally [[Xorg]] should be able to auto-detect required drivers using [[HAL]], but users have the option to configure the X server manually, too; see [[Xorg Input Hotplugging]].<br />
<br />
===LILO speed improvement===<br />
Besides [[GRUB]], LILO is the most widely known Linux boot loader, legacy or not. Follow instructions shown in [[LILO#Sample setup]] for making the most out of its features.<br />
<br />
===Num Lock activation at boot===<br />
Num Lock is a toggle key found in most keyboards. For activating Num Lock's number key-assignment during startup, see [[Activating Numlock on Bootup]].<br />
<br />
===Retaining boot messages===<br />
Once it concludes, the screen is cleared and the login prompt appears, leaving users unable to gather feedback from the boot process. [[Disable clearing of boot messages]] to overcome this limitation.<br />
<br />
===Start X at boot===<br />
If utilizing an [[X]] server to provide a graphical user interface, users may wish to start this server during the boot process rather than starting it manually after login. See [[Display Manager]] if desiring a graphical login or [[Start X at boot]] for methods that do not involve a display manager.<br />
<br />
==Console improvements==<br />
''This section applies to small modifications that better console program's practicality. For more, please see [[:Category:Command shells (English)]] and [[:Category:Utilities (English)]].''<br />
<br />
===Aliases===<br />
Users can define shortcuts for frequently-used commands using a built-in shell command. Common time-saving aliases can be found in [[Core Utilities#alias]].<br />
<br />
===Bash additions===<br />
A list of miscellaneous Bash settings, including completion enhancements, history search and readline macros is available in [[Bash#Extended usage]].<br />
<br />
===Compressed files===<br />
====Browsing compressed files====<br />
====Extracting compressed files====<br />
<br />
===Control echo===<br />
<br />
===Mouse support===<br />
Using a mouse with the console for copy-paste operations can be preferred over [[screen]]'s traditional copy mode. Refer to [[Console Mouse Support]] for comprehensive directions.<br />
<br />
==Input==<br />
''This section contains popular input device configuration tips. For more, please see [[:Category:Input devices (English)]].''<br />
<br />
===Configure all mouse buttons===<br />
Owners of advanced or unusual mice may find that not all mouse buttons are recognized by default, or may wish to assign different actions for extra buttons. Instructions can be found in [[Get All Mouse Buttons Working]].<br />
<br />
===Keyboard layouts===<br />
Non-English or otherwise non-standard keyboards may not function as expected by default. To define the keymap in virtual consoles, the [[KEYMAP]] variable must be set in [[rc.conf]]. For [[Xorg]] users, the required changes are described in [[Xorg#Keyboard layout]].<br />
<br />
===Laptop touchpads===<br />
Many laptops use [http://www.synaptics.com/ Synaptics] or [http://www.alps.com/ ALPS] "touchpad" pointing devices. These, and several other touchpad models, use the Synaptics input driver; see [[Touchpad Synaptics]] for installation and configuration details.<br />
<br />
==Package management==<br />
''This section contains helpful information related to package management. All users should at least be familiar with the [[pacman]] package manager. For more, please see [[:Category:Package management (English)]].''<br />
<br />
===Aliases for pacman===<br />
Aliasing a command, or a group thereof, is a way of saving time when using the console. This is specially helpful for repetitive tasks that don't need significant alteration to their parameters between executions. Various time saving pacman aliases are organized in [[pacman Tips]], besides other suggested tools.<br />
<br />
===Arch Build System===<br />
''Ports'' is a system initially used by BSD distributions consisting of build scripts that reside in a directory tree on the local system. Simply put, each port contains a script within a directory intuitively named after the installable third-party application.<br />
<br />
The [[ABS]] tree offers the same functionality by providing build scripts called [[PKGBUILD]]s, which are populated with information for a given piece of software; integrity hashes, project URL, version, license and build instructions. These PKGBUILDs are later parsed by [[makepkg]], the actual program that generates packages cleanly manageable by pacman.<br />
<br />
Every package in the repositories along with those present in the AUR are subject to recompilation with makepkg.<br />
<br />
===Arch User Repository===<br />
While the [[ABS]] tree allows the ability of building software available in the official repositories, the [[AUR]] is the equivalent for user submitted packages. It is an unsupported repository of build scripts accessible through the [http://aur.archlinux.org/index.php web interface] or by an [[AUR helper]].<br />
<br />
AUR helpers like [[Yaourt]] and [[aurbuild]] add seamless access to the AUR. They may vary in features, but all ease in searching, fetching, building, and installing from over 18,673 PKGBUILDs found in the unofficial repository.<br />
<br />
===Mirrors===<br />
Visit [[Mirrors]] for steps on taking full advantage of using the fastest and most up to date pacman mirrors. As explained in the article, a particularly good advice is to routinely check [http://users.archlinux.de/~gerbra/mirrorcheck.html Mirrorcheck] and/or [http://www.archlinux.de/?page=MirrorStatus Mirror status] for a list of mirrors that have been recently synced.<br />
<br />
==Power management==<br />
''This section may be of use to laptop owners or users otherwise seeking power management controls. For more, please see [[:Category:Power management (English)]].''<br />
<br />
===acpid===<br />
Users can configure how the system reacts to ACPI events such as pressing the power button or closing a laptop's lid using [[acpid]].<br />
<br />
===CPU frequency scaling===<br />
Modern processors can decrease their frequency and voltage to reduce heat and power consumption. Less heat leads to a quieter system and prolongs the life of hardware. [[cpufrequtils]] is a set of utilities designed to assist CPU frequency scaling.<br />
<br />
===Laptops===<br />
For articles related to portable computing along with model-specific installation guides, please see [[:Category:Laptops (English)]]. For a general overview of laptop-related articles and recommendations, see [[Laptop]].<br />
<br />
===Suspending and hibernation===<br />
Several options are available to users desiring suspend-to-RAM (sleep/stand-by) and suspend-to-disk (hibernate) functionality. [[pm-utils]] describes one popular method, while [[hibernate-script]] is an older alternative that does not depend on Xorg packages.<br />
<br />
==Networking==<br />
''This section is confined to small networking procedures. Head over to [[Network]] for a full guide. For more, please see [[:Category:Networking (English)]].''<br />
<br />
===Disable IPv6===<br />
Not only does the module take around 250k of memory, it has also been reported that disabling it notoriously speeds up network access for programs that erroneously try to query servers with it. Incidentally, [[Firefox]] is listed among the affected applications. So until the widespread adoption of IPv6, it may be beneficial to [[IPv6 - Disabling the Module|disable it]].<br />
<br />
===DNS speed improvement===<br />
To improve load time by caching queries, use [[pdnsd]], a very simple program that does not attempt to fill every need. Or install [[dnsmasq]], a broader choice which also supports turning the system into a DHCP server.<br />
<br />
==System administration==<br />
''This section deals with administrative tasks and system management. For more, please see [[:Category:System administration (English)]].''<br />
<br />
===Privilege escalation===<br />
A new installation leaves users with only the super user account, better known as root. Logging in as root for prolonged periods of time is widely considered to be foolish and insecure. Instead, users should [[User Management|create]] and use unprivileged user accounts for most tasks, only using the root account for system administration. The [[su]] (substitute user) command allows assuming the identity of another user on the system (usually root) from an existing login, whereas the [[sudo]] command grants temporary privilege escalation for a specific command.<br />
<br />
===Windows networking===<br />
To enable communication between Windows and Arch Linux machines across a network, users can use [[Samba]]; a re-implementation of the SMB/CIFS networking protocol.<br />
<br />
==System services==<br />
''This section relates to daemons. For more, please see [[:Category:Daemons and system services (English)]].''<br />
<br />
===HAL===<br />
After having installed a desktop environment or window manager, installing [[HAL]] seems like a natural follow-up since it enables plug-and-play functionality for mobile phones, MP3 players, external HDDs, and other hardware. Often, HAL is used to mount the device and make an icon on a convenient place, like the desktop or in 'My Computer', allowing access to the peripheral soon after it has been plugged in. Altogether, this avoids manual [[fstab]] configuration or making [[udev]] rules for each and every new device.<br />
<br />
[[KDE]], [[GNOME]] and [[Xfce]] all use [[HAL]].<br />
<br />
===Local mail delivery===<br />
A default base setup bestows no means for mail syncing. To configure postfix for simple local mailbox delivery, see [[Local Mail Delivery with Postfix]]. Other options are [[SSMTP]], [[MSMTP]] and [[fdm]].</div>
Flydragon
https://wiki.archlinux.org/index.php?title=Template;i18n&diff=91815
Template;i18n
2010-01-12T06:09:22Z
<p>Flydragon: </p>
<hr />
<div><noinclude>{{Template}} {{DISPLAYTITLE:Template:i18n}}<br />
<br />
'''See [[Help:i18n]].'''</noinclude><includeonly><div class="toc" style="text-align: center; margin-bottom: 1em"><br />
'''[[Help:i18n|i18n]]'''<br />
----<br />
<span style="white-space: nowrap">: [[{{{1}}}|English]] :</span>{{Lang|{{{1}}}|简体中文}}{{Lang|{{{1}}}|正體中文}}{{Lang|{{{1}}}|Dansk}}{{Lang|{{{1}}}|Deutsch}}{{Lang|{{{1}}}|Español}}{{Lang|{{{1}}}|Français}}{{Lang|{{{1}}}|Indonesia}}{{Lang|{{{1}}}|Italiano}}{{Lang|{{{1}}}|Lietuviškai}}{{Lang|{{{1}}}|Magyar}}{{Lang|{{{1}}}|Nederlands}}{{Lang|{{{1}}}|Polski}}{{Lang|{{{1}}}|Português}}{{Lang|{{{1}}}|Română}}{{Lang|{{{1}}}|Slovenský}}{{Lang|{{{1}}}|Suomi}}{{Lang|{{{1}}}|Svenska}}{{Lang|{{{1}}}|Türkçe}}{{Lang|{{{1}}}|Česky}}{{Lang|{{{1}}}|Ελληνικά}}{{Lang|{{{1}}}|Русский}}{{Lang|{{{1}}}|Српски}}{{Lang|{{{1}}}|Українська}}{{Lang|{{{1}}}|עברית}}{{Lang|{{{1}}}|ไทย}}{{Lang|{{{1}}}|日本語}}{{Lang|{{{1}}}|한국어}}<br />
</div></includeonly></div>
Flydragon
https://wiki.archlinux.org/index.php?title=ArchLinux_%E6%96%B0%E6%89%8B%E6%8C%87%E5%8D%97_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=90864
ArchLinux 新手指南 (简体中文)
2010-01-04T11:23:55Z
<p>Flydragon: /* Fluxbox */</p>
<hr />
<div>[[Category:简体中文]]<br />
[[Category:获取并安装Arch (简体中文)]]<br />
[[Category:关于Arch_(简体中文)]]<br />
[[Category:HOWTOs (简体中文)]]<br />
<br />
{{Article summary start}}<br />
{{Article summary text|本文针对新手,提供了极其详尽的Archlinux的安装过程向导,和相关的简要说明。}}<br />
{{Article summary heading|已有的语言版本}}<br />
{{Article summary heading|Available Languages}}<br />
{{i18n_entry|Česky|Průvodce začátečníka (Česky)}}<br />
{{i18n_entry|简体中文|Arch 新手安装指南 (简体中文)}}<br />
{{i18n_entry|正體中文|Beginner's Guide 新手指南}}<br />
{{i18n_entry|Dansk|Dansk_Begynderguide}}<br />
{{i18n_entry|Deutsch|Beginners Guide (Deutsch)}}<br />
{{i18n_entry|English|Beginners Guide}}<br />
{{i18n_entry|Español|Guía para Principiantes (Español)}}<br />
{{i18n_entry|Français|Manuel_du_Débutant_(Français)}}<br />
{{i18n_entry|Italiano|Beginners Guide (Italiano)}}<br />
{{i18n_entry|Indonesia|Beginners_Guide_(Indonesia)}}<br />
{{i18n_entry|Lietuviškai|Pradedančiųjų gidas (Lietuviškai)}}<br />
{{i18n_entry|Nederlands|Beginners_Guide_(Nederlands)}}<br />
{{i18n_entry|Português Brasil|Guia do Iniciante(Português do Brasil)}}<br />
{{i18n_entry|Português|Guia para Principiantes(Português)}}<br />
{{i18n_entry|Русский|Руководство_для_новичков}}<br />
{{i18n_entry|Türkçe|Başlangıç Rehberi (Türkçe)}}<br />
{{i18n_entry|हिन्दी|नौसिखिया गाइड(हिन्दी)}}<br />
{{Article summary heading|相关文章}}<br />
{{Article summary wiki|Arch 官方安装指南 (简体中文)}}(更通用的安装方式)<br />
{{Article summary wiki|ArchLinux新手指南附录 (简体中文)}}<br />
{{Article summary wiki|ArchLinux安装完后的小技巧 (简体中文)}}<br />
{{Article summary wiki|ArchLinux常用的应用程序(简体中文)}}<br />
{{Article summary wiki|Work and Play with Arch (Chinese)}}<br />
{{Article summary end}}<br />
<br />
==前言==<br />
<br />
=====所有你一直想知道的关于安装Arch的事=====<br />
这篇文档将会指导你安装和配置[[ArchLinux (简体中文)|Arch Linux]] ── 一个简洁、轻量级的GNU/Linux发行版,一个类<code>UNIX</code>的操作系统。本文是面向Arch新用户,因此尽力为所有人提供强大的参考资料和信息。本指南讲述该如何获得一个基本配置好的Arch Linux系统(拥有一个图形桌面环境),但显然是不可能涵盖(甚至是预见)所有的信息。因此本指南会专注于某些关键性的步骤,想要进一步深入了解你可以查看[[Main Page (简体中文)|Arch Linux Wiki]]或者[http://bbs.archlinux.org/ Arch Linux论坛]。同时有兴趣的话你还可以了解一下[[Arch 之道 (简体中文)|Arch 之道]],它概述了Arch Linux发行版背后的哲学思想。<br />
<br />
'''Arch Linux的相关特性:'''<br />
* '''[[The Arch Way | Simple]]''' design and philosophy<br />
* Community distro targeted at competent GNU/Linux users<br />
* All packages compiled for '''i686/x86-64'''<br />
* 从底层开始就可以让用户高度定制<br />
* '''[[The Arch boot process | BSD-style init]]''' scripts, featuring one centralized configuration file<br />
* '''滚动升级''' <br />
* '''[[Pacman]]''' package manager is fast, written in '''C''', lightweight and agile, with a very modest memory footprint<br />
* '''[[ABS]]''': The '''A'''rch '''B'''uild '''S'''ystem, a ports-like package building system makes it simple to create your own easily installable Arch packages from source, to use and/or share with the community on the [[AUR]]<br />
* '''[[AUR]]''': The Arch User Repository, offering many thousands of build scripts for Arch user-provided software packages<br />
<br />
=====别怕(DON'T PANIC)!=====<br />
要知道Arch Linux的安装方法和过程也许会和你所使用过的其它GNU/Linux发行版非常不同,特别你是个新手的话将更能体会到这点。通常,GNU/Linux发行版会在一张或者一堆CD(甚至是DVD)上捆绑了大量的软件,包含了缺省桌面环境、缺省的应用程序和设置、硬件自动检测和图形化的安装程序,一切都是替你选择好了的。相反的,Arch Linux系统是让'''用户自己'''只是用一个bash shell和基本系统工具,从ncurses installer和基础系统上建造起来的。这就是[[Arch 之道 (简体中文)|Arch 之道]]。不象其它大型发行版,它没有强加于用户的缺省环境或者配置。你可以在命令行使用[[pacman (简体中文)|pacman]]通过互联网连接从Arch软件仓库安装软件包,直到你的系统配置成你希望的样子。这给予了用户最大的弹性、选择性和对系统资源的控制。因为是'''你'''建造了它,所以你肯定能了解系统里具体细节,知道底层都有些什么。<br />
<br />
Arch Linux系统是通过编辑文本文件进行配置的,没有提供图形界面的工具,所以需要对系统和linux相对熟悉。<br />
Arch Linux针对的是有能力的GNU/Linux用户以及希望花费时间学习系统知识的用户。 <br />
<br />
''Arch是一个可以被用户塑造的工具。''<br />
<br />
=====授权协议=====<br />
<br />
Arch Linux, pacman, documentation, and scripts are copyright<br />
©2002-2007 by Judd Vinet, ©2007-2008 by Aaron Griffin and are licensed under the GNU General Public License Version 2.<br />
<br />
=====[[Arch 之道 (简体中文)|Arch 之道]]=====<br />
<br />
''Arch的设计思想是"保持简洁"(keeping it simple)。'' <br />
<br />
这里的‘简洁’并不是单指‘简单’或者‘用户友好’,而是‘没有不必要的增加、修改或者复杂性’。简而言之,即优雅、极简之法。<br />
<br />
<br />
''"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 crap." -Aaron Griffin''<br />
<br />
<br />
''"The extraordinary part of [my method] lies in its simplicity..I have always believed that the simple way is the right way."'' - Bruce Lee<br />
“(我的方法中)最超凡的部分是它的简单性,我一直相信简单的就是对的。” 李小龙(Bruce Lee)<br />
<br />
Occam's razor: ''Entia non sunt multiplicanda praeter necessitatem'' or "Entities should not be multiplied unnecessarily." The term razor refers to the act of shaving away unnecessary assumptions and complications to get to the simplest explanation, method or theory.<br />
<br />
{{Box Note |'''仔细遵循本指南是成功安装一个配置正常的Arch Linux系统的基本要点,因此''请''认真仔细的阅读本文'''}}<br />
* 你也可以将本指南打印出来,作为一个较为有用的Arch Linux用户手册。<br />
*''如果你想在这个wiki里增加内容,请适当描述清楚“为什么会这样”以及“该怎么办”。最佳的文档应该能教会我们如何做和为什么这么做!''<br />
* Arch的wiki是项优秀的资源,可以[http://wiki.archlinux.org/index.php/Main_Page 第一时间]用来解决日常问题; 如果找不到答案也可以求助IRC和[http://bbs.archlinux.org/ 论坛]。<br />
----<br />
----<br />
欢迎使用Arch!现在,让我们开始吧。<br />
<br />
本文按照安装过程分四大部分:<br />
<br />
'''[[#第一部分:安装基本系统|第一部分:安装基本系统]]'''<br />
<br />
'''[[#第二部分:完成基本系统并升级|第二部分:完成基本系统并升级]]'''<br />
<br />
'''[[#第三部分:安装X并配置ALSA|第三部分:安装X并配置ALSA]]'''<br />
<br />
'''[[#第四部分:安装并配置桌面环境|第四部分:安装并配置桌面环境]]'''<br />
<br />
==第一部分:安装基本系统==<br />
===一、获取最新的系统安装包===<br />
<br />
你可以从[http://archlinux.org/download/ 这里]获取Arch最新的官方系统安装包。最新版本是2009.08<br />
<br />
*不论是Core还是Netinstall系统安装包,都只是包含了安装'''Arch Linux基本系统'''所需的软件包. ''注意,基本系统是不包含GUI图形界面的。它主要包含了GNU的系列工具(编译器、汇编程序、链接、库、脚本,还有其它的一些有用的工具),Linux的内核,还有一些额外的库和模块。<br />
*Core映像文件可以较方便的通过CD或者网络进行安装。<br />
*Netinstall映像文件较小巧,本身没有提供软件包,整个系统都是通过internet来获取的。<br />
*isolinux映像文件是给那些使用grub版本时发生问题的用户的。两者没有其它区别。<br />
*Arch64问答( http://wiki.archlinux.org/index.php/Arch64_问答_(简体中文) )可以帮助你在32位版本和64位版本之间作出选择。<br />
<br />
====CD 系统安装包====<br />
把下载的.iso映像文件刻录到CD上。开机时用CD启动,出现界面,跳到[[#二、启动Arch Linux系统安装程序| 二、启动Arch Linux系统安装程序]]<br />
{{Box Note| 通常为了刻录的稳定可靠(速率越低刻录质量越有保证),推荐刻录的最大速度不超过16倍速。有些用户推荐'''''速度为 4x 或者 2x.''''' 如果所刻录的CD有问题,可以尝试使用你系统所支持的最小速度方式刻录。 }}<br />
<br />
<br />
====USB安装方式====<br />
{{Warning|这样做会把USB盘里面原有的数据格式化。}}<br />
<br />
'''<code>UNIX</code> 方式:'''<br />
<br />
插入USB盘,找到其路径,用<code>/bin/dd</code>命令把.img映像文件写入USB(Linux下):<br />
<br />
dd if=archlinux-2009.08-''{core|netinstall}''-''{i686|x86_64}''.img of=/dev/sd''x''<br />
<br />
if= 后面是.img镜像文件的路径,of= 是你的USB路径. 要使用/dev/sd''x''而不是/dev/sd''x1''.(就是要使用整个分区而不是第一分区)<br />
<br />
'''检查镜像的完整性md5sum (可选):'''<br />
<br />
记下读入和写出的记录区数目,然后执行以下命令进行检查:<br />
dd if=/dev/sd''x'' count=''记录区数目'' status=noxfer | md5sum<br />
<br />
md5sum命令返回的值(这是你检查U盘上文件得到的)要与你下载的archlinux镜像文件的md5sum校验值相同;它们都应该和镜像站点的md5sum文件列表里相应的值相同。<br />
<br />
'''Windows方式:'''<br />
<br />
从https://launchpad.net/win32-image-writer/+download 下载Disk Imager。插入U盘,启动Disk Imager并选择映像文件,再选择U盘相应的磁盘驱动号,点击"write"即可。<br />
<br />
===二、启动Arch Linux系统安装程序===<br />
Usually, the first item is the preferred selection. However, choose Boot Archlive or Boot Archlive [legacy IDE] if you have trouble with libata/PATA, or have no SATA (Serial ATA) drives.<br />
<br />
Also, to change boot options, press '''e''' for editing the boot lines. Many users may wish to change the resolution of the framebuffer, for more readable console output. Append:<br />
插入刻录好的光盘CD或者USB盘,然后用它启动电脑。可能需要在BIOS里(通常是启动后在加电自检过程中按DEL、F1、F2、F11或者F12)改变一下启动顺序使得CD或者USB先被启动。<br />
<br />
{{Note|内存需求:<br />
* Core : 160 MB RAM x86_64/i686 (选择所有软件包,开启交换分区)<br />
* Netinstall : 160 MB RAM x86_64/i686 (选择所有软件包,开启交换分区)}}<br />
<br />
启动了Arch Linux光盘后,用上下箭头高亮菜单,按下回车键进行选择。<br />
<br />
通常,推荐选择第一项菜单。不过如果使用libata/PATA出现问题或者没有SATA (Serial ATA)驱动器,你也可以选择Boot Archlive或者Boot Archlive [legacy IDE] 。<br />
<br />
如果你需要改变启动参数,可以按‘e ’键来编辑启动行内容。 含多用户可能希望改变framebuffer分辨率以得到更好的终端显示。将<br />
vga=773<br />
加到kernel一行的后面,然后按<ENTER>,就可以得到1024x768的framebuffer。设置完毕后按'''b'''则使用相应的选择项进行启动。<br />
<br />
系统将会启动并提示登录,这时可以用'root'进行登录(不要加上单引号)。<br />
<br />
如果你的机器从live CD启动时发生错误或者一些其它'''硬件hardware'''错误,请参看[[Installation Troubleshooting]]。<br />
<br />
<br />
====登录并根据需要更换键盘映射表====<br />
如果你使用non-US键盘布局,可以用命令选择相应的键盘映射表。<br />
# km<br />
或者是是用loadkeys命令<br />
# loadkeys ''layout''<br />
(把''layout''替换成你需要的,比如 &quot;<code>fr</code>&quot; 或者 &quot;<code>be-latin1</code>&quot;)<br />
<br />
====边安装边查看安装指南====<br />
在刻录的livecd里面,已经包含了官方安装指南,在安装的时候可以边安装边查看,按组合键<ALT>+F2 切换到控制台vc/2(alt+f3,alt+f4……分别可以切换到对应的控制台vc/3,vc/4……以此类推),然后输入:<br />
<br />
# less /arch/docs/official_installation_guide_en<br />
<br />
按组合键<ALT>+F1回到控制台vc/1,继续安装系统。安装过程中可以随时切换回vc/2来查看安装指南。<br />
<code>less</code> 是个文本查看程序,位于<code>/usr/bin/less</code><br />
{{tip|请注意,官方指南仅涵盖基本系统的安装和配置过程。一旦安装完毕,强烈建议回到本wiki浏览更多安装后续已经相关问题。}}<br />
<br />
===三、开始安装===<br />
键入<br />
/arch/setup <br />
开始安装。<br />
<br />
====1、选择安装来源====<br />
接着会出现一个选择安装来源的提示。如果你用core ISO的话请选择CD,如果使用FTP ISO的话则选择FTP。<br />
* 如果选择 CORE installer,可以直接看下面的硬盘分区配置。<br />
* FTP/HTTP only: 选择这个需要预先加载网络驱动以便联网安装. 使用Udev来加载这些模块非常有效.<br />
按组合键ALT+F3切换到控制台vc/3,确认一下看其是否生效 invoking ifconfig -a . (Select OK to continue.) ——把后面的网络配置提前看<br />
<br />
====2、设置时间====<br />
有两个选择:<br />
* UTC - 如果使用unix系统包括Linux, Freebsd等, 建议使用UTC<br />
* local - 如果和Windows共享多引导系统, 建议使用local<br />
<br />
====3、硬盘分区配置====<br />
选择第一个菜单项"Prepare Hard Drive"。请注意,"Auto-Prepare"(自动分区)并不是最佳的选择,因为它只分配了最基本的三个区( /,/home,swap)<br />
在这里我们用手工进行硬盘分区。选择"2. Partition Hard Drives",接着选要分区的硬盘(比如:/dev/sdx),然后按你需要编辑分区表。<br />
<br />
''Arch Linux安装程序使用cfdisk公用程序来对硬盘进行分区。''<br />
<br />
''接下来,熟悉GNU/Linux的用户可以跳过这段内容直接到下面'''[[#选择软件包|选择软件包]]'''。''<br />
<br />
=====分区信息=====<br />
<br />
对磁盘进行分区是指在磁盘上定义若干区域(分区),每个都象是一个独立的磁盘,可以在其上创建(格式化)一个文件系统。 分区的类型分为主分区(Primary)、扩展分区(Extended)和逻辑分区(Logical)三类。 <br />
<br />
主分区可以被启动,一个物理磁盘最多能有4个主分区。要使用超过4个的话,只能使用一个包含了逻辑分区的扩展分区。<br />
(译者注:为避免误解,较易懂的解释应该是:一个磁盘不算逻辑分区最多只能有4个分区,这4个要么全是主分区,要么就是3个主分区+1个扩展分区,当然你将整个磁盘划为1个主分区也是没问题的,只要不超过4个分区即可)<br />
<br />
扩展分区通常不会被直接使用,它是作为逻辑分区的“容器”存在。一个硬盘只能有一个扩展分区,可以在里面继续再划分逻辑分区。<br />
<br />
当对一个磁盘进行分区时,是按这种数字顺序命名:主分区为sda1-3,跟着是扩展分区sda4(译者注:在/dev和fdisk -l里是看不到这个sda4的),在扩展分区中划分出来的逻辑分区分别是sda5、sda6,如此类推。<br />
<br />
=====交换分区swap=====<br />
交换分区Swap是虚拟内存在硬盘上驻留的地方,内核可以用它来储存在物理内存中放不下的数据。<br />
<br />
过去,常用的规则是将交换分区大小设置为物理内存的两倍。但是随着时间推移,现在的计算机已经有更大的内存容量,这条规则已经不适用了。通常,512MB内存的计算机,两倍(1G)的还是够用的。而1G内存的计算机,一倍的也够用了。如果你有更大的内存(比如超过1GB),也许可以完全把交换分区忘了,不推荐这样做!<br />
* ''如果你打算使用休眠到磁盘的电源方案,你必须要有不小于内存容量大小的交换分区,有些用户甚至会推荐大于物理内存容量15%的大小。''<br />
<br />
=====规划分区=====<br />
磁盘分区的规划是十分个人的设置。每位用户的决策都会根据自己计算机的情况和需求而不同。至少需要有一个包含了根[http://en.wikipedia.org/wiki/File_system 文件系统] ( / )的主分区和一个交换分区。你还可以选择给/boot(主要用来存放内核文件)、/usr、/var和/home(用来存放用户个人数据)划出独立分区。一个较好的做法是给 / 和 /home都划分独立分区。这样的话,当你因为某些原因重装Arch Linux(或者其它发行版),你还可以保留你的个人数据例如音乐、图片、桌面环境配置等。<br />
<br />
在本案例中,我们划分一个分区给 /,一个给/home,另外还有一个交换分区。<br />
<br />
=====开始创建分区cfdisk=====<br />
让我们开始创建一个包含'''root'''(/)文件系统的主分区。 <br />
<br />
选择'''N'''ew -> Primary,然后输入你希望的分区大小(对一个完整的Linux系统,4到8G是个不错的选择)。分区要位于磁盘的开头部分。选择刚新建的分区,接着选择'''B'''ootable将它置为可启动。<br />
<br />
同时选择分区文件系统类型'''T'''ype,指定为'83 Linux'.。<br />
<br />
给你的/home目录创建另一个分区。选择另外一个主分区设成你想要的容量大小,这取决于你的用户会在他们的home目录里储存多少文件,其大小可能从几百M办公文档到上百G音频视频,所以这里我无法给出一个建议。如果你要使用磁盘所有的剩余空间,记得保给交换分区留一部分(例如1GB或1024MB)。<br />
<br />
同样的,选择'''T'''ype为'83 Linux'。 <br />
<br />
最后,我们给交换分区创建一个分区。选择一个介于512MB到1GB之间的大小并将'''T'''ype改为82 (Linux swap / Solaris)。<br />
<br />
现在的分区规划看起来应该象这样(基于你的选择大小也许会有所不同):<br />
<br />
Name Flags Part Type FS Type [Label] Size (MB)<br />
-------------------------------------------------------------------------<br />
sda1 Boot Primary Linux (4096 - 8192)<br />
sda2 Primary Linux (> 100)<br />
sda3 Primary Linux swap / Solaris (512 - 1024)<br />
<br />
选择'''W'''rite并输入''''yes''''。要注意如果你删除了分区的话,这个操作会破坏你磁盘上的数据。选择'''Q'''uit退出分区程序。<br />
选择Done离开此菜单,接着选择"Set Filesystem Mountpoints"。<br />
<br />
=====IDE设备,为什么看起来它们和SCSI设备一样?=====<br />
最新开发的Linux内核里包含了libata和PATA模块,所有的IDE、SATA和SCSI都采用sd''x''这种命名方式。这十分正常,无需担心。<br />
<br />
=====设置文件系统挂载点=====<br />
<br />
''' ”文件系统格式(filesystems)“和”文件系统结构(file systems)“的区别:'''<br />
<br />
从技术层面确切的说,'''文件系统格式(filesystems)'''是一种数据'''格式''',涉及信息吞吐,比如ext2;而”文件系统结构(file systems)“则是特定操作系统中文件和目录的布局,比如/home/username/games。因此,当你被问及是否创建'''文件系统格式(filesystems)'''时,是在问你是否要'''格式化'''该分区…但是当程序向你问及挂载点时,你应该给出的则是该分区应该出现在你的Arch Linux ”文件系统结构“中的位置。<br />
<br />
'''文件系统类型:'''<br />
<br />
'''强烈建议:'''创建一个交换分区(SWAP)。选择一个合适的分区(本例中使用的是sda3). 安装程序就会询问你是否要创建swap 文件系统; 选择 yes. 接下来, 选择根分区的挂载点(本例中就是 sda1). 然后安装程序就会询问你需要哪一种文件系统。<br />
<br />
{{Box Note| 采用何种文件系统的类型取决于实际应用需要,没有十全十美的文件系统,选择任何一个文件系统,都需要在数据安全和性能要求方面作出适当倾斜,下面只是简单的介绍各种Arch linux支持的文件系统 }}<br />
<br />
1. '''ext2''' - 古老、 可靠的 GNU/Linux 文件系统。非常的稳定,不过 ''不支持日志记录功能''。磁盘检测速度较慢,因而有些不便. ''ext2可以容易地转换成ext3''。一般认为/boot分区采用此系统最合适,因为/boot里的东西就开机的时候读取一次,而且很少有变动,不需要日志文件系统,如果采用日志文件系统,日志的体积很可能远远大于内核的大小。<br />
<br />
2. '''ext3''' - 基于ext2系统, 并添加了日志记录功能。 一般认为他比其他文件系统要 ''稍微的'' 慢一点, 不过 ''非常的'' 稳定并且使用最为广泛,由 GNU/Linux FS 负责维护和开发。<br />
<br />
'''高性能文件系统:'''<br />
<br />
3. '''ext4''' - 最近加入支持的文件系统,是ext2和ext3的后续发展版本,Ext4增加了48位块地址,最大支持1EB文件系统,和单个16TB的文件,增加子目录限制到64,000。新增了很多功能,提供在线碎片处理,速度比ext3快,系统开销比ext3小。<br />
{{Box Note| 由于此系统较新,目前仍存在一些问题,暂时建议/home分区不采用此文件系统,以保证个人数据安全。}}<br />
<br />
4. '''ReiserFS''' - Hans Reiser 主持编写的高性能的日志文件系统,使用一种非常独特有趣的数据存储检索方法。ReiserFS 效率非常高, 特别在处理很多小文件的时候更是如此。ReiserFS在挂载的时候相对比较慢. 性能稳定。 ReiserFS 现在的开发并不活跃(最新的版本是Reiser4).<br />
<br />
5. '''JFS''' - IBM提供的日志文件系统( '''J'''ournaled '''F'''ile'''S'''ystem首字母缩写). JFS 效率非常高并且CPU资源占用率比其他任何一个文件系统都要低。并且在挂载和磁盘检测的时候都非常快,在各方面的表现都非常突出,尤其是 conjunction with the deadline scheduler. (参见 [[JFS]].) 但是并不像ext或者ReiserFS那样应用广泛。<br />
<br />
6. '''XFS''' - 非常高效的日志文件系统,特别适合处理大文件。在处理小文件的时候稍慢。在挂载的时候也很快。由于 /var 需要处理很多的小文件,所以可能不太适合作为/var 分区的文件系统。 GNU/Linux 文件系统中,最先实现可用的在线碎片处理。应用不及ext和ReiserFS那么广泛。<br />
* JFS 和 XFS 不能被磁盘工具压缩(比如gparted 或者 parted magic)<br />
<br />
'''未来文件系统'''<br />
<br />
7、btrfs - 此文件系统尚未被Arch纳入正式支持。是Oracle提供的copy-on-write档案系统。目标在取代的ext3,提高ext3单一档案的大小,总档案系统大小或档案检查,加入目前ext3未支援的功能,比如:writable snapshots,snapshots of snapshots,内建磁盘阵列(RAID)支援,and subvolumes。<br />
<br />
最主要的差别在于[http://en.wikipedia.org/wiki/Journaling_file_system 日志系统] (一种类似的在数据库环境中记录着日志变更的东西). 除ext2之外,其他文件系统都支持日志记录功能. ext3 完全兼容 ext2,因此哪怕你可以用一个非常古老的CD来挂载他,也没问题。 根分区目前最安全的选择就是使用ext3文件系统。ReiserFS,XFS,和JFS也可以使用,因为GRUB (启动引导管理器,稍候在安装部分将会介绍到) 都可以从这些文件系统中启动。你可以通过选择‘’‘yes’‘’来创建文件系统(并格式化分区),接着你就会被提示添加附加分区。 在我们的例子中, 只有sda2了。 选择一个文件系统类型,并且把这个分区挂在到/home. 再次说明,创建文件系统并且选择Done。然后回到主菜单。<br />
<br />
====4、选择软件包====<br />
现在我们要选择安装哪些软件包到系统中。选择CD作为来源,如果你不止一个光驱的话还需要选择使用哪个的光驱。<br />
<br />
软件包选择分为两个阶段。首先要选择软件包分类,然后出现所选分类中软件包的详细列表供你微调。使用空格键进行选择和取消。<br />
<br />
''*BASE:包含最小的软件包集合,仅够构建一个可运行的系统骨架。''<br />
''*SUPPORT:供网络和文件系统用的额外软件包,例如gpm、fuse、dnsutils、无线驱动、ndiswrapper、ntfs-3g诸如此类。''<br />
''*DEVEL:软件创建工具,如GCC、autoconf、automake和make等等。''<br />
''*LIB:大量的库文件,如gmp、lebelf、libevent等等。''<br />
*''' 2008.06 版'''的软件包选择,只有一个: BASE ,选择之后进入其详细列表. <br />
<br />
在这里,我们对'Select all packages by default'选择'yes'。<br />
<br />
接下来屏幕将显示你所选的软件包。对于新手,较安全的做法是不修改它,而有经验的用户可能希望裁减掉一些不需要的软件包。(例如,不需要的文件系统类型公用程序,不需要的驱动等等。)<br />
<br />
====5、安装软件包====<br />
接着,选择'Install Packages'。你会被询问是否希望保留pacman缓冲里的软件包。如果你选'yes',日后你还可以选择对某些软件包进行降级,因此推荐保留(日后你还是可以清除这些缓存的)。安装脚本跟着就会安装所选软件包到你的系统中。这些软件包是二进制的、针对i686优化的,总共仅100MB,因此安装是相当便捷的。<br />
<br />
====6、配置系统====<br />
系统接着会询问你是否要选择[[Hwdetect|hwdetect]]来收集配置所需信息。新手应该选择是('yes')。<br />
<br />
如果是相当熟悉自己的硬件、所需模块,有能力从零开始手动配置/etc/mkinitcpio和/etc/fstab 的高级用户,可以选择否'no'。(当然,此选项是非常复杂的,已经超过本指南的范围,这里就不详细解释了。)<br />
<br />
接下来,系统会询问你是否需要支持从USB设备、FireWire设备、PCMCIA设备、NFS共享、软RAID阵列、LVM2卷和加密卷上启动。如果需要则选'yes',在本案例中以上都不选。<br />
<br />
新手还应该选择让/etc/mkinitcpio/kernel26-fallback.conf使用[[Hwdetect|hwdetect]]的结果,这将确保你的硬盘控制器相容次序。<br />
<br />
现在系统会询问你使用哪个文本编辑器;如果你不熟悉[http://en.wikipedia.org/wiki/Vim_%28text_editor%29 vi/vim]的话可以选择[http://en.wikipedia.org/wiki/Nano_%28text_editor%29 nano]。然后就会出现一个包含系统中大部分重要配置文件的菜单。如果你打算查找/etc/rc.conf中可用的选项,只需按Alt+F2切换到另外一个虚拟控制台进行查找,然后用Alt+F1切换回安装程序。<br />
<br />
======系统配置主文件'''/etc/rc.conf'''======<br />
Arch Linux继承FreeBSD的传统,使用'''/etc/rc.conf'''作为系统配置的主要文件。这个文件包含了广泛的配置信息,主要用于系统的启动。正如名字中所包含的意思,它还包含了供/etc/rc*文件使用的配置。/etc/rc.conf提供了一个Arch用户可以轻易访问到的,简洁而又范围广泛的精简系统资源配置方案。<br />
* '''LOCALIZATION'''部分<br />
** '''LOCALE'''=: 系统场所(locale)设置,被所有国际化(i18n-aware)的应用程序使用 。从命令行上运行locale可以列出可用的locale设置。此设置缺省是适合英文(US English)用户使用的en_US.utf8。(此处locale的设置必须与/etc/locale.gen一致,'''[[#/etc/locale.gen|详见下文]]'''。)中文一般是zh_CN.UTF-8,如果使用之后乱码,先换回en_US.utf8,等进图形界面后再换回来。<br />
** '''HARDWARECLOCK'''=: 指示开关机时进行同步的硬件时钟,是'''UTC'''时间(协调世界时(Universal Time Coordinated), 过去曾用格林威治平均时(GMT)来表示)还是'''localtime'''(本地时间)。通常UTC较为好,因为它大大简化了时区和日光节约时间(中国过去称为夏时制)的变更。而当你同时还有其它操作系统如windows进行双启动,就必须使用localtime(本地时间),它只把本地时间保存到硬件时钟里。<br />
** '''TIMEZONE'''=: 时区(TIMEZONE)。(所有可用的时区可在/usr/share/zoneinfo/里找到。)<br />
** '''KEYMAP'''=: 可用的键盘映射表可在/usr/share/kbd/keymaps里找到。请注意此设定仅在TTY中有效,在所有图形窗口管理器或者X中都不使用此设置!<br />
** '''CONSOLEFONT'''=: 如果你一定要修改此设置,可在/usr/share/kbd/consolefonts/中找到可用的字体。<br />
** '''CONSOLEMAP'''=: 定义了启动时setfont程序加载的控制台映射表。有需要的话,可在/usr/share/kbd/consoletrans里找到可用的映射表。<br />
** '''USECOLOR'''=: 如果你使用彩色显示器的话请选"yes"。<br />
<br />
LOCALE="zh_CN.UTF-8"<br />
HARDWARECLOCK="localtime"<br />
TIMEZONE="Asia/Shanghai"<br />
KEYMAP="us"<br />
CONSOLEFONT=<br />
CONSOLEMAP=<br />
USECOLOR="yes"<br />
* '''HARDWARE'''部分<br />
** '''MOD_AUTOLOAD'''=: 如果你使用'''udev'''在启动时探测硬件并加载相应模块。请设置为"yes",(适合缺省模块化的内核)。设置为"no"就得靠用户自己指定所需的有关信息。<br />
** '''MOD_BLACKLIST'''=: 模块黑名单。在下面的例子中,IPv6模块和pcspeaker都被列入黑名单而不被加载。<br />
** '''MODULES'''=: 指示了其它模块,如果你知道缺少哪个重要的模块可以加在里面。('''hwdetect'''应该已经填写了最重要的模块):<br />
# Scan hardware and load required modules at bootup<br />
MOD_AUTOLOAD="yes"<br />
# Module Blacklist - modules in this list will never be loaded by '''udev'''<br />
MOD_BLACKLIST=(net-pf-10 pcspkr)<br />
#<br />
MODULES=(e100 eepro100 mii slhc snd-ac97-codec snd-intel8x0 soundcore)<br />
* '''NETWORKING'''部分<br />
** '''HOSTNAME'''=:设置为你喜欢的主机名(HOSTNAME)。<br />
** '''lo'''=: 不修改此行。<br />
** '''eth0'''=: 如果使用'''静态IP'''的话请调整网络接口的IP地址、掩码和广播地址。如果使用'''DHCP'''的话则设为eth0="dhcp"。<br />
** '''INTERFACES'''=: 指定使用哪些网络接口。如果你不使用DHCP来配置设备,而是通过命令行用ifconfig手动配置设备的话,这里的变量值(名字必须等于打算进行配置的设备名一样)必须和ifconfig里加入的内容一样。<br />
** '''gateway'''=: 如果你使用'''静态IP''',将网关(gateway)地址设为路由器的IP。如果使用DHCP,则将此行用'#'注释掉。<br />
** '''ROUTES'''=: 如果你使用'''静态IP''',则将'gateway'前面的'!'去掉。如果使用'''DHCP'''的话则不需要修改此行。<br />
<br />
<br />
例如,当使用'''DHCP''':<br />
HOSTNAME="arch"<br />
lo="lo 127.0.0.1"<br />
#eth0="eth0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255" <br />
eth0="dhcp"<br />
INTERFACES=(lo eth0)<br />
#gateway="default gw 192.168.0.1"<br />
ROUTES=(!gateway)<br />
* '''DAEMONS'''部分<br />
这个序列罗列了位于/etc/rc.d/里需要在启动过程中启动的脚本名字。<br />
<br />
*如果脚本名字前有惊叹号(!),表示它不被执行。<br />
*如果脚本名字前有符号(@),则表示它会在后台被执行,启动序列不会等待此脚本成功执行完毕,而是继续执行下一个守护进程脚本。<br />
<br />
这种'BSD风格'的初始化就是Arch的处理办法,而其它发行版则是在一个init.d目录里使用一大堆符号链接(一个简单的文件 vs 一整个目录)。<br />
<br />
======关于守护进程======<br />
虽然此时你不需修改[[daemons]]行,不过还是有必要解释一下什么是守护进程,因为过一会儿在指南里我们会需要它。<br />
<br />
和Windows服务(service)类似,守护进程(daemon)是一个运行于后台的程序,等待事件发生并提供服务。一个较好的例子是webserver等待请求以发送页面,还有SSH服务等待用户登录。这些都是全功能的程序,还有些守护进程工作起来并不是那么明显的。例如向日志文件里写信息的守护进程(如syslog、metalog),当系统空闲时降低CPU频率的守护进程(如cpufreq),以及提供图形化登录的守护进程(如gdm、kdm)。所有这些程序都可以被加入到daemons行中,在系统启动时被执行。本指南会对一些较有用的守护进程进行介绍。<br />
按Ctrl+X退出nano编辑器。<br />
<br />
======磁盘和分区配置文件:/etc/fstab======<br />
'''fstab''' ('''f'''ile '''s'''ystems '''tab'''le的缩写) 是系统配置的一部分,该文件列出所有可用的磁盘和分区,并指明它们初始化的方式或整合至全局文件系统的方式。'''/etc/fstab'''文件一般被'''mount'''命令读取,以决定某一特定设备被挂载时所采用的选项。<br />
<br />
这是一个'''/etc/fstab'''的例子:<br />
<br />
#<br />
# /etc/fstab: static file system information<br />
#<br />
# <file system> <dir> <type> <options> <dump> <pass><br />
none /dev/pts devpts defaults 0 0<br />
none /dev/shm tmpfs defaults 0 0<br />
#/dev/cdrom /mnt/cdrom iso9660 ro,user,noauto,unhide 0 0<br />
#/dev/dvd /mnt/dvd udf ro,user,noauto,unhide 0 0<br />
#/dev/fd0 /mnt/fd0 vfat user,noauto 0 0<br />
/dev/sda1 / jfs defaults,noatime,nodiratime 0 1 <br />
/dev/sda2 /home jfs defaults,noatime,nodiratime 0 2<br />
/dev/sda3 swap swap defaults 0 0<br />
Hwdetect应该已经有效地配置了一个可用的'''fstab''',但最好还是简要地检查一下。<br />
<br />
*如果你打算用'''hal'''来自动挂载DVD之类的媒体,为了给即将安装的'''hal'''做准备,你可能要注释掉cdrom和dvd条目。 <br />
<br />
''在笔记本电脑和桌面系统上,可以给 / 和 /home加上'noatime'和'nodiratime'选项来提高速度、性能,同时还能省电。无论你采用何种文件系统,这样做都应该是安全的。''<br />
<br />
更多信息请参照[[Fstab]]<br />
<br />
======'''mkinitcpio.conf、modprobe.conf和kernel26-fallback.conf'''======<br />
此时我们无须去修改这些配置文件。'''mkinitcpio.conf'''负责配置ramdisk(例如从RAID、加密卷启动), '''modprobe.conf'''可以用来设置内核模块的的某些配置选项,而'''kernel26-fallback.conf'''则是initramfs后备配置。<br />
<br />
======(对于静态IP)网络配置文件:/etc/resolv.conf ======<br />
*''如果你使用DHCP,完全可以忽略此文件,缺省情况下dhcpd守护进程会自动创建和销毁此文件。''<br />
<br />
如果你使用静态IP,则可在/etc/resolv.conf里设置你的DNS服务器。每行的格式为nameserver <ip地址>,如果有多个DNS服务器则可以填入多行。<br />
<br />
如果你使用路由器,也许会希望由你的路由器本身指定DNS服务器,而在'''resolv.conf'''里只是写入你的路由器的IP(同时也是'''/etc/rc.conf'''里的网关),例如:<br />
nameserver 192.168.1.1<br />
可选的,逐个加入你的DNS服务器,例如:<br />
nameserver 4.2.2.1<br />
nameserver 4.2.2.2<br />
<br />
如果使用'''DHCP''',你也可以在你的路由器里指定你的DNS服务器,或者如果你的ISP支持的话由ISP自动指定。<br />
<br />
======/etc/hosts======<br />
可以在此文件中加入你想要的''hostname'',必须和/etc/rc.conf里的设置一致,因此它应该象这样:<br />
127.0.0.1 localhost.localdomain localhost '''''yourhostname'''''<br />
''为了程序的兼容性,必须严格遵照这个格式,'''包括'localhost' 这项'''!错误的句法可能会导致网络性能低下和/或某些程序运行缓慢甚至无法运行。这对新手来说是十分普遍的错误。''<br />
<br />
对于大部分用户,只要把''yourhostname''加入到行末就就可以了,不过有些用户推荐以下句法:<br />
127.0.0.1 '''''yourhostname'''''.domain.org localhost.localdomain localhost '''''yourhostname'''''<br />
如果你使用静态IP,可以用这种句法加入新行:<static-ip> hostname.domainname.org hostname,例如:<br />
192.168.1.100 '''''yourhostname'''''.domain.org '''''yourhostname'''''<br />
<br />
======/etc/hosts.deny和/etc/hosts.allow======<br />
如果你打算使用[[SSH|ssh]]的话,请根据自己的需要修改此配置。缺省设置是拒绝所有进入的连接,而不只是ssh连接。编辑'''/etc/hosts.allow '''文件加入:<br />
<br />
* 允许所有进入的ssh连接。<br />
sshd:all <br />
<br />
* 允许特定IP地址进入ssh连接。<br />
sshd: 192.168.0.1<br />
<br />
* 允许你指定的网段 (地址从 192.168.0.0 到 192.168.0.255)<br />
sshd: 192.168.0.<br />
<br />
* 允许某个IP地址范围<br />
sshd: 10.0.0.0/255.255.255.0<br />
<br />
如果你不打算使用[[SSH|ssh]],为安全起见请保持此文件的缺省设置(为空)。<br />
<br />
======/etc/locale.gen======<br />
<br />
'''locale-gen''' 命令从 '''/etc/locale.gen'''读取信息设定系统的locales. 这些设置稍后会被'''glibc''' 和其他一些支持本地化的程序或者库用于自动翻译输出各种语言的"独特" 文本, 并且合适的显示地域、货币、时区以及日期格式, 字符排列方式和其他一些本地化的特殊标准。设置默认本地化的功能是类<code>UNIX</code>操作系统的一大特质<br />
<br />
默认情况下 /etc/locale.gen 是一个仅包含注释文档的空文件.编辑后,这个文件将不会get touched again. 每次'''glibc'''更新之后'''locale-gen'''就会运行一次, 以在/etc/locale.gen重新生成所有的本地化设置.<br />
<br />
选定你需要的本地化类型(移除前面的#即可), 比如:<br />
en_US ISO-8859-1<br />
en_US.UTF-8 <br />
('''你这里的设置必须和上文中提到的/etc/rc.conf 的设置一致哦.''')<br />
<br />
现在,安装程序将运行locale-gen 脚本, 以生成你设定的locales。你以后可以通过修改文件/etc/locale.gen变更你的locale, 然后使用根用户(root)运行'locale-gen'脚本使之生效。<br />
<br />
''Note 如果你选择并设置了locale, 他将提示你 "The current locale is invalid..." 错误。可能是因为大多数新Arch用户都会犯的普遍的错误,也是在论坛中问得最多的问题。''<br />
<br />
======Root密码======<br />
最后,设置一个root密码并确定你已牢记它。返回主菜单然后接着安装启动加载器。<br />
<br />
======Pacman镜像======<br />
为'''pacman'''选择一个软件仓库镜像站。记住主站 archlinux.org 是有流量限制的,下载速度限于50KB/s.。<br />
<br />
在列表中仔细查看, 一般 xxx.cn 是中国镜像, xxx.au 是澳大利亚, 等等...<br />
<br />
*''如果你不熟悉现有的镜像和它们所处的位置,那就随便选一个。稍后你可以编辑 "/etc/pacman.d/mirrorlist", 或运行本指南后面提到的'''rankmirrors'''脚本,它将自动配置最接近你的镜像。''<br />
<br />
返回主菜单。<br />
<br />
====7、安装启动加载器====<br />
因为本案例中没有第二个操作系统,因此我们需要安装一个启动加载器。推荐选择[http://www.gnu.org/software/grub/ GNU GRUB]作为启动加载器。另外一种选择是[http://lilo.go.dyndns.org/ LILO]。缺省的'''GRUB'''配置('''/boot/grub/menu.lst''')应该足够了。唯一你可能想修改的是控制台的分辨率。将vga=<number>加入到第一个kernel行。(menu.lst中已列出一张分辨率和数字的对应表格可供查找。)<br />
title Arch Linux (Main)<br />
root (hd0,0)<br />
kernel /boot/vmlinuz26 root=/dev/sda1 ro vga=773<br />
initrd /boot/kernel26.img<br />
参数"vga=773"表示1024x768分辨率、256色的framebuffer。<br />
<br />
将'''GRUB'''启动加载器安装到主引导区(本例中为sda)。<br />
<br />
====8、系统重启====<br />
退出安装程序。<br />
*建议:为了方便接下来更进一步的安装配置,可以把光盘里的新手指南复制一份到电脑里,这样后面的安装就能查看相应的向导了<br />
<br />
cp /arch/beginnersguide.txt /mnt/home/beginnersguide.txt<br />
<br />
系统重启之后,进入控制台,可以使用下面命令查看这新手指南<br />
less /home/beginnersguide.txt<br />
所有安装完毕之后,可以删了这指南<br />
rm /home/beginnersguide.txt<br />
<br />
输入命令下面命令,重启:<br />
<br />
reboot<br />
<br />
一个新Arch Linux系统就会启动并进入登录提示符(你可能需要在'''BIOS'''将启动顺序改为优先从硬盘启动)。<br />
<br />
'''祝贺你,一个崭新的Arch Linux基础系统闪亮登场了!'''<br />
<br />
==第二部分:完成基本系统并升级==<br />
你的新Arch Linux基础系统现在已是一个功能完整的GNU/Linux环境了,随时可以进行定制。从现在开始,你可以按自己的意图和需求改造它。由于arch是滚动发布的,所以安装包不一定是最新的系统,所以我们在安装完成之后,需要立即更新系统。<br />
<br />
让我们开始吧。<br />
-----<br />
登录入你的root账号。我们将以root身份配置pacman和更新系统,然后创建一个普通用户账号。<br />
<br />
===一、配置网络(如果有需要)===<br />
*''如果安装脚本的自动配置不适合你,本段内容将帮助你配置大部分类型的网络。''<br />
-----<br />
如果一切正常的话,你的网络应该可以正常使用了。先ping www.google.com验证一下:<br />
ping -c 3 www.google.com<br />
<br />
''如果你已经成功建立网络连接,则跳到下面阅读[[#使用pacman更新、同步、升级系统|使用pacman更新、同步、升级系统]]'''。''<br />
<br />
如果ping www.google.com后得到"unknown host"的错误,可以认为你的网络尚未正确配置。你需要重新检查以下内容的完整性和正确性:<br />
'''/etc/rc.conf''' # 特别留意HOSTNAME= 和 NETWORKING 部分有无输入错误。<br />
<br />
'''/etc/hosts''' # 复核一下格式。(看之前的内容。)<br />
<br />
'''/etc/resolv.conf''' # 当你使用静态IP时需要检查。如果你使用DHCP,缺省这个文件会被自动创建和销毁,不过也可以改为你需要的内容。(参见[[Network]]。)<br />
<br />
高级的网络配置方法可以在[[Network]]一文中找到。<br />
<br />
=====有线网络=====<br />
<br />
用以下命令检查网络<br />
ifconfig<br />
你应该看到eth0这一项。如果有需要,你可以这样设置一个新的静态IP:<br />
ifconfig eth0 <ip address> netmask <netmask> up <br />
并且这样设置缺省网关:<br />
route add default gw <ip address of the gateway><br />
查看一下/etc/resolv.conf是否包含你的DNS服务器,不过缺失了则补填进去。<br />
再次用ping www.google.cn检查一下网络。如果一切正常,将/etc/rc.conf调整为刚才新设置的静态IP。如果你的网络使用DHCP服务器/路由器的话,输入:<br />
dhcpcd eth0<br />
如果这样可行的话,则将/etc/rc.conf按之前所述方法调整为动态IP。<br />
<br />
=====无线网络=====<br />
详见安装指南:[[无线设置 (简体中文)|无线设置]]<br />
<br />
=====模拟信号调制解调器=====<br />
<br />
如果你想使用外接电话线调制解调器, 你至少要安装ppp包. 根据需要修改配置文件 /etc/ppp/options 你可以参考 man pppd 的帮助.<br />
<br />
你还需要定制一个 chat 协议脚本, 在初始化握手连接建立以后, 提供你的ISP用户名和密码. 命令pppd 和 chat 的帮助里有例子不管你是菜鸟还是高手都应该能搞定连接了.<br />
使用 udev 的话, 串口设备一般是 /dev/tts/0 和 /dev/tts/1.<br />
<br />
Tip: Read [[Dialup without a dialer HOWTO]].<br />
<br />
如果你不想为了 pppd 拔光自己的头发, 你可能会选择安装 wvdial 或类似的配置工具来简化这个过程.<br />
如果你的猫是所谓的 WinModem, 也就是内置 PCI modem 卡, 你可以在这个网址找到大量信息: [http://www.linmodems.org/ LinModem]<br />
<br />
=====ISDN=====<br />
<br />
通过三步,完成 ISDN 的安装和配置:<br />
# 安装配置固件Install and configure hardware<br />
# 安装配置ISDN 管理工具<br />
# 添加ISP信息<br />
<br />
现在的 Arch stock kernels 已经包含了ISDN 所需要的modules, 所以不需要重新去编译内核,除非 you're about to use rather odd ISDN hardware. 把ISDN卡插入电脑或者插入USB ISDN-Box之后,you can try loading the modules with modprobe. 绝大部分的ISDN PCI 卡都能被module hisax处理,只需要两个参数:类型和协议。 如果使用的是1TR6标准,则协议设定为 '1' ,如果使用的是EuroISDN (EDSS1),协议设定为 '2', '3' if you're hooked to a so-called leased-line without D-channel, 如果使用的是US NI1,则设为'4'.<br />
<br />
所有配置细节都可以在kernel documentation, more specifically in the isdn subdirectory, and available online中获知。 类型的参数是根据电视卡来设定的,在README.HiSax kernel documentation中,有一个可能类型的列表。 用相应的参数加载moduleChoose,比如这个:<br />
<br />
modprobe hisax type=18 protocol=2<br />
<br />
这个将加载适用于电视卡类型为ELSA Quickstep 1000PCI,德国使用的EDSS1协议的模块hisax。可以在日志文件/var/log/everything.log中查看是否模块被预加载。额外的USB ISDN Adapter需要加载些USB模块才能正常工作。<br />
<br />
通过上述设定之后,如果电视卡能正常工作,那么把下面模块和参数加入/etc/modprobe.conf中:<br />
<br />
alias ippp0 hisax<br />
options hisax type=18 protocol=2<br />
<br />
这么做的好处是,这些模块在不使用时不会被加载。另外的方法是可以在这只加参数,把hisax加入/etc/rc.conf里面的MODULES,这样做的坏处就是不管这些模块是不是在使用,都加载了。 <br />
<br />
完成上述步骤之后,需要安装管理工具<br />
<br />
安装软件包isdn4k-utils,阅读关于isdnctrl的说明手册。在说明手册里,将有详细的说明:如何创建一个配置文件that can be parsed by isdnctrl,安装实例。 Please note that you have to add your SPID to your MSN setting separated by a colon if you use US NI1.<br />
<br />
使用isdnctrl utility配置ISDN卡之后,将可以拨号到你设定的PHONE_OUT参数的机器上,但提示用户名和密码错误。把用户名和密码加入到/etc/ppp/pap-secrets或者/etc/ppp/chap-secrets,这个主要根据的是你的ISP使用的协议授权方式,as if you were configuring a normal analogous PPP link。如果无法确定,可以两个文件都加。<br />
<br />
完成上述设定之后,用root帐号建立一个拨号连接:<br />
isdnctrl dial ippp0<br />
有啥问题,请检查日志文件!<br />
<br />
=====DSL (PPPoE)=====<br />
<br />
仅当需要你的计算机去主动拨号连接ISP的情况下才需参考本段内容。如果你使用独立的路由器来负责这类工作,你只需要设置一个缺省网关即可。<br />
<br />
在使用DSL连接前,你得先在计算机里安装一个连接到DSL-Modem的网卡。将你新装网卡加入到modules.conf/modprobe.conf或者MODULES列表之后,安装rp-pppoe软件包并运行pppoe-setup脚本来配置你的连接。当你输入完有关信息后,可以分别通过以下命令来进行连接和挂断:<br />
<br />
/etc/rc.d/adsl start<br />
<br />
和<br />
<br />
/etc/rc.d/adsl stop<br />
<br />
setup过程一般都是很容易、直观的,如果还有不懂可以阅读man手册。如果你想在启动时自动拨号,可以将adsl加入到DAEMONS列表中。<br />
<br />
<br />
===二、更新Pacman===<br />
<br />
====pacman是什么?====<br />
[[Pacman]]是Arch Linux的软件包管理器('''pac'''kage '''man'''ager)。Pacman是用C语言编写的,速度快,使用简便,功能强大。它可以管理整个软件包系统,负责软件包的安装、删除、降级(通过缓存),也支持自编译的软件包,自动分析依赖关系,可以搜索远程和本地软件仓库,还有大量其它功能。这里我们将用pacman来从远程软件仓库下载软件包并安装到系统中。<br />
<br />
对系统进行定制,pacman是Arch Linux最重要工具。<br />
<br />
====1、配置pacman====<br />
=====pacman总配置文件/etc/pacman.conf=====<br />
Arch通过pacman可以获得对下面 4软件仓库的管理:<br />
<br />
'''[core]'''<br />
<br />
[core](“核心”)仓库的简单原则是只提供一个基本的Arch Linux的基本工具:GNU系列工具,Linux内核,一个文字编辑器,一个命令行浏览器等(这里也有一些例外。比如说,vi和nano是同时提供的,允许用户选择一个或两个)。它包含所有使你的系统正常运转的“必须”安装的包,只有它们完美地工作,你的系统才能继续运行。这些是绝对“system-critical”(对系统来说至关重要)的包。由开发者负责维护。<br />
<br />
*''Core安装媒介(The Core installation media)简单地包含一个安装脚本,一个当前发布版本的核心仓库的快照(snapshot)。''<br />
<br />
'''[extra]'''<br />
<br />
[extra](“额外的”)仓库包含所有的对于一个基本的Arch系统不是必须,但是对于构建一个完整的系统环境有用的的Arch包。 比如'''X''', KDE和Apache,都可以在这里面找到。它也是由开发者维护的。<br />
<br />
'''[testing]'''<br />
<br />
[testing](“测试”)仓库包含的包是[core]和[extra]仓库的候选者。<br />
下面情况下,新的软件包将进入[testing]软件仓库:<br />
* 可能会导致系统出问题的升级,需要测试。<br />
* 需要重新打包其他软件包。这种情况下,所有需要重新打包的软件包将被放在[testing]仓库,直到所有重新打包完成,这些软件包才回归原有的软件仓库。 <br />
<br />
开发者维护。<br />
<br />
[testing]是唯一的一个在名义上与其它官方仓库有冲突的仓库。(that can have name collisions with any of the other official repositories. )<br />
<br />
<font color=&quot;blue&quot;>*如果开启, [testing]必须放在''pacman.conf''的软件仓库的第一个。</font><br />
<br />
<font color=&quot;red&quot;>'''警告''': '''''开启[testing]软件仓库,容易导致系统崩溃,因此只建议有经验的用户开启。'''''</font><br />
<br />
'''[community]'''<br />
<br />
[community](“社区”)仓库是由“信任用户”(''Trusted Users (TUs)'')维护的,是''Arch User Repository ([[AUR]])''(Arch用户仓库)的一部分。它包含的是二进制的包,在用户仓库中有足够的“票数”,并由''信任用戶''挑选出来的。像其它上面列出的仓库一样,[community] 可以用pacman获取。<br />
<br />
'''[[AUR]]''' 也包含'''unsupported''' 分支,这不能直接通过pacman获取。*. [unsupported] 包含多达海量PKGBUILD脚本,用来从源代码编译。这从其它仓库中是不能使用的。 <br />
<br />
<nowiki>*</nowiki> '''''[[AUR Helpers]]''''' 能帮助你无缝地使用AUR。<br />
<br />
'''/etc/pacman.conf'''<br />
<br />
每次调用pacman,它都会读取/etc/pacman.conf文件。这个配置文件分若干段,每一段定义了一个pacman用来搜索软件的仓库。唯一例外的是options段,它定义了全局选项。<br />
nano /etc/pacman.conf<br />
范例:<br />
#<br />
# /etc/pacman.conf<br />
#<br />
# See the pacman.conf(5) manpage for option and repository directives<br />
<br />
#<br />
# GENERAL OPTIONS<br />
#<br />
[options]<br />
# The following paths are commented out with their default values listed.<br />
# If you wish to use different paths, uncomment and update the paths.<br />
#RootDir = /<br />
#DBPath = /var/lib/pacman/<br />
#CacheDir = /var/cache/pacman/pkg/<br />
#LogFile = /var/log/pacman.log<br />
HoldPkg = pacman glibc<br />
# If upgrades are available for these packages they will be asked for first<br />
SyncFirst = pacman<br />
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u<br />
#XferCommand = /usr/bin/curl %u > %o<br />
<br />
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup<br />
#IgnorePkg =<br />
#IgnoreGroup =<br />
<br />
#NoUpgrade =<br />
#NoExtract =<br />
<br />
# Misc options (all disabled by default)<br />
#NoPassiveFtp<br />
#UseSyslog<br />
#ShowSize<br />
#UseDelta<br />
#TotalDownload<br />
#<br />
# REPOSITORIES<br />
# - can be defined here or included from another file<br />
# - pacman will search repositories in the order defined here<br />
# - local/custom mirrors can be added here or in separate files<br />
# - repositories listed first will take precedence when packages<br />
# have identical names, regardless of version number<br />
# - URLs will have $repo replaced by the name of the current repo<br />
#<br />
# Repository entries are of the format:<br />
# [repo-name]<br />
# Server = ServerName<br />
# Include = IncludePath<br />
#<br />
# The header [repo-name] is crucial - it must be present and<br />
# uncommented to enable the repo.<br />
# <br />
<br />
# Testing is disabled by default. To enable, uncomment the following<br />
# two lines. You can add preferred servers immediately after the header,<br />
# and they will be used before the default mirrors.<br />
#[testing]<br />
#Include = /etc/pacman.d/mirrorlist<br />
<br />
[core]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
[extra]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist <br />
<br />
[community]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
# An example of a custom package repository. See the pacman manpage for<br />
# tips on creating your own repositories.<br />
#[custom]<br />
#Server = file:///home/custompkgs<br />
要开启一个软件仓库,只需要将'Include ='和'[repository]'行前的注释符号(#)去除。<br />
<br />
*"Server ="行如果取消注释,将会强制此服务器被首先搜索,详细的仓库配置位于/etc/pacman.d/下。<br />
* 注意:选择仓库时,请确认将仓库名和'Include ='行都一同取消注释。没有这样做的话会导致你选择的仓库被忽略!这是个很普遍的错误。<br />
<br />
=====(如果有必要)配置镜像列表 /etc/pacman.d/mirrorlist=====<br />
更快的镜像能显著改善pacman的性能和你对Arch Linux的总体体验。<br />
<br />
*手动编辑/etc/pacman.d/mirrorlist:<br />
nano /etc/pacman.d/mirrorlist<br />
删除所有不在你所在洲或者太远的镜像。(在nano里你可以用CTRL-K删除每个不需要的行。)保存文件并退出。<br />
<br />
*'''rankmirrors'''脚本可以根据镜像的响应延迟对其自动排名。'''Rankmirrors'''是python脚本,需要安装python:<br />
<br />
pacman -S python<br />
<br />
然后,运行'''rankmirrors'''脚本按响应延迟顺序对镜像进行排名:<br />
rankmirrors -v /etc/pacman.d/mirrorlist<br />
输出会列出所有镜像和它们的响应延迟(ping),例如:<br />
<br />
# United States<br />
# http://mirrors.easynews.com/linux/archlinux/$repo/os/i686 ... 0.96<br />
# ftp://ftp.nethat.com/pub/linux/archlinux/$repo/os/i686 ... unreachable<br />
# ftp://locke.suu.edu/linux/dist/archlinux/$repo/os/i686 ... 2.43<br />
# ftp://mirrors.unixheads.org/archlinux/$repo/os/i686 ... 1.96<br />
<br />
脚本将从低到高的响应延迟顺序显示:<br />
Server = http://mirrors.easynews.com/linux/archlinux/$repo/os/i686<br />
Server = ftp://mirrors.unixheads.org/archlinux/$repo/os/i686<br />
Server = ftp://locke.suu.edu/linux/dist/archlinux/$repo/os/i686<br />
Server = ftp://ftp.nethat.com/pub/linux/archlinux/$repo/os/i686<br />
<br />
要注意的是这个结果对于镜像排列并非很精确,最接近你的镜像或者延迟最低的镜像并不一定是最佳选择。(反应迅速但是内容过时的镜像、或者低延迟但是窄带宽的镜像对你毫无用处)。<br />
<br />
编辑/etc/pacman.d/mirrorlist,将最佳的镜像置于在列表顶端。为了体验多个镜像你可能要不断修改此配置文件,请精明地选择。<br />
<br />
====常用的命令====<br />
<br />
与远程软件仓库同步和更新本地包数据库 (推荐在安装和更新包之前这样做):<br />
pacman -Sy<br />
<br />
'''升级'''系统中所有的包:<br />
pacman -Su<br />
<br />
一条同步、更新、'''升级''' 所有系统中的包的命令:<br />
pacman -Syu<br />
<br />
安装或者升级单个软件包或者一串包(包括其依赖包):<br />
pacman -S packageA packageB<br />
<br />
同步、更新数据库并安装软件包:<br />
pacman -Sy packageA packageB<br />
<br />
移除软件包, 但保留依赖的包:<br />
pacman -R package<br />
<br />
移除单个包,并且移除没有被别的软件依赖的依赖包:<br />
pacman -Rs package<br />
<br />
移除包所有不需要的依赖包并删除其配置文件:<br />
pacman -Rsn package<br />
<br />
通过给定关键词(列表)搜索远程软件仓库数据库(repo):<br />
pacman -Ss keyword<br />
<br />
列出系统中所有的包<br />
pacman -Q<br />
<br />
在本地包数据库搜索 (查询)指定软件包:<br />
pacman -Q package <br />
<br />
在本地包数据库搜索 (查询)指定软件包并列出相关信息:<br />
pacman -Qi package<br />
<br />
To defragment pacman的数据库缓存和速度优化选项:<br />
pacman-optimize<br />
<br />
统计当前系统中的包数量:<br />
pacman -Q | wc -l<br />
<br />
使用ABS和makepkg从源代码编译安装包:<br />
pacman -U packagename.pkg.tar.gz<br />
<br />
Note: pacman有很多很多的选项和功能组合。你可以试试man pacman或者查阅lt the [[pacman]]维基条目<br />
<br />
====软件包管理增强工具====<br />
* Yaourt 可查询aur的pacman增强工具<br />
* Tupac 快速查询的yaourt增强工具<br />
* Powerpill 多进程下载的pacman增强工具<br />
{{Box Note| 强烈建议更新系统完毕后,安装yaourt和powerpill,以便更充分享受Arch Linux的方便和强大。}}<br />
在/etc/pacman.conf文件里,最后添加两行(如果是i686的话,把x86_64换成i686即可):<br />
[archlinuxfr]<br />
Server = http://repo.archlinux.fr/x86_64<br />
然后使用pacman安装yaourt<br />
pacman -Sy yaourt<br />
<br />
以后就可以使用yaourt命令来查找并安装包括[[AUR]]里的软件了。比如bcm无线网卡,需要安装b43-firmware(此软件包在[[AUR]]仓库里,使用pacman无法查找到),使用yaourt命令查找并安装:<br />
yaourt b43-firmware<br />
找到之后,根据相应提示,一直到安装完成。<br />
<br />
====图形化管理工具====<br />
* qt界面的shaman:比较成熟的pacman 图形化管理工具<br />
* gtk界面的gtkpacman :目前BUG比较多,不稳定。<br />
<br />
====Pacman的更多信息====<br />
用此命令查看pacman手册:<br />
man pacman<br />
有空的话可以看看[[pacman (简体中文)]]维基条目。<br />
<br />
====2、更新Pacman自己====<br />
<br />
一开始,系统可能会提示你先更新pacman自身,这取决于Arch安装包的新旧程度:<br />
pacman -Sy pacman<br />
pacman开始查看是否需要更新,如果有提示需要更新,则按‘y’,开始pacman更新。<br />
<br />
'''''有时候,还需要用户主动修改某些配置;请仔细阅读升级过程中的输出获取相关信息。'''''<br />
<br />
===三、更新系统===<br />
====使用[[pacman (简体中文)|pacman]]====<br />
现在我们要用[[pacman (简体中文)|pacman]]来更新系统。要更新、同步并'''升级'''你的系统,可以使用命令:<br />
pacman -Syu<br />
pacman就会获取所有最新可用软件包信息并进行升级。(此时你可能会被提示先升级pacman自身。如果是这样,回答'yes',然后在完毕后再运行一次pacman -Syu命令。)<br />
<br />
===='''滚动发布'''之美====<br />
Arch是一个'''rolling release'''(滚动发布)的发行版。这意味着没有必要重新安装或执行完整的系统重建来升级到最新版本。只需要执行'''pacman -Syu''',就能保持你的系统更新到最新和bleeding edge(表示最新的、因而也并非完美的技术)。<br />
<br />
===四、增加一个用户并设置用户组===<br />
用root账号来处理日常工作是很危险的。Root是用来处理系统管理的任务。我们可以用以下命令增加一个普通用户账号:<br />
adduser<br />
大部分缺省选项都是没问题的,你可能还需要将storage、audio、video、optical和wheel加入到你的用户组中 ── 特别是在你打算使用一个完整功能的桌面环境的情况下。<br />
<br />
用户组和用户的关联定义在/etc/group文件中: <br />
<br />
它包含了:<br />
<br />
*'''audio''' - 关于声卡和相关软件的任务<br />
<br />
*'''wheel''' - 给sudo使用<br />
<br />
*'''storage''' - 负责存储设备<br />
<br />
*'''video''' - 视频任务和3D加速<br />
<br />
*'''optical''' - 和光驱有关的任务<br />
<br />
*'''floppy''' - 软驱访问<br />
<br />
*'''lp''' - 打印任务<br />
<br />
请参看[[Groups]]一文了解你应该属于哪些用户组。<br />
你还可能需要将你的用户账号加入到以下用户组(需要以root身份运行此命令):<br />
usermod -aG audio,video,floppy,lp,optical,network,storage,wheel,dbus,hal USERNAME<br />
详情可看usermod和gpasswd的man手册。<br />
<br />
===五、安装建立Sudo (可选)===<br />
安装Sudo:<br />
# pacman -S sudo<br />
以root身份,运行命令visudo,把用户加入sudo用户 (a &quot;sudoer&quot;).如果不知道怎么使用vi,你可以在用visudo前设置VISUAL 或 EDITOR环境变量为你喜欢的编辑器。例如:<br />
# export VISUAL=vim<br />
或<br />
# export EDITOR=nano<br />
如果你对于用vi很适应,去掉EDITOR=nano这个变量就行:<br />
# visudo<br />
这命令将在一个特殊的vi会话中打开文件 /etc/sudoers 。visudo复制文件到一个可编辑的临时文件中,用一个编辑器编辑它(vi是默认的),接下来运行一个安全检查(“sanity check”)。如果通过,这个临时文件就有正确的权限将重写的原始文件。t<br />
<br />
<font color=&quot;red&quot;>'''注意:不要直接用编辑器编辑 /etc/sudoers ; 否则会出现这样的提示:Errors in syntax can cause annoyances (像root帐户不能使用的描述一样)。 必须使用 ''visudo'' 命令来编辑 /etc/sudoers.'''</font><br />
<br />
当用户输入以 &quot;sudo&quot;, 作为开始的命令行时,临时授予该用户root权限。加入下面一行:<br />
USER_NAME ALL=(ALL) ALL<br />
USER_NAME 就是单个用户名。<br />
<br />
更多信息,比如按<TAB> 自动命令补全,请见[[Sudo]]<br />
<br />
==第三部分:安装X并配置ALSA==<br />
一共有三步工作:<br />
*1、安装声卡驱动<br />
*2、安装x-window(包括显卡驱动)<br />
*3、配置X<br />
<br />
{{Box Note | '''在热插拔未配置正确的情况下,或者是/etc/rc.d/hal未启动的情况下,请不要启动开启X(包括重启使用gdm或者kdm登陆),否则可能导致鼠标键盘失去响应!!!'''}}<br />
<br />
===一、配置声卡:使用alsamixer===<br />
高级Linux声音架构(Advanced Linux Sound Architecture,简称ALSA)是一个Linux内核组件。它替换了原有的开放声音系统(OSS),为声卡提供了设备驱动。除了声音设备驱动以外,'''ALSA'''还给应用程序开发人员提供了一个用户空间库,可使更高级的API无需直接与内核驱动打交道就能使用驱动功能。<br />
<br />
{{Box Note| Alsa已经包含进最新的内核kernel,udev 将在系统启动时自动检测硬件,并自动根据声卡加载相应的内核模块。虽然声卡已经在工作,但电脑的声音默认是静音。}}<br />
{{Box Note| OSS4.1已经放出,相对于老的版本,这是一个显著的提升的版本,如果使用ALSA有问题, 或者是想尝试新的功能,可以使用 OSS4.1。 相关说明可见: [[OSS]]}} <br />
<br />
Alsa-utils软件包里的alsamixer让我们可以从命令行来配置声音设备。(你也可以稍后在'''X'''环境中使用alsamixer。)<br />
默认情况下,内核加载模块snd_pcsp,这是一个alsa pc speaker模块。 snd_pcsp通常先于&quot;你实际的&quot;声卡模块加载。大部分情况下,这模块最后加载更好,因为可以让alsamixer正确控制需要的声卡。<br />
<br />
在/etc/modprobe.conf中加入这行,可以使得snd_pcsp最后加载:<br />
options snd-pcsp index=2<br />
<br />
当然,如果你不想让snd_pcsp加载,可以把它放入黑名单,或者是在/etc/rc.conf的Modules里禁止它:<br />
MODULES=(... !snd_pcsp)<br />
<br />
{{Box Note | 想要生效,需要释放并重新加载所有声音模块,当然,系统重启就可以简单解决这问题。 }}<br />
<br />
* 安装alsa-utils软件包:<br />
pacman -S alsa-utils<br />
<br />
* 为了解决Alsa声卡独占问题,可以安装alsa-oss:<br />
# pacman -S alsa-oss <br />
<br />
* 把你的普通用户账号加入到audio用户组中:以root身份,运行<code>/usr/bin/gpasswd</code>程序:<br />
gpasswd -a yourusername audio<br />
*以普通用户身份运行: <br />
alsamixer<br />
用左右光标键移动到Master和PCM声道上,按'''M'''取消掉静音。用向上键增加音量。(70-90的音量是较合适的范围)按ESC键离开alsamixer。<br />
有'''Speaker'''的,需要同时取消静音并调整之. <br />
<br />
====测试声音====<br />
以普通用户身份,使用 <code>/usr/bin/aplay</code>程序来测试你的声音配置:<br />
aplay /usr/share/sounds/alsa/Front_Center.wav<br />
你应该会听到一个女性声音说:“Front,center。”<br />
<br />
====保存声音配置====<br />
以root身份运行<code>/usr/bin/alsactl</code> :<br />
alsactl store<br />
这将创建'/etc/asound.state'文件,用来保存alsamixer的设置。<br />
<br />
为了每次启动都可以自动恢复混音器设置,可将守护进程''alsa''加入到你的/etc/rc.conf中的DAEMONS列表。<br />
nano /etc/rc.conf<br />
DAEMONS=(syslog-ng network crond '''alsa''')<br />
''注意,alsa守护进程在启动过程中仅仅是恢复音量设置。它和alsa音频库(和内核级API)是完全不同的。''<br />
<br />
更多详情请参看[[ALSA 安装设置 (简体中文)|ALSA 安装设置]]。<br />
<br />
===二、安装X===<br />
'''X''' 窗口系统(一般叫'''X11'''或者更简单的叫'''X''') 是一个网络互动和显示服务,提供位图显示器窗口. 提供标准化工具包(toolkit)和协议,用于<code>UNIX</code>类操作系统,构建一个图形界面(GUIs) <br />
<br />
'''X''' 提供最基本、基础的框架,用于构建一个图形操作界面环境。包括:绘图、屏幕窗口移动,与鼠标或者键盘的交互。 '''X''' 并不负责用户交互界面的部分:有独立的客户端程序负责处理这部分。 比如gnome、kde。<br />
<br />
'''X''' 因为它先于'''W'''窗口系统,最初由斯坦福大学开发。 <br />
<br />
*''注意: 如果想使用一个'''开源''' 显卡驱动, 需要3d加速,强烈建议在安装Xorg之前安装库 libgl :''<br />
pacman -S libgl<br />
''(拥有专利的视频驱动提供它们自己的gl库安装(implementations).)''<br />
----- <br />
====1、安装X====<br />
构建一个GUI的第一步:用pacman来安装Xorg包.<br />
<br />
# pacman -S xorg<br />
对于新版的xorg,建议(可能大部分情况下是必须的)安装输入设备驱动evdev。它本来应该作为xorg-server的一个依赖被安装的,不过不知道为什么貌似缺失了:<br />
# pacman -S xf86-input-evdev<br />
3d的工具比如glxgears包含在包'''mesa''' 里(如果需要,也安装):<br />
# pacman -S mesa<br />
<br />
====2、安装显卡驱动====<br />
到这一步,已经有了运行'''X''' Server的基本软件包,接下来需要把显卡的驱动安装到电脑里(e.g. xf86-video-<name>). 最简单的X.org配置方法就是安装正确的驱动包,然后使用自动脚本对 /etc/X11/xorg.conf 进行初始化,比如使用 Xorg -configure(arch团队提供hwd工具,但据以前用户的反映,这个现在还老出问题,新手可以使用,以后有能力再配置其他).<br />
<br />
如果不知道显卡类型,输入下面命令:<br />
lspci | grep VGA<br />
<br />
输入下面命令,查看所有'''开源'''驱动: <br />
pacman -Ss xf86-video | less<br />
<br />
下面是一个'''开源'''的显卡列表和相关说明:<br />
*'''xf86-video-apm''' Alliance ProMotion video driver<br />
*'''xf86-video-ark''' ark video driver<br />
*'''xf86-video-ati''' ati video driver<br />
*'''xf86-video-chips''' Chips and Technologies video driver<br />
*'''xf86-video-cirrus''' Cirrus Logic video driver<br />
*'''xf86-video-dummy''' dummy video driver<br />
*'''xf86-video-fbdev''' framebuffer video driver<br />
*'''xf86-video-glint''' GLINT/Permedia video driver<br />
*'''xf86-video-i128''' Number 0 i128 video driver<br />
*'''xf86-video-i740''' Intel i740 video driver<br />
*'''xf86-video-i810''' Intel i810/i830/i9xx video drivers (deprecated - use -intel)<br />
*'''xf86-video-intel''' Newer Version of Intel i810/i830/i9xx video drivers<br />
*'''xf86-video-imstt''' Integrated Micro Solutions Twin Turbo vidoe driver<br />
*'''xf86-video-mach64''' mach64 video driver <br />
*'''xf86-video-mga''' mga video driver (Matrox Graphics Adapter) <br />
*'''xf86-video-neomagic''' neomagic video driver<br />
*'''xf86-video-nouveau''' Open Source 3D acceleration driver for nVidia cards (eperimental)<br />
*'''xf86-video-nv''' nvidia nv video driver<br />
*'''xf86-video-openchrome''' Openchrome drivers<br />
*'''xf86-video-r128''' ati Rage128 video driver<br />
*'''xf86-video-radeonhd''' Experimental Radeon HD video driver for r500 and r600 ATI cards<br />
*'''xf86-video-rendition''' Rendition video driver<br />
*'''xf86-video-s3''' S3 video driver<br />
*'''xf86-video-s3virge''' S3 Virge video driver<br />
*'''xf86-video-savage''' savage video driver<br />
*'''xf86-video-siliconmotion''' siliconmotion video driver<br />
*'''xf86-video-sis''' SiS video driver<br />
*'''xf86-video-sisusb''' SiS USB video driver<br />
*'''xf86-video-tdfx''' tdfx video driver<br />
*'''xf86-video-trident''' Trident video driver<br />
*'''xf86-video-tseng''' tseng video driver<br />
*'''xf86-video-unichrome''' Unichrome video drivers<br />
*'''xf86-video-v4l''' v4l video driver<br />
*'''xf86-video-vesa''' vesa video driver<br />
*'''xf86-video-vga''' VGA 16 color video driver<br />
*'''xf86-video-via''' via video driver<br />
*'''xf86-video-vmware''' vmware video driver<br />
*'''xf86-video-voodoo''' voodoo video driver<br />
<br />
* 说明:'''vesa'''驱动是最通用的软图形驱动, 适用于大部分的显卡, 但没有3D加速等功能。所以如果实在无法找到合适的显卡驱动,就只好选用vesa, 理论上它应该能在任何显卡上工作。(这是原话,好像夸张了点!If you cannot find a suitable driver for your video chipset, vesa '''should''' work.)<br />
<br />
用pacman来安装适合你显卡的驱动。例如:<br />
pacman -S xf86-video-savage<br />
(给Savage显卡的驱动。)<br />
<br />
* 如果实在不确定需要安装那个显卡驱动,可以安装所有显卡驱动包, 输入下面命令:<br />
pacman -S xorg-video-drivers<br />
<br />
*如果显卡是nVIDIA 或者ATI的,并'''想安装nVIDIA或者ATI官方提供的显卡驱动,请看下面。'''<br />
-----<br />
<br />
====nVIDIA图形显示卡====<br />
nVIDIA显示卡的驱动程序被许多人认为是非常好的质量,而且带有高级3D性能。<br />
<br />
在设置您的你nVIDIA显卡之前您先要选择您要使用的驱动程序。Arch现在有3种不一样的nVIDIA驱动程序,各自支持不同型号的显卡:<br />
<br />
'''1. nvidia-96xx''' ''直到Ge Force 4的较新显卡''<br />
<br />
'''2. nvidia-173xx''' ''Geforce FX系列显卡''<br />
<br />
'''3. nvidia''' ''在GF FX之后的最新GPU''<br />
<br />
{{Box Note| 一些特别老如TNT和TNT2之类的显卡所需的Nvidia-71xx系列闭源驱动,由于无法在Arch所用的新版Xorg下正常运行,并且nvidia也已不再继续支持它们,因此已被删除。你可以改用xf86-video-nv或者xf86-video-vesa驱动。}}<br />
<br />
到nVIDIA主页,看哪个适合你电脑.区别只是安装,配置过程是一样的.<br />
<br />
''根据你的显卡'',选择合适的nVIDIA驱动安装,比如: <br />
pacman -S nvidia-96xx<br />
<br />
nVIDIA软件包有个工具能自动升级你已有的nVIDIA驱动的配置文件/etc/X11/xorg.conf,输入下列命令即可实现:<br />
nvidia-xconfig<br />
<br />
它也有一些选项,用于更深入和具体地配置xorg.conf文件的内容和选项,例如:<br />
<br />
<br />
nvidia-xconfig --composite --add-argb-glx-visuals<br />
<br />
更详细的信息,请参考:nvidia-xconfig(1).<br />
<br />
一些有用的妙法可用在“device“部分(你要清楚它们不一定都能对你的系统有用):<br />
Option "RenderAccel" "true"<br />
Option "NoLogo" "true"<br />
Option "AGPFastWrite" "true"<br />
Option "EnablePageFlip" "true"<br />
将所有的DRI注释掉:<br />
# Load "dri"<br />
<br />
多检查几次你的/etc/X11/xorg.conf以确定你的默认的depth(色深),horizontal sync(水平同步),垂直刷新率,以及分辨率是可以接受的。<br />
<br />
使用<code>/sbin/depmod</code>命令来更新内核模块依赖:<br />
depmod -a<br />
(也许需要重启。)<br />
{{Tip|nvidia配置的高级的说明参考文章[[NVIDIA]] 。}}<br />
<br />
现在你可以跳到'''[[#三、配置X:创建并修改/etc/X11/xorg.conf|配置X]]'''来进一步熟悉,或者跳到'''[[#3、测试 X|测试 X]]'''继续安装过程。<br />
<br />
====ATI图形显示卡====<br />
ATI用户的驱动可以有几种选择。<br />
* '''xf86-video-ati'''软件包提供的开源'''''radeon'''''驱动。<br />
** 原创的、完全支持Radeon芯片组到X1950(最新的R500芯片组)的逆向工程开源驱动。对9200系列以前的显卡完全支持,可以稳定的提供全2D和3D加速。从9500到X1950完全支持2D加速特性,良好的3D加速,不过缺乏某些闭源驱动的特性(例如能源节省特性仍处于测试阶段)。xf86-video-ati支持从HD2xxx (R6xx)到最新的显卡,不过目前仅提供2D支持。<br />
* '''xf86-video-radeonhd'''软件包提供了开源的'''''radeonhd'''''驱动。<br />
** 此驱动支持ATI R500(Radeon X1000系列)以及更新的芯片组。该驱动由AMD提供文档,Novell为之开发。它支持RandR 1.2,目前的开发工作非常活跃。因此所支持的不同系列显卡的功能可以不一致。(有些用户反映它性能优异,而有些则说它很糟)。它还支持带音频的HDMI。<br />
* AUR中的Catalyst软件包提供了闭源'''''fglrx'''''驱动。稍后将介绍闭源驱动。<br />
开源驱动通常可以满足大部分需求而且较少出问题。<br />
<br />
安装'''''radeon'''''ATI驱动:<br />
# pacman -S xf86-video-ati libgl ati-dri<br />
安装'''''radeonhd'''''ATI驱动:<br />
# pacman -S xf86-video-radeonhd libgl ati-dri<br />
<br />
Arch的<code>extra</code>官方仓库曾经提供过闭源ATI驱动'''Catalyst'''的预编译包,不过在2009年3月以后,由于对闭源驱动的质量和开发进度不满意,官方取消了对它的支持。目前catalyst驱动可以在[http://aur.archlinux.org/packages.php?ID=22899 AUR]中找到。Catalyst驱动的安装信息可以在[[ATI#Proprietary_ATI_Catalyst_driver|这里]]找到。<br />
<br />
{{Warning| 闭源ATI驱动仅支持R600和更新的显卡(即HD2xxx及以上系列),不支持旧系列(X1xxx系列及以下)。}}<br />
<br />
{{Tip|ATI配置的高级指引可以参看[[ATI | ATI wiki 文章]]。}}<br />
<br />
====3、安装输入设备驱动软件包====<br />
最新的X需要你为包括键盘和鼠标在内的输入设备安装驱动。查看可用输入设备驱动的完整列表:<br />
# pacman -Ss xf86-input | less<br />
<br />
对大部分用户,xf86-input-keyboard和xf86-input-mouse应该可以满足基本配置。使用pacman来为你的输入设备安装需要的驱动,例如:<br />
# pacman -S xf86-input-keyboard<br />
===三、配置X:创建并修改/etc/X11/xorg.conf===<br />
====xorg.conf文件====<br />
/etc/X11/xorg.conf 是你的 X-Window-System 的主要配置文件,你的 GUI('''G'''raphical '''U'''ser '''I'''nterface)的基础,它是一个普通的文本文件,里面由 “section” 和 “subsection” 来安排。重要的 section 有 ''Files, InputDevice, Module, Monitor, Modes, Screen, Device'' 和 ''ServerLayout''。各个section安排的前后次序没有关系,对同一种类型的设备也可以有多个section,比如你可能有多个显示器,或者你的本本既有鼠标又有触摸板。<br />
------<br />
从X11R7.2版开始Xserver引入了自动配置特性。在大多情况下,即使没有xorg.conf文件它也能很好地运作。如果''自动检测功能工作正常'',而且你又不需要开启如 aiglx、compositing 等功能的话,你甚至不需要创建这个配置文件。<br />
<br />
====1、创建 /etc/X11/xorg.conf====<br />
<br />
高级用户可以手动创建他们的xorg.conf文件。一般用户可以使用程序<code>/usr/bin/Xorg</code>附加参数-configure来生成一个基本的配置文件;以root身份输入下面命令:<br />
# Xorg -configure<br />
这里生成的文件是/root/xorg.conf.new <br />
<br />
把这文件复制到 <code>/etc/X11/</code>:<br />
# cp /root/xorg.xonf.new /etc/X11/xorg.conf<br />
<br />
====更多的创建/etc/X11/xorg.conf的办法====<br />
* 说明:如果你的电脑已经有一个配置好的xorg.conf文件,不管这个文件是在什么别的发行版下生成的,只要Xorg的版本一致,就可以把该文件复制到你的Arch系统的<code>/etc/X11/</code>目录下。<br />
* 可以使用程序<code>/usr/bin/hwd</code>生成xorg.conf。首先要安装这程序:<br />
# pacman -S hwd<br />
然后输入下面命令:<br />
# hwd -xa<br />
{{Box Note| 目前,hwd在生成的xorg.conf有一行失效。 使用完这程序后,需要手动删除或者是注释掉 Section &quot;Files&quot;下的RgbPath那一行。via nano /etc/X11/xorg.conf or your equivalent, as root/sudo.}}<br />
<br />
* 使用<code>/usr/bin/xorgcfg</code> 脚本生成xorg.conf:<br />
# xorgcfg <br />
* 使用<code>/usr/bin/xorgconfig</code>生成xorg.conf,这个程序以互动方式来创建该文件,输入下面命令运行:<br />
# xorgconfig<br />
<br />
====2、Input设备热插拔问题:请在测试X前阅读====<br />
<br />
xorg 1.5.x版本里已经开启热插拔Input设备。<br />
{{Box Note | 当热插拔开启后, X将清空xorg.conf里所有使用the kbd and mouse 驱动建立的设备。这将导致X被冻结,使得鼠标和键盘失去响应。下面是解决办法。'''方法只能二选一'''}}<br />
<br />
有两个办法可以修复这一问题:<br />
<br />
1) '''配置 input设备热插拔''':安装驱动 xf86-input-evdev,同时配置HAL使其能使用kbd/mouse驱动。<br />
<br />
安装xf86-input-evdev:<br />
# pacman -S xf86-input-evdev<br />
在X.org相关进程启动前,启动守护进程hal:<br />
# /etc/rc.d/hal start<br />
把hal加入/etc/rc.conf里的DAEMONS列表里,这样每次电脑启动,都会自动开启hal。详情请见[[Xorg input hotplugging]] 。<br />
<br />
说明: 开启hal必须首先有一个dbus用户和用户组,以root身份输入下面命令创建用户和用户组<br />
<br />
usr/sbin/groupadd -g 81 dbus<br />
usr/sbin/useradd -c 'System message bus' -u 81 -g dbus -d '/' -s /bin/false dbus<br />
<br />
2) '''关闭input设备热插拔''':在/etc/X11/xorg.conf的ServerFlags段,加入参数''Option &quot;AutoAddDevices&quot; &quot;False&quot;'' 这将忽略hal的硬件检测,并使用你xorg.conf的keyboard/mouse配置。步骤如下<br />
# nano /etc/X11/xorg.conf<br />
加入下面三行:<br />
Section &quot;ServerFlags&quot;<br />
Option &quot;AutoAddDevices&quot; &quot;False&quot;<br />
EndSection<br />
<br />
====3、测试 X====<br />
<br />
在所生成的xorg文件路径''path/to/xorg.conf''前,加入参数''-config'' ,运行 '''X'''脚本,可以测试脚本配置是否正确。<br />
比如要测试你上面生成的xorg是否配置正确,输入:<br />
X -config /root/xorg.conf.new<br />
'''X''' 将启动,在屏幕中央会有一个白色的 X ,鼠标或是触摸板可以移动它,按 CTRL-Alt-Backspace 可以退出 '''X'''<br />
<br />
====对xorg.conf除错====<br />
如果 X 出现错误不能运行,你需要手动检查你的配置文件:<br />
<br />
nano /root/xorg.conf.new<br />
<br />
* 确定 Xorg -configure 命令正确的识别了你的显卡,比如:<br />
Section &quot;Device&quot;<br />
<br />
...<br />
<br />
Driver &quot;savage&quot;<br />
<br />
...<br />
<br />
EndSection<br />
<br />
* 确定里面的 Section "Monitor" 设置了水平同步率和垂直刷新率,如果没有要把它加上:<br />
Section &quot;Monitor&quot;<br />
Identifier &quot;Monitor0&quot;<br />
VendorName &quot;Monitor Vendor&quot;<br />
ModelName &quot;Monitor Model&quot;<br />
HorizSync 30.0 - 130.0 # Safe for LCD's<br />
VertRefresh 50.0 - 100.0 # Safe for LCD's and most CRT's.<br />
EndSection<br />
如果你不知道这些刷新率到底是多少,你就得查一下你显示器的说明书。<br />
<br />
* 在section "Screen"配置默认色深(color depth):<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Card0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
(此处色深被设定为真彩24色。)<br />
<br />
<br />
* 在subsection &quot;Display&quot; 加入你需要的Modes, at least under the Depth 24 header, e.g.:<br />
SubSection &quot;Display&quot;<br />
Viewport 0 0<br />
Depth 24<br />
Modes &quot;1024x768&quot; &quot;800x600&quot; &quot;640x480&quot;<br />
* Add the following section, if you wish to enable eye candy which requires the composite extension: <br />
Section &quot;Extensions&quot;<br />
Option &quot;Composite&quot; &quot;Enable&quot;<br />
EndSection<br />
<br />
* 上述调整完成后,再测试你的配置:<br />
X -config /root/xorg.conf.new<br />
<br />
* 在确认 '''X''' session开启,没有错误之后,把测试好的配置文件移到 /etc/X11下,作为系统的xorg.conf配置文件:<br />
mv /root/xorg.conf.new /etc/X11/xorg.conf<br />
详细的介绍可见[[Xorg]] <br />
<br />
接下来可以简单作测试 '''[[#Simple baseline X test|Simple baseline X test]]'''<br />
<br />
====调整键盘布局====<br />
=====如果开启了input热插拔=====<br />
# cp /usr/share/hal/fdi/policy/10osvendor/10-keymap.fdi /etc/hal/fdi/policy/<br />
# nano /etc/hal/fdi/policy/10-keymap.fdi<br />
Edit the &quot;input.xkb.layout&quot; key and possibly the &quot;input.xkb.variant&quot; key in this file.<br />
Restart hal:<br />
# /etc/rc.d/hal restart<br />
<br />
=====如果关闭了input热插拔=====<br />
Add option lines in the &quot;InputDevice&quot; section of the /etc/X11/xorg.conf file specifying the keyboard layout and variant:<br />
Option &quot;XkbLayout&quot; &quot;be&quot;<br />
Option &quot;XkbVariant&quot; &quot;&quot;<br />
<br />
详情请见 [[Xorg input hotplugging]]。<br />
<br />
===简单的命令行界面X测试(如果需要)===<br />
<br />
在安装了xorg、合适的显卡驱动、创建了一个/etc/X11/xorg.conf文件之后,如果想在安装完整桌面环境之前,快速测试下你的配置,使用'''xterm'''可以实现! <br />
Xterm是个简单的终端模拟程序,作为base xorg软件包的一部分会被自动安装,运行在'''X '''Server环境里。通过配置~/.xinitrc,Xterm可以让我们快速测试显卡驱动和配置文件/etc/X11/xorg.conf是否被正确配置。(另外,如果在没有/etc/X11/xorg.conf的情况下,你想测试下'''X''' 自动检测是否满意,也可以使用这个)<br />
<br />
==== 准备工作:配置~/.xinitrc====<br />
<br />
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. <br />
{{Box Note | '''[[.xinitrc]]''' is a so-called 'dot' (.) file. 在UNIX文件系统下,文件名以 (.)开头的,是 '隐藏文件',,使用普通的命令'ls' 将不显示这些文件,使用加了参数命令'''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 &quot;Run Control&quot;.}}<br />
<br />
'''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. (说明: ''如果没有文件~/.xinitrc, /etc/X11/xinit/xinitrc 将被作为替代来使用,这是个使用TWM and Xterm的默认配置。'')<br />
<br />
切换到'''''普通, 非root'''''用户:<br />
# su - ''yourusername''<br />
* /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.<br />
* 如果没有~/.xinitrc这个文件,到该目录下创建一个,或者从/etc/skel/复制一个同样的文件到你的home目录:: <br />
<br />
$ cp /etc/skel/[[.xinitrc]] ~/<br />
<br />
* 编辑文件: <br />
$ nano ~/.xinitrc<br />
加入这行&quot;<code>exec xterm</code>&quot;像下面这样:<br />
<br />
#!/bin/sh<br />
#<br />
# ~/.xinitrc<br />
#<br />
# Executed by startx (run your window manager from here)<br />
#<br />
exec xterm<br />
# exec wmaker<br />
# exec startkde<br />
# exec icewm<br />
# exec blackbox<br />
# exec fluxbox<br />
<br />
{{Box Note | ''请确保~/.xinitrc''里,以'''exec'''开头的,只有'''一行'''的注释被去掉。}}<br />
<br />
====开始执行测试====<br />
<br />
* 以普通用户身份输入下面命令,开启'''X''',开始测试你的配置:<br />
<br />
$ startx<br />
或者是这命令<br />
$ xinit<br />
<br />
此时会打开一个'''xterm''' session,你可以在这里测试your keyboard and its layout<br />
<br />
* 按Ctrl+Alt+Backspace,或者输入"exit"可以退出'''X''' Server。<br />
* 如果开启'''X'''出现问题,在终端,查看日志文件/var/log/Xorg.0.log的错误信息。<br />
<br />
更多的Xorg configuration介绍可见[[Xorg]] .<br />
<br />
==第四部分:安装并配置桌面环境==<br />
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 icons, applets, windows, toolbars, folders, wallpapers, 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.<br />
<br />
* 如果你需要一个完整功能,类似于Windows和Mac OSX, 可以选择安装'''[[#KDE|KDE]]''' <br />
* If you want something slightly more minimalist, which follows the K.I.S.S. principle more closely, '''[[#GNOME|GNOME]]''' is a good choice<br />
* '''[[#Xfce|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.<br />
<br />
如果你的机器较老,或者是希望使用一个更轻量、更少GUI要求,可以选择只安装 '''Window Manager''', 或者 WM. A WM controls the placement and appearance of application windows in conjunction with the X Window System but does NOT provide such additions as panels, applets, icons, etc.<br />
* Lightweight floating WM's include: [[#Openbox|'''Openbox''']], [[#Fluxbox|'''Fluxbox''']], [[#fvwm2|'''fvwm2''']], '''Windowmaker, Pekwm, and TWM'''.<br />
* If you need something completely different, try '''Awesome, ion, wmii, dwm, or xmonad'''。<br />
<br />
===一、安装字体===<br />
在安装桌面环境/窗口管理器'''之前''',也许你会先安装些美观的字体。Dejavu和bitstream-vera都是不错的字体集。而对于网页,你还可能需要Microsoft字体。如下安装:<br />
pacman -S ttf-ms-fonts ttf-dejavu ttf-bitstream-vera<br />
对于中文字体,开源的文泉驿正黑矢量字体是不错的选择,它还内嵌了9pt-12pt的点阵宋体:<br />
pacman -S wqy-zenhei<br />
<br />
===二、选择默认启动的桌面环境 ~/.xinitrc===<br />
<br />
以普通用户身份编辑/home/username/.xinitrc,加入你要用的DE. This will allow you to use '''startx/xinit''' from the shell, in the future, to open your DE/WM of choice:<br />
<br />
nano ~/.xinitrc<br />
<br />
反注释或者加入相应的桌面环境/窗口管理器的''''exec''' ..'内容行。例如:使用Xfce4桌面环境:<br />
<br />
exec startxfce4 <br />
<br />
记住在~/.xinitrc中只反注释掉一行'''exec'''。这条命令将一直运行到你注销桌面登录。一般的,shell将等到kde完成加载之后,在运行下一条命令。在命令前加 &quot;exec&quot; ,是告诉the shell 这条命令最后执行, 这样shell就不用等待其他命令了,直接载入桌面。<br />
接下来安装你所选的桌面环境/窗口管理器。<br />
<br />
===三、选择安装一个桌面环境===<br />
====GNOME====<br />
=====关于GNOME=====<br />
GNOME是'''G'''NU '''N'''etwork '''O'''bject '''M'''odel '''E'''nvironment的缩写。GNOME项目有两大部分:GNOME桌面环境 ── 既直观又迷人的最终用户桌面,以及GNOME开发平台 ── 一个用来创建可与桌面集成的应用程序的庞大的框架。<br />
<br />
=====安装=====<br />
安装基本的GNOME环境:<br />
pacman -S gnome<br />
<br />
安装额外的GNOME环境:<br />
pacman -S gnome-extra<br />
然后选择提示的所有软件包。 <br />
<br />
=====对GNOME有用的守护进程=====<br />
如之前所述,守护进程(daemon)是运行在后台的程序,它等待事件发生并提供相应的服务。其中'''Hal'''守护进程可以自动挂载磁盘、光驱和U盘给GUI使用。'''Fam'''守护进程可以在GUI中实时反映文件的变动,如最近安装的程序、文件系统的变化等。'''Hal'''和'''fam'''使得GNOME的使用更为方便。Hal和fam软件包在安装GNOME时已一同安装,建议安装社区库的gamin来替代fam。<br />
<br />
{{Box Note|注意,fam是一个比较老的包,很容易造成较大的日志文件。}}<br />
<br />
{{Box Note|在当前的gnome环境中,你可以安装gamin来实现fam的功能。这时,你可以不用在DAEMONS中添加fam启动项了(不需要加入gamin,它会自动被启用)。}}<br />
<br />
* 你需要启动'''hal'''守护进程。<br />
<br />
启动hal:<br />
/etc/rc.d/hal start<br />
<br />
如果您想使用fam,同样需要启动:<br />
/etc/rc.d/fam start<br />
<br />
将hal加入到/etc/rc.conf的DAEMONS中以使得它们随系统启动而自动运行:<br />
nano /etc/rc.conf<br />
<br />
DAEMONS=(syslog-ng network crond alsa '''hal''')<br />
<br />
{{Box Note|注意,如果使用fam,那么把fam加入到hal后面。}}<br />
<br />
* 或许你还会希望安装一个图形界面的登录管理器。在GNOME下'''gdm'''守护进程是个不错的选择。<br />
以root身份运行:<br />
pacman -S gdm<br />
<br />
让gdm启用有两种方式,一种是直接加入到DAEMONS的末尾,通过rc.conf来启动;另外一种方式是用过配置inittab来加载gdm。<br />
<br />
* 通过inittab来加载gdm也很方便(推荐使用这种方式):<br />
nano /etc/inittab<br />
<br />
修改默认启动方式:<br />
<br />
将<br />
id:3:initdefault:<br />
改为<br />
id:5:initdefault:<br />
<br />
然后取消下面代码的注释:<br />
x:5:respawn:/usr/sbin/gdm -nodaemon<br />
<br />
{{Box Note|实际上,可以看到gdm/xdm/kdm/slim等,使用哪个取决于你的喜好,启用喜欢的那个,将其他的注释掉。当然,本章介绍的是gnome,所以推荐gdm,下章中将推荐kdm:)}}<br />
<br />
<br />
* 通过DAEMONS方式启动gdm也很方便:<br />
nano /etc/rc.conf<br />
<br />
DAEMONS=(syslog-ng network crond alsa hal gdm)<br />
<br />
{{Box Note|这是类似debian/ubuntu的做法,这种方式有一点不好:不管什么时候(非修复模式),系统总是会尝试进入gdm引导的X方式下。对于X已经配置得很好,并且不使用纯控制台的人可以使用这种方式。但是选择这种方式的话你将不能通过内核参数3或者5来区分进入纯字符控制台还是X11的gdm登录窗口。}}<br />
<br />
* 开启Gnome<br />
以普通用户身份启动X:<br />
startx<br />
或者这条命令也行:<br />
$ xinit<br />
如果你的 ~/.xinitrc一直没配置,那你将可以一直使用下面这条命令来开启Gnome:<br />
$ xinit /usr/bin/gnome-session<br />
<br />
关于安装和配置GNOME的高级指引可以参见[[GNOME (简体中文)|GNOME]]一文。接下来你可以浏览'''[[#优化和收尾|优化和收尾]]'''。或许你还会对[[ArchTips(简体中文)|Arch安装完后的小技巧]]一文感兴趣。<br />
<br />
=====美化=====<br />
如果不满足于缺省的GNOME主题和图标,那么可以安装一个不错的主题,比如murrine:<br />
pacman -S gtk-engine-murrine<br />
接着在System->Preferences->Theme里选择这个主题。<br />
<br />
Arch Linux也做了些不错的主题,根据你自己的审美观,选择满意的安装吧:<br />
<br />
# pacman -S gtk-engines gtk2-themes-collection gtk-aurora-engine gtk-candido-engine gtk-rezlooks-engine<br />
<br />
你还可以在[http://www.gnome-look.org Gnome Look]里找到更多的主题、图标和壁纸。<br />
<br />
====KDE====<br />
=====关于KDE=====<br />
KDE桌面环境('''K''' '''D'''esktop '''E'''nvironment)的缩写。 KDE是一种著名的运行于GNU/Linux 、 <code>UNIX</code> 工作站等的强大、自由图形工作环境。她拥有对系统内部各功能的强大整合能力、跨平台能力、易用性、优异的初始界面.<br />
<br />
=====安装=====<br />
Arch提供多个版本的kde: '''kde、kdebase 和 KDEmod'''. 选'''一个'''就行了,然后 '''[[#有用的KDE守护进程|有用的KDE守护进程]]''': <br />
<br />
'''1.)''' '''kde'''是完整的kde软件包,大概 ~300MB,适合主要使用kde软件的系统.<br />
pacman -S kde<br />
'''2.)''' '''kdebase'''是kde的基础软件包(里面没有kdm),大概 ~80MB,适合于只想把kde作为基础系统.<br />
pacman -S kdebase<br />
'''3.)''' '''KDEmod''' 是 Arch Linux独有的、社区驱动的项目,目标是把kde更加细致的模块化和达到其极致的运行效率。KDEmod项目的网站在http://chakra-project.org/ 。<br />
<br />
=====有用的KDE守护进程=====<br />
<br />
KDE 需要'''hal''' ('''H'''ardware '''A'''bstraction '''L'''ayer) 作为守护进程(daemons). '''kdm''' ( '''K''' '''D'''isplay '''M'''anager), 提供一个 '''图形化登录界面'''.<br />
{{Box Note|hal守护进程将自动开启dbus守护进程。kde4里已经不需要fam。kdm现在在kdebase-workstation这个包里,如果只安装kdebase,需要再安装此包才能使用kdm}}<br />
<br />
hal 服务配合其他软件, 能自动挂接热插拔硬盘, 光驱, USB drives/thumbdrives for use in the GUI. <br />
<br />
-----<br />
启动hal进程:<br />
<br />
/etc/rc.d/hal start<br />
<br />
编辑/etc/rc.conf的 DAEMONS部分:<br />
nano /etc/rc.conf<br />
把 '''hal''' 加入 DAEMONS 部分,以便他们在系统启动时加载. 如果想要kde的图形化登录界面,把 '''kdm'''也加进去(或者不加,在/etc/inittab里面设置): <br />
DAEMONS=(syslog-ng network crond alsa '''hal kdm''')<br />
{{Box Note|如果你安装的是KDEmod3,则使用kdm3替换kdm}}<br />
<br />
*这种方式能启动运行等级3, (/etc/inittab 默认多用户模式), 然后启动 KDM 进程来登录. <br />
<br />
*有些用户喜欢使用 /etc/inittab 方式来启动系统到运行等级5. 细节请参考 [[Adding a login manager (KDM, GDM, or XDM) to automatically boot on startup]].<br />
<br />
*如果你喜欢启动时进入命令行, 即运行等级3, 然后手动启动 X, 则不加入kdm, 或者是加个前缀( ! )禁止它。<br />
<br />
* 现在可以试试效果了,用普通用户身份开启X Server:<br />
startx<br />
或者<br />
$ xinit<br />
更多关于安装和配置KDE的文章,请看[[KDE]].<br />
<br />
到此步,可以看 '''[[#优化和收尾]]'''这部分了. 你可能想参考 [[Post Installation Tips]] wiki文章.<br />
<br />
====Xfce====<br />
=====关于Xfce=====<br />
和GNMOE、KDE一样,Xfce是一个桌面环境,其目标是快捷、轻量,同时又美观而易用。它还提供了一整套的应用程序如根窗口应用(root window app)、 窗口管理器、文件管理器、面板等等。 Xfce是用GTK2 toolkit编写的(类似GNOME),和其它大型桌面环境一样,它也有自己的开发环境(库文件、守护进程等)。但不象GNOME或者KDE,Xfce是轻量化的,其设计更接近于CDE而不是Windows或者Mac。它的开发周期比较慢,但是十分稳定、速度很快。在老硬件上Xfce可以运行得很好,而在新机器上更是运行如飞。<br />
<br />
=====安装=====<br />
安装完整的xfce环境以及主题和extras:<br />
pacman -S xfce4 xfce4-goodies gtk2-themes-collection <br />
<br />
如果你使用KDM或者GDM的话会显示一个xfce会话。另一种启动方式是:<br />
startxfce4<br />
<br />
关于安装和配置xfce的高级指引可以参见[[Xfce (简体中文)|Xfce]]一文。<br />
<br />
恭喜!欢迎来到Arch Linux系统的Xfce桌面环境!接下来你可以浏览'''[[#优化和收尾|优化和收尾]]''',或者下面的其它内容。或许你还会对[[ArchTips(简体中文)|Arch安装完后的小技巧]]一文感兴趣。<br />
<br />
====*box====<br />
=====Fluxbox=====<br />
Fluxbox © 是另一个流行的快速轻量级的 X 下的窗口管理器.<br />
它是在 Blackbox 0.61.1 的代码基础上开发的. Fluxbox 看上去很像 blackbox, 它的界面方案, 颜色, 窗口按钮等都跟blackbox相似 (界面方案100% 兼容).<br />
<br />
安装fluxbox:<br />
pacman -S fluxbox fluxconf<br />
<br />
如果你使用 gdm/kdm 登录管理器, fluxbox 会被添加到session选项列表. 或者你可以修改 .xinitrc 在最后一行加上:<br />
exec startfluxbox <br />
<br />
更多信息可参考 [[Fluxbox]].<br />
<br />
=====Openbox=====<br />
Openbox是一个标准的”温顺的“,快速的,轻量级的,可扩展的窗口管理器。<br />
<br />
Openbox与你的应用程序一起工作工作,并使你的的桌面便于管理。这是因为它的开发方式和通常的窗口管理器的方式是相悖的。 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.<br />
<br />
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. <br />
<br />
安装openbox<br />
pacman -S openbox obconf obmenu<br />
<br />
一旦openbox安装好,你将得到一个消息to move menu.xml & rc.xml to ~/.config/openbox/ in your home directory:<br />
<br />
mkdir -p ~/.config/openbox/<br />
cp /etc/xdg/openbox/rc.xml ~/.config/openbox/<br />
cp /etc/xdg/openbox/menu.xml ~/.config/openbox/<br />
<br />
In the file "rc.xml" you can change various settings for Openbox (or you can use OBconf). In "menu.xml" you can change your right-click menu.<br />
<br />
To be able to log into openbox you can either go via graphical login using KDM/GDM or startx, in which case you will need to edit your ~/.xinitrc (as user) and add the following:<br />
<br />
exec openbox<br />
<br />
For KDM there is nothing left to do; openbox is listed in the sessions menu in KDM.<br />
<br />
Useful programs for openbox are:<br />
* PyPanel or LXpanel if you want a panel<br />
* feh if you want to set the background<br />
* ROX if you want a simple file manager and desktop icons<br />
<br />
More information is available in the [[Openbox]] article.<br />
<br />
====fvwm2====<br />
FVWM是一个非常强大的面向X桌面系统的”ICCCM-compliant的多虚拟桌面的窗口管理器“(ICCCM-compliant multiple virtual desktop window manager)。开发活动很活跃,支持也是极好的。 <br />
<br />
输入下面命令安装 fvwm2 <br />
pacman -S fvwm <br />
<br />
fvwm会自动添加进 kdm/gdm会话列表. 如果没有的话,添加 <br />
exec fvwm <br />
<br />
到你的用户文件 .xinitrc.<br />
<br />
注意:这个稳定版已经有些年头了,如果需要最新的fvwm版本,可以安装unstable repo里的fvwm-devel 包.<br />
<br />
===四、优化和收尾===<br />
====HAL====<br />
如果你已经安装了一个桌面环境,但是又觉得用起来不是很方便,那么现在就是个安装HAL的好时机了。HAL使得你的手机、iPod、移动硬盘等等可以即插即用。它会挂载设备并在你的桌面或/和'My Computer'目录中创建相应的图标,使得你可以在插入设备后就能访问到它,无需每次都对每个新设备来手动配置/etc/fstab文件或者udev规则。<br />
<br />
KDE、GNOME和XFCE都使用到HAL。<br />
<br />
安装过程描述可以在[[HAL (简体中文)|HAL]]一文中找到。其它一些信息可以在[http://en.wikipedia.org/wiki/HAL_(software) Wikipedia]上找到。<br />
<br />
====启动时让守护进程在后台执行====<br />
<br />
要加速系统的启动过程,可以在/etc/rc.conf中给守护进程前加上'@'符号使之在后台执行,例如:<br />
<br />
DAEMONS=(@syslog-ng @network crond @alsa @hal @fam @kdm)<br />
这使得守护进程在后台被加载,无需等待它们加载结束。<br />
<br />
在守护进程前加上(!)可以禁止系统启动时加载它,例如:<br />
<br />
DAEMONS=(@syslog-ng @network !crond @alsa @hal @fam @kdm)<br />
<br />
另一种方式是直接将不需要的守护进程删除。<br />
<br />
====美化LCD下的字体====<br />
See [[Fonts]]<br />
<br />
====让所有的鼠标按键生效====<br />
看这个 [[Get All Mouse Buttons Working]]<br />
<br />
====笔记本电脑可能遇到的问题====<br />
(1) 触摸板问题<br />
参看http://wiki.archlinux.org/index.php/Touchpad_Synaptics<br />
<br />
(2) 摄像头问题<br />
参看http://wiki.archlinux.org/index.php/Webcam_Setup<br />
<br />
(3) 无线上网问题<br />
参看http://wiki.archlinux.org/index.php/Wireless<br />
<br />
(4) 快捷键问题<br />
参看http://wiki.archlinux.org/index.php/Extra_Keyboard_Keys<br />
<br />
====配置CPU频率====<br />
现在的处理器能够降低频率和电压,以降温和降低电源消耗。降温能使系统更稳定,笔记本用户肯定是想这样做的,但是即使是台式机也会对系统有利。<br />
<br />
安装CPU频率工具用:<br />
pacman -S cpufrequtils<br />
<br />
把CPU频率在/etc/rc.conf里加入到启动进程(daemons)中。编辑配置文件/etc/conf.d/cpufreq改<br />
governor="conservative"<br />
<br />
这使得在需要的情况下可以动态地增减CPU频率(这是对于台式机来说也是一个安全的选择)。改变最小频率(min_freq)和最大频率(max_freq)以匹配你的CPU的情况。如果你不知道频率,在载入频率测量模块后运行“cpufreq-info”。你也可以将min_freq和max_freq注释掉或删除,这样就能自动进行。加入频率测量模块到/etc/rc.conf的模块行。<br />
几乎所有的笔记本和台式机都可以简单地使用''acpi-cpufreq''驱动,但是也有其它的选择,如:''p4-clockmod, powernow-k6, powernow-k7, powernow-k8, and speedstep-centrino''。 <br />
<br />
通过下面这个命令载入这个模块:<br />
modprobe <modulname> <br />
通过下面命令行开启cpufreq:<br />
/etc/rc.d/cpufreq start<br />
更多细节,请看 [[Cpufrequtils]]<br />
<br />
==第五部分:常用的应用程序==<br />
更多信息,请看[[ArchLinux常用的应用程序(简体中文)]].<br />
<br />
==附录==<br />
新手指南附录[[ArchLinux新手指南附录 (简体中文)]]<br />
<br />
想得到更多的信息和支持,你可以去[http://www.archlinux.org/ homepage], [[Special:Search|search the wiki]],[http://bbs.archlinux.org/ forums],[[ArchChannel|IRC channel]],以及[http://www.archlinux.org/mailman/listinfo/ mailing lists]。<br />
=====问题答疑=====<br />
See [[Arch FAQs for newbies]]<br />
还有这里[http://bbs.archlinux.org/viewtopic.php?t=29055 Arch forum thread] 也是面向初学者的。<br />
<br />
=====术语=====<br />
更多信息关于Arch术语,查阅[[Arch Terminology/Jargon for newbies|this article]].<br />
<br />
=====接下来还有什么?=====<br />
<br />
你还可以阅读:<br />
<br />
[[Arch 官方安装指南 (简体中文)|Arch 官方安装指南]]<br />
<br />
[[Arch AUR (简体中文)|ArchLinux社区用户软件仓库 (AUR)]]<br />
<br />
[[Get All Mouse Buttons Working]]<br />
<br />
[[改善Pacman性能 (简体中文)|改善Pacman性能]]<br />
<br />
[[Kernel Compilation]]<br />
<br />
[[Pm-utils 电源管理 (简体中文)|Pm-utils 电源管理]]<br />
<br />
[[CPU 频率调节 (简体中文)|CPU 频率调节]]<br />
<br />
[[:Category:美化|美化]]</div>
Flydragon
https://wiki.archlinux.org/index.php?title=ArchLinux_%E6%96%B0%E6%89%8B%E6%8C%87%E5%8D%97_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=90861
ArchLinux 新手指南 (简体中文)
2010-01-04T11:16:40Z
<p>Flydragon: /* 有用的KDE守护进程 */</p>
<hr />
<div>[[Category:简体中文]]<br />
[[Category:获取并安装Arch (简体中文)]]<br />
[[Category:关于Arch_(简体中文)]]<br />
[[Category:HOWTOs (简体中文)]]<br />
<br />
{{Article summary start}}<br />
{{Article summary text|本文针对新手,提供了极其详尽的Archlinux的安装过程向导,和相关的简要说明。}}<br />
{{Article summary heading|已有的语言版本}}<br />
{{Article summary heading|Available Languages}}<br />
{{i18n_entry|Česky|Průvodce začátečníka (Česky)}}<br />
{{i18n_entry|简体中文|Arch 新手安装指南 (简体中文)}}<br />
{{i18n_entry|正體中文|Beginner's Guide 新手指南}}<br />
{{i18n_entry|Dansk|Dansk_Begynderguide}}<br />
{{i18n_entry|Deutsch|Beginners Guide (Deutsch)}}<br />
{{i18n_entry|English|Beginners Guide}}<br />
{{i18n_entry|Español|Guía para Principiantes (Español)}}<br />
{{i18n_entry|Français|Manuel_du_Débutant_(Français)}}<br />
{{i18n_entry|Italiano|Beginners Guide (Italiano)}}<br />
{{i18n_entry|Indonesia|Beginners_Guide_(Indonesia)}}<br />
{{i18n_entry|Lietuviškai|Pradedančiųjų gidas (Lietuviškai)}}<br />
{{i18n_entry|Nederlands|Beginners_Guide_(Nederlands)}}<br />
{{i18n_entry|Português Brasil|Guia do Iniciante(Português do Brasil)}}<br />
{{i18n_entry|Português|Guia para Principiantes(Português)}}<br />
{{i18n_entry|Русский|Руководство_для_новичков}}<br />
{{i18n_entry|Türkçe|Başlangıç Rehberi (Türkçe)}}<br />
{{i18n_entry|हिन्दी|नौसिखिया गाइड(हिन्दी)}}<br />
{{Article summary heading|相关文章}}<br />
{{Article summary wiki|Arch 官方安装指南 (简体中文)}}(更通用的安装方式)<br />
{{Article summary wiki|ArchLinux新手指南附录 (简体中文)}}<br />
{{Article summary wiki|ArchLinux安装完后的小技巧 (简体中文)}}<br />
{{Article summary wiki|ArchLinux常用的应用程序(简体中文)}}<br />
{{Article summary wiki|Work and Play with Arch (Chinese)}}<br />
{{Article summary end}}<br />
<br />
==前言==<br />
<br />
=====所有你一直想知道的关于安装Arch的事=====<br />
这篇文档将会指导你安装和配置[[ArchLinux (简体中文)|Arch Linux]] ── 一个简洁、轻量级的GNU/Linux发行版,一个类<code>UNIX</code>的操作系统。本文是面向Arch新用户,因此尽力为所有人提供强大的参考资料和信息。本指南讲述该如何获得一个基本配置好的Arch Linux系统(拥有一个图形桌面环境),但显然是不可能涵盖(甚至是预见)所有的信息。因此本指南会专注于某些关键性的步骤,想要进一步深入了解你可以查看[[Main Page (简体中文)|Arch Linux Wiki]]或者[http://bbs.archlinux.org/ Arch Linux论坛]。同时有兴趣的话你还可以了解一下[[Arch 之道 (简体中文)|Arch 之道]],它概述了Arch Linux发行版背后的哲学思想。<br />
<br />
'''Arch Linux的相关特性:'''<br />
* '''[[The Arch Way | Simple]]''' design and philosophy<br />
* Community distro targeted at competent GNU/Linux users<br />
* All packages compiled for '''i686/x86-64'''<br />
* 从底层开始就可以让用户高度定制<br />
* '''[[The Arch boot process | BSD-style init]]''' scripts, featuring one centralized configuration file<br />
* '''滚动升级''' <br />
* '''[[Pacman]]''' package manager is fast, written in '''C''', lightweight and agile, with a very modest memory footprint<br />
* '''[[ABS]]''': The '''A'''rch '''B'''uild '''S'''ystem, a ports-like package building system makes it simple to create your own easily installable Arch packages from source, to use and/or share with the community on the [[AUR]]<br />
* '''[[AUR]]''': The Arch User Repository, offering many thousands of build scripts for Arch user-provided software packages<br />
<br />
=====别怕(DON'T PANIC)!=====<br />
要知道Arch Linux的安装方法和过程也许会和你所使用过的其它GNU/Linux发行版非常不同,特别你是个新手的话将更能体会到这点。通常,GNU/Linux发行版会在一张或者一堆CD(甚至是DVD)上捆绑了大量的软件,包含了缺省桌面环境、缺省的应用程序和设置、硬件自动检测和图形化的安装程序,一切都是替你选择好了的。相反的,Arch Linux系统是让'''用户自己'''只是用一个bash shell和基本系统工具,从ncurses installer和基础系统上建造起来的。这就是[[Arch 之道 (简体中文)|Arch 之道]]。不象其它大型发行版,它没有强加于用户的缺省环境或者配置。你可以在命令行使用[[pacman (简体中文)|pacman]]通过互联网连接从Arch软件仓库安装软件包,直到你的系统配置成你希望的样子。这给予了用户最大的弹性、选择性和对系统资源的控制。因为是'''你'''建造了它,所以你肯定能了解系统里具体细节,知道底层都有些什么。<br />
<br />
Arch Linux系统是通过编辑文本文件进行配置的,没有提供图形界面的工具,所以需要对系统和linux相对熟悉。<br />
Arch Linux针对的是有能力的GNU/Linux用户以及希望花费时间学习系统知识的用户。 <br />
<br />
''Arch是一个可以被用户塑造的工具。''<br />
<br />
=====授权协议=====<br />
<br />
Arch Linux, pacman, documentation, and scripts are copyright<br />
©2002-2007 by Judd Vinet, ©2007-2008 by Aaron Griffin and are licensed under the GNU General Public License Version 2.<br />
<br />
=====[[Arch 之道 (简体中文)|Arch 之道]]=====<br />
<br />
''Arch的设计思想是"保持简洁"(keeping it simple)。'' <br />
<br />
这里的‘简洁’并不是单指‘简单’或者‘用户友好’,而是‘没有不必要的增加、修改或者复杂性’。简而言之,即优雅、极简之法。<br />
<br />
<br />
''"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 crap." -Aaron Griffin''<br />
<br />
<br />
''"The extraordinary part of [my method] lies in its simplicity..I have always believed that the simple way is the right way."'' - Bruce Lee<br />
“(我的方法中)最超凡的部分是它的简单性,我一直相信简单的就是对的。” 李小龙(Bruce Lee)<br />
<br />
Occam's razor: ''Entia non sunt multiplicanda praeter necessitatem'' or "Entities should not be multiplied unnecessarily." The term razor refers to the act of shaving away unnecessary assumptions and complications to get to the simplest explanation, method or theory.<br />
<br />
{{Box Note |'''仔细遵循本指南是成功安装一个配置正常的Arch Linux系统的基本要点,因此''请''认真仔细的阅读本文'''}}<br />
* 你也可以将本指南打印出来,作为一个较为有用的Arch Linux用户手册。<br />
*''如果你想在这个wiki里增加内容,请适当描述清楚“为什么会这样”以及“该怎么办”。最佳的文档应该能教会我们如何做和为什么这么做!''<br />
* Arch的wiki是项优秀的资源,可以[http://wiki.archlinux.org/index.php/Main_Page 第一时间]用来解决日常问题; 如果找不到答案也可以求助IRC和[http://bbs.archlinux.org/ 论坛]。<br />
----<br />
----<br />
欢迎使用Arch!现在,让我们开始吧。<br />
<br />
本文按照安装过程分四大部分:<br />
<br />
'''[[#第一部分:安装基本系统|第一部分:安装基本系统]]'''<br />
<br />
'''[[#第二部分:完成基本系统并升级|第二部分:完成基本系统并升级]]'''<br />
<br />
'''[[#第三部分:安装X并配置ALSA|第三部分:安装X并配置ALSA]]'''<br />
<br />
'''[[#第四部分:安装并配置桌面环境|第四部分:安装并配置桌面环境]]'''<br />
<br />
==第一部分:安装基本系统==<br />
===一、获取最新的系统安装包===<br />
<br />
你可以从[http://archlinux.org/download/ 这里]获取Arch最新的官方系统安装包。最新版本是2009.08<br />
<br />
*不论是Core还是Netinstall系统安装包,都只是包含了安装'''Arch Linux基本系统'''所需的软件包. ''注意,基本系统是不包含GUI图形界面的。它主要包含了GNU的系列工具(编译器、汇编程序、链接、库、脚本,还有其它的一些有用的工具),Linux的内核,还有一些额外的库和模块。<br />
*Core映像文件可以较方便的通过CD或者网络进行安装。<br />
*Netinstall映像文件较小巧,本身没有提供软件包,整个系统都是通过internet来获取的。<br />
*isolinux映像文件是给那些使用grub版本时发生问题的用户的。两者没有其它区别。<br />
*Arch64问答( http://wiki.archlinux.org/index.php/Arch64_问答_(简体中文) )可以帮助你在32位版本和64位版本之间作出选择。<br />
<br />
====CD 系统安装包====<br />
把下载的.iso映像文件刻录到CD上。开机时用CD启动,出现界面,跳到[[#二、启动Arch Linux系统安装程序| 二、启动Arch Linux系统安装程序]]<br />
{{Box Note| 通常为了刻录的稳定可靠(速率越低刻录质量越有保证),推荐刻录的最大速度不超过16倍速。有些用户推荐'''''速度为 4x 或者 2x.''''' 如果所刻录的CD有问题,可以尝试使用你系统所支持的最小速度方式刻录。 }}<br />
<br />
<br />
====USB安装方式====<br />
{{Warning|这样做会把USB盘里面原有的数据格式化。}}<br />
<br />
'''<code>UNIX</code> 方式:'''<br />
<br />
插入USB盘,找到其路径,用<code>/bin/dd</code>命令把.img映像文件写入USB(Linux下):<br />
<br />
dd if=archlinux-2009.08-''{core|netinstall}''-''{i686|x86_64}''.img of=/dev/sd''x''<br />
<br />
if= 后面是.img镜像文件的路径,of= 是你的USB路径. 要使用/dev/sd''x''而不是/dev/sd''x1''.(就是要使用整个分区而不是第一分区)<br />
<br />
'''检查镜像的完整性md5sum (可选):'''<br />
<br />
记下读入和写出的记录区数目,然后执行以下命令进行检查:<br />
dd if=/dev/sd''x'' count=''记录区数目'' status=noxfer | md5sum<br />
<br />
md5sum命令返回的值(这是你检查U盘上文件得到的)要与你下载的archlinux镜像文件的md5sum校验值相同;它们都应该和镜像站点的md5sum文件列表里相应的值相同。<br />
<br />
'''Windows方式:'''<br />
<br />
从https://launchpad.net/win32-image-writer/+download 下载Disk Imager。插入U盘,启动Disk Imager并选择映像文件,再选择U盘相应的磁盘驱动号,点击"write"即可。<br />
<br />
===二、启动Arch Linux系统安装程序===<br />
Usually, the first item is the preferred selection. However, choose Boot Archlive or Boot Archlive [legacy IDE] if you have trouble with libata/PATA, or have no SATA (Serial ATA) drives.<br />
<br />
Also, to change boot options, press '''e''' for editing the boot lines. Many users may wish to change the resolution of the framebuffer, for more readable console output. Append:<br />
插入刻录好的光盘CD或者USB盘,然后用它启动电脑。可能需要在BIOS里(通常是启动后在加电自检过程中按DEL、F1、F2、F11或者F12)改变一下启动顺序使得CD或者USB先被启动。<br />
<br />
{{Note|内存需求:<br />
* Core : 160 MB RAM x86_64/i686 (选择所有软件包,开启交换分区)<br />
* Netinstall : 160 MB RAM x86_64/i686 (选择所有软件包,开启交换分区)}}<br />
<br />
启动了Arch Linux光盘后,用上下箭头高亮菜单,按下回车键进行选择。<br />
<br />
通常,推荐选择第一项菜单。不过如果使用libata/PATA出现问题或者没有SATA (Serial ATA)驱动器,你也可以选择Boot Archlive或者Boot Archlive [legacy IDE] 。<br />
<br />
如果你需要改变启动参数,可以按‘e ’键来编辑启动行内容。 含多用户可能希望改变framebuffer分辨率以得到更好的终端显示。将<br />
vga=773<br />
加到kernel一行的后面,然后按<ENTER>,就可以得到1024x768的framebuffer。设置完毕后按'''b'''则使用相应的选择项进行启动。<br />
<br />
系统将会启动并提示登录,这时可以用'root'进行登录(不要加上单引号)。<br />
<br />
如果你的机器从live CD启动时发生错误或者一些其它'''硬件hardware'''错误,请参看[[Installation Troubleshooting]]。<br />
<br />
<br />
====登录并根据需要更换键盘映射表====<br />
如果你使用non-US键盘布局,可以用命令选择相应的键盘映射表。<br />
# km<br />
或者是是用loadkeys命令<br />
# loadkeys ''layout''<br />
(把''layout''替换成你需要的,比如 &quot;<code>fr</code>&quot; 或者 &quot;<code>be-latin1</code>&quot;)<br />
<br />
====边安装边查看安装指南====<br />
在刻录的livecd里面,已经包含了官方安装指南,在安装的时候可以边安装边查看,按组合键<ALT>+F2 切换到控制台vc/2(alt+f3,alt+f4……分别可以切换到对应的控制台vc/3,vc/4……以此类推),然后输入:<br />
<br />
# less /arch/docs/official_installation_guide_en<br />
<br />
按组合键<ALT>+F1回到控制台vc/1,继续安装系统。安装过程中可以随时切换回vc/2来查看安装指南。<br />
<code>less</code> 是个文本查看程序,位于<code>/usr/bin/less</code><br />
{{tip|请注意,官方指南仅涵盖基本系统的安装和配置过程。一旦安装完毕,强烈建议回到本wiki浏览更多安装后续已经相关问题。}}<br />
<br />
===三、开始安装===<br />
键入<br />
/arch/setup <br />
开始安装。<br />
<br />
====1、选择安装来源====<br />
接着会出现一个选择安装来源的提示。如果你用core ISO的话请选择CD,如果使用FTP ISO的话则选择FTP。<br />
* 如果选择 CORE installer,可以直接看下面的硬盘分区配置。<br />
* FTP/HTTP only: 选择这个需要预先加载网络驱动以便联网安装. 使用Udev来加载这些模块非常有效.<br />
按组合键ALT+F3切换到控制台vc/3,确认一下看其是否生效 invoking ifconfig -a . (Select OK to continue.) ——把后面的网络配置提前看<br />
<br />
====2、设置时间====<br />
有两个选择:<br />
* UTC - 如果使用unix系统包括Linux, Freebsd等, 建议使用UTC<br />
* local - 如果和Windows共享多引导系统, 建议使用local<br />
<br />
====3、硬盘分区配置====<br />
选择第一个菜单项"Prepare Hard Drive"。请注意,"Auto-Prepare"(自动分区)并不是最佳的选择,因为它只分配了最基本的三个区( /,/home,swap)<br />
在这里我们用手工进行硬盘分区。选择"2. Partition Hard Drives",接着选要分区的硬盘(比如:/dev/sdx),然后按你需要编辑分区表。<br />
<br />
''Arch Linux安装程序使用cfdisk公用程序来对硬盘进行分区。''<br />
<br />
''接下来,熟悉GNU/Linux的用户可以跳过这段内容直接到下面'''[[#选择软件包|选择软件包]]'''。''<br />
<br />
=====分区信息=====<br />
<br />
对磁盘进行分区是指在磁盘上定义若干区域(分区),每个都象是一个独立的磁盘,可以在其上创建(格式化)一个文件系统。 分区的类型分为主分区(Primary)、扩展分区(Extended)和逻辑分区(Logical)三类。 <br />
<br />
主分区可以被启动,一个物理磁盘最多能有4个主分区。要使用超过4个的话,只能使用一个包含了逻辑分区的扩展分区。<br />
(译者注:为避免误解,较易懂的解释应该是:一个磁盘不算逻辑分区最多只能有4个分区,这4个要么全是主分区,要么就是3个主分区+1个扩展分区,当然你将整个磁盘划为1个主分区也是没问题的,只要不超过4个分区即可)<br />
<br />
扩展分区通常不会被直接使用,它是作为逻辑分区的“容器”存在。一个硬盘只能有一个扩展分区,可以在里面继续再划分逻辑分区。<br />
<br />
当对一个磁盘进行分区时,是按这种数字顺序命名:主分区为sda1-3,跟着是扩展分区sda4(译者注:在/dev和fdisk -l里是看不到这个sda4的),在扩展分区中划分出来的逻辑分区分别是sda5、sda6,如此类推。<br />
<br />
=====交换分区swap=====<br />
交换分区Swap是虚拟内存在硬盘上驻留的地方,内核可以用它来储存在物理内存中放不下的数据。<br />
<br />
过去,常用的规则是将交换分区大小设置为物理内存的两倍。但是随着时间推移,现在的计算机已经有更大的内存容量,这条规则已经不适用了。通常,512MB内存的计算机,两倍(1G)的还是够用的。而1G内存的计算机,一倍的也够用了。如果你有更大的内存(比如超过1GB),也许可以完全把交换分区忘了,不推荐这样做!<br />
* ''如果你打算使用休眠到磁盘的电源方案,你必须要有不小于内存容量大小的交换分区,有些用户甚至会推荐大于物理内存容量15%的大小。''<br />
<br />
=====规划分区=====<br />
磁盘分区的规划是十分个人的设置。每位用户的决策都会根据自己计算机的情况和需求而不同。至少需要有一个包含了根[http://en.wikipedia.org/wiki/File_system 文件系统] ( / )的主分区和一个交换分区。你还可以选择给/boot(主要用来存放内核文件)、/usr、/var和/home(用来存放用户个人数据)划出独立分区。一个较好的做法是给 / 和 /home都划分独立分区。这样的话,当你因为某些原因重装Arch Linux(或者其它发行版),你还可以保留你的个人数据例如音乐、图片、桌面环境配置等。<br />
<br />
在本案例中,我们划分一个分区给 /,一个给/home,另外还有一个交换分区。<br />
<br />
=====开始创建分区cfdisk=====<br />
让我们开始创建一个包含'''root'''(/)文件系统的主分区。 <br />
<br />
选择'''N'''ew -> Primary,然后输入你希望的分区大小(对一个完整的Linux系统,4到8G是个不错的选择)。分区要位于磁盘的开头部分。选择刚新建的分区,接着选择'''B'''ootable将它置为可启动。<br />
<br />
同时选择分区文件系统类型'''T'''ype,指定为'83 Linux'.。<br />
<br />
给你的/home目录创建另一个分区。选择另外一个主分区设成你想要的容量大小,这取决于你的用户会在他们的home目录里储存多少文件,其大小可能从几百M办公文档到上百G音频视频,所以这里我无法给出一个建议。如果你要使用磁盘所有的剩余空间,记得保给交换分区留一部分(例如1GB或1024MB)。<br />
<br />
同样的,选择'''T'''ype为'83 Linux'。 <br />
<br />
最后,我们给交换分区创建一个分区。选择一个介于512MB到1GB之间的大小并将'''T'''ype改为82 (Linux swap / Solaris)。<br />
<br />
现在的分区规划看起来应该象这样(基于你的选择大小也许会有所不同):<br />
<br />
Name Flags Part Type FS Type [Label] Size (MB)<br />
-------------------------------------------------------------------------<br />
sda1 Boot Primary Linux (4096 - 8192)<br />
sda2 Primary Linux (> 100)<br />
sda3 Primary Linux swap / Solaris (512 - 1024)<br />
<br />
选择'''W'''rite并输入''''yes''''。要注意如果你删除了分区的话,这个操作会破坏你磁盘上的数据。选择'''Q'''uit退出分区程序。<br />
选择Done离开此菜单,接着选择"Set Filesystem Mountpoints"。<br />
<br />
=====IDE设备,为什么看起来它们和SCSI设备一样?=====<br />
最新开发的Linux内核里包含了libata和PATA模块,所有的IDE、SATA和SCSI都采用sd''x''这种命名方式。这十分正常,无需担心。<br />
<br />
=====设置文件系统挂载点=====<br />
<br />
''' ”文件系统格式(filesystems)“和”文件系统结构(file systems)“的区别:'''<br />
<br />
从技术层面确切的说,'''文件系统格式(filesystems)'''是一种数据'''格式''',涉及信息吞吐,比如ext2;而”文件系统结构(file systems)“则是特定操作系统中文件和目录的布局,比如/home/username/games。因此,当你被问及是否创建'''文件系统格式(filesystems)'''时,是在问你是否要'''格式化'''该分区…但是当程序向你问及挂载点时,你应该给出的则是该分区应该出现在你的Arch Linux ”文件系统结构“中的位置。<br />
<br />
'''文件系统类型:'''<br />
<br />
'''强烈建议:'''创建一个交换分区(SWAP)。选择一个合适的分区(本例中使用的是sda3). 安装程序就会询问你是否要创建swap 文件系统; 选择 yes. 接下来, 选择根分区的挂载点(本例中就是 sda1). 然后安装程序就会询问你需要哪一种文件系统。<br />
<br />
{{Box Note| 采用何种文件系统的类型取决于实际应用需要,没有十全十美的文件系统,选择任何一个文件系统,都需要在数据安全和性能要求方面作出适当倾斜,下面只是简单的介绍各种Arch linux支持的文件系统 }}<br />
<br />
1. '''ext2''' - 古老、 可靠的 GNU/Linux 文件系统。非常的稳定,不过 ''不支持日志记录功能''。磁盘检测速度较慢,因而有些不便. ''ext2可以容易地转换成ext3''。一般认为/boot分区采用此系统最合适,因为/boot里的东西就开机的时候读取一次,而且很少有变动,不需要日志文件系统,如果采用日志文件系统,日志的体积很可能远远大于内核的大小。<br />
<br />
2. '''ext3''' - 基于ext2系统, 并添加了日志记录功能。 一般认为他比其他文件系统要 ''稍微的'' 慢一点, 不过 ''非常的'' 稳定并且使用最为广泛,由 GNU/Linux FS 负责维护和开发。<br />
<br />
'''高性能文件系统:'''<br />
<br />
3. '''ext4''' - 最近加入支持的文件系统,是ext2和ext3的后续发展版本,Ext4增加了48位块地址,最大支持1EB文件系统,和单个16TB的文件,增加子目录限制到64,000。新增了很多功能,提供在线碎片处理,速度比ext3快,系统开销比ext3小。<br />
{{Box Note| 由于此系统较新,目前仍存在一些问题,暂时建议/home分区不采用此文件系统,以保证个人数据安全。}}<br />
<br />
4. '''ReiserFS''' - Hans Reiser 主持编写的高性能的日志文件系统,使用一种非常独特有趣的数据存储检索方法。ReiserFS 效率非常高, 特别在处理很多小文件的时候更是如此。ReiserFS在挂载的时候相对比较慢. 性能稳定。 ReiserFS 现在的开发并不活跃(最新的版本是Reiser4).<br />
<br />
5. '''JFS''' - IBM提供的日志文件系统( '''J'''ournaled '''F'''ile'''S'''ystem首字母缩写). JFS 效率非常高并且CPU资源占用率比其他任何一个文件系统都要低。并且在挂载和磁盘检测的时候都非常快,在各方面的表现都非常突出,尤其是 conjunction with the deadline scheduler. (参见 [[JFS]].) 但是并不像ext或者ReiserFS那样应用广泛。<br />
<br />
6. '''XFS''' - 非常高效的日志文件系统,特别适合处理大文件。在处理小文件的时候稍慢。在挂载的时候也很快。由于 /var 需要处理很多的小文件,所以可能不太适合作为/var 分区的文件系统。 GNU/Linux 文件系统中,最先实现可用的在线碎片处理。应用不及ext和ReiserFS那么广泛。<br />
* JFS 和 XFS 不能被磁盘工具压缩(比如gparted 或者 parted magic)<br />
<br />
'''未来文件系统'''<br />
<br />
7、btrfs - 此文件系统尚未被Arch纳入正式支持。是Oracle提供的copy-on-write档案系统。目标在取代的ext3,提高ext3单一档案的大小,总档案系统大小或档案检查,加入目前ext3未支援的功能,比如:writable snapshots,snapshots of snapshots,内建磁盘阵列(RAID)支援,and subvolumes。<br />
<br />
最主要的差别在于[http://en.wikipedia.org/wiki/Journaling_file_system 日志系统] (一种类似的在数据库环境中记录着日志变更的东西). 除ext2之外,其他文件系统都支持日志记录功能. ext3 完全兼容 ext2,因此哪怕你可以用一个非常古老的CD来挂载他,也没问题。 根分区目前最安全的选择就是使用ext3文件系统。ReiserFS,XFS,和JFS也可以使用,因为GRUB (启动引导管理器,稍候在安装部分将会介绍到) 都可以从这些文件系统中启动。你可以通过选择‘’‘yes’‘’来创建文件系统(并格式化分区),接着你就会被提示添加附加分区。 在我们的例子中, 只有sda2了。 选择一个文件系统类型,并且把这个分区挂在到/home. 再次说明,创建文件系统并且选择Done。然后回到主菜单。<br />
<br />
====4、选择软件包====<br />
现在我们要选择安装哪些软件包到系统中。选择CD作为来源,如果你不止一个光驱的话还需要选择使用哪个的光驱。<br />
<br />
软件包选择分为两个阶段。首先要选择软件包分类,然后出现所选分类中软件包的详细列表供你微调。使用空格键进行选择和取消。<br />
<br />
''*BASE:包含最小的软件包集合,仅够构建一个可运行的系统骨架。''<br />
''*SUPPORT:供网络和文件系统用的额外软件包,例如gpm、fuse、dnsutils、无线驱动、ndiswrapper、ntfs-3g诸如此类。''<br />
''*DEVEL:软件创建工具,如GCC、autoconf、automake和make等等。''<br />
''*LIB:大量的库文件,如gmp、lebelf、libevent等等。''<br />
*''' 2008.06 版'''的软件包选择,只有一个: BASE ,选择之后进入其详细列表. <br />
<br />
在这里,我们对'Select all packages by default'选择'yes'。<br />
<br />
接下来屏幕将显示你所选的软件包。对于新手,较安全的做法是不修改它,而有经验的用户可能希望裁减掉一些不需要的软件包。(例如,不需要的文件系统类型公用程序,不需要的驱动等等。)<br />
<br />
====5、安装软件包====<br />
接着,选择'Install Packages'。你会被询问是否希望保留pacman缓冲里的软件包。如果你选'yes',日后你还可以选择对某些软件包进行降级,因此推荐保留(日后你还是可以清除这些缓存的)。安装脚本跟着就会安装所选软件包到你的系统中。这些软件包是二进制的、针对i686优化的,总共仅100MB,因此安装是相当便捷的。<br />
<br />
====6、配置系统====<br />
系统接着会询问你是否要选择[[Hwdetect|hwdetect]]来收集配置所需信息。新手应该选择是('yes')。<br />
<br />
如果是相当熟悉自己的硬件、所需模块,有能力从零开始手动配置/etc/mkinitcpio和/etc/fstab 的高级用户,可以选择否'no'。(当然,此选项是非常复杂的,已经超过本指南的范围,这里就不详细解释了。)<br />
<br />
接下来,系统会询问你是否需要支持从USB设备、FireWire设备、PCMCIA设备、NFS共享、软RAID阵列、LVM2卷和加密卷上启动。如果需要则选'yes',在本案例中以上都不选。<br />
<br />
新手还应该选择让/etc/mkinitcpio/kernel26-fallback.conf使用[[Hwdetect|hwdetect]]的结果,这将确保你的硬盘控制器相容次序。<br />
<br />
现在系统会询问你使用哪个文本编辑器;如果你不熟悉[http://en.wikipedia.org/wiki/Vim_%28text_editor%29 vi/vim]的话可以选择[http://en.wikipedia.org/wiki/Nano_%28text_editor%29 nano]。然后就会出现一个包含系统中大部分重要配置文件的菜单。如果你打算查找/etc/rc.conf中可用的选项,只需按Alt+F2切换到另外一个虚拟控制台进行查找,然后用Alt+F1切换回安装程序。<br />
<br />
======系统配置主文件'''/etc/rc.conf'''======<br />
Arch Linux继承FreeBSD的传统,使用'''/etc/rc.conf'''作为系统配置的主要文件。这个文件包含了广泛的配置信息,主要用于系统的启动。正如名字中所包含的意思,它还包含了供/etc/rc*文件使用的配置。/etc/rc.conf提供了一个Arch用户可以轻易访问到的,简洁而又范围广泛的精简系统资源配置方案。<br />
* '''LOCALIZATION'''部分<br />
** '''LOCALE'''=: 系统场所(locale)设置,被所有国际化(i18n-aware)的应用程序使用 。从命令行上运行locale可以列出可用的locale设置。此设置缺省是适合英文(US English)用户使用的en_US.utf8。(此处locale的设置必须与/etc/locale.gen一致,'''[[#/etc/locale.gen|详见下文]]'''。)中文一般是zh_CN.UTF-8,如果使用之后乱码,先换回en_US.utf8,等进图形界面后再换回来。<br />
** '''HARDWARECLOCK'''=: 指示开关机时进行同步的硬件时钟,是'''UTC'''时间(协调世界时(Universal Time Coordinated), 过去曾用格林威治平均时(GMT)来表示)还是'''localtime'''(本地时间)。通常UTC较为好,因为它大大简化了时区和日光节约时间(中国过去称为夏时制)的变更。而当你同时还有其它操作系统如windows进行双启动,就必须使用localtime(本地时间),它只把本地时间保存到硬件时钟里。<br />
** '''TIMEZONE'''=: 时区(TIMEZONE)。(所有可用的时区可在/usr/share/zoneinfo/里找到。)<br />
** '''KEYMAP'''=: 可用的键盘映射表可在/usr/share/kbd/keymaps里找到。请注意此设定仅在TTY中有效,在所有图形窗口管理器或者X中都不使用此设置!<br />
** '''CONSOLEFONT'''=: 如果你一定要修改此设置,可在/usr/share/kbd/consolefonts/中找到可用的字体。<br />
** '''CONSOLEMAP'''=: 定义了启动时setfont程序加载的控制台映射表。有需要的话,可在/usr/share/kbd/consoletrans里找到可用的映射表。<br />
** '''USECOLOR'''=: 如果你使用彩色显示器的话请选"yes"。<br />
<br />
LOCALE="zh_CN.UTF-8"<br />
HARDWARECLOCK="localtime"<br />
TIMEZONE="Asia/Shanghai"<br />
KEYMAP="us"<br />
CONSOLEFONT=<br />
CONSOLEMAP=<br />
USECOLOR="yes"<br />
* '''HARDWARE'''部分<br />
** '''MOD_AUTOLOAD'''=: 如果你使用'''udev'''在启动时探测硬件并加载相应模块。请设置为"yes",(适合缺省模块化的内核)。设置为"no"就得靠用户自己指定所需的有关信息。<br />
** '''MOD_BLACKLIST'''=: 模块黑名单。在下面的例子中,IPv6模块和pcspeaker都被列入黑名单而不被加载。<br />
** '''MODULES'''=: 指示了其它模块,如果你知道缺少哪个重要的模块可以加在里面。('''hwdetect'''应该已经填写了最重要的模块):<br />
# Scan hardware and load required modules at bootup<br />
MOD_AUTOLOAD="yes"<br />
# Module Blacklist - modules in this list will never be loaded by '''udev'''<br />
MOD_BLACKLIST=(net-pf-10 pcspkr)<br />
#<br />
MODULES=(e100 eepro100 mii slhc snd-ac97-codec snd-intel8x0 soundcore)<br />
* '''NETWORKING'''部分<br />
** '''HOSTNAME'''=:设置为你喜欢的主机名(HOSTNAME)。<br />
** '''lo'''=: 不修改此行。<br />
** '''eth0'''=: 如果使用'''静态IP'''的话请调整网络接口的IP地址、掩码和广播地址。如果使用'''DHCP'''的话则设为eth0="dhcp"。<br />
** '''INTERFACES'''=: 指定使用哪些网络接口。如果你不使用DHCP来配置设备,而是通过命令行用ifconfig手动配置设备的话,这里的变量值(名字必须等于打算进行配置的设备名一样)必须和ifconfig里加入的内容一样。<br />
** '''gateway'''=: 如果你使用'''静态IP''',将网关(gateway)地址设为路由器的IP。如果使用DHCP,则将此行用'#'注释掉。<br />
** '''ROUTES'''=: 如果你使用'''静态IP''',则将'gateway'前面的'!'去掉。如果使用'''DHCP'''的话则不需要修改此行。<br />
<br />
<br />
例如,当使用'''DHCP''':<br />
HOSTNAME="arch"<br />
lo="lo 127.0.0.1"<br />
#eth0="eth0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255" <br />
eth0="dhcp"<br />
INTERFACES=(lo eth0)<br />
#gateway="default gw 192.168.0.1"<br />
ROUTES=(!gateway)<br />
* '''DAEMONS'''部分<br />
这个序列罗列了位于/etc/rc.d/里需要在启动过程中启动的脚本名字。<br />
<br />
*如果脚本名字前有惊叹号(!),表示它不被执行。<br />
*如果脚本名字前有符号(@),则表示它会在后台被执行,启动序列不会等待此脚本成功执行完毕,而是继续执行下一个守护进程脚本。<br />
<br />
这种'BSD风格'的初始化就是Arch的处理办法,而其它发行版则是在一个init.d目录里使用一大堆符号链接(一个简单的文件 vs 一整个目录)。<br />
<br />
======关于守护进程======<br />
虽然此时你不需修改[[daemons]]行,不过还是有必要解释一下什么是守护进程,因为过一会儿在指南里我们会需要它。<br />
<br />
和Windows服务(service)类似,守护进程(daemon)是一个运行于后台的程序,等待事件发生并提供服务。一个较好的例子是webserver等待请求以发送页面,还有SSH服务等待用户登录。这些都是全功能的程序,还有些守护进程工作起来并不是那么明显的。例如向日志文件里写信息的守护进程(如syslog、metalog),当系统空闲时降低CPU频率的守护进程(如cpufreq),以及提供图形化登录的守护进程(如gdm、kdm)。所有这些程序都可以被加入到daemons行中,在系统启动时被执行。本指南会对一些较有用的守护进程进行介绍。<br />
按Ctrl+X退出nano编辑器。<br />
<br />
======磁盘和分区配置文件:/etc/fstab======<br />
'''fstab''' ('''f'''ile '''s'''ystems '''tab'''le的缩写) 是系统配置的一部分,该文件列出所有可用的磁盘和分区,并指明它们初始化的方式或整合至全局文件系统的方式。'''/etc/fstab'''文件一般被'''mount'''命令读取,以决定某一特定设备被挂载时所采用的选项。<br />
<br />
这是一个'''/etc/fstab'''的例子:<br />
<br />
#<br />
# /etc/fstab: static file system information<br />
#<br />
# <file system> <dir> <type> <options> <dump> <pass><br />
none /dev/pts devpts defaults 0 0<br />
none /dev/shm tmpfs defaults 0 0<br />
#/dev/cdrom /mnt/cdrom iso9660 ro,user,noauto,unhide 0 0<br />
#/dev/dvd /mnt/dvd udf ro,user,noauto,unhide 0 0<br />
#/dev/fd0 /mnt/fd0 vfat user,noauto 0 0<br />
/dev/sda1 / jfs defaults,noatime,nodiratime 0 1 <br />
/dev/sda2 /home jfs defaults,noatime,nodiratime 0 2<br />
/dev/sda3 swap swap defaults 0 0<br />
Hwdetect应该已经有效地配置了一个可用的'''fstab''',但最好还是简要地检查一下。<br />
<br />
*如果你打算用'''hal'''来自动挂载DVD之类的媒体,为了给即将安装的'''hal'''做准备,你可能要注释掉cdrom和dvd条目。 <br />
<br />
''在笔记本电脑和桌面系统上,可以给 / 和 /home加上'noatime'和'nodiratime'选项来提高速度、性能,同时还能省电。无论你采用何种文件系统,这样做都应该是安全的。''<br />
<br />
更多信息请参照[[Fstab]]<br />
<br />
======'''mkinitcpio.conf、modprobe.conf和kernel26-fallback.conf'''======<br />
此时我们无须去修改这些配置文件。'''mkinitcpio.conf'''负责配置ramdisk(例如从RAID、加密卷启动), '''modprobe.conf'''可以用来设置内核模块的的某些配置选项,而'''kernel26-fallback.conf'''则是initramfs后备配置。<br />
<br />
======(对于静态IP)网络配置文件:/etc/resolv.conf ======<br />
*''如果你使用DHCP,完全可以忽略此文件,缺省情况下dhcpd守护进程会自动创建和销毁此文件。''<br />
<br />
如果你使用静态IP,则可在/etc/resolv.conf里设置你的DNS服务器。每行的格式为nameserver <ip地址>,如果有多个DNS服务器则可以填入多行。<br />
<br />
如果你使用路由器,也许会希望由你的路由器本身指定DNS服务器,而在'''resolv.conf'''里只是写入你的路由器的IP(同时也是'''/etc/rc.conf'''里的网关),例如:<br />
nameserver 192.168.1.1<br />
可选的,逐个加入你的DNS服务器,例如:<br />
nameserver 4.2.2.1<br />
nameserver 4.2.2.2<br />
<br />
如果使用'''DHCP''',你也可以在你的路由器里指定你的DNS服务器,或者如果你的ISP支持的话由ISP自动指定。<br />
<br />
======/etc/hosts======<br />
可以在此文件中加入你想要的''hostname'',必须和/etc/rc.conf里的设置一致,因此它应该象这样:<br />
127.0.0.1 localhost.localdomain localhost '''''yourhostname'''''<br />
''为了程序的兼容性,必须严格遵照这个格式,'''包括'localhost' 这项'''!错误的句法可能会导致网络性能低下和/或某些程序运行缓慢甚至无法运行。这对新手来说是十分普遍的错误。''<br />
<br />
对于大部分用户,只要把''yourhostname''加入到行末就就可以了,不过有些用户推荐以下句法:<br />
127.0.0.1 '''''yourhostname'''''.domain.org localhost.localdomain localhost '''''yourhostname'''''<br />
如果你使用静态IP,可以用这种句法加入新行:<static-ip> hostname.domainname.org hostname,例如:<br />
192.168.1.100 '''''yourhostname'''''.domain.org '''''yourhostname'''''<br />
<br />
======/etc/hosts.deny和/etc/hosts.allow======<br />
如果你打算使用[[SSH|ssh]]的话,请根据自己的需要修改此配置。缺省设置是拒绝所有进入的连接,而不只是ssh连接。编辑'''/etc/hosts.allow '''文件加入:<br />
<br />
* 允许所有进入的ssh连接。<br />
sshd:all <br />
<br />
* 允许特定IP地址进入ssh连接。<br />
sshd: 192.168.0.1<br />
<br />
* 允许你指定的网段 (地址从 192.168.0.0 到 192.168.0.255)<br />
sshd: 192.168.0.<br />
<br />
* 允许某个IP地址范围<br />
sshd: 10.0.0.0/255.255.255.0<br />
<br />
如果你不打算使用[[SSH|ssh]],为安全起见请保持此文件的缺省设置(为空)。<br />
<br />
======/etc/locale.gen======<br />
<br />
'''locale-gen''' 命令从 '''/etc/locale.gen'''读取信息设定系统的locales. 这些设置稍后会被'''glibc''' 和其他一些支持本地化的程序或者库用于自动翻译输出各种语言的"独特" 文本, 并且合适的显示地域、货币、时区以及日期格式, 字符排列方式和其他一些本地化的特殊标准。设置默认本地化的功能是类<code>UNIX</code>操作系统的一大特质<br />
<br />
默认情况下 /etc/locale.gen 是一个仅包含注释文档的空文件.编辑后,这个文件将不会get touched again. 每次'''glibc'''更新之后'''locale-gen'''就会运行一次, 以在/etc/locale.gen重新生成所有的本地化设置.<br />
<br />
选定你需要的本地化类型(移除前面的#即可), 比如:<br />
en_US ISO-8859-1<br />
en_US.UTF-8 <br />
('''你这里的设置必须和上文中提到的/etc/rc.conf 的设置一致哦.''')<br />
<br />
现在,安装程序将运行locale-gen 脚本, 以生成你设定的locales。你以后可以通过修改文件/etc/locale.gen变更你的locale, 然后使用根用户(root)运行'locale-gen'脚本使之生效。<br />
<br />
''Note 如果你选择并设置了locale, 他将提示你 "The current locale is invalid..." 错误。可能是因为大多数新Arch用户都会犯的普遍的错误,也是在论坛中问得最多的问题。''<br />
<br />
======Root密码======<br />
最后,设置一个root密码并确定你已牢记它。返回主菜单然后接着安装启动加载器。<br />
<br />
======Pacman镜像======<br />
为'''pacman'''选择一个软件仓库镜像站。记住主站 archlinux.org 是有流量限制的,下载速度限于50KB/s.。<br />
<br />
在列表中仔细查看, 一般 xxx.cn 是中国镜像, xxx.au 是澳大利亚, 等等...<br />
<br />
*''如果你不熟悉现有的镜像和它们所处的位置,那就随便选一个。稍后你可以编辑 "/etc/pacman.d/mirrorlist", 或运行本指南后面提到的'''rankmirrors'''脚本,它将自动配置最接近你的镜像。''<br />
<br />
返回主菜单。<br />
<br />
====7、安装启动加载器====<br />
因为本案例中没有第二个操作系统,因此我们需要安装一个启动加载器。推荐选择[http://www.gnu.org/software/grub/ GNU GRUB]作为启动加载器。另外一种选择是[http://lilo.go.dyndns.org/ LILO]。缺省的'''GRUB'''配置('''/boot/grub/menu.lst''')应该足够了。唯一你可能想修改的是控制台的分辨率。将vga=<number>加入到第一个kernel行。(menu.lst中已列出一张分辨率和数字的对应表格可供查找。)<br />
title Arch Linux (Main)<br />
root (hd0,0)<br />
kernel /boot/vmlinuz26 root=/dev/sda1 ro vga=773<br />
initrd /boot/kernel26.img<br />
参数"vga=773"表示1024x768分辨率、256色的framebuffer。<br />
<br />
将'''GRUB'''启动加载器安装到主引导区(本例中为sda)。<br />
<br />
====8、系统重启====<br />
退出安装程序。<br />
*建议:为了方便接下来更进一步的安装配置,可以把光盘里的新手指南复制一份到电脑里,这样后面的安装就能查看相应的向导了<br />
<br />
cp /arch/beginnersguide.txt /mnt/home/beginnersguide.txt<br />
<br />
系统重启之后,进入控制台,可以使用下面命令查看这新手指南<br />
less /home/beginnersguide.txt<br />
所有安装完毕之后,可以删了这指南<br />
rm /home/beginnersguide.txt<br />
<br />
输入命令下面命令,重启:<br />
<br />
reboot<br />
<br />
一个新Arch Linux系统就会启动并进入登录提示符(你可能需要在'''BIOS'''将启动顺序改为优先从硬盘启动)。<br />
<br />
'''祝贺你,一个崭新的Arch Linux基础系统闪亮登场了!'''<br />
<br />
==第二部分:完成基本系统并升级==<br />
你的新Arch Linux基础系统现在已是一个功能完整的GNU/Linux环境了,随时可以进行定制。从现在开始,你可以按自己的意图和需求改造它。由于arch是滚动发布的,所以安装包不一定是最新的系统,所以我们在安装完成之后,需要立即更新系统。<br />
<br />
让我们开始吧。<br />
-----<br />
登录入你的root账号。我们将以root身份配置pacman和更新系统,然后创建一个普通用户账号。<br />
<br />
===一、配置网络(如果有需要)===<br />
*''如果安装脚本的自动配置不适合你,本段内容将帮助你配置大部分类型的网络。''<br />
-----<br />
如果一切正常的话,你的网络应该可以正常使用了。先ping www.google.com验证一下:<br />
ping -c 3 www.google.com<br />
<br />
''如果你已经成功建立网络连接,则跳到下面阅读[[#使用pacman更新、同步、升级系统|使用pacman更新、同步、升级系统]]'''。''<br />
<br />
如果ping www.google.com后得到"unknown host"的错误,可以认为你的网络尚未正确配置。你需要重新检查以下内容的完整性和正确性:<br />
'''/etc/rc.conf''' # 特别留意HOSTNAME= 和 NETWORKING 部分有无输入错误。<br />
<br />
'''/etc/hosts''' # 复核一下格式。(看之前的内容。)<br />
<br />
'''/etc/resolv.conf''' # 当你使用静态IP时需要检查。如果你使用DHCP,缺省这个文件会被自动创建和销毁,不过也可以改为你需要的内容。(参见[[Network]]。)<br />
<br />
高级的网络配置方法可以在[[Network]]一文中找到。<br />
<br />
=====有线网络=====<br />
<br />
用以下命令检查网络<br />
ifconfig<br />
你应该看到eth0这一项。如果有需要,你可以这样设置一个新的静态IP:<br />
ifconfig eth0 <ip address> netmask <netmask> up <br />
并且这样设置缺省网关:<br />
route add default gw <ip address of the gateway><br />
查看一下/etc/resolv.conf是否包含你的DNS服务器,不过缺失了则补填进去。<br />
再次用ping www.google.cn检查一下网络。如果一切正常,将/etc/rc.conf调整为刚才新设置的静态IP。如果你的网络使用DHCP服务器/路由器的话,输入:<br />
dhcpcd eth0<br />
如果这样可行的话,则将/etc/rc.conf按之前所述方法调整为动态IP。<br />
<br />
=====无线网络=====<br />
详见安装指南:[[无线设置 (简体中文)|无线设置]]<br />
<br />
=====模拟信号调制解调器=====<br />
<br />
如果你想使用外接电话线调制解调器, 你至少要安装ppp包. 根据需要修改配置文件 /etc/ppp/options 你可以参考 man pppd 的帮助.<br />
<br />
你还需要定制一个 chat 协议脚本, 在初始化握手连接建立以后, 提供你的ISP用户名和密码. 命令pppd 和 chat 的帮助里有例子不管你是菜鸟还是高手都应该能搞定连接了.<br />
使用 udev 的话, 串口设备一般是 /dev/tts/0 和 /dev/tts/1.<br />
<br />
Tip: Read [[Dialup without a dialer HOWTO]].<br />
<br />
如果你不想为了 pppd 拔光自己的头发, 你可能会选择安装 wvdial 或类似的配置工具来简化这个过程.<br />
如果你的猫是所谓的 WinModem, 也就是内置 PCI modem 卡, 你可以在这个网址找到大量信息: [http://www.linmodems.org/ LinModem]<br />
<br />
=====ISDN=====<br />
<br />
通过三步,完成 ISDN 的安装和配置:<br />
# 安装配置固件Install and configure hardware<br />
# 安装配置ISDN 管理工具<br />
# 添加ISP信息<br />
<br />
现在的 Arch stock kernels 已经包含了ISDN 所需要的modules, 所以不需要重新去编译内核,除非 you're about to use rather odd ISDN hardware. 把ISDN卡插入电脑或者插入USB ISDN-Box之后,you can try loading the modules with modprobe. 绝大部分的ISDN PCI 卡都能被module hisax处理,只需要两个参数:类型和协议。 如果使用的是1TR6标准,则协议设定为 '1' ,如果使用的是EuroISDN (EDSS1),协议设定为 '2', '3' if you're hooked to a so-called leased-line without D-channel, 如果使用的是US NI1,则设为'4'.<br />
<br />
所有配置细节都可以在kernel documentation, more specifically in the isdn subdirectory, and available online中获知。 类型的参数是根据电视卡来设定的,在README.HiSax kernel documentation中,有一个可能类型的列表。 用相应的参数加载moduleChoose,比如这个:<br />
<br />
modprobe hisax type=18 protocol=2<br />
<br />
这个将加载适用于电视卡类型为ELSA Quickstep 1000PCI,德国使用的EDSS1协议的模块hisax。可以在日志文件/var/log/everything.log中查看是否模块被预加载。额外的USB ISDN Adapter需要加载些USB模块才能正常工作。<br />
<br />
通过上述设定之后,如果电视卡能正常工作,那么把下面模块和参数加入/etc/modprobe.conf中:<br />
<br />
alias ippp0 hisax<br />
options hisax type=18 protocol=2<br />
<br />
这么做的好处是,这些模块在不使用时不会被加载。另外的方法是可以在这只加参数,把hisax加入/etc/rc.conf里面的MODULES,这样做的坏处就是不管这些模块是不是在使用,都加载了。 <br />
<br />
完成上述步骤之后,需要安装管理工具<br />
<br />
安装软件包isdn4k-utils,阅读关于isdnctrl的说明手册。在说明手册里,将有详细的说明:如何创建一个配置文件that can be parsed by isdnctrl,安装实例。 Please note that you have to add your SPID to your MSN setting separated by a colon if you use US NI1.<br />
<br />
使用isdnctrl utility配置ISDN卡之后,将可以拨号到你设定的PHONE_OUT参数的机器上,但提示用户名和密码错误。把用户名和密码加入到/etc/ppp/pap-secrets或者/etc/ppp/chap-secrets,这个主要根据的是你的ISP使用的协议授权方式,as if you were configuring a normal analogous PPP link。如果无法确定,可以两个文件都加。<br />
<br />
完成上述设定之后,用root帐号建立一个拨号连接:<br />
isdnctrl dial ippp0<br />
有啥问题,请检查日志文件!<br />
<br />
=====DSL (PPPoE)=====<br />
<br />
仅当需要你的计算机去主动拨号连接ISP的情况下才需参考本段内容。如果你使用独立的路由器来负责这类工作,你只需要设置一个缺省网关即可。<br />
<br />
在使用DSL连接前,你得先在计算机里安装一个连接到DSL-Modem的网卡。将你新装网卡加入到modules.conf/modprobe.conf或者MODULES列表之后,安装rp-pppoe软件包并运行pppoe-setup脚本来配置你的连接。当你输入完有关信息后,可以分别通过以下命令来进行连接和挂断:<br />
<br />
/etc/rc.d/adsl start<br />
<br />
和<br />
<br />
/etc/rc.d/adsl stop<br />
<br />
setup过程一般都是很容易、直观的,如果还有不懂可以阅读man手册。如果你想在启动时自动拨号,可以将adsl加入到DAEMONS列表中。<br />
<br />
<br />
===二、更新Pacman===<br />
<br />
====pacman是什么?====<br />
[[Pacman]]是Arch Linux的软件包管理器('''pac'''kage '''man'''ager)。Pacman是用C语言编写的,速度快,使用简便,功能强大。它可以管理整个软件包系统,负责软件包的安装、删除、降级(通过缓存),也支持自编译的软件包,自动分析依赖关系,可以搜索远程和本地软件仓库,还有大量其它功能。这里我们将用pacman来从远程软件仓库下载软件包并安装到系统中。<br />
<br />
对系统进行定制,pacman是Arch Linux最重要工具。<br />
<br />
====1、配置pacman====<br />
=====pacman总配置文件/etc/pacman.conf=====<br />
Arch通过pacman可以获得对下面 4软件仓库的管理:<br />
<br />
'''[core]'''<br />
<br />
[core](“核心”)仓库的简单原则是只提供一个基本的Arch Linux的基本工具:GNU系列工具,Linux内核,一个文字编辑器,一个命令行浏览器等(这里也有一些例外。比如说,vi和nano是同时提供的,允许用户选择一个或两个)。它包含所有使你的系统正常运转的“必须”安装的包,只有它们完美地工作,你的系统才能继续运行。这些是绝对“system-critical”(对系统来说至关重要)的包。由开发者负责维护。<br />
<br />
*''Core安装媒介(The Core installation media)简单地包含一个安装脚本,一个当前发布版本的核心仓库的快照(snapshot)。''<br />
<br />
'''[extra]'''<br />
<br />
[extra](“额外的”)仓库包含所有的对于一个基本的Arch系统不是必须,但是对于构建一个完整的系统环境有用的的Arch包。 比如'''X''', KDE和Apache,都可以在这里面找到。它也是由开发者维护的。<br />
<br />
'''[testing]'''<br />
<br />
[testing](“测试”)仓库包含的包是[core]和[extra]仓库的候选者。<br />
下面情况下,新的软件包将进入[testing]软件仓库:<br />
* 可能会导致系统出问题的升级,需要测试。<br />
* 需要重新打包其他软件包。这种情况下,所有需要重新打包的软件包将被放在[testing]仓库,直到所有重新打包完成,这些软件包才回归原有的软件仓库。 <br />
<br />
开发者维护。<br />
<br />
[testing]是唯一的一个在名义上与其它官方仓库有冲突的仓库。(that can have name collisions with any of the other official repositories. )<br />
<br />
<font color=&quot;blue&quot;>*如果开启, [testing]必须放在''pacman.conf''的软件仓库的第一个。</font><br />
<br />
<font color=&quot;red&quot;>'''警告''': '''''开启[testing]软件仓库,容易导致系统崩溃,因此只建议有经验的用户开启。'''''</font><br />
<br />
'''[community]'''<br />
<br />
[community](“社区”)仓库是由“信任用户”(''Trusted Users (TUs)'')维护的,是''Arch User Repository ([[AUR]])''(Arch用户仓库)的一部分。它包含的是二进制的包,在用户仓库中有足够的“票数”,并由''信任用戶''挑选出来的。像其它上面列出的仓库一样,[community] 可以用pacman获取。<br />
<br />
'''[[AUR]]''' 也包含'''unsupported''' 分支,这不能直接通过pacman获取。*. [unsupported] 包含多达海量PKGBUILD脚本,用来从源代码编译。这从其它仓库中是不能使用的。 <br />
<br />
<nowiki>*</nowiki> '''''[[AUR Helpers]]''''' 能帮助你无缝地使用AUR。<br />
<br />
'''/etc/pacman.conf'''<br />
<br />
每次调用pacman,它都会读取/etc/pacman.conf文件。这个配置文件分若干段,每一段定义了一个pacman用来搜索软件的仓库。唯一例外的是options段,它定义了全局选项。<br />
nano /etc/pacman.conf<br />
范例:<br />
#<br />
# /etc/pacman.conf<br />
#<br />
# See the pacman.conf(5) manpage for option and repository directives<br />
<br />
#<br />
# GENERAL OPTIONS<br />
#<br />
[options]<br />
# The following paths are commented out with their default values listed.<br />
# If you wish to use different paths, uncomment and update the paths.<br />
#RootDir = /<br />
#DBPath = /var/lib/pacman/<br />
#CacheDir = /var/cache/pacman/pkg/<br />
#LogFile = /var/log/pacman.log<br />
HoldPkg = pacman glibc<br />
# If upgrades are available for these packages they will be asked for first<br />
SyncFirst = pacman<br />
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u<br />
#XferCommand = /usr/bin/curl %u > %o<br />
<br />
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup<br />
#IgnorePkg =<br />
#IgnoreGroup =<br />
<br />
#NoUpgrade =<br />
#NoExtract =<br />
<br />
# Misc options (all disabled by default)<br />
#NoPassiveFtp<br />
#UseSyslog<br />
#ShowSize<br />
#UseDelta<br />
#TotalDownload<br />
#<br />
# REPOSITORIES<br />
# - can be defined here or included from another file<br />
# - pacman will search repositories in the order defined here<br />
# - local/custom mirrors can be added here or in separate files<br />
# - repositories listed first will take precedence when packages<br />
# have identical names, regardless of version number<br />
# - URLs will have $repo replaced by the name of the current repo<br />
#<br />
# Repository entries are of the format:<br />
# [repo-name]<br />
# Server = ServerName<br />
# Include = IncludePath<br />
#<br />
# The header [repo-name] is crucial - it must be present and<br />
# uncommented to enable the repo.<br />
# <br />
<br />
# Testing is disabled by default. To enable, uncomment the following<br />
# two lines. You can add preferred servers immediately after the header,<br />
# and they will be used before the default mirrors.<br />
#[testing]<br />
#Include = /etc/pacman.d/mirrorlist<br />
<br />
[core]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
[extra]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist <br />
<br />
[community]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
# An example of a custom package repository. See the pacman manpage for<br />
# tips on creating your own repositories.<br />
#[custom]<br />
#Server = file:///home/custompkgs<br />
要开启一个软件仓库,只需要将'Include ='和'[repository]'行前的注释符号(#)去除。<br />
<br />
*"Server ="行如果取消注释,将会强制此服务器被首先搜索,详细的仓库配置位于/etc/pacman.d/下。<br />
* 注意:选择仓库时,请确认将仓库名和'Include ='行都一同取消注释。没有这样做的话会导致你选择的仓库被忽略!这是个很普遍的错误。<br />
<br />
=====(如果有必要)配置镜像列表 /etc/pacman.d/mirrorlist=====<br />
更快的镜像能显著改善pacman的性能和你对Arch Linux的总体体验。<br />
<br />
*手动编辑/etc/pacman.d/mirrorlist:<br />
nano /etc/pacman.d/mirrorlist<br />
删除所有不在你所在洲或者太远的镜像。(在nano里你可以用CTRL-K删除每个不需要的行。)保存文件并退出。<br />
<br />
*'''rankmirrors'''脚本可以根据镜像的响应延迟对其自动排名。'''Rankmirrors'''是python脚本,需要安装python:<br />
<br />
pacman -S python<br />
<br />
然后,运行'''rankmirrors'''脚本按响应延迟顺序对镜像进行排名:<br />
rankmirrors -v /etc/pacman.d/mirrorlist<br />
输出会列出所有镜像和它们的响应延迟(ping),例如:<br />
<br />
# United States<br />
# http://mirrors.easynews.com/linux/archlinux/$repo/os/i686 ... 0.96<br />
# ftp://ftp.nethat.com/pub/linux/archlinux/$repo/os/i686 ... unreachable<br />
# ftp://locke.suu.edu/linux/dist/archlinux/$repo/os/i686 ... 2.43<br />
# ftp://mirrors.unixheads.org/archlinux/$repo/os/i686 ... 1.96<br />
<br />
脚本将从低到高的响应延迟顺序显示:<br />
Server = http://mirrors.easynews.com/linux/archlinux/$repo/os/i686<br />
Server = ftp://mirrors.unixheads.org/archlinux/$repo/os/i686<br />
Server = ftp://locke.suu.edu/linux/dist/archlinux/$repo/os/i686<br />
Server = ftp://ftp.nethat.com/pub/linux/archlinux/$repo/os/i686<br />
<br />
要注意的是这个结果对于镜像排列并非很精确,最接近你的镜像或者延迟最低的镜像并不一定是最佳选择。(反应迅速但是内容过时的镜像、或者低延迟但是窄带宽的镜像对你毫无用处)。<br />
<br />
编辑/etc/pacman.d/mirrorlist,将最佳的镜像置于在列表顶端。为了体验多个镜像你可能要不断修改此配置文件,请精明地选择。<br />
<br />
====常用的命令====<br />
<br />
与远程软件仓库同步和更新本地包数据库 (推荐在安装和更新包之前这样做):<br />
pacman -Sy<br />
<br />
'''升级'''系统中所有的包:<br />
pacman -Su<br />
<br />
一条同步、更新、'''升级''' 所有系统中的包的命令:<br />
pacman -Syu<br />
<br />
安装或者升级单个软件包或者一串包(包括其依赖包):<br />
pacman -S packageA packageB<br />
<br />
同步、更新数据库并安装软件包:<br />
pacman -Sy packageA packageB<br />
<br />
移除软件包, 但保留依赖的包:<br />
pacman -R package<br />
<br />
移除单个包,并且移除没有被别的软件依赖的依赖包:<br />
pacman -Rs package<br />
<br />
移除包所有不需要的依赖包并删除其配置文件:<br />
pacman -Rsn package<br />
<br />
通过给定关键词(列表)搜索远程软件仓库数据库(repo):<br />
pacman -Ss keyword<br />
<br />
列出系统中所有的包<br />
pacman -Q<br />
<br />
在本地包数据库搜索 (查询)指定软件包:<br />
pacman -Q package <br />
<br />
在本地包数据库搜索 (查询)指定软件包并列出相关信息:<br />
pacman -Qi package<br />
<br />
To defragment pacman的数据库缓存和速度优化选项:<br />
pacman-optimize<br />
<br />
统计当前系统中的包数量:<br />
pacman -Q | wc -l<br />
<br />
使用ABS和makepkg从源代码编译安装包:<br />
pacman -U packagename.pkg.tar.gz<br />
<br />
Note: pacman有很多很多的选项和功能组合。你可以试试man pacman或者查阅lt the [[pacman]]维基条目<br />
<br />
====软件包管理增强工具====<br />
* Yaourt 可查询aur的pacman增强工具<br />
* Tupac 快速查询的yaourt增强工具<br />
* Powerpill 多进程下载的pacman增强工具<br />
{{Box Note| 强烈建议更新系统完毕后,安装yaourt和powerpill,以便更充分享受Arch Linux的方便和强大。}}<br />
在/etc/pacman.conf文件里,最后添加两行(如果是i686的话,把x86_64换成i686即可):<br />
[archlinuxfr]<br />
Server = http://repo.archlinux.fr/x86_64<br />
然后使用pacman安装yaourt<br />
pacman -Sy yaourt<br />
<br />
以后就可以使用yaourt命令来查找并安装包括[[AUR]]里的软件了。比如bcm无线网卡,需要安装b43-firmware(此软件包在[[AUR]]仓库里,使用pacman无法查找到),使用yaourt命令查找并安装:<br />
yaourt b43-firmware<br />
找到之后,根据相应提示,一直到安装完成。<br />
<br />
====图形化管理工具====<br />
* qt界面的shaman:比较成熟的pacman 图形化管理工具<br />
* gtk界面的gtkpacman :目前BUG比较多,不稳定。<br />
<br />
====Pacman的更多信息====<br />
用此命令查看pacman手册:<br />
man pacman<br />
有空的话可以看看[[pacman (简体中文)]]维基条目。<br />
<br />
====2、更新Pacman自己====<br />
<br />
一开始,系统可能会提示你先更新pacman自身,这取决于Arch安装包的新旧程度:<br />
pacman -Sy pacman<br />
pacman开始查看是否需要更新,如果有提示需要更新,则按‘y’,开始pacman更新。<br />
<br />
'''''有时候,还需要用户主动修改某些配置;请仔细阅读升级过程中的输出获取相关信息。'''''<br />
<br />
===三、更新系统===<br />
====使用[[pacman (简体中文)|pacman]]====<br />
现在我们要用[[pacman (简体中文)|pacman]]来更新系统。要更新、同步并'''升级'''你的系统,可以使用命令:<br />
pacman -Syu<br />
pacman就会获取所有最新可用软件包信息并进行升级。(此时你可能会被提示先升级pacman自身。如果是这样,回答'yes',然后在完毕后再运行一次pacman -Syu命令。)<br />
<br />
===='''滚动发布'''之美====<br />
Arch是一个'''rolling release'''(滚动发布)的发行版。这意味着没有必要重新安装或执行完整的系统重建来升级到最新版本。只需要执行'''pacman -Syu''',就能保持你的系统更新到最新和bleeding edge(表示最新的、因而也并非完美的技术)。<br />
<br />
===四、增加一个用户并设置用户组===<br />
用root账号来处理日常工作是很危险的。Root是用来处理系统管理的任务。我们可以用以下命令增加一个普通用户账号:<br />
adduser<br />
大部分缺省选项都是没问题的,你可能还需要将storage、audio、video、optical和wheel加入到你的用户组中 ── 特别是在你打算使用一个完整功能的桌面环境的情况下。<br />
<br />
用户组和用户的关联定义在/etc/group文件中: <br />
<br />
它包含了:<br />
<br />
*'''audio''' - 关于声卡和相关软件的任务<br />
<br />
*'''wheel''' - 给sudo使用<br />
<br />
*'''storage''' - 负责存储设备<br />
<br />
*'''video''' - 视频任务和3D加速<br />
<br />
*'''optical''' - 和光驱有关的任务<br />
<br />
*'''floppy''' - 软驱访问<br />
<br />
*'''lp''' - 打印任务<br />
<br />
请参看[[Groups]]一文了解你应该属于哪些用户组。<br />
你还可能需要将你的用户账号加入到以下用户组(需要以root身份运行此命令):<br />
usermod -aG audio,video,floppy,lp,optical,network,storage,wheel,dbus,hal USERNAME<br />
详情可看usermod和gpasswd的man手册。<br />
<br />
===五、安装建立Sudo (可选)===<br />
安装Sudo:<br />
# pacman -S sudo<br />
以root身份,运行命令visudo,把用户加入sudo用户 (a &quot;sudoer&quot;).如果不知道怎么使用vi,你可以在用visudo前设置VISUAL 或 EDITOR环境变量为你喜欢的编辑器。例如:<br />
# export VISUAL=vim<br />
或<br />
# export EDITOR=nano<br />
如果你对于用vi很适应,去掉EDITOR=nano这个变量就行:<br />
# visudo<br />
这命令将在一个特殊的vi会话中打开文件 /etc/sudoers 。visudo复制文件到一个可编辑的临时文件中,用一个编辑器编辑它(vi是默认的),接下来运行一个安全检查(“sanity check”)。如果通过,这个临时文件就有正确的权限将重写的原始文件。t<br />
<br />
<font color=&quot;red&quot;>'''注意:不要直接用编辑器编辑 /etc/sudoers ; 否则会出现这样的提示:Errors in syntax can cause annoyances (像root帐户不能使用的描述一样)。 必须使用 ''visudo'' 命令来编辑 /etc/sudoers.'''</font><br />
<br />
当用户输入以 &quot;sudo&quot;, 作为开始的命令行时,临时授予该用户root权限。加入下面一行:<br />
USER_NAME ALL=(ALL) ALL<br />
USER_NAME 就是单个用户名。<br />
<br />
更多信息,比如按<TAB> 自动命令补全,请见[[Sudo]]<br />
<br />
==第三部分:安装X并配置ALSA==<br />
一共有三步工作:<br />
*1、安装声卡驱动<br />
*2、安装x-window(包括显卡驱动)<br />
*3、配置X<br />
<br />
{{Box Note | '''在热插拔未配置正确的情况下,或者是/etc/rc.d/hal未启动的情况下,请不要启动开启X(包括重启使用gdm或者kdm登陆),否则可能导致鼠标键盘失去响应!!!'''}}<br />
<br />
===一、配置声卡:使用alsamixer===<br />
高级Linux声音架构(Advanced Linux Sound Architecture,简称ALSA)是一个Linux内核组件。它替换了原有的开放声音系统(OSS),为声卡提供了设备驱动。除了声音设备驱动以外,'''ALSA'''还给应用程序开发人员提供了一个用户空间库,可使更高级的API无需直接与内核驱动打交道就能使用驱动功能。<br />
<br />
{{Box Note| Alsa已经包含进最新的内核kernel,udev 将在系统启动时自动检测硬件,并自动根据声卡加载相应的内核模块。虽然声卡已经在工作,但电脑的声音默认是静音。}}<br />
{{Box Note| OSS4.1已经放出,相对于老的版本,这是一个显著的提升的版本,如果使用ALSA有问题, 或者是想尝试新的功能,可以使用 OSS4.1。 相关说明可见: [[OSS]]}} <br />
<br />
Alsa-utils软件包里的alsamixer让我们可以从命令行来配置声音设备。(你也可以稍后在'''X'''环境中使用alsamixer。)<br />
默认情况下,内核加载模块snd_pcsp,这是一个alsa pc speaker模块。 snd_pcsp通常先于&quot;你实际的&quot;声卡模块加载。大部分情况下,这模块最后加载更好,因为可以让alsamixer正确控制需要的声卡。<br />
<br />
在/etc/modprobe.conf中加入这行,可以使得snd_pcsp最后加载:<br />
options snd-pcsp index=2<br />
<br />
当然,如果你不想让snd_pcsp加载,可以把它放入黑名单,或者是在/etc/rc.conf的Modules里禁止它:<br />
MODULES=(... !snd_pcsp)<br />
<br />
{{Box Note | 想要生效,需要释放并重新加载所有声音模块,当然,系统重启就可以简单解决这问题。 }}<br />
<br />
* 安装alsa-utils软件包:<br />
pacman -S alsa-utils<br />
<br />
* 为了解决Alsa声卡独占问题,可以安装alsa-oss:<br />
# pacman -S alsa-oss <br />
<br />
* 把你的普通用户账号加入到audio用户组中:以root身份,运行<code>/usr/bin/gpasswd</code>程序:<br />
gpasswd -a yourusername audio<br />
*以普通用户身份运行: <br />
alsamixer<br />
用左右光标键移动到Master和PCM声道上,按'''M'''取消掉静音。用向上键增加音量。(70-90的音量是较合适的范围)按ESC键离开alsamixer。<br />
有'''Speaker'''的,需要同时取消静音并调整之. <br />
<br />
====测试声音====<br />
以普通用户身份,使用 <code>/usr/bin/aplay</code>程序来测试你的声音配置:<br />
aplay /usr/share/sounds/alsa/Front_Center.wav<br />
你应该会听到一个女性声音说:“Front,center。”<br />
<br />
====保存声音配置====<br />
以root身份运行<code>/usr/bin/alsactl</code> :<br />
alsactl store<br />
这将创建'/etc/asound.state'文件,用来保存alsamixer的设置。<br />
<br />
为了每次启动都可以自动恢复混音器设置,可将守护进程''alsa''加入到你的/etc/rc.conf中的DAEMONS列表。<br />
nano /etc/rc.conf<br />
DAEMONS=(syslog-ng network crond '''alsa''')<br />
''注意,alsa守护进程在启动过程中仅仅是恢复音量设置。它和alsa音频库(和内核级API)是完全不同的。''<br />
<br />
更多详情请参看[[ALSA 安装设置 (简体中文)|ALSA 安装设置]]。<br />
<br />
===二、安装X===<br />
'''X''' 窗口系统(一般叫'''X11'''或者更简单的叫'''X''') 是一个网络互动和显示服务,提供位图显示器窗口. 提供标准化工具包(toolkit)和协议,用于<code>UNIX</code>类操作系统,构建一个图形界面(GUIs) <br />
<br />
'''X''' 提供最基本、基础的框架,用于构建一个图形操作界面环境。包括:绘图、屏幕窗口移动,与鼠标或者键盘的交互。 '''X''' 并不负责用户交互界面的部分:有独立的客户端程序负责处理这部分。 比如gnome、kde。<br />
<br />
'''X''' 因为它先于'''W'''窗口系统,最初由斯坦福大学开发。 <br />
<br />
*''注意: 如果想使用一个'''开源''' 显卡驱动, 需要3d加速,强烈建议在安装Xorg之前安装库 libgl :''<br />
pacman -S libgl<br />
''(拥有专利的视频驱动提供它们自己的gl库安装(implementations).)''<br />
----- <br />
====1、安装X====<br />
构建一个GUI的第一步:用pacman来安装Xorg包.<br />
<br />
# pacman -S xorg<br />
对于新版的xorg,建议(可能大部分情况下是必须的)安装输入设备驱动evdev。它本来应该作为xorg-server的一个依赖被安装的,不过不知道为什么貌似缺失了:<br />
# pacman -S xf86-input-evdev<br />
3d的工具比如glxgears包含在包'''mesa''' 里(如果需要,也安装):<br />
# pacman -S mesa<br />
<br />
====2、安装显卡驱动====<br />
到这一步,已经有了运行'''X''' Server的基本软件包,接下来需要把显卡的驱动安装到电脑里(e.g. xf86-video-<name>). 最简单的X.org配置方法就是安装正确的驱动包,然后使用自动脚本对 /etc/X11/xorg.conf 进行初始化,比如使用 Xorg -configure(arch团队提供hwd工具,但据以前用户的反映,这个现在还老出问题,新手可以使用,以后有能力再配置其他).<br />
<br />
如果不知道显卡类型,输入下面命令:<br />
lspci | grep VGA<br />
<br />
输入下面命令,查看所有'''开源'''驱动: <br />
pacman -Ss xf86-video | less<br />
<br />
下面是一个'''开源'''的显卡列表和相关说明:<br />
*'''xf86-video-apm''' Alliance ProMotion video driver<br />
*'''xf86-video-ark''' ark video driver<br />
*'''xf86-video-ati''' ati video driver<br />
*'''xf86-video-chips''' Chips and Technologies video driver<br />
*'''xf86-video-cirrus''' Cirrus Logic video driver<br />
*'''xf86-video-dummy''' dummy video driver<br />
*'''xf86-video-fbdev''' framebuffer video driver<br />
*'''xf86-video-glint''' GLINT/Permedia video driver<br />
*'''xf86-video-i128''' Number 0 i128 video driver<br />
*'''xf86-video-i740''' Intel i740 video driver<br />
*'''xf86-video-i810''' Intel i810/i830/i9xx video drivers (deprecated - use -intel)<br />
*'''xf86-video-intel''' Newer Version of Intel i810/i830/i9xx video drivers<br />
*'''xf86-video-imstt''' Integrated Micro Solutions Twin Turbo vidoe driver<br />
*'''xf86-video-mach64''' mach64 video driver <br />
*'''xf86-video-mga''' mga video driver (Matrox Graphics Adapter) <br />
*'''xf86-video-neomagic''' neomagic video driver<br />
*'''xf86-video-nouveau''' Open Source 3D acceleration driver for nVidia cards (eperimental)<br />
*'''xf86-video-nv''' nvidia nv video driver<br />
*'''xf86-video-openchrome''' Openchrome drivers<br />
*'''xf86-video-r128''' ati Rage128 video driver<br />
*'''xf86-video-radeonhd''' Experimental Radeon HD video driver for r500 and r600 ATI cards<br />
*'''xf86-video-rendition''' Rendition video driver<br />
*'''xf86-video-s3''' S3 video driver<br />
*'''xf86-video-s3virge''' S3 Virge video driver<br />
*'''xf86-video-savage''' savage video driver<br />
*'''xf86-video-siliconmotion''' siliconmotion video driver<br />
*'''xf86-video-sis''' SiS video driver<br />
*'''xf86-video-sisusb''' SiS USB video driver<br />
*'''xf86-video-tdfx''' tdfx video driver<br />
*'''xf86-video-trident''' Trident video driver<br />
*'''xf86-video-tseng''' tseng video driver<br />
*'''xf86-video-unichrome''' Unichrome video drivers<br />
*'''xf86-video-v4l''' v4l video driver<br />
*'''xf86-video-vesa''' vesa video driver<br />
*'''xf86-video-vga''' VGA 16 color video driver<br />
*'''xf86-video-via''' via video driver<br />
*'''xf86-video-vmware''' vmware video driver<br />
*'''xf86-video-voodoo''' voodoo video driver<br />
<br />
* 说明:'''vesa'''驱动是最通用的软图形驱动, 适用于大部分的显卡, 但没有3D加速等功能。所以如果实在无法找到合适的显卡驱动,就只好选用vesa, 理论上它应该能在任何显卡上工作。(这是原话,好像夸张了点!If you cannot find a suitable driver for your video chipset, vesa '''should''' work.)<br />
<br />
用pacman来安装适合你显卡的驱动。例如:<br />
pacman -S xf86-video-savage<br />
(给Savage显卡的驱动。)<br />
<br />
* 如果实在不确定需要安装那个显卡驱动,可以安装所有显卡驱动包, 输入下面命令:<br />
pacman -S xorg-video-drivers<br />
<br />
*如果显卡是nVIDIA 或者ATI的,并'''想安装nVIDIA或者ATI官方提供的显卡驱动,请看下面。'''<br />
-----<br />
<br />
====nVIDIA图形显示卡====<br />
nVIDIA显示卡的驱动程序被许多人认为是非常好的质量,而且带有高级3D性能。<br />
<br />
在设置您的你nVIDIA显卡之前您先要选择您要使用的驱动程序。Arch现在有3种不一样的nVIDIA驱动程序,各自支持不同型号的显卡:<br />
<br />
'''1. nvidia-96xx''' ''直到Ge Force 4的较新显卡''<br />
<br />
'''2. nvidia-173xx''' ''Geforce FX系列显卡''<br />
<br />
'''3. nvidia''' ''在GF FX之后的最新GPU''<br />
<br />
{{Box Note| 一些特别老如TNT和TNT2之类的显卡所需的Nvidia-71xx系列闭源驱动,由于无法在Arch所用的新版Xorg下正常运行,并且nvidia也已不再继续支持它们,因此已被删除。你可以改用xf86-video-nv或者xf86-video-vesa驱动。}}<br />
<br />
到nVIDIA主页,看哪个适合你电脑.区别只是安装,配置过程是一样的.<br />
<br />
''根据你的显卡'',选择合适的nVIDIA驱动安装,比如: <br />
pacman -S nvidia-96xx<br />
<br />
nVIDIA软件包有个工具能自动升级你已有的nVIDIA驱动的配置文件/etc/X11/xorg.conf,输入下列命令即可实现:<br />
nvidia-xconfig<br />
<br />
它也有一些选项,用于更深入和具体地配置xorg.conf文件的内容和选项,例如:<br />
<br />
<br />
nvidia-xconfig --composite --add-argb-glx-visuals<br />
<br />
更详细的信息,请参考:nvidia-xconfig(1).<br />
<br />
一些有用的妙法可用在“device“部分(你要清楚它们不一定都能对你的系统有用):<br />
Option "RenderAccel" "true"<br />
Option "NoLogo" "true"<br />
Option "AGPFastWrite" "true"<br />
Option "EnablePageFlip" "true"<br />
将所有的DRI注释掉:<br />
# Load "dri"<br />
<br />
多检查几次你的/etc/X11/xorg.conf以确定你的默认的depth(色深),horizontal sync(水平同步),垂直刷新率,以及分辨率是可以接受的。<br />
<br />
使用<code>/sbin/depmod</code>命令来更新内核模块依赖:<br />
depmod -a<br />
(也许需要重启。)<br />
{{Tip|nvidia配置的高级的说明参考文章[[NVIDIA]] 。}}<br />
<br />
现在你可以跳到'''[[#三、配置X:创建并修改/etc/X11/xorg.conf|配置X]]'''来进一步熟悉,或者跳到'''[[#3、测试 X|测试 X]]'''继续安装过程。<br />
<br />
====ATI图形显示卡====<br />
ATI用户的驱动可以有几种选择。<br />
* '''xf86-video-ati'''软件包提供的开源'''''radeon'''''驱动。<br />
** 原创的、完全支持Radeon芯片组到X1950(最新的R500芯片组)的逆向工程开源驱动。对9200系列以前的显卡完全支持,可以稳定的提供全2D和3D加速。从9500到X1950完全支持2D加速特性,良好的3D加速,不过缺乏某些闭源驱动的特性(例如能源节省特性仍处于测试阶段)。xf86-video-ati支持从HD2xxx (R6xx)到最新的显卡,不过目前仅提供2D支持。<br />
* '''xf86-video-radeonhd'''软件包提供了开源的'''''radeonhd'''''驱动。<br />
** 此驱动支持ATI R500(Radeon X1000系列)以及更新的芯片组。该驱动由AMD提供文档,Novell为之开发。它支持RandR 1.2,目前的开发工作非常活跃。因此所支持的不同系列显卡的功能可以不一致。(有些用户反映它性能优异,而有些则说它很糟)。它还支持带音频的HDMI。<br />
* AUR中的Catalyst软件包提供了闭源'''''fglrx'''''驱动。稍后将介绍闭源驱动。<br />
开源驱动通常可以满足大部分需求而且较少出问题。<br />
<br />
安装'''''radeon'''''ATI驱动:<br />
# pacman -S xf86-video-ati libgl ati-dri<br />
安装'''''radeonhd'''''ATI驱动:<br />
# pacman -S xf86-video-radeonhd libgl ati-dri<br />
<br />
Arch的<code>extra</code>官方仓库曾经提供过闭源ATI驱动'''Catalyst'''的预编译包,不过在2009年3月以后,由于对闭源驱动的质量和开发进度不满意,官方取消了对它的支持。目前catalyst驱动可以在[http://aur.archlinux.org/packages.php?ID=22899 AUR]中找到。Catalyst驱动的安装信息可以在[[ATI#Proprietary_ATI_Catalyst_driver|这里]]找到。<br />
<br />
{{Warning| 闭源ATI驱动仅支持R600和更新的显卡(即HD2xxx及以上系列),不支持旧系列(X1xxx系列及以下)。}}<br />
<br />
{{Tip|ATI配置的高级指引可以参看[[ATI | ATI wiki 文章]]。}}<br />
<br />
====3、安装输入设备驱动软件包====<br />
最新的X需要你为包括键盘和鼠标在内的输入设备安装驱动。查看可用输入设备驱动的完整列表:<br />
# pacman -Ss xf86-input | less<br />
<br />
对大部分用户,xf86-input-keyboard和xf86-input-mouse应该可以满足基本配置。使用pacman来为你的输入设备安装需要的驱动,例如:<br />
# pacman -S xf86-input-keyboard<br />
===三、配置X:创建并修改/etc/X11/xorg.conf===<br />
====xorg.conf文件====<br />
/etc/X11/xorg.conf 是你的 X-Window-System 的主要配置文件,你的 GUI('''G'''raphical '''U'''ser '''I'''nterface)的基础,它是一个普通的文本文件,里面由 “section” 和 “subsection” 来安排。重要的 section 有 ''Files, InputDevice, Module, Monitor, Modes, Screen, Device'' 和 ''ServerLayout''。各个section安排的前后次序没有关系,对同一种类型的设备也可以有多个section,比如你可能有多个显示器,或者你的本本既有鼠标又有触摸板。<br />
------<br />
从X11R7.2版开始Xserver引入了自动配置特性。在大多情况下,即使没有xorg.conf文件它也能很好地运作。如果''自动检测功能工作正常'',而且你又不需要开启如 aiglx、compositing 等功能的话,你甚至不需要创建这个配置文件。<br />
<br />
====1、创建 /etc/X11/xorg.conf====<br />
<br />
高级用户可以手动创建他们的xorg.conf文件。一般用户可以使用程序<code>/usr/bin/Xorg</code>附加参数-configure来生成一个基本的配置文件;以root身份输入下面命令:<br />
# Xorg -configure<br />
这里生成的文件是/root/xorg.conf.new <br />
<br />
把这文件复制到 <code>/etc/X11/</code>:<br />
# cp /root/xorg.xonf.new /etc/X11/xorg.conf<br />
<br />
====更多的创建/etc/X11/xorg.conf的办法====<br />
* 说明:如果你的电脑已经有一个配置好的xorg.conf文件,不管这个文件是在什么别的发行版下生成的,只要Xorg的版本一致,就可以把该文件复制到你的Arch系统的<code>/etc/X11/</code>目录下。<br />
* 可以使用程序<code>/usr/bin/hwd</code>生成xorg.conf。首先要安装这程序:<br />
# pacman -S hwd<br />
然后输入下面命令:<br />
# hwd -xa<br />
{{Box Note| 目前,hwd在生成的xorg.conf有一行失效。 使用完这程序后,需要手动删除或者是注释掉 Section &quot;Files&quot;下的RgbPath那一行。via nano /etc/X11/xorg.conf or your equivalent, as root/sudo.}}<br />
<br />
* 使用<code>/usr/bin/xorgcfg</code> 脚本生成xorg.conf:<br />
# xorgcfg <br />
* 使用<code>/usr/bin/xorgconfig</code>生成xorg.conf,这个程序以互动方式来创建该文件,输入下面命令运行:<br />
# xorgconfig<br />
<br />
====2、Input设备热插拔问题:请在测试X前阅读====<br />
<br />
xorg 1.5.x版本里已经开启热插拔Input设备。<br />
{{Box Note | 当热插拔开启后, X将清空xorg.conf里所有使用the kbd and mouse 驱动建立的设备。这将导致X被冻结,使得鼠标和键盘失去响应。下面是解决办法。'''方法只能二选一'''}}<br />
<br />
有两个办法可以修复这一问题:<br />
<br />
1) '''配置 input设备热插拔''':安装驱动 xf86-input-evdev,同时配置HAL使其能使用kbd/mouse驱动。<br />
<br />
安装xf86-input-evdev:<br />
# pacman -S xf86-input-evdev<br />
在X.org相关进程启动前,启动守护进程hal:<br />
# /etc/rc.d/hal start<br />
把hal加入/etc/rc.conf里的DAEMONS列表里,这样每次电脑启动,都会自动开启hal。详情请见[[Xorg input hotplugging]] 。<br />
<br />
说明: 开启hal必须首先有一个dbus用户和用户组,以root身份输入下面命令创建用户和用户组<br />
<br />
usr/sbin/groupadd -g 81 dbus<br />
usr/sbin/useradd -c 'System message bus' -u 81 -g dbus -d '/' -s /bin/false dbus<br />
<br />
2) '''关闭input设备热插拔''':在/etc/X11/xorg.conf的ServerFlags段,加入参数''Option &quot;AutoAddDevices&quot; &quot;False&quot;'' 这将忽略hal的硬件检测,并使用你xorg.conf的keyboard/mouse配置。步骤如下<br />
# nano /etc/X11/xorg.conf<br />
加入下面三行:<br />
Section &quot;ServerFlags&quot;<br />
Option &quot;AutoAddDevices&quot; &quot;False&quot;<br />
EndSection<br />
<br />
====3、测试 X====<br />
<br />
在所生成的xorg文件路径''path/to/xorg.conf''前,加入参数''-config'' ,运行 '''X'''脚本,可以测试脚本配置是否正确。<br />
比如要测试你上面生成的xorg是否配置正确,输入:<br />
X -config /root/xorg.conf.new<br />
'''X''' 将启动,在屏幕中央会有一个白色的 X ,鼠标或是触摸板可以移动它,按 CTRL-Alt-Backspace 可以退出 '''X'''<br />
<br />
====对xorg.conf除错====<br />
如果 X 出现错误不能运行,你需要手动检查你的配置文件:<br />
<br />
nano /root/xorg.conf.new<br />
<br />
* 确定 Xorg -configure 命令正确的识别了你的显卡,比如:<br />
Section &quot;Device&quot;<br />
<br />
...<br />
<br />
Driver &quot;savage&quot;<br />
<br />
...<br />
<br />
EndSection<br />
<br />
* 确定里面的 Section "Monitor" 设置了水平同步率和垂直刷新率,如果没有要把它加上:<br />
Section &quot;Monitor&quot;<br />
Identifier &quot;Monitor0&quot;<br />
VendorName &quot;Monitor Vendor&quot;<br />
ModelName &quot;Monitor Model&quot;<br />
HorizSync 30.0 - 130.0 # Safe for LCD's<br />
VertRefresh 50.0 - 100.0 # Safe for LCD's and most CRT's.<br />
EndSection<br />
如果你不知道这些刷新率到底是多少,你就得查一下你显示器的说明书。<br />
<br />
* 在section "Screen"配置默认色深(color depth):<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Card0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
(此处色深被设定为真彩24色。)<br />
<br />
<br />
* 在subsection &quot;Display&quot; 加入你需要的Modes, at least under the Depth 24 header, e.g.:<br />
SubSection &quot;Display&quot;<br />
Viewport 0 0<br />
Depth 24<br />
Modes &quot;1024x768&quot; &quot;800x600&quot; &quot;640x480&quot;<br />
* Add the following section, if you wish to enable eye candy which requires the composite extension: <br />
Section &quot;Extensions&quot;<br />
Option &quot;Composite&quot; &quot;Enable&quot;<br />
EndSection<br />
<br />
* 上述调整完成后,再测试你的配置:<br />
X -config /root/xorg.conf.new<br />
<br />
* 在确认 '''X''' session开启,没有错误之后,把测试好的配置文件移到 /etc/X11下,作为系统的xorg.conf配置文件:<br />
mv /root/xorg.conf.new /etc/X11/xorg.conf<br />
详细的介绍可见[[Xorg]] <br />
<br />
接下来可以简单作测试 '''[[#Simple baseline X test|Simple baseline X test]]'''<br />
<br />
====调整键盘布局====<br />
=====如果开启了input热插拔=====<br />
# cp /usr/share/hal/fdi/policy/10osvendor/10-keymap.fdi /etc/hal/fdi/policy/<br />
# nano /etc/hal/fdi/policy/10-keymap.fdi<br />
Edit the &quot;input.xkb.layout&quot; key and possibly the &quot;input.xkb.variant&quot; key in this file.<br />
Restart hal:<br />
# /etc/rc.d/hal restart<br />
<br />
=====如果关闭了input热插拔=====<br />
Add option lines in the &quot;InputDevice&quot; section of the /etc/X11/xorg.conf file specifying the keyboard layout and variant:<br />
Option &quot;XkbLayout&quot; &quot;be&quot;<br />
Option &quot;XkbVariant&quot; &quot;&quot;<br />
<br />
详情请见 [[Xorg input hotplugging]]。<br />
<br />
===简单的命令行界面X测试(如果需要)===<br />
<br />
在安装了xorg、合适的显卡驱动、创建了一个/etc/X11/xorg.conf文件之后,如果想在安装完整桌面环境之前,快速测试下你的配置,使用'''xterm'''可以实现! <br />
Xterm是个简单的终端模拟程序,作为base xorg软件包的一部分会被自动安装,运行在'''X '''Server环境里。通过配置~/.xinitrc,Xterm可以让我们快速测试显卡驱动和配置文件/etc/X11/xorg.conf是否被正确配置。(另外,如果在没有/etc/X11/xorg.conf的情况下,你想测试下'''X''' 自动检测是否满意,也可以使用这个)<br />
<br />
==== 准备工作:配置~/.xinitrc====<br />
<br />
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. <br />
{{Box Note | '''[[.xinitrc]]''' is a so-called 'dot' (.) file. 在UNIX文件系统下,文件名以 (.)开头的,是 '隐藏文件',,使用普通的命令'ls' 将不显示这些文件,使用加了参数命令'''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 &quot;Run Control&quot;.}}<br />
<br />
'''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. (说明: ''如果没有文件~/.xinitrc, /etc/X11/xinit/xinitrc 将被作为替代来使用,这是个使用TWM and Xterm的默认配置。'')<br />
<br />
切换到'''''普通, 非root'''''用户:<br />
# su - ''yourusername''<br />
* /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.<br />
* 如果没有~/.xinitrc这个文件,到该目录下创建一个,或者从/etc/skel/复制一个同样的文件到你的home目录:: <br />
<br />
$ cp /etc/skel/[[.xinitrc]] ~/<br />
<br />
* 编辑文件: <br />
$ nano ~/.xinitrc<br />
加入这行&quot;<code>exec xterm</code>&quot;像下面这样:<br />
<br />
#!/bin/sh<br />
#<br />
# ~/.xinitrc<br />
#<br />
# Executed by startx (run your window manager from here)<br />
#<br />
exec xterm<br />
# exec wmaker<br />
# exec startkde<br />
# exec icewm<br />
# exec blackbox<br />
# exec fluxbox<br />
<br />
{{Box Note | ''请确保~/.xinitrc''里,以'''exec'''开头的,只有'''一行'''的注释被去掉。}}<br />
<br />
====开始执行测试====<br />
<br />
* 以普通用户身份输入下面命令,开启'''X''',开始测试你的配置:<br />
<br />
$ startx<br />
或者是这命令<br />
$ xinit<br />
<br />
此时会打开一个'''xterm''' session,你可以在这里测试your keyboard and its layout<br />
<br />
* 按Ctrl+Alt+Backspace,或者输入"exit"可以退出'''X''' Server。<br />
* 如果开启'''X'''出现问题,在终端,查看日志文件/var/log/Xorg.0.log的错误信息。<br />
<br />
更多的Xorg configuration介绍可见[[Xorg]] .<br />
<br />
==第四部分:安装并配置桌面环境==<br />
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 icons, applets, windows, toolbars, folders, wallpapers, 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.<br />
<br />
* 如果你需要一个完整功能,类似于Windows和Mac OSX, 可以选择安装'''[[#KDE|KDE]]''' <br />
* If you want something slightly more minimalist, which follows the K.I.S.S. principle more closely, '''[[#GNOME|GNOME]]''' is a good choice<br />
* '''[[#Xfce|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.<br />
<br />
如果你的机器较老,或者是希望使用一个更轻量、更少GUI要求,可以选择只安装 '''Window Manager''', 或者 WM. A WM controls the placement and appearance of application windows in conjunction with the X Window System but does NOT provide such additions as panels, applets, icons, etc.<br />
* Lightweight floating WM's include: [[#Openbox|'''Openbox''']], [[#Fluxbox|'''Fluxbox''']], [[#fvwm2|'''fvwm2''']], '''Windowmaker, Pekwm, and TWM'''.<br />
* If you need something completely different, try '''Awesome, ion, wmii, dwm, or xmonad'''。<br />
<br />
===一、安装字体===<br />
在安装桌面环境/窗口管理器'''之前''',也许你会先安装些美观的字体。Dejavu和bitstream-vera都是不错的字体集。而对于网页,你还可能需要Microsoft字体。如下安装:<br />
pacman -S ttf-ms-fonts ttf-dejavu ttf-bitstream-vera<br />
对于中文字体,开源的文泉驿正黑矢量字体是不错的选择,它还内嵌了9pt-12pt的点阵宋体:<br />
pacman -S wqy-zenhei<br />
<br />
===二、选择默认启动的桌面环境 ~/.xinitrc===<br />
<br />
以普通用户身份编辑/home/username/.xinitrc,加入你要用的DE. This will allow you to use '''startx/xinit''' from the shell, in the future, to open your DE/WM of choice:<br />
<br />
nano ~/.xinitrc<br />
<br />
反注释或者加入相应的桌面环境/窗口管理器的''''exec''' ..'内容行。例如:使用Xfce4桌面环境:<br />
<br />
exec startxfce4 <br />
<br />
记住在~/.xinitrc中只反注释掉一行'''exec'''。这条命令将一直运行到你注销桌面登录。一般的,shell将等到kde完成加载之后,在运行下一条命令。在命令前加 &quot;exec&quot; ,是告诉the shell 这条命令最后执行, 这样shell就不用等待其他命令了,直接载入桌面。<br />
接下来安装你所选的桌面环境/窗口管理器。<br />
<br />
===三、选择安装一个桌面环境===<br />
====GNOME====<br />
=====关于GNOME=====<br />
GNOME是'''G'''NU '''N'''etwork '''O'''bject '''M'''odel '''E'''nvironment的缩写。GNOME项目有两大部分:GNOME桌面环境 ── 既直观又迷人的最终用户桌面,以及GNOME开发平台 ── 一个用来创建可与桌面集成的应用程序的庞大的框架。<br />
<br />
=====安装=====<br />
安装基本的GNOME环境:<br />
pacman -S gnome<br />
<br />
安装额外的GNOME环境:<br />
pacman -S gnome-extra<br />
然后选择提示的所有软件包。 <br />
<br />
=====对GNOME有用的守护进程=====<br />
如之前所述,守护进程(daemon)是运行在后台的程序,它等待事件发生并提供相应的服务。其中'''Hal'''守护进程可以自动挂载磁盘、光驱和U盘给GUI使用。'''Fam'''守护进程可以在GUI中实时反映文件的变动,如最近安装的程序、文件系统的变化等。'''Hal'''和'''fam'''使得GNOME的使用更为方便。Hal和fam软件包在安装GNOME时已一同安装,建议安装社区库的gamin来替代fam。<br />
<br />
{{Box Note|注意,fam是一个比较老的包,很容易造成较大的日志文件。}}<br />
<br />
{{Box Note|在当前的gnome环境中,你可以安装gamin来实现fam的功能。这时,你可以不用在DAEMONS中添加fam启动项了(不需要加入gamin,它会自动被启用)。}}<br />
<br />
* 你需要启动'''hal'''守护进程。<br />
<br />
启动hal:<br />
/etc/rc.d/hal start<br />
<br />
如果您想使用fam,同样需要启动:<br />
/etc/rc.d/fam start<br />
<br />
将hal加入到/etc/rc.conf的DAEMONS中以使得它们随系统启动而自动运行:<br />
nano /etc/rc.conf<br />
<br />
DAEMONS=(syslog-ng network crond alsa '''hal''')<br />
<br />
{{Box Note|注意,如果使用fam,那么把fam加入到hal后面。}}<br />
<br />
* 或许你还会希望安装一个图形界面的登录管理器。在GNOME下'''gdm'''守护进程是个不错的选择。<br />
以root身份运行:<br />
pacman -S gdm<br />
<br />
让gdm启用有两种方式,一种是直接加入到DAEMONS的末尾,通过rc.conf来启动;另外一种方式是用过配置inittab来加载gdm。<br />
<br />
* 通过inittab来加载gdm也很方便(推荐使用这种方式):<br />
nano /etc/inittab<br />
<br />
修改默认启动方式:<br />
<br />
将<br />
id:3:initdefault:<br />
改为<br />
id:5:initdefault:<br />
<br />
然后取消下面代码的注释:<br />
x:5:respawn:/usr/sbin/gdm -nodaemon<br />
<br />
{{Box Note|实际上,可以看到gdm/xdm/kdm/slim等,使用哪个取决于你的喜好,启用喜欢的那个,将其他的注释掉。当然,本章介绍的是gnome,所以推荐gdm,下章中将推荐kdm:)}}<br />
<br />
<br />
* 通过DAEMONS方式启动gdm也很方便:<br />
nano /etc/rc.conf<br />
<br />
DAEMONS=(syslog-ng network crond alsa hal gdm)<br />
<br />
{{Box Note|这是类似debian/ubuntu的做法,这种方式有一点不好:不管什么时候(非修复模式),系统总是会尝试进入gdm引导的X方式下。对于X已经配置得很好,并且不使用纯控制台的人可以使用这种方式。但是选择这种方式的话你将不能通过内核参数3或者5来区分进入纯字符控制台还是X11的gdm登录窗口。}}<br />
<br />
* 开启Gnome<br />
以普通用户身份启动X:<br />
startx<br />
或者这条命令也行:<br />
$ xinit<br />
如果你的 ~/.xinitrc一直没配置,那你将可以一直使用下面这条命令来开启Gnome:<br />
$ xinit /usr/bin/gnome-session<br />
<br />
关于安装和配置GNOME的高级指引可以参见[[GNOME (简体中文)|GNOME]]一文。接下来你可以浏览'''[[#优化和收尾|优化和收尾]]'''。或许你还会对[[ArchTips(简体中文)|Arch安装完后的小技巧]]一文感兴趣。<br />
<br />
=====美化=====<br />
如果不满足于缺省的GNOME主题和图标,那么可以安装一个不错的主题,比如murrine:<br />
pacman -S gtk-engine-murrine<br />
接着在System->Preferences->Theme里选择这个主题。<br />
<br />
Arch Linux也做了些不错的主题,根据你自己的审美观,选择满意的安装吧:<br />
<br />
# pacman -S gtk-engines gtk2-themes-collection gtk-aurora-engine gtk-candido-engine gtk-rezlooks-engine<br />
<br />
你还可以在[http://www.gnome-look.org Gnome Look]里找到更多的主题、图标和壁纸。<br />
<br />
====KDE====<br />
=====关于KDE=====<br />
KDE桌面环境('''K''' '''D'''esktop '''E'''nvironment)的缩写。 KDE是一种著名的运行于GNU/Linux 、 <code>UNIX</code> 工作站等的强大、自由图形工作环境。她拥有对系统内部各功能的强大整合能力、跨平台能力、易用性、优异的初始界面.<br />
<br />
=====安装=====<br />
Arch提供多个版本的kde: '''kde、kdebase 和 KDEmod'''. 选'''一个'''就行了,然后 '''[[#有用的KDE守护进程|有用的KDE守护进程]]''': <br />
<br />
'''1.)''' '''kde'''是完整的kde软件包,大概 ~300MB,适合主要使用kde软件的系统.<br />
pacman -S kde<br />
'''2.)''' '''kdebase'''是kde的基础软件包(里面没有kdm),大概 ~80MB,适合于只想把kde作为基础系统.<br />
pacman -S kdebase<br />
'''3.)''' '''KDEmod''' 是 Arch Linux独有的、社区驱动的项目,目标是把kde更加细致的模块化和达到其极致的运行效率。KDEmod项目的网站在http://chakra-project.org/ 。<br />
<br />
=====有用的KDE守护进程=====<br />
<br />
KDE 需要'''hal''' ('''H'''ardware '''A'''bstraction '''L'''ayer) 作为守护进程(daemons). '''kdm''' ( '''K''' '''D'''isplay '''M'''anager), 提供一个 '''图形化登录界面'''.<br />
{{Box Note|hal守护进程将自动开启dbus守护进程。kde4里已经不需要fam。kdm现在在kdebase-workstation这个包里,如果只安装kdebase,需要再安装此包才能使用kdm}}<br />
<br />
hal 服务配合其他软件, 能自动挂接热插拔硬盘, 光驱, USB drives/thumbdrives for use in the GUI. <br />
<br />
-----<br />
启动hal进程:<br />
<br />
/etc/rc.d/hal start<br />
<br />
编辑/etc/rc.conf的 DAEMONS部分:<br />
nano /etc/rc.conf<br />
把 '''hal''' 加入 DAEMONS 部分,以便他们在系统启动时加载. 如果想要kde的图形化登录界面,把 '''kdm'''也加进去(或者不加,在/etc/inittab里面设置): <br />
DAEMONS=(syslog-ng network crond alsa '''hal kdm''')<br />
{{Box Note|如果你安装的是KDEmod3,则使用kdm3替换kdm}}<br />
<br />
*这种方式能启动运行等级3, (/etc/inittab 默认多用户模式), 然后启动 KDM 进程来登录. <br />
<br />
*有些用户喜欢使用 /etc/inittab 方式来启动系统到运行等级5. 细节请参考 [[Adding a login manager (KDM, GDM, or XDM) to automatically boot on startup]].<br />
<br />
*如果你喜欢启动时进入命令行, 即运行等级3, 然后手动启动 X, 则不加入kdm, 或者是加个前缀( ! )禁止它。<br />
<br />
* 现在可以试试效果了,用普通用户身份开启X Server:<br />
startx<br />
或者<br />
$ xinit<br />
更多关于安装和配置KDE的文章,请看[[KDE]].<br />
<br />
到此步,可以看 '''[[#优化和收尾]]'''这部分了. 你可能想参考 [[Post Installation Tips]] wiki文章.<br />
<br />
====Xfce====<br />
=====关于Xfce=====<br />
和GNMOE、KDE一样,Xfce是一个桌面环境,其目标是快捷、轻量,同时又美观而易用。它还提供了一整套的应用程序如根窗口应用(root window app)、 窗口管理器、文件管理器、面板等等。 Xfce是用GTK2 toolkit编写的(类似GNOME),和其它大型桌面环境一样,它也有自己的开发环境(库文件、守护进程等)。但不象GNOME或者KDE,Xfce是轻量化的,其设计更接近于CDE而不是Windows或者Mac。它的开发周期比较慢,但是十分稳定、速度很快。在老硬件上Xfce可以运行得很好,而在新机器上更是运行如飞。<br />
<br />
=====安装=====<br />
安装完整的xfce环境以及主题和extras:<br />
pacman -S xfce4 xfce4-goodies gtk2-themes-collection <br />
<br />
如果你使用KDM或者GDM的话会显示一个xfce会话。另一种启动方式是:<br />
startxfce4<br />
<br />
关于安装和配置xfce的高级指引可以参见[[Xfce (简体中文)|Xfce]]一文。<br />
<br />
恭喜!欢迎来到Arch Linux系统的Xfce桌面环境!接下来你可以浏览'''[[#优化和收尾|优化和收尾]]''',或者下面的其它内容。或许你还会对[[ArchTips(简体中文)|Arch安装完后的小技巧]]一文感兴趣。<br />
<br />
====*box====<br />
=====Fluxbox=====<br />
Fluxbox © is yet another windowmanager for X.<br />
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).<br />
<br />
Install Fluxbox using <br />
pacman -S fluxbox fluxconf<br />
<br />
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:<br />
exec startfluxbox <br />
<br />
More information is available in the [[Fluxbox]] article.<br />
<br />
=====Openbox=====<br />
Openbox是一个标准的”温顺的“,快速的,轻量级的,可扩展的窗口管理器。<br />
<br />
Openbox与你的应用程序一起工作工作,并使你的的桌面便于管理。这是因为它的开发方式和通常的窗口管理器的方式是相悖的。 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.<br />
<br />
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. <br />
<br />
安装openbox<br />
pacman -S openbox obconf obmenu<br />
<br />
一旦openbox安装好,你将得到一个消息to move menu.xml & rc.xml to ~/.config/openbox/ in your home directory:<br />
<br />
mkdir -p ~/.config/openbox/<br />
cp /etc/xdg/openbox/rc.xml ~/.config/openbox/<br />
cp /etc/xdg/openbox/menu.xml ~/.config/openbox/<br />
<br />
In the file "rc.xml" you can change various settings for Openbox (or you can use OBconf). In "menu.xml" you can change your right-click menu.<br />
<br />
To be able to log into openbox you can either go via graphical login using KDM/GDM or startx, in which case you will need to edit your ~/.xinitrc (as user) and add the following:<br />
<br />
exec openbox<br />
<br />
For KDM there is nothing left to do; openbox is listed in the sessions menu in KDM.<br />
<br />
Useful programs for openbox are:<br />
* PyPanel or LXpanel if you want a panel<br />
* feh if you want to set the background<br />
* ROX if you want a simple file manager and desktop icons<br />
<br />
More information is available in the [[Openbox]] article.<br />
<br />
====fvwm2====<br />
FVWM是一个非常强大的面向X桌面系统的”ICCCM-compliant的多虚拟桌面的窗口管理器“(ICCCM-compliant multiple virtual desktop window manager)。开发活动很活跃,支持也是极好的。 <br />
<br />
输入下面命令安装 fvwm2 <br />
pacman -S fvwm <br />
<br />
fvwm会自动添加进 kdm/gdm会话列表. 如果没有的话,添加 <br />
exec fvwm <br />
<br />
到你的用户文件 .xinitrc.<br />
<br />
注意:这个稳定版已经有些年头了,如果需要最新的fvwm版本,可以安装unstable repo里的fvwm-devel 包.<br />
<br />
===四、优化和收尾===<br />
====HAL====<br />
如果你已经安装了一个桌面环境,但是又觉得用起来不是很方便,那么现在就是个安装HAL的好时机了。HAL使得你的手机、iPod、移动硬盘等等可以即插即用。它会挂载设备并在你的桌面或/和'My Computer'目录中创建相应的图标,使得你可以在插入设备后就能访问到它,无需每次都对每个新设备来手动配置/etc/fstab文件或者udev规则。<br />
<br />
KDE、GNOME和XFCE都使用到HAL。<br />
<br />
安装过程描述可以在[[HAL (简体中文)|HAL]]一文中找到。其它一些信息可以在[http://en.wikipedia.org/wiki/HAL_(software) Wikipedia]上找到。<br />
<br />
====启动时让守护进程在后台执行====<br />
<br />
要加速系统的启动过程,可以在/etc/rc.conf中给守护进程前加上'@'符号使之在后台执行,例如:<br />
<br />
DAEMONS=(@syslog-ng @network crond @alsa @hal @fam @kdm)<br />
这使得守护进程在后台被加载,无需等待它们加载结束。<br />
<br />
在守护进程前加上(!)可以禁止系统启动时加载它,例如:<br />
<br />
DAEMONS=(@syslog-ng @network !crond @alsa @hal @fam @kdm)<br />
<br />
另一种方式是直接将不需要的守护进程删除。<br />
<br />
====美化LCD下的字体====<br />
See [[Fonts]]<br />
<br />
====让所有的鼠标按键生效====<br />
看这个 [[Get All Mouse Buttons Working]]<br />
<br />
====笔记本电脑可能遇到的问题====<br />
(1) 触摸板问题<br />
参看http://wiki.archlinux.org/index.php/Touchpad_Synaptics<br />
<br />
(2) 摄像头问题<br />
参看http://wiki.archlinux.org/index.php/Webcam_Setup<br />
<br />
(3) 无线上网问题<br />
参看http://wiki.archlinux.org/index.php/Wireless<br />
<br />
(4) 快捷键问题<br />
参看http://wiki.archlinux.org/index.php/Extra_Keyboard_Keys<br />
<br />
====配置CPU频率====<br />
现在的处理器能够降低频率和电压,以降温和降低电源消耗。降温能使系统更稳定,笔记本用户肯定是想这样做的,但是即使是台式机也会对系统有利。<br />
<br />
安装CPU频率工具用:<br />
pacman -S cpufrequtils<br />
<br />
把CPU频率在/etc/rc.conf里加入到启动进程(daemons)中。编辑配置文件/etc/conf.d/cpufreq改<br />
governor="conservative"<br />
<br />
这使得在需要的情况下可以动态地增减CPU频率(这是对于台式机来说也是一个安全的选择)。改变最小频率(min_freq)和最大频率(max_freq)以匹配你的CPU的情况。如果你不知道频率,在载入频率测量模块后运行“cpufreq-info”。你也可以将min_freq和max_freq注释掉或删除,这样就能自动进行。加入频率测量模块到/etc/rc.conf的模块行。<br />
几乎所有的笔记本和台式机都可以简单地使用''acpi-cpufreq''驱动,但是也有其它的选择,如:''p4-clockmod, powernow-k6, powernow-k7, powernow-k8, and speedstep-centrino''。 <br />
<br />
通过下面这个命令载入这个模块:<br />
modprobe <modulname> <br />
通过下面命令行开启cpufreq:<br />
/etc/rc.d/cpufreq start<br />
更多细节,请看 [[Cpufrequtils]]<br />
<br />
==第五部分:常用的应用程序==<br />
更多信息,请看[[ArchLinux常用的应用程序(简体中文)]].<br />
<br />
==附录==<br />
新手指南附录[[ArchLinux新手指南附录 (简体中文)]]<br />
<br />
想得到更多的信息和支持,你可以去[http://www.archlinux.org/ homepage], [[Special:Search|search the wiki]],[http://bbs.archlinux.org/ forums],[[ArchChannel|IRC channel]],以及[http://www.archlinux.org/mailman/listinfo/ mailing lists]。<br />
=====问题答疑=====<br />
See [[Arch FAQs for newbies]]<br />
还有这里[http://bbs.archlinux.org/viewtopic.php?t=29055 Arch forum thread] 也是面向初学者的。<br />
<br />
=====术语=====<br />
更多信息关于Arch术语,查阅[[Arch Terminology/Jargon for newbies|this article]].<br />
<br />
=====接下来还有什么?=====<br />
<br />
你还可以阅读:<br />
<br />
[[Arch 官方安装指南 (简体中文)|Arch 官方安装指南]]<br />
<br />
[[Arch AUR (简体中文)|ArchLinux社区用户软件仓库 (AUR)]]<br />
<br />
[[Get All Mouse Buttons Working]]<br />
<br />
[[改善Pacman性能 (简体中文)|改善Pacman性能]]<br />
<br />
[[Kernel Compilation]]<br />
<br />
[[Pm-utils 电源管理 (简体中文)|Pm-utils 电源管理]]<br />
<br />
[[CPU 频率调节 (简体中文)|CPU 频率调节]]<br />
<br />
[[:Category:美化|美化]]</div>
Flydragon
https://wiki.archlinux.org/index.php?title=ArchLinux_%E6%96%B0%E6%89%8B%E6%8C%87%E5%8D%97_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=90859
ArchLinux 新手指南 (简体中文)
2010-01-04T11:03:28Z
<p>Flydragon: /* 2、安装显卡驱动 */</p>
<hr />
<div>[[Category:简体中文]]<br />
[[Category:获取并安装Arch (简体中文)]]<br />
[[Category:关于Arch_(简体中文)]]<br />
[[Category:HOWTOs (简体中文)]]<br />
<br />
{{Article summary start}}<br />
{{Article summary text|本文针对新手,提供了极其详尽的Archlinux的安装过程向导,和相关的简要说明。}}<br />
{{Article summary heading|已有的语言版本}}<br />
{{Article summary heading|Available Languages}}<br />
{{i18n_entry|Česky|Průvodce začátečníka (Česky)}}<br />
{{i18n_entry|简体中文|Arch 新手安装指南 (简体中文)}}<br />
{{i18n_entry|正體中文|Beginner's Guide 新手指南}}<br />
{{i18n_entry|Dansk|Dansk_Begynderguide}}<br />
{{i18n_entry|Deutsch|Beginners Guide (Deutsch)}}<br />
{{i18n_entry|English|Beginners Guide}}<br />
{{i18n_entry|Español|Guía para Principiantes (Español)}}<br />
{{i18n_entry|Français|Manuel_du_Débutant_(Français)}}<br />
{{i18n_entry|Italiano|Beginners Guide (Italiano)}}<br />
{{i18n_entry|Indonesia|Beginners_Guide_(Indonesia)}}<br />
{{i18n_entry|Lietuviškai|Pradedančiųjų gidas (Lietuviškai)}}<br />
{{i18n_entry|Nederlands|Beginners_Guide_(Nederlands)}}<br />
{{i18n_entry|Português Brasil|Guia do Iniciante(Português do Brasil)}}<br />
{{i18n_entry|Português|Guia para Principiantes(Português)}}<br />
{{i18n_entry|Русский|Руководство_для_новичков}}<br />
{{i18n_entry|Türkçe|Başlangıç Rehberi (Türkçe)}}<br />
{{i18n_entry|हिन्दी|नौसिखिया गाइड(हिन्दी)}}<br />
{{Article summary heading|相关文章}}<br />
{{Article summary wiki|Arch 官方安装指南 (简体中文)}}(更通用的安装方式)<br />
{{Article summary wiki|ArchLinux新手指南附录 (简体中文)}}<br />
{{Article summary wiki|ArchLinux安装完后的小技巧 (简体中文)}}<br />
{{Article summary wiki|ArchLinux常用的应用程序(简体中文)}}<br />
{{Article summary wiki|Work and Play with Arch (Chinese)}}<br />
{{Article summary end}}<br />
<br />
==前言==<br />
<br />
=====所有你一直想知道的关于安装Arch的事=====<br />
这篇文档将会指导你安装和配置[[ArchLinux (简体中文)|Arch Linux]] ── 一个简洁、轻量级的GNU/Linux发行版,一个类<code>UNIX</code>的操作系统。本文是面向Arch新用户,因此尽力为所有人提供强大的参考资料和信息。本指南讲述该如何获得一个基本配置好的Arch Linux系统(拥有一个图形桌面环境),但显然是不可能涵盖(甚至是预见)所有的信息。因此本指南会专注于某些关键性的步骤,想要进一步深入了解你可以查看[[Main Page (简体中文)|Arch Linux Wiki]]或者[http://bbs.archlinux.org/ Arch Linux论坛]。同时有兴趣的话你还可以了解一下[[Arch 之道 (简体中文)|Arch 之道]],它概述了Arch Linux发行版背后的哲学思想。<br />
<br />
'''Arch Linux的相关特性:'''<br />
* '''[[The Arch Way | Simple]]''' design and philosophy<br />
* Community distro targeted at competent GNU/Linux users<br />
* All packages compiled for '''i686/x86-64'''<br />
* 从底层开始就可以让用户高度定制<br />
* '''[[The Arch boot process | BSD-style init]]''' scripts, featuring one centralized configuration file<br />
* '''滚动升级''' <br />
* '''[[Pacman]]''' package manager is fast, written in '''C''', lightweight and agile, with a very modest memory footprint<br />
* '''[[ABS]]''': The '''A'''rch '''B'''uild '''S'''ystem, a ports-like package building system makes it simple to create your own easily installable Arch packages from source, to use and/or share with the community on the [[AUR]]<br />
* '''[[AUR]]''': The Arch User Repository, offering many thousands of build scripts for Arch user-provided software packages<br />
<br />
=====别怕(DON'T PANIC)!=====<br />
要知道Arch Linux的安装方法和过程也许会和你所使用过的其它GNU/Linux发行版非常不同,特别你是个新手的话将更能体会到这点。通常,GNU/Linux发行版会在一张或者一堆CD(甚至是DVD)上捆绑了大量的软件,包含了缺省桌面环境、缺省的应用程序和设置、硬件自动检测和图形化的安装程序,一切都是替你选择好了的。相反的,Arch Linux系统是让'''用户自己'''只是用一个bash shell和基本系统工具,从ncurses installer和基础系统上建造起来的。这就是[[Arch 之道 (简体中文)|Arch 之道]]。不象其它大型发行版,它没有强加于用户的缺省环境或者配置。你可以在命令行使用[[pacman (简体中文)|pacman]]通过互联网连接从Arch软件仓库安装软件包,直到你的系统配置成你希望的样子。这给予了用户最大的弹性、选择性和对系统资源的控制。因为是'''你'''建造了它,所以你肯定能了解系统里具体细节,知道底层都有些什么。<br />
<br />
Arch Linux系统是通过编辑文本文件进行配置的,没有提供图形界面的工具,所以需要对系统和linux相对熟悉。<br />
Arch Linux针对的是有能力的GNU/Linux用户以及希望花费时间学习系统知识的用户。 <br />
<br />
''Arch是一个可以被用户塑造的工具。''<br />
<br />
=====授权协议=====<br />
<br />
Arch Linux, pacman, documentation, and scripts are copyright<br />
©2002-2007 by Judd Vinet, ©2007-2008 by Aaron Griffin and are licensed under the GNU General Public License Version 2.<br />
<br />
=====[[Arch 之道 (简体中文)|Arch 之道]]=====<br />
<br />
''Arch的设计思想是"保持简洁"(keeping it simple)。'' <br />
<br />
这里的‘简洁’并不是单指‘简单’或者‘用户友好’,而是‘没有不必要的增加、修改或者复杂性’。简而言之,即优雅、极简之法。<br />
<br />
<br />
''"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 crap." -Aaron Griffin''<br />
<br />
<br />
''"The extraordinary part of [my method] lies in its simplicity..I have always believed that the simple way is the right way."'' - Bruce Lee<br />
“(我的方法中)最超凡的部分是它的简单性,我一直相信简单的就是对的。” 李小龙(Bruce Lee)<br />
<br />
Occam's razor: ''Entia non sunt multiplicanda praeter necessitatem'' or "Entities should not be multiplied unnecessarily." The term razor refers to the act of shaving away unnecessary assumptions and complications to get to the simplest explanation, method or theory.<br />
<br />
{{Box Note |'''仔细遵循本指南是成功安装一个配置正常的Arch Linux系统的基本要点,因此''请''认真仔细的阅读本文'''}}<br />
* 你也可以将本指南打印出来,作为一个较为有用的Arch Linux用户手册。<br />
*''如果你想在这个wiki里增加内容,请适当描述清楚“为什么会这样”以及“该怎么办”。最佳的文档应该能教会我们如何做和为什么这么做!''<br />
* Arch的wiki是项优秀的资源,可以[http://wiki.archlinux.org/index.php/Main_Page 第一时间]用来解决日常问题; 如果找不到答案也可以求助IRC和[http://bbs.archlinux.org/ 论坛]。<br />
----<br />
----<br />
欢迎使用Arch!现在,让我们开始吧。<br />
<br />
本文按照安装过程分四大部分:<br />
<br />
'''[[#第一部分:安装基本系统|第一部分:安装基本系统]]'''<br />
<br />
'''[[#第二部分:完成基本系统并升级|第二部分:完成基本系统并升级]]'''<br />
<br />
'''[[#第三部分:安装X并配置ALSA|第三部分:安装X并配置ALSA]]'''<br />
<br />
'''[[#第四部分:安装并配置桌面环境|第四部分:安装并配置桌面环境]]'''<br />
<br />
==第一部分:安装基本系统==<br />
===一、获取最新的系统安装包===<br />
<br />
你可以从[http://archlinux.org/download/ 这里]获取Arch最新的官方系统安装包。最新版本是2009.08<br />
<br />
*不论是Core还是Netinstall系统安装包,都只是包含了安装'''Arch Linux基本系统'''所需的软件包. ''注意,基本系统是不包含GUI图形界面的。它主要包含了GNU的系列工具(编译器、汇编程序、链接、库、脚本,还有其它的一些有用的工具),Linux的内核,还有一些额外的库和模块。<br />
*Core映像文件可以较方便的通过CD或者网络进行安装。<br />
*Netinstall映像文件较小巧,本身没有提供软件包,整个系统都是通过internet来获取的。<br />
*isolinux映像文件是给那些使用grub版本时发生问题的用户的。两者没有其它区别。<br />
*Arch64问答( http://wiki.archlinux.org/index.php/Arch64_问答_(简体中文) )可以帮助你在32位版本和64位版本之间作出选择。<br />
<br />
====CD 系统安装包====<br />
把下载的.iso映像文件刻录到CD上。开机时用CD启动,出现界面,跳到[[#二、启动Arch Linux系统安装程序| 二、启动Arch Linux系统安装程序]]<br />
{{Box Note| 通常为了刻录的稳定可靠(速率越低刻录质量越有保证),推荐刻录的最大速度不超过16倍速。有些用户推荐'''''速度为 4x 或者 2x.''''' 如果所刻录的CD有问题,可以尝试使用你系统所支持的最小速度方式刻录。 }}<br />
<br />
<br />
====USB安装方式====<br />
{{Warning|这样做会把USB盘里面原有的数据格式化。}}<br />
<br />
'''<code>UNIX</code> 方式:'''<br />
<br />
插入USB盘,找到其路径,用<code>/bin/dd</code>命令把.img映像文件写入USB(Linux下):<br />
<br />
dd if=archlinux-2009.08-''{core|netinstall}''-''{i686|x86_64}''.img of=/dev/sd''x''<br />
<br />
if= 后面是.img镜像文件的路径,of= 是你的USB路径. 要使用/dev/sd''x''而不是/dev/sd''x1''.(就是要使用整个分区而不是第一分区)<br />
<br />
'''检查镜像的完整性md5sum (可选):'''<br />
<br />
记下读入和写出的记录区数目,然后执行以下命令进行检查:<br />
dd if=/dev/sd''x'' count=''记录区数目'' status=noxfer | md5sum<br />
<br />
md5sum命令返回的值(这是你检查U盘上文件得到的)要与你下载的archlinux镜像文件的md5sum校验值相同;它们都应该和镜像站点的md5sum文件列表里相应的值相同。<br />
<br />
'''Windows方式:'''<br />
<br />
从https://launchpad.net/win32-image-writer/+download 下载Disk Imager。插入U盘,启动Disk Imager并选择映像文件,再选择U盘相应的磁盘驱动号,点击"write"即可。<br />
<br />
===二、启动Arch Linux系统安装程序===<br />
Usually, the first item is the preferred selection. However, choose Boot Archlive or Boot Archlive [legacy IDE] if you have trouble with libata/PATA, or have no SATA (Serial ATA) drives.<br />
<br />
Also, to change boot options, press '''e''' for editing the boot lines. Many users may wish to change the resolution of the framebuffer, for more readable console output. Append:<br />
插入刻录好的光盘CD或者USB盘,然后用它启动电脑。可能需要在BIOS里(通常是启动后在加电自检过程中按DEL、F1、F2、F11或者F12)改变一下启动顺序使得CD或者USB先被启动。<br />
<br />
{{Note|内存需求:<br />
* Core : 160 MB RAM x86_64/i686 (选择所有软件包,开启交换分区)<br />
* Netinstall : 160 MB RAM x86_64/i686 (选择所有软件包,开启交换分区)}}<br />
<br />
启动了Arch Linux光盘后,用上下箭头高亮菜单,按下回车键进行选择。<br />
<br />
通常,推荐选择第一项菜单。不过如果使用libata/PATA出现问题或者没有SATA (Serial ATA)驱动器,你也可以选择Boot Archlive或者Boot Archlive [legacy IDE] 。<br />
<br />
如果你需要改变启动参数,可以按‘e ’键来编辑启动行内容。 含多用户可能希望改变framebuffer分辨率以得到更好的终端显示。将<br />
vga=773<br />
加到kernel一行的后面,然后按<ENTER>,就可以得到1024x768的framebuffer。设置完毕后按'''b'''则使用相应的选择项进行启动。<br />
<br />
系统将会启动并提示登录,这时可以用'root'进行登录(不要加上单引号)。<br />
<br />
如果你的机器从live CD启动时发生错误或者一些其它'''硬件hardware'''错误,请参看[[Installation Troubleshooting]]。<br />
<br />
<br />
====登录并根据需要更换键盘映射表====<br />
如果你使用non-US键盘布局,可以用命令选择相应的键盘映射表。<br />
# km<br />
或者是是用loadkeys命令<br />
# loadkeys ''layout''<br />
(把''layout''替换成你需要的,比如 &quot;<code>fr</code>&quot; 或者 &quot;<code>be-latin1</code>&quot;)<br />
<br />
====边安装边查看安装指南====<br />
在刻录的livecd里面,已经包含了官方安装指南,在安装的时候可以边安装边查看,按组合键<ALT>+F2 切换到控制台vc/2(alt+f3,alt+f4……分别可以切换到对应的控制台vc/3,vc/4……以此类推),然后输入:<br />
<br />
# less /arch/docs/official_installation_guide_en<br />
<br />
按组合键<ALT>+F1回到控制台vc/1,继续安装系统。安装过程中可以随时切换回vc/2来查看安装指南。<br />
<code>less</code> 是个文本查看程序,位于<code>/usr/bin/less</code><br />
{{tip|请注意,官方指南仅涵盖基本系统的安装和配置过程。一旦安装完毕,强烈建议回到本wiki浏览更多安装后续已经相关问题。}}<br />
<br />
===三、开始安装===<br />
键入<br />
/arch/setup <br />
开始安装。<br />
<br />
====1、选择安装来源====<br />
接着会出现一个选择安装来源的提示。如果你用core ISO的话请选择CD,如果使用FTP ISO的话则选择FTP。<br />
* 如果选择 CORE installer,可以直接看下面的硬盘分区配置。<br />
* FTP/HTTP only: 选择这个需要预先加载网络驱动以便联网安装. 使用Udev来加载这些模块非常有效.<br />
按组合键ALT+F3切换到控制台vc/3,确认一下看其是否生效 invoking ifconfig -a . (Select OK to continue.) ——把后面的网络配置提前看<br />
<br />
====2、设置时间====<br />
有两个选择:<br />
* UTC - 如果使用unix系统包括Linux, Freebsd等, 建议使用UTC<br />
* local - 如果和Windows共享多引导系统, 建议使用local<br />
<br />
====3、硬盘分区配置====<br />
选择第一个菜单项"Prepare Hard Drive"。请注意,"Auto-Prepare"(自动分区)并不是最佳的选择,因为它只分配了最基本的三个区( /,/home,swap)<br />
在这里我们用手工进行硬盘分区。选择"2. Partition Hard Drives",接着选要分区的硬盘(比如:/dev/sdx),然后按你需要编辑分区表。<br />
<br />
''Arch Linux安装程序使用cfdisk公用程序来对硬盘进行分区。''<br />
<br />
''接下来,熟悉GNU/Linux的用户可以跳过这段内容直接到下面'''[[#选择软件包|选择软件包]]'''。''<br />
<br />
=====分区信息=====<br />
<br />
对磁盘进行分区是指在磁盘上定义若干区域(分区),每个都象是一个独立的磁盘,可以在其上创建(格式化)一个文件系统。 分区的类型分为主分区(Primary)、扩展分区(Extended)和逻辑分区(Logical)三类。 <br />
<br />
主分区可以被启动,一个物理磁盘最多能有4个主分区。要使用超过4个的话,只能使用一个包含了逻辑分区的扩展分区。<br />
(译者注:为避免误解,较易懂的解释应该是:一个磁盘不算逻辑分区最多只能有4个分区,这4个要么全是主分区,要么就是3个主分区+1个扩展分区,当然你将整个磁盘划为1个主分区也是没问题的,只要不超过4个分区即可)<br />
<br />
扩展分区通常不会被直接使用,它是作为逻辑分区的“容器”存在。一个硬盘只能有一个扩展分区,可以在里面继续再划分逻辑分区。<br />
<br />
当对一个磁盘进行分区时,是按这种数字顺序命名:主分区为sda1-3,跟着是扩展分区sda4(译者注:在/dev和fdisk -l里是看不到这个sda4的),在扩展分区中划分出来的逻辑分区分别是sda5、sda6,如此类推。<br />
<br />
=====交换分区swap=====<br />
交换分区Swap是虚拟内存在硬盘上驻留的地方,内核可以用它来储存在物理内存中放不下的数据。<br />
<br />
过去,常用的规则是将交换分区大小设置为物理内存的两倍。但是随着时间推移,现在的计算机已经有更大的内存容量,这条规则已经不适用了。通常,512MB内存的计算机,两倍(1G)的还是够用的。而1G内存的计算机,一倍的也够用了。如果你有更大的内存(比如超过1GB),也许可以完全把交换分区忘了,不推荐这样做!<br />
* ''如果你打算使用休眠到磁盘的电源方案,你必须要有不小于内存容量大小的交换分区,有些用户甚至会推荐大于物理内存容量15%的大小。''<br />
<br />
=====规划分区=====<br />
磁盘分区的规划是十分个人的设置。每位用户的决策都会根据自己计算机的情况和需求而不同。至少需要有一个包含了根[http://en.wikipedia.org/wiki/File_system 文件系统] ( / )的主分区和一个交换分区。你还可以选择给/boot(主要用来存放内核文件)、/usr、/var和/home(用来存放用户个人数据)划出独立分区。一个较好的做法是给 / 和 /home都划分独立分区。这样的话,当你因为某些原因重装Arch Linux(或者其它发行版),你还可以保留你的个人数据例如音乐、图片、桌面环境配置等。<br />
<br />
在本案例中,我们划分一个分区给 /,一个给/home,另外还有一个交换分区。<br />
<br />
=====开始创建分区cfdisk=====<br />
让我们开始创建一个包含'''root'''(/)文件系统的主分区。 <br />
<br />
选择'''N'''ew -> Primary,然后输入你希望的分区大小(对一个完整的Linux系统,4到8G是个不错的选择)。分区要位于磁盘的开头部分。选择刚新建的分区,接着选择'''B'''ootable将它置为可启动。<br />
<br />
同时选择分区文件系统类型'''T'''ype,指定为'83 Linux'.。<br />
<br />
给你的/home目录创建另一个分区。选择另外一个主分区设成你想要的容量大小,这取决于你的用户会在他们的home目录里储存多少文件,其大小可能从几百M办公文档到上百G音频视频,所以这里我无法给出一个建议。如果你要使用磁盘所有的剩余空间,记得保给交换分区留一部分(例如1GB或1024MB)。<br />
<br />
同样的,选择'''T'''ype为'83 Linux'。 <br />
<br />
最后,我们给交换分区创建一个分区。选择一个介于512MB到1GB之间的大小并将'''T'''ype改为82 (Linux swap / Solaris)。<br />
<br />
现在的分区规划看起来应该象这样(基于你的选择大小也许会有所不同):<br />
<br />
Name Flags Part Type FS Type [Label] Size (MB)<br />
-------------------------------------------------------------------------<br />
sda1 Boot Primary Linux (4096 - 8192)<br />
sda2 Primary Linux (> 100)<br />
sda3 Primary Linux swap / Solaris (512 - 1024)<br />
<br />
选择'''W'''rite并输入''''yes''''。要注意如果你删除了分区的话,这个操作会破坏你磁盘上的数据。选择'''Q'''uit退出分区程序。<br />
选择Done离开此菜单,接着选择"Set Filesystem Mountpoints"。<br />
<br />
=====IDE设备,为什么看起来它们和SCSI设备一样?=====<br />
最新开发的Linux内核里包含了libata和PATA模块,所有的IDE、SATA和SCSI都采用sd''x''这种命名方式。这十分正常,无需担心。<br />
<br />
=====设置文件系统挂载点=====<br />
<br />
''' ”文件系统格式(filesystems)“和”文件系统结构(file systems)“的区别:'''<br />
<br />
从技术层面确切的说,'''文件系统格式(filesystems)'''是一种数据'''格式''',涉及信息吞吐,比如ext2;而”文件系统结构(file systems)“则是特定操作系统中文件和目录的布局,比如/home/username/games。因此,当你被问及是否创建'''文件系统格式(filesystems)'''时,是在问你是否要'''格式化'''该分区…但是当程序向你问及挂载点时,你应该给出的则是该分区应该出现在你的Arch Linux ”文件系统结构“中的位置。<br />
<br />
'''文件系统类型:'''<br />
<br />
'''强烈建议:'''创建一个交换分区(SWAP)。选择一个合适的分区(本例中使用的是sda3). 安装程序就会询问你是否要创建swap 文件系统; 选择 yes. 接下来, 选择根分区的挂载点(本例中就是 sda1). 然后安装程序就会询问你需要哪一种文件系统。<br />
<br />
{{Box Note| 采用何种文件系统的类型取决于实际应用需要,没有十全十美的文件系统,选择任何一个文件系统,都需要在数据安全和性能要求方面作出适当倾斜,下面只是简单的介绍各种Arch linux支持的文件系统 }}<br />
<br />
1. '''ext2''' - 古老、 可靠的 GNU/Linux 文件系统。非常的稳定,不过 ''不支持日志记录功能''。磁盘检测速度较慢,因而有些不便. ''ext2可以容易地转换成ext3''。一般认为/boot分区采用此系统最合适,因为/boot里的东西就开机的时候读取一次,而且很少有变动,不需要日志文件系统,如果采用日志文件系统,日志的体积很可能远远大于内核的大小。<br />
<br />
2. '''ext3''' - 基于ext2系统, 并添加了日志记录功能。 一般认为他比其他文件系统要 ''稍微的'' 慢一点, 不过 ''非常的'' 稳定并且使用最为广泛,由 GNU/Linux FS 负责维护和开发。<br />
<br />
'''高性能文件系统:'''<br />
<br />
3. '''ext4''' - 最近加入支持的文件系统,是ext2和ext3的后续发展版本,Ext4增加了48位块地址,最大支持1EB文件系统,和单个16TB的文件,增加子目录限制到64,000。新增了很多功能,提供在线碎片处理,速度比ext3快,系统开销比ext3小。<br />
{{Box Note| 由于此系统较新,目前仍存在一些问题,暂时建议/home分区不采用此文件系统,以保证个人数据安全。}}<br />
<br />
4. '''ReiserFS''' - Hans Reiser 主持编写的高性能的日志文件系统,使用一种非常独特有趣的数据存储检索方法。ReiserFS 效率非常高, 特别在处理很多小文件的时候更是如此。ReiserFS在挂载的时候相对比较慢. 性能稳定。 ReiserFS 现在的开发并不活跃(最新的版本是Reiser4).<br />
<br />
5. '''JFS''' - IBM提供的日志文件系统( '''J'''ournaled '''F'''ile'''S'''ystem首字母缩写). JFS 效率非常高并且CPU资源占用率比其他任何一个文件系统都要低。并且在挂载和磁盘检测的时候都非常快,在各方面的表现都非常突出,尤其是 conjunction with the deadline scheduler. (参见 [[JFS]].) 但是并不像ext或者ReiserFS那样应用广泛。<br />
<br />
6. '''XFS''' - 非常高效的日志文件系统,特别适合处理大文件。在处理小文件的时候稍慢。在挂载的时候也很快。由于 /var 需要处理很多的小文件,所以可能不太适合作为/var 分区的文件系统。 GNU/Linux 文件系统中,最先实现可用的在线碎片处理。应用不及ext和ReiserFS那么广泛。<br />
* JFS 和 XFS 不能被磁盘工具压缩(比如gparted 或者 parted magic)<br />
<br />
'''未来文件系统'''<br />
<br />
7、btrfs - 此文件系统尚未被Arch纳入正式支持。是Oracle提供的copy-on-write档案系统。目标在取代的ext3,提高ext3单一档案的大小,总档案系统大小或档案检查,加入目前ext3未支援的功能,比如:writable snapshots,snapshots of snapshots,内建磁盘阵列(RAID)支援,and subvolumes。<br />
<br />
最主要的差别在于[http://en.wikipedia.org/wiki/Journaling_file_system 日志系统] (一种类似的在数据库环境中记录着日志变更的东西). 除ext2之外,其他文件系统都支持日志记录功能. ext3 完全兼容 ext2,因此哪怕你可以用一个非常古老的CD来挂载他,也没问题。 根分区目前最安全的选择就是使用ext3文件系统。ReiserFS,XFS,和JFS也可以使用,因为GRUB (启动引导管理器,稍候在安装部分将会介绍到) 都可以从这些文件系统中启动。你可以通过选择‘’‘yes’‘’来创建文件系统(并格式化分区),接着你就会被提示添加附加分区。 在我们的例子中, 只有sda2了。 选择一个文件系统类型,并且把这个分区挂在到/home. 再次说明,创建文件系统并且选择Done。然后回到主菜单。<br />
<br />
====4、选择软件包====<br />
现在我们要选择安装哪些软件包到系统中。选择CD作为来源,如果你不止一个光驱的话还需要选择使用哪个的光驱。<br />
<br />
软件包选择分为两个阶段。首先要选择软件包分类,然后出现所选分类中软件包的详细列表供你微调。使用空格键进行选择和取消。<br />
<br />
''*BASE:包含最小的软件包集合,仅够构建一个可运行的系统骨架。''<br />
''*SUPPORT:供网络和文件系统用的额外软件包,例如gpm、fuse、dnsutils、无线驱动、ndiswrapper、ntfs-3g诸如此类。''<br />
''*DEVEL:软件创建工具,如GCC、autoconf、automake和make等等。''<br />
''*LIB:大量的库文件,如gmp、lebelf、libevent等等。''<br />
*''' 2008.06 版'''的软件包选择,只有一个: BASE ,选择之后进入其详细列表. <br />
<br />
在这里,我们对'Select all packages by default'选择'yes'。<br />
<br />
接下来屏幕将显示你所选的软件包。对于新手,较安全的做法是不修改它,而有经验的用户可能希望裁减掉一些不需要的软件包。(例如,不需要的文件系统类型公用程序,不需要的驱动等等。)<br />
<br />
====5、安装软件包====<br />
接着,选择'Install Packages'。你会被询问是否希望保留pacman缓冲里的软件包。如果你选'yes',日后你还可以选择对某些软件包进行降级,因此推荐保留(日后你还是可以清除这些缓存的)。安装脚本跟着就会安装所选软件包到你的系统中。这些软件包是二进制的、针对i686优化的,总共仅100MB,因此安装是相当便捷的。<br />
<br />
====6、配置系统====<br />
系统接着会询问你是否要选择[[Hwdetect|hwdetect]]来收集配置所需信息。新手应该选择是('yes')。<br />
<br />
如果是相当熟悉自己的硬件、所需模块,有能力从零开始手动配置/etc/mkinitcpio和/etc/fstab 的高级用户,可以选择否'no'。(当然,此选项是非常复杂的,已经超过本指南的范围,这里就不详细解释了。)<br />
<br />
接下来,系统会询问你是否需要支持从USB设备、FireWire设备、PCMCIA设备、NFS共享、软RAID阵列、LVM2卷和加密卷上启动。如果需要则选'yes',在本案例中以上都不选。<br />
<br />
新手还应该选择让/etc/mkinitcpio/kernel26-fallback.conf使用[[Hwdetect|hwdetect]]的结果,这将确保你的硬盘控制器相容次序。<br />
<br />
现在系统会询问你使用哪个文本编辑器;如果你不熟悉[http://en.wikipedia.org/wiki/Vim_%28text_editor%29 vi/vim]的话可以选择[http://en.wikipedia.org/wiki/Nano_%28text_editor%29 nano]。然后就会出现一个包含系统中大部分重要配置文件的菜单。如果你打算查找/etc/rc.conf中可用的选项,只需按Alt+F2切换到另外一个虚拟控制台进行查找,然后用Alt+F1切换回安装程序。<br />
<br />
======系统配置主文件'''/etc/rc.conf'''======<br />
Arch Linux继承FreeBSD的传统,使用'''/etc/rc.conf'''作为系统配置的主要文件。这个文件包含了广泛的配置信息,主要用于系统的启动。正如名字中所包含的意思,它还包含了供/etc/rc*文件使用的配置。/etc/rc.conf提供了一个Arch用户可以轻易访问到的,简洁而又范围广泛的精简系统资源配置方案。<br />
* '''LOCALIZATION'''部分<br />
** '''LOCALE'''=: 系统场所(locale)设置,被所有国际化(i18n-aware)的应用程序使用 。从命令行上运行locale可以列出可用的locale设置。此设置缺省是适合英文(US English)用户使用的en_US.utf8。(此处locale的设置必须与/etc/locale.gen一致,'''[[#/etc/locale.gen|详见下文]]'''。)中文一般是zh_CN.UTF-8,如果使用之后乱码,先换回en_US.utf8,等进图形界面后再换回来。<br />
** '''HARDWARECLOCK'''=: 指示开关机时进行同步的硬件时钟,是'''UTC'''时间(协调世界时(Universal Time Coordinated), 过去曾用格林威治平均时(GMT)来表示)还是'''localtime'''(本地时间)。通常UTC较为好,因为它大大简化了时区和日光节约时间(中国过去称为夏时制)的变更。而当你同时还有其它操作系统如windows进行双启动,就必须使用localtime(本地时间),它只把本地时间保存到硬件时钟里。<br />
** '''TIMEZONE'''=: 时区(TIMEZONE)。(所有可用的时区可在/usr/share/zoneinfo/里找到。)<br />
** '''KEYMAP'''=: 可用的键盘映射表可在/usr/share/kbd/keymaps里找到。请注意此设定仅在TTY中有效,在所有图形窗口管理器或者X中都不使用此设置!<br />
** '''CONSOLEFONT'''=: 如果你一定要修改此设置,可在/usr/share/kbd/consolefonts/中找到可用的字体。<br />
** '''CONSOLEMAP'''=: 定义了启动时setfont程序加载的控制台映射表。有需要的话,可在/usr/share/kbd/consoletrans里找到可用的映射表。<br />
** '''USECOLOR'''=: 如果你使用彩色显示器的话请选"yes"。<br />
<br />
LOCALE="zh_CN.UTF-8"<br />
HARDWARECLOCK="localtime"<br />
TIMEZONE="Asia/Shanghai"<br />
KEYMAP="us"<br />
CONSOLEFONT=<br />
CONSOLEMAP=<br />
USECOLOR="yes"<br />
* '''HARDWARE'''部分<br />
** '''MOD_AUTOLOAD'''=: 如果你使用'''udev'''在启动时探测硬件并加载相应模块。请设置为"yes",(适合缺省模块化的内核)。设置为"no"就得靠用户自己指定所需的有关信息。<br />
** '''MOD_BLACKLIST'''=: 模块黑名单。在下面的例子中,IPv6模块和pcspeaker都被列入黑名单而不被加载。<br />
** '''MODULES'''=: 指示了其它模块,如果你知道缺少哪个重要的模块可以加在里面。('''hwdetect'''应该已经填写了最重要的模块):<br />
# Scan hardware and load required modules at bootup<br />
MOD_AUTOLOAD="yes"<br />
# Module Blacklist - modules in this list will never be loaded by '''udev'''<br />
MOD_BLACKLIST=(net-pf-10 pcspkr)<br />
#<br />
MODULES=(e100 eepro100 mii slhc snd-ac97-codec snd-intel8x0 soundcore)<br />
* '''NETWORKING'''部分<br />
** '''HOSTNAME'''=:设置为你喜欢的主机名(HOSTNAME)。<br />
** '''lo'''=: 不修改此行。<br />
** '''eth0'''=: 如果使用'''静态IP'''的话请调整网络接口的IP地址、掩码和广播地址。如果使用'''DHCP'''的话则设为eth0="dhcp"。<br />
** '''INTERFACES'''=: 指定使用哪些网络接口。如果你不使用DHCP来配置设备,而是通过命令行用ifconfig手动配置设备的话,这里的变量值(名字必须等于打算进行配置的设备名一样)必须和ifconfig里加入的内容一样。<br />
** '''gateway'''=: 如果你使用'''静态IP''',将网关(gateway)地址设为路由器的IP。如果使用DHCP,则将此行用'#'注释掉。<br />
** '''ROUTES'''=: 如果你使用'''静态IP''',则将'gateway'前面的'!'去掉。如果使用'''DHCP'''的话则不需要修改此行。<br />
<br />
<br />
例如,当使用'''DHCP''':<br />
HOSTNAME="arch"<br />
lo="lo 127.0.0.1"<br />
#eth0="eth0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255" <br />
eth0="dhcp"<br />
INTERFACES=(lo eth0)<br />
#gateway="default gw 192.168.0.1"<br />
ROUTES=(!gateway)<br />
* '''DAEMONS'''部分<br />
这个序列罗列了位于/etc/rc.d/里需要在启动过程中启动的脚本名字。<br />
<br />
*如果脚本名字前有惊叹号(!),表示它不被执行。<br />
*如果脚本名字前有符号(@),则表示它会在后台被执行,启动序列不会等待此脚本成功执行完毕,而是继续执行下一个守护进程脚本。<br />
<br />
这种'BSD风格'的初始化就是Arch的处理办法,而其它发行版则是在一个init.d目录里使用一大堆符号链接(一个简单的文件 vs 一整个目录)。<br />
<br />
======关于守护进程======<br />
虽然此时你不需修改[[daemons]]行,不过还是有必要解释一下什么是守护进程,因为过一会儿在指南里我们会需要它。<br />
<br />
和Windows服务(service)类似,守护进程(daemon)是一个运行于后台的程序,等待事件发生并提供服务。一个较好的例子是webserver等待请求以发送页面,还有SSH服务等待用户登录。这些都是全功能的程序,还有些守护进程工作起来并不是那么明显的。例如向日志文件里写信息的守护进程(如syslog、metalog),当系统空闲时降低CPU频率的守护进程(如cpufreq),以及提供图形化登录的守护进程(如gdm、kdm)。所有这些程序都可以被加入到daemons行中,在系统启动时被执行。本指南会对一些较有用的守护进程进行介绍。<br />
按Ctrl+X退出nano编辑器。<br />
<br />
======磁盘和分区配置文件:/etc/fstab======<br />
'''fstab''' ('''f'''ile '''s'''ystems '''tab'''le的缩写) 是系统配置的一部分,该文件列出所有可用的磁盘和分区,并指明它们初始化的方式或整合至全局文件系统的方式。'''/etc/fstab'''文件一般被'''mount'''命令读取,以决定某一特定设备被挂载时所采用的选项。<br />
<br />
这是一个'''/etc/fstab'''的例子:<br />
<br />
#<br />
# /etc/fstab: static file system information<br />
#<br />
# <file system> <dir> <type> <options> <dump> <pass><br />
none /dev/pts devpts defaults 0 0<br />
none /dev/shm tmpfs defaults 0 0<br />
#/dev/cdrom /mnt/cdrom iso9660 ro,user,noauto,unhide 0 0<br />
#/dev/dvd /mnt/dvd udf ro,user,noauto,unhide 0 0<br />
#/dev/fd0 /mnt/fd0 vfat user,noauto 0 0<br />
/dev/sda1 / jfs defaults,noatime,nodiratime 0 1 <br />
/dev/sda2 /home jfs defaults,noatime,nodiratime 0 2<br />
/dev/sda3 swap swap defaults 0 0<br />
Hwdetect应该已经有效地配置了一个可用的'''fstab''',但最好还是简要地检查一下。<br />
<br />
*如果你打算用'''hal'''来自动挂载DVD之类的媒体,为了给即将安装的'''hal'''做准备,你可能要注释掉cdrom和dvd条目。 <br />
<br />
''在笔记本电脑和桌面系统上,可以给 / 和 /home加上'noatime'和'nodiratime'选项来提高速度、性能,同时还能省电。无论你采用何种文件系统,这样做都应该是安全的。''<br />
<br />
更多信息请参照[[Fstab]]<br />
<br />
======'''mkinitcpio.conf、modprobe.conf和kernel26-fallback.conf'''======<br />
此时我们无须去修改这些配置文件。'''mkinitcpio.conf'''负责配置ramdisk(例如从RAID、加密卷启动), '''modprobe.conf'''可以用来设置内核模块的的某些配置选项,而'''kernel26-fallback.conf'''则是initramfs后备配置。<br />
<br />
======(对于静态IP)网络配置文件:/etc/resolv.conf ======<br />
*''如果你使用DHCP,完全可以忽略此文件,缺省情况下dhcpd守护进程会自动创建和销毁此文件。''<br />
<br />
如果你使用静态IP,则可在/etc/resolv.conf里设置你的DNS服务器。每行的格式为nameserver <ip地址>,如果有多个DNS服务器则可以填入多行。<br />
<br />
如果你使用路由器,也许会希望由你的路由器本身指定DNS服务器,而在'''resolv.conf'''里只是写入你的路由器的IP(同时也是'''/etc/rc.conf'''里的网关),例如:<br />
nameserver 192.168.1.1<br />
可选的,逐个加入你的DNS服务器,例如:<br />
nameserver 4.2.2.1<br />
nameserver 4.2.2.2<br />
<br />
如果使用'''DHCP''',你也可以在你的路由器里指定你的DNS服务器,或者如果你的ISP支持的话由ISP自动指定。<br />
<br />
======/etc/hosts======<br />
可以在此文件中加入你想要的''hostname'',必须和/etc/rc.conf里的设置一致,因此它应该象这样:<br />
127.0.0.1 localhost.localdomain localhost '''''yourhostname'''''<br />
''为了程序的兼容性,必须严格遵照这个格式,'''包括'localhost' 这项'''!错误的句法可能会导致网络性能低下和/或某些程序运行缓慢甚至无法运行。这对新手来说是十分普遍的错误。''<br />
<br />
对于大部分用户,只要把''yourhostname''加入到行末就就可以了,不过有些用户推荐以下句法:<br />
127.0.0.1 '''''yourhostname'''''.domain.org localhost.localdomain localhost '''''yourhostname'''''<br />
如果你使用静态IP,可以用这种句法加入新行:<static-ip> hostname.domainname.org hostname,例如:<br />
192.168.1.100 '''''yourhostname'''''.domain.org '''''yourhostname'''''<br />
<br />
======/etc/hosts.deny和/etc/hosts.allow======<br />
如果你打算使用[[SSH|ssh]]的话,请根据自己的需要修改此配置。缺省设置是拒绝所有进入的连接,而不只是ssh连接。编辑'''/etc/hosts.allow '''文件加入:<br />
<br />
* 允许所有进入的ssh连接。<br />
sshd:all <br />
<br />
* 允许特定IP地址进入ssh连接。<br />
sshd: 192.168.0.1<br />
<br />
* 允许你指定的网段 (地址从 192.168.0.0 到 192.168.0.255)<br />
sshd: 192.168.0.<br />
<br />
* 允许某个IP地址范围<br />
sshd: 10.0.0.0/255.255.255.0<br />
<br />
如果你不打算使用[[SSH|ssh]],为安全起见请保持此文件的缺省设置(为空)。<br />
<br />
======/etc/locale.gen======<br />
<br />
'''locale-gen''' 命令从 '''/etc/locale.gen'''读取信息设定系统的locales. 这些设置稍后会被'''glibc''' 和其他一些支持本地化的程序或者库用于自动翻译输出各种语言的"独特" 文本, 并且合适的显示地域、货币、时区以及日期格式, 字符排列方式和其他一些本地化的特殊标准。设置默认本地化的功能是类<code>UNIX</code>操作系统的一大特质<br />
<br />
默认情况下 /etc/locale.gen 是一个仅包含注释文档的空文件.编辑后,这个文件将不会get touched again. 每次'''glibc'''更新之后'''locale-gen'''就会运行一次, 以在/etc/locale.gen重新生成所有的本地化设置.<br />
<br />
选定你需要的本地化类型(移除前面的#即可), 比如:<br />
en_US ISO-8859-1<br />
en_US.UTF-8 <br />
('''你这里的设置必须和上文中提到的/etc/rc.conf 的设置一致哦.''')<br />
<br />
现在,安装程序将运行locale-gen 脚本, 以生成你设定的locales。你以后可以通过修改文件/etc/locale.gen变更你的locale, 然后使用根用户(root)运行'locale-gen'脚本使之生效。<br />
<br />
''Note 如果你选择并设置了locale, 他将提示你 "The current locale is invalid..." 错误。可能是因为大多数新Arch用户都会犯的普遍的错误,也是在论坛中问得最多的问题。''<br />
<br />
======Root密码======<br />
最后,设置一个root密码并确定你已牢记它。返回主菜单然后接着安装启动加载器。<br />
<br />
======Pacman镜像======<br />
为'''pacman'''选择一个软件仓库镜像站。记住主站 archlinux.org 是有流量限制的,下载速度限于50KB/s.。<br />
<br />
在列表中仔细查看, 一般 xxx.cn 是中国镜像, xxx.au 是澳大利亚, 等等...<br />
<br />
*''如果你不熟悉现有的镜像和它们所处的位置,那就随便选一个。稍后你可以编辑 "/etc/pacman.d/mirrorlist", 或运行本指南后面提到的'''rankmirrors'''脚本,它将自动配置最接近你的镜像。''<br />
<br />
返回主菜单。<br />
<br />
====7、安装启动加载器====<br />
因为本案例中没有第二个操作系统,因此我们需要安装一个启动加载器。推荐选择[http://www.gnu.org/software/grub/ GNU GRUB]作为启动加载器。另外一种选择是[http://lilo.go.dyndns.org/ LILO]。缺省的'''GRUB'''配置('''/boot/grub/menu.lst''')应该足够了。唯一你可能想修改的是控制台的分辨率。将vga=<number>加入到第一个kernel行。(menu.lst中已列出一张分辨率和数字的对应表格可供查找。)<br />
title Arch Linux (Main)<br />
root (hd0,0)<br />
kernel /boot/vmlinuz26 root=/dev/sda1 ro vga=773<br />
initrd /boot/kernel26.img<br />
参数"vga=773"表示1024x768分辨率、256色的framebuffer。<br />
<br />
将'''GRUB'''启动加载器安装到主引导区(本例中为sda)。<br />
<br />
====8、系统重启====<br />
退出安装程序。<br />
*建议:为了方便接下来更进一步的安装配置,可以把光盘里的新手指南复制一份到电脑里,这样后面的安装就能查看相应的向导了<br />
<br />
cp /arch/beginnersguide.txt /mnt/home/beginnersguide.txt<br />
<br />
系统重启之后,进入控制台,可以使用下面命令查看这新手指南<br />
less /home/beginnersguide.txt<br />
所有安装完毕之后,可以删了这指南<br />
rm /home/beginnersguide.txt<br />
<br />
输入命令下面命令,重启:<br />
<br />
reboot<br />
<br />
一个新Arch Linux系统就会启动并进入登录提示符(你可能需要在'''BIOS'''将启动顺序改为优先从硬盘启动)。<br />
<br />
'''祝贺你,一个崭新的Arch Linux基础系统闪亮登场了!'''<br />
<br />
==第二部分:完成基本系统并升级==<br />
你的新Arch Linux基础系统现在已是一个功能完整的GNU/Linux环境了,随时可以进行定制。从现在开始,你可以按自己的意图和需求改造它。由于arch是滚动发布的,所以安装包不一定是最新的系统,所以我们在安装完成之后,需要立即更新系统。<br />
<br />
让我们开始吧。<br />
-----<br />
登录入你的root账号。我们将以root身份配置pacman和更新系统,然后创建一个普通用户账号。<br />
<br />
===一、配置网络(如果有需要)===<br />
*''如果安装脚本的自动配置不适合你,本段内容将帮助你配置大部分类型的网络。''<br />
-----<br />
如果一切正常的话,你的网络应该可以正常使用了。先ping www.google.com验证一下:<br />
ping -c 3 www.google.com<br />
<br />
''如果你已经成功建立网络连接,则跳到下面阅读[[#使用pacman更新、同步、升级系统|使用pacman更新、同步、升级系统]]'''。''<br />
<br />
如果ping www.google.com后得到"unknown host"的错误,可以认为你的网络尚未正确配置。你需要重新检查以下内容的完整性和正确性:<br />
'''/etc/rc.conf''' # 特别留意HOSTNAME= 和 NETWORKING 部分有无输入错误。<br />
<br />
'''/etc/hosts''' # 复核一下格式。(看之前的内容。)<br />
<br />
'''/etc/resolv.conf''' # 当你使用静态IP时需要检查。如果你使用DHCP,缺省这个文件会被自动创建和销毁,不过也可以改为你需要的内容。(参见[[Network]]。)<br />
<br />
高级的网络配置方法可以在[[Network]]一文中找到。<br />
<br />
=====有线网络=====<br />
<br />
用以下命令检查网络<br />
ifconfig<br />
你应该看到eth0这一项。如果有需要,你可以这样设置一个新的静态IP:<br />
ifconfig eth0 <ip address> netmask <netmask> up <br />
并且这样设置缺省网关:<br />
route add default gw <ip address of the gateway><br />
查看一下/etc/resolv.conf是否包含你的DNS服务器,不过缺失了则补填进去。<br />
再次用ping www.google.cn检查一下网络。如果一切正常,将/etc/rc.conf调整为刚才新设置的静态IP。如果你的网络使用DHCP服务器/路由器的话,输入:<br />
dhcpcd eth0<br />
如果这样可行的话,则将/etc/rc.conf按之前所述方法调整为动态IP。<br />
<br />
=====无线网络=====<br />
详见安装指南:[[无线设置 (简体中文)|无线设置]]<br />
<br />
=====模拟信号调制解调器=====<br />
<br />
如果你想使用外接电话线调制解调器, 你至少要安装ppp包. 根据需要修改配置文件 /etc/ppp/options 你可以参考 man pppd 的帮助.<br />
<br />
你还需要定制一个 chat 协议脚本, 在初始化握手连接建立以后, 提供你的ISP用户名和密码. 命令pppd 和 chat 的帮助里有例子不管你是菜鸟还是高手都应该能搞定连接了.<br />
使用 udev 的话, 串口设备一般是 /dev/tts/0 和 /dev/tts/1.<br />
<br />
Tip: Read [[Dialup without a dialer HOWTO]].<br />
<br />
如果你不想为了 pppd 拔光自己的头发, 你可能会选择安装 wvdial 或类似的配置工具来简化这个过程.<br />
如果你的猫是所谓的 WinModem, 也就是内置 PCI modem 卡, 你可以在这个网址找到大量信息: [http://www.linmodems.org/ LinModem]<br />
<br />
=====ISDN=====<br />
<br />
通过三步,完成 ISDN 的安装和配置:<br />
# 安装配置固件Install and configure hardware<br />
# 安装配置ISDN 管理工具<br />
# 添加ISP信息<br />
<br />
现在的 Arch stock kernels 已经包含了ISDN 所需要的modules, 所以不需要重新去编译内核,除非 you're about to use rather odd ISDN hardware. 把ISDN卡插入电脑或者插入USB ISDN-Box之后,you can try loading the modules with modprobe. 绝大部分的ISDN PCI 卡都能被module hisax处理,只需要两个参数:类型和协议。 如果使用的是1TR6标准,则协议设定为 '1' ,如果使用的是EuroISDN (EDSS1),协议设定为 '2', '3' if you're hooked to a so-called leased-line without D-channel, 如果使用的是US NI1,则设为'4'.<br />
<br />
所有配置细节都可以在kernel documentation, more specifically in the isdn subdirectory, and available online中获知。 类型的参数是根据电视卡来设定的,在README.HiSax kernel documentation中,有一个可能类型的列表。 用相应的参数加载moduleChoose,比如这个:<br />
<br />
modprobe hisax type=18 protocol=2<br />
<br />
这个将加载适用于电视卡类型为ELSA Quickstep 1000PCI,德国使用的EDSS1协议的模块hisax。可以在日志文件/var/log/everything.log中查看是否模块被预加载。额外的USB ISDN Adapter需要加载些USB模块才能正常工作。<br />
<br />
通过上述设定之后,如果电视卡能正常工作,那么把下面模块和参数加入/etc/modprobe.conf中:<br />
<br />
alias ippp0 hisax<br />
options hisax type=18 protocol=2<br />
<br />
这么做的好处是,这些模块在不使用时不会被加载。另外的方法是可以在这只加参数,把hisax加入/etc/rc.conf里面的MODULES,这样做的坏处就是不管这些模块是不是在使用,都加载了。 <br />
<br />
完成上述步骤之后,需要安装管理工具<br />
<br />
安装软件包isdn4k-utils,阅读关于isdnctrl的说明手册。在说明手册里,将有详细的说明:如何创建一个配置文件that can be parsed by isdnctrl,安装实例。 Please note that you have to add your SPID to your MSN setting separated by a colon if you use US NI1.<br />
<br />
使用isdnctrl utility配置ISDN卡之后,将可以拨号到你设定的PHONE_OUT参数的机器上,但提示用户名和密码错误。把用户名和密码加入到/etc/ppp/pap-secrets或者/etc/ppp/chap-secrets,这个主要根据的是你的ISP使用的协议授权方式,as if you were configuring a normal analogous PPP link。如果无法确定,可以两个文件都加。<br />
<br />
完成上述设定之后,用root帐号建立一个拨号连接:<br />
isdnctrl dial ippp0<br />
有啥问题,请检查日志文件!<br />
<br />
=====DSL (PPPoE)=====<br />
<br />
仅当需要你的计算机去主动拨号连接ISP的情况下才需参考本段内容。如果你使用独立的路由器来负责这类工作,你只需要设置一个缺省网关即可。<br />
<br />
在使用DSL连接前,你得先在计算机里安装一个连接到DSL-Modem的网卡。将你新装网卡加入到modules.conf/modprobe.conf或者MODULES列表之后,安装rp-pppoe软件包并运行pppoe-setup脚本来配置你的连接。当你输入完有关信息后,可以分别通过以下命令来进行连接和挂断:<br />
<br />
/etc/rc.d/adsl start<br />
<br />
和<br />
<br />
/etc/rc.d/adsl stop<br />
<br />
setup过程一般都是很容易、直观的,如果还有不懂可以阅读man手册。如果你想在启动时自动拨号,可以将adsl加入到DAEMONS列表中。<br />
<br />
<br />
===二、更新Pacman===<br />
<br />
====pacman是什么?====<br />
[[Pacman]]是Arch Linux的软件包管理器('''pac'''kage '''man'''ager)。Pacman是用C语言编写的,速度快,使用简便,功能强大。它可以管理整个软件包系统,负责软件包的安装、删除、降级(通过缓存),也支持自编译的软件包,自动分析依赖关系,可以搜索远程和本地软件仓库,还有大量其它功能。这里我们将用pacman来从远程软件仓库下载软件包并安装到系统中。<br />
<br />
对系统进行定制,pacman是Arch Linux最重要工具。<br />
<br />
====1、配置pacman====<br />
=====pacman总配置文件/etc/pacman.conf=====<br />
Arch通过pacman可以获得对下面 4软件仓库的管理:<br />
<br />
'''[core]'''<br />
<br />
[core](“核心”)仓库的简单原则是只提供一个基本的Arch Linux的基本工具:GNU系列工具,Linux内核,一个文字编辑器,一个命令行浏览器等(这里也有一些例外。比如说,vi和nano是同时提供的,允许用户选择一个或两个)。它包含所有使你的系统正常运转的“必须”安装的包,只有它们完美地工作,你的系统才能继续运行。这些是绝对“system-critical”(对系统来说至关重要)的包。由开发者负责维护。<br />
<br />
*''Core安装媒介(The Core installation media)简单地包含一个安装脚本,一个当前发布版本的核心仓库的快照(snapshot)。''<br />
<br />
'''[extra]'''<br />
<br />
[extra](“额外的”)仓库包含所有的对于一个基本的Arch系统不是必须,但是对于构建一个完整的系统环境有用的的Arch包。 比如'''X''', KDE和Apache,都可以在这里面找到。它也是由开发者维护的。<br />
<br />
'''[testing]'''<br />
<br />
[testing](“测试”)仓库包含的包是[core]和[extra]仓库的候选者。<br />
下面情况下,新的软件包将进入[testing]软件仓库:<br />
* 可能会导致系统出问题的升级,需要测试。<br />
* 需要重新打包其他软件包。这种情况下,所有需要重新打包的软件包将被放在[testing]仓库,直到所有重新打包完成,这些软件包才回归原有的软件仓库。 <br />
<br />
开发者维护。<br />
<br />
[testing]是唯一的一个在名义上与其它官方仓库有冲突的仓库。(that can have name collisions with any of the other official repositories. )<br />
<br />
<font color=&quot;blue&quot;>*如果开启, [testing]必须放在''pacman.conf''的软件仓库的第一个。</font><br />
<br />
<font color=&quot;red&quot;>'''警告''': '''''开启[testing]软件仓库,容易导致系统崩溃,因此只建议有经验的用户开启。'''''</font><br />
<br />
'''[community]'''<br />
<br />
[community](“社区”)仓库是由“信任用户”(''Trusted Users (TUs)'')维护的,是''Arch User Repository ([[AUR]])''(Arch用户仓库)的一部分。它包含的是二进制的包,在用户仓库中有足够的“票数”,并由''信任用戶''挑选出来的。像其它上面列出的仓库一样,[community] 可以用pacman获取。<br />
<br />
'''[[AUR]]''' 也包含'''unsupported''' 分支,这不能直接通过pacman获取。*. [unsupported] 包含多达海量PKGBUILD脚本,用来从源代码编译。这从其它仓库中是不能使用的。 <br />
<br />
<nowiki>*</nowiki> '''''[[AUR Helpers]]''''' 能帮助你无缝地使用AUR。<br />
<br />
'''/etc/pacman.conf'''<br />
<br />
每次调用pacman,它都会读取/etc/pacman.conf文件。这个配置文件分若干段,每一段定义了一个pacman用来搜索软件的仓库。唯一例外的是options段,它定义了全局选项。<br />
nano /etc/pacman.conf<br />
范例:<br />
#<br />
# /etc/pacman.conf<br />
#<br />
# See the pacman.conf(5) manpage for option and repository directives<br />
<br />
#<br />
# GENERAL OPTIONS<br />
#<br />
[options]<br />
# The following paths are commented out with their default values listed.<br />
# If you wish to use different paths, uncomment and update the paths.<br />
#RootDir = /<br />
#DBPath = /var/lib/pacman/<br />
#CacheDir = /var/cache/pacman/pkg/<br />
#LogFile = /var/log/pacman.log<br />
HoldPkg = pacman glibc<br />
# If upgrades are available for these packages they will be asked for first<br />
SyncFirst = pacman<br />
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u<br />
#XferCommand = /usr/bin/curl %u > %o<br />
<br />
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup<br />
#IgnorePkg =<br />
#IgnoreGroup =<br />
<br />
#NoUpgrade =<br />
#NoExtract =<br />
<br />
# Misc options (all disabled by default)<br />
#NoPassiveFtp<br />
#UseSyslog<br />
#ShowSize<br />
#UseDelta<br />
#TotalDownload<br />
#<br />
# REPOSITORIES<br />
# - can be defined here or included from another file<br />
# - pacman will search repositories in the order defined here<br />
# - local/custom mirrors can be added here or in separate files<br />
# - repositories listed first will take precedence when packages<br />
# have identical names, regardless of version number<br />
# - URLs will have $repo replaced by the name of the current repo<br />
#<br />
# Repository entries are of the format:<br />
# [repo-name]<br />
# Server = ServerName<br />
# Include = IncludePath<br />
#<br />
# The header [repo-name] is crucial - it must be present and<br />
# uncommented to enable the repo.<br />
# <br />
<br />
# Testing is disabled by default. To enable, uncomment the following<br />
# two lines. You can add preferred servers immediately after the header,<br />
# and they will be used before the default mirrors.<br />
#[testing]<br />
#Include = /etc/pacman.d/mirrorlist<br />
<br />
[core]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
[extra]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist <br />
<br />
[community]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
# An example of a custom package repository. See the pacman manpage for<br />
# tips on creating your own repositories.<br />
#[custom]<br />
#Server = file:///home/custompkgs<br />
要开启一个软件仓库,只需要将'Include ='和'[repository]'行前的注释符号(#)去除。<br />
<br />
*"Server ="行如果取消注释,将会强制此服务器被首先搜索,详细的仓库配置位于/etc/pacman.d/下。<br />
* 注意:选择仓库时,请确认将仓库名和'Include ='行都一同取消注释。没有这样做的话会导致你选择的仓库被忽略!这是个很普遍的错误。<br />
<br />
=====(如果有必要)配置镜像列表 /etc/pacman.d/mirrorlist=====<br />
更快的镜像能显著改善pacman的性能和你对Arch Linux的总体体验。<br />
<br />
*手动编辑/etc/pacman.d/mirrorlist:<br />
nano /etc/pacman.d/mirrorlist<br />
删除所有不在你所在洲或者太远的镜像。(在nano里你可以用CTRL-K删除每个不需要的行。)保存文件并退出。<br />
<br />
*'''rankmirrors'''脚本可以根据镜像的响应延迟对其自动排名。'''Rankmirrors'''是python脚本,需要安装python:<br />
<br />
pacman -S python<br />
<br />
然后,运行'''rankmirrors'''脚本按响应延迟顺序对镜像进行排名:<br />
rankmirrors -v /etc/pacman.d/mirrorlist<br />
输出会列出所有镜像和它们的响应延迟(ping),例如:<br />
<br />
# United States<br />
# http://mirrors.easynews.com/linux/archlinux/$repo/os/i686 ... 0.96<br />
# ftp://ftp.nethat.com/pub/linux/archlinux/$repo/os/i686 ... unreachable<br />
# ftp://locke.suu.edu/linux/dist/archlinux/$repo/os/i686 ... 2.43<br />
# ftp://mirrors.unixheads.org/archlinux/$repo/os/i686 ... 1.96<br />
<br />
脚本将从低到高的响应延迟顺序显示:<br />
Server = http://mirrors.easynews.com/linux/archlinux/$repo/os/i686<br />
Server = ftp://mirrors.unixheads.org/archlinux/$repo/os/i686<br />
Server = ftp://locke.suu.edu/linux/dist/archlinux/$repo/os/i686<br />
Server = ftp://ftp.nethat.com/pub/linux/archlinux/$repo/os/i686<br />
<br />
要注意的是这个结果对于镜像排列并非很精确,最接近你的镜像或者延迟最低的镜像并不一定是最佳选择。(反应迅速但是内容过时的镜像、或者低延迟但是窄带宽的镜像对你毫无用处)。<br />
<br />
编辑/etc/pacman.d/mirrorlist,将最佳的镜像置于在列表顶端。为了体验多个镜像你可能要不断修改此配置文件,请精明地选择。<br />
<br />
====常用的命令====<br />
<br />
与远程软件仓库同步和更新本地包数据库 (推荐在安装和更新包之前这样做):<br />
pacman -Sy<br />
<br />
'''升级'''系统中所有的包:<br />
pacman -Su<br />
<br />
一条同步、更新、'''升级''' 所有系统中的包的命令:<br />
pacman -Syu<br />
<br />
安装或者升级单个软件包或者一串包(包括其依赖包):<br />
pacman -S packageA packageB<br />
<br />
同步、更新数据库并安装软件包:<br />
pacman -Sy packageA packageB<br />
<br />
移除软件包, 但保留依赖的包:<br />
pacman -R package<br />
<br />
移除单个包,并且移除没有被别的软件依赖的依赖包:<br />
pacman -Rs package<br />
<br />
移除包所有不需要的依赖包并删除其配置文件:<br />
pacman -Rsn package<br />
<br />
通过给定关键词(列表)搜索远程软件仓库数据库(repo):<br />
pacman -Ss keyword<br />
<br />
列出系统中所有的包<br />
pacman -Q<br />
<br />
在本地包数据库搜索 (查询)指定软件包:<br />
pacman -Q package <br />
<br />
在本地包数据库搜索 (查询)指定软件包并列出相关信息:<br />
pacman -Qi package<br />
<br />
To defragment pacman的数据库缓存和速度优化选项:<br />
pacman-optimize<br />
<br />
统计当前系统中的包数量:<br />
pacman -Q | wc -l<br />
<br />
使用ABS和makepkg从源代码编译安装包:<br />
pacman -U packagename.pkg.tar.gz<br />
<br />
Note: pacman有很多很多的选项和功能组合。你可以试试man pacman或者查阅lt the [[pacman]]维基条目<br />
<br />
====软件包管理增强工具====<br />
* Yaourt 可查询aur的pacman增强工具<br />
* Tupac 快速查询的yaourt增强工具<br />
* Powerpill 多进程下载的pacman增强工具<br />
{{Box Note| 强烈建议更新系统完毕后,安装yaourt和powerpill,以便更充分享受Arch Linux的方便和强大。}}<br />
在/etc/pacman.conf文件里,最后添加两行(如果是i686的话,把x86_64换成i686即可):<br />
[archlinuxfr]<br />
Server = http://repo.archlinux.fr/x86_64<br />
然后使用pacman安装yaourt<br />
pacman -Sy yaourt<br />
<br />
以后就可以使用yaourt命令来查找并安装包括[[AUR]]里的软件了。比如bcm无线网卡,需要安装b43-firmware(此软件包在[[AUR]]仓库里,使用pacman无法查找到),使用yaourt命令查找并安装:<br />
yaourt b43-firmware<br />
找到之后,根据相应提示,一直到安装完成。<br />
<br />
====图形化管理工具====<br />
* qt界面的shaman:比较成熟的pacman 图形化管理工具<br />
* gtk界面的gtkpacman :目前BUG比较多,不稳定。<br />
<br />
====Pacman的更多信息====<br />
用此命令查看pacman手册:<br />
man pacman<br />
有空的话可以看看[[pacman (简体中文)]]维基条目。<br />
<br />
====2、更新Pacman自己====<br />
<br />
一开始,系统可能会提示你先更新pacman自身,这取决于Arch安装包的新旧程度:<br />
pacman -Sy pacman<br />
pacman开始查看是否需要更新,如果有提示需要更新,则按‘y’,开始pacman更新。<br />
<br />
'''''有时候,还需要用户主动修改某些配置;请仔细阅读升级过程中的输出获取相关信息。'''''<br />
<br />
===三、更新系统===<br />
====使用[[pacman (简体中文)|pacman]]====<br />
现在我们要用[[pacman (简体中文)|pacman]]来更新系统。要更新、同步并'''升级'''你的系统,可以使用命令:<br />
pacman -Syu<br />
pacman就会获取所有最新可用软件包信息并进行升级。(此时你可能会被提示先升级pacman自身。如果是这样,回答'yes',然后在完毕后再运行一次pacman -Syu命令。)<br />
<br />
===='''滚动发布'''之美====<br />
Arch是一个'''rolling release'''(滚动发布)的发行版。这意味着没有必要重新安装或执行完整的系统重建来升级到最新版本。只需要执行'''pacman -Syu''',就能保持你的系统更新到最新和bleeding edge(表示最新的、因而也并非完美的技术)。<br />
<br />
===四、增加一个用户并设置用户组===<br />
用root账号来处理日常工作是很危险的。Root是用来处理系统管理的任务。我们可以用以下命令增加一个普通用户账号:<br />
adduser<br />
大部分缺省选项都是没问题的,你可能还需要将storage、audio、video、optical和wheel加入到你的用户组中 ── 特别是在你打算使用一个完整功能的桌面环境的情况下。<br />
<br />
用户组和用户的关联定义在/etc/group文件中: <br />
<br />
它包含了:<br />
<br />
*'''audio''' - 关于声卡和相关软件的任务<br />
<br />
*'''wheel''' - 给sudo使用<br />
<br />
*'''storage''' - 负责存储设备<br />
<br />
*'''video''' - 视频任务和3D加速<br />
<br />
*'''optical''' - 和光驱有关的任务<br />
<br />
*'''floppy''' - 软驱访问<br />
<br />
*'''lp''' - 打印任务<br />
<br />
请参看[[Groups]]一文了解你应该属于哪些用户组。<br />
你还可能需要将你的用户账号加入到以下用户组(需要以root身份运行此命令):<br />
usermod -aG audio,video,floppy,lp,optical,network,storage,wheel,dbus,hal USERNAME<br />
详情可看usermod和gpasswd的man手册。<br />
<br />
===五、安装建立Sudo (可选)===<br />
安装Sudo:<br />
# pacman -S sudo<br />
以root身份,运行命令visudo,把用户加入sudo用户 (a &quot;sudoer&quot;).如果不知道怎么使用vi,你可以在用visudo前设置VISUAL 或 EDITOR环境变量为你喜欢的编辑器。例如:<br />
# export VISUAL=vim<br />
或<br />
# export EDITOR=nano<br />
如果你对于用vi很适应,去掉EDITOR=nano这个变量就行:<br />
# visudo<br />
这命令将在一个特殊的vi会话中打开文件 /etc/sudoers 。visudo复制文件到一个可编辑的临时文件中,用一个编辑器编辑它(vi是默认的),接下来运行一个安全检查(“sanity check”)。如果通过,这个临时文件就有正确的权限将重写的原始文件。t<br />
<br />
<font color=&quot;red&quot;>'''注意:不要直接用编辑器编辑 /etc/sudoers ; 否则会出现这样的提示:Errors in syntax can cause annoyances (像root帐户不能使用的描述一样)。 必须使用 ''visudo'' 命令来编辑 /etc/sudoers.'''</font><br />
<br />
当用户输入以 &quot;sudo&quot;, 作为开始的命令行时,临时授予该用户root权限。加入下面一行:<br />
USER_NAME ALL=(ALL) ALL<br />
USER_NAME 就是单个用户名。<br />
<br />
更多信息,比如按<TAB> 自动命令补全,请见[[Sudo]]<br />
<br />
==第三部分:安装X并配置ALSA==<br />
一共有三步工作:<br />
*1、安装声卡驱动<br />
*2、安装x-window(包括显卡驱动)<br />
*3、配置X<br />
<br />
{{Box Note | '''在热插拔未配置正确的情况下,或者是/etc/rc.d/hal未启动的情况下,请不要启动开启X(包括重启使用gdm或者kdm登陆),否则可能导致鼠标键盘失去响应!!!'''}}<br />
<br />
===一、配置声卡:使用alsamixer===<br />
高级Linux声音架构(Advanced Linux Sound Architecture,简称ALSA)是一个Linux内核组件。它替换了原有的开放声音系统(OSS),为声卡提供了设备驱动。除了声音设备驱动以外,'''ALSA'''还给应用程序开发人员提供了一个用户空间库,可使更高级的API无需直接与内核驱动打交道就能使用驱动功能。<br />
<br />
{{Box Note| Alsa已经包含进最新的内核kernel,udev 将在系统启动时自动检测硬件,并自动根据声卡加载相应的内核模块。虽然声卡已经在工作,但电脑的声音默认是静音。}}<br />
{{Box Note| OSS4.1已经放出,相对于老的版本,这是一个显著的提升的版本,如果使用ALSA有问题, 或者是想尝试新的功能,可以使用 OSS4.1。 相关说明可见: [[OSS]]}} <br />
<br />
Alsa-utils软件包里的alsamixer让我们可以从命令行来配置声音设备。(你也可以稍后在'''X'''环境中使用alsamixer。)<br />
默认情况下,内核加载模块snd_pcsp,这是一个alsa pc speaker模块。 snd_pcsp通常先于&quot;你实际的&quot;声卡模块加载。大部分情况下,这模块最后加载更好,因为可以让alsamixer正确控制需要的声卡。<br />
<br />
在/etc/modprobe.conf中加入这行,可以使得snd_pcsp最后加载:<br />
options snd-pcsp index=2<br />
<br />
当然,如果你不想让snd_pcsp加载,可以把它放入黑名单,或者是在/etc/rc.conf的Modules里禁止它:<br />
MODULES=(... !snd_pcsp)<br />
<br />
{{Box Note | 想要生效,需要释放并重新加载所有声音模块,当然,系统重启就可以简单解决这问题。 }}<br />
<br />
* 安装alsa-utils软件包:<br />
pacman -S alsa-utils<br />
<br />
* 为了解决Alsa声卡独占问题,可以安装alsa-oss:<br />
# pacman -S alsa-oss <br />
<br />
* 把你的普通用户账号加入到audio用户组中:以root身份,运行<code>/usr/bin/gpasswd</code>程序:<br />
gpasswd -a yourusername audio<br />
*以普通用户身份运行: <br />
alsamixer<br />
用左右光标键移动到Master和PCM声道上,按'''M'''取消掉静音。用向上键增加音量。(70-90的音量是较合适的范围)按ESC键离开alsamixer。<br />
有'''Speaker'''的,需要同时取消静音并调整之. <br />
<br />
====测试声音====<br />
以普通用户身份,使用 <code>/usr/bin/aplay</code>程序来测试你的声音配置:<br />
aplay /usr/share/sounds/alsa/Front_Center.wav<br />
你应该会听到一个女性声音说:“Front,center。”<br />
<br />
====保存声音配置====<br />
以root身份运行<code>/usr/bin/alsactl</code> :<br />
alsactl store<br />
这将创建'/etc/asound.state'文件,用来保存alsamixer的设置。<br />
<br />
为了每次启动都可以自动恢复混音器设置,可将守护进程''alsa''加入到你的/etc/rc.conf中的DAEMONS列表。<br />
nano /etc/rc.conf<br />
DAEMONS=(syslog-ng network crond '''alsa''')<br />
''注意,alsa守护进程在启动过程中仅仅是恢复音量设置。它和alsa音频库(和内核级API)是完全不同的。''<br />
<br />
更多详情请参看[[ALSA 安装设置 (简体中文)|ALSA 安装设置]]。<br />
<br />
===二、安装X===<br />
'''X''' 窗口系统(一般叫'''X11'''或者更简单的叫'''X''') 是一个网络互动和显示服务,提供位图显示器窗口. 提供标准化工具包(toolkit)和协议,用于<code>UNIX</code>类操作系统,构建一个图形界面(GUIs) <br />
<br />
'''X''' 提供最基本、基础的框架,用于构建一个图形操作界面环境。包括:绘图、屏幕窗口移动,与鼠标或者键盘的交互。 '''X''' 并不负责用户交互界面的部分:有独立的客户端程序负责处理这部分。 比如gnome、kde。<br />
<br />
'''X''' 因为它先于'''W'''窗口系统,最初由斯坦福大学开发。 <br />
<br />
*''注意: 如果想使用一个'''开源''' 显卡驱动, 需要3d加速,强烈建议在安装Xorg之前安装库 libgl :''<br />
pacman -S libgl<br />
''(拥有专利的视频驱动提供它们自己的gl库安装(implementations).)''<br />
----- <br />
====1、安装X====<br />
构建一个GUI的第一步:用pacman来安装Xorg包.<br />
<br />
# pacman -S xorg<br />
对于新版的xorg,建议(可能大部分情况下是必须的)安装输入设备驱动evdev。它本来应该作为xorg-server的一个依赖被安装的,不过不知道为什么貌似缺失了:<br />
# pacman -S xf86-input-evdev<br />
3d的工具比如glxgears包含在包'''mesa''' 里(如果需要,也安装):<br />
# pacman -S mesa<br />
<br />
====2、安装显卡驱动====<br />
到这一步,已经有了运行'''X''' Server的基本软件包,接下来需要把显卡的驱动安装到电脑里(e.g. xf86-video-<name>). 最简单的X.org配置方法就是安装正确的驱动包,然后使用自动脚本对 /etc/X11/xorg.conf 进行初始化,比如使用 Xorg -configure(arch团队提供hwd工具,但据以前用户的反映,这个现在还老出问题,新手可以使用,以后有能力再配置其他).<br />
<br />
如果不知道显卡类型,输入下面命令:<br />
lspci | grep VGA<br />
<br />
输入下面命令,查看所有'''开源'''驱动: <br />
pacman -Ss xf86-video | less<br />
<br />
下面是一个'''开源'''的显卡列表和相关说明:<br />
*'''xf86-video-apm''' Alliance ProMotion video driver<br />
*'''xf86-video-ark''' ark video driver<br />
*'''xf86-video-ati''' ati video driver<br />
*'''xf86-video-chips''' Chips and Technologies video driver<br />
*'''xf86-video-cirrus''' Cirrus Logic video driver<br />
*'''xf86-video-dummy''' dummy video driver<br />
*'''xf86-video-fbdev''' framebuffer video driver<br />
*'''xf86-video-glint''' GLINT/Permedia video driver<br />
*'''xf86-video-i128''' Number 0 i128 video driver<br />
*'''xf86-video-i740''' Intel i740 video driver<br />
*'''xf86-video-i810''' Intel i810/i830/i9xx video drivers (deprecated - use -intel)<br />
*'''xf86-video-intel''' Newer Version of Intel i810/i830/i9xx video drivers<br />
*'''xf86-video-imstt''' Integrated Micro Solutions Twin Turbo vidoe driver<br />
*'''xf86-video-mach64''' mach64 video driver <br />
*'''xf86-video-mga''' mga video driver (Matrox Graphics Adapter) <br />
*'''xf86-video-neomagic''' neomagic video driver<br />
*'''xf86-video-nouveau''' Open Source 3D acceleration driver for nVidia cards (eperimental)<br />
*'''xf86-video-nv''' nvidia nv video driver<br />
*'''xf86-video-openchrome''' Openchrome drivers<br />
*'''xf86-video-r128''' ati Rage128 video driver<br />
*'''xf86-video-radeonhd''' Experimental Radeon HD video driver for r500 and r600 ATI cards<br />
*'''xf86-video-rendition''' Rendition video driver<br />
*'''xf86-video-s3''' S3 video driver<br />
*'''xf86-video-s3virge''' S3 Virge video driver<br />
*'''xf86-video-savage''' savage video driver<br />
*'''xf86-video-siliconmotion''' siliconmotion video driver<br />
*'''xf86-video-sis''' SiS video driver<br />
*'''xf86-video-sisusb''' SiS USB video driver<br />
*'''xf86-video-tdfx''' tdfx video driver<br />
*'''xf86-video-trident''' Trident video driver<br />
*'''xf86-video-tseng''' tseng video driver<br />
*'''xf86-video-unichrome''' Unichrome video drivers<br />
*'''xf86-video-v4l''' v4l video driver<br />
*'''xf86-video-vesa''' vesa video driver<br />
*'''xf86-video-vga''' VGA 16 color video driver<br />
*'''xf86-video-via''' via video driver<br />
*'''xf86-video-vmware''' vmware video driver<br />
*'''xf86-video-voodoo''' voodoo video driver<br />
<br />
* 说明:'''vesa'''驱动是最通用的软图形驱动, 适用于大部分的显卡, 但没有3D加速等功能。所以如果实在无法找到合适的显卡驱动,就只好选用vesa, 理论上它应该能在任何显卡上工作。(这是原话,好像夸张了点!If you cannot find a suitable driver for your video chipset, vesa '''should''' work.)<br />
<br />
用pacman来安装适合你显卡的驱动。例如:<br />
pacman -S xf86-video-savage<br />
(给Savage显卡的驱动。)<br />
<br />
* 如果实在不确定需要安装那个显卡驱动,可以安装所有显卡驱动包, 输入下面命令:<br />
pacman -S xorg-video-drivers<br />
<br />
*如果显卡是nVIDIA 或者ATI的,并'''想安装nVIDIA或者ATI官方提供的显卡驱动,请看下面。'''<br />
-----<br />
<br />
====nVIDIA图形显示卡====<br />
nVIDIA显示卡的驱动程序被许多人认为是非常好的质量,而且带有高级3D性能。<br />
<br />
在设置您的你nVIDIA显卡之前您先要选择您要使用的驱动程序。Arch现在有3种不一样的nVIDIA驱动程序,各自支持不同型号的显卡:<br />
<br />
'''1. nvidia-96xx''' ''直到Ge Force 4的较新显卡''<br />
<br />
'''2. nvidia-173xx''' ''Geforce FX系列显卡''<br />
<br />
'''3. nvidia''' ''在GF FX之后的最新GPU''<br />
<br />
{{Box Note| 一些特别老如TNT和TNT2之类的显卡所需的Nvidia-71xx系列闭源驱动,由于无法在Arch所用的新版Xorg下正常运行,并且nvidia也已不再继续支持它们,因此已被删除。你可以改用xf86-video-nv或者xf86-video-vesa驱动。}}<br />
<br />
到nVIDIA主页,看哪个适合你电脑.区别只是安装,配置过程是一样的.<br />
<br />
''根据你的显卡'',选择合适的nVIDIA驱动安装,比如: <br />
pacman -S nvidia-96xx<br />
<br />
nVIDIA软件包有个工具能自动升级你已有的nVIDIA驱动的配置文件/etc/X11/xorg.conf,输入下列命令即可实现:<br />
nvidia-xconfig<br />
<br />
它也有一些选项,用于更深入和具体地配置xorg.conf文件的内容和选项,例如:<br />
<br />
<br />
nvidia-xconfig --composite --add-argb-glx-visuals<br />
<br />
更详细的信息,请参考:nvidia-xconfig(1).<br />
<br />
一些有用的妙法可用在“device“部分(你要清楚它们不一定都能对你的系统有用):<br />
Option "RenderAccel" "true"<br />
Option "NoLogo" "true"<br />
Option "AGPFastWrite" "true"<br />
Option "EnablePageFlip" "true"<br />
将所有的DRI注释掉:<br />
# Load "dri"<br />
<br />
多检查几次你的/etc/X11/xorg.conf以确定你的默认的depth(色深),horizontal sync(水平同步),垂直刷新率,以及分辨率是可以接受的。<br />
<br />
使用<code>/sbin/depmod</code>命令来更新内核模块依赖:<br />
depmod -a<br />
(也许需要重启。)<br />
{{Tip|nvidia配置的高级的说明参考文章[[NVIDIA]] 。}}<br />
<br />
现在你可以跳到'''[[#三、配置X:创建并修改/etc/X11/xorg.conf|配置X]]'''来进一步熟悉,或者跳到'''[[#3、测试 X|测试 X]]'''继续安装过程。<br />
<br />
====ATI图形显示卡====<br />
ATI用户的驱动可以有几种选择。<br />
* '''xf86-video-ati'''软件包提供的开源'''''radeon'''''驱动。<br />
** 原创的、完全支持Radeon芯片组到X1950(最新的R500芯片组)的逆向工程开源驱动。对9200系列以前的显卡完全支持,可以稳定的提供全2D和3D加速。从9500到X1950完全支持2D加速特性,良好的3D加速,不过缺乏某些闭源驱动的特性(例如能源节省特性仍处于测试阶段)。xf86-video-ati支持从HD2xxx (R6xx)到最新的显卡,不过目前仅提供2D支持。<br />
* '''xf86-video-radeonhd'''软件包提供了开源的'''''radeonhd'''''驱动。<br />
** 此驱动支持ATI R500(Radeon X1000系列)以及更新的芯片组。该驱动由AMD提供文档,Novell为之开发。它支持RandR 1.2,目前的开发工作非常活跃。因此所支持的不同系列显卡的功能可以不一致。(有些用户反映它性能优异,而有些则说它很糟)。它还支持带音频的HDMI。<br />
* AUR中的Catalyst软件包提供了闭源'''''fglrx'''''驱动。稍后将介绍闭源驱动。<br />
开源驱动通常可以满足大部分需求而且较少出问题。<br />
<br />
安装'''''radeon'''''ATI驱动:<br />
# pacman -S xf86-video-ati libgl ati-dri<br />
安装'''''radeonhd'''''ATI驱动:<br />
# pacman -S xf86-video-radeonhd libgl ati-dri<br />
<br />
Arch的<code>extra</code>官方仓库曾经提供过闭源ATI驱动'''Catalyst'''的预编译包,不过在2009年3月以后,由于对闭源驱动的质量和开发进度不满意,官方取消了对它的支持。目前catalyst驱动可以在[http://aur.archlinux.org/packages.php?ID=22899 AUR]中找到。Catalyst驱动的安装信息可以在[[ATI#Proprietary_ATI_Catalyst_driver|这里]]找到。<br />
<br />
{{Warning| 闭源ATI驱动仅支持R600和更新的显卡(即HD2xxx及以上系列),不支持旧系列(X1xxx系列及以下)。}}<br />
<br />
{{Tip|ATI配置的高级指引可以参看[[ATI | ATI wiki 文章]]。}}<br />
<br />
====3、安装输入设备驱动软件包====<br />
最新的X需要你为包括键盘和鼠标在内的输入设备安装驱动。查看可用输入设备驱动的完整列表:<br />
# pacman -Ss xf86-input | less<br />
<br />
对大部分用户,xf86-input-keyboard和xf86-input-mouse应该可以满足基本配置。使用pacman来为你的输入设备安装需要的驱动,例如:<br />
# pacman -S xf86-input-keyboard<br />
===三、配置X:创建并修改/etc/X11/xorg.conf===<br />
====xorg.conf文件====<br />
/etc/X11/xorg.conf 是你的 X-Window-System 的主要配置文件,你的 GUI('''G'''raphical '''U'''ser '''I'''nterface)的基础,它是一个普通的文本文件,里面由 “section” 和 “subsection” 来安排。重要的 section 有 ''Files, InputDevice, Module, Monitor, Modes, Screen, Device'' 和 ''ServerLayout''。各个section安排的前后次序没有关系,对同一种类型的设备也可以有多个section,比如你可能有多个显示器,或者你的本本既有鼠标又有触摸板。<br />
------<br />
从X11R7.2版开始Xserver引入了自动配置特性。在大多情况下,即使没有xorg.conf文件它也能很好地运作。如果''自动检测功能工作正常'',而且你又不需要开启如 aiglx、compositing 等功能的话,你甚至不需要创建这个配置文件。<br />
<br />
====1、创建 /etc/X11/xorg.conf====<br />
<br />
高级用户可以手动创建他们的xorg.conf文件。一般用户可以使用程序<code>/usr/bin/Xorg</code>附加参数-configure来生成一个基本的配置文件;以root身份输入下面命令:<br />
# Xorg -configure<br />
这里生成的文件是/root/xorg.conf.new <br />
<br />
把这文件复制到 <code>/etc/X11/</code>:<br />
# cp /root/xorg.xonf.new /etc/X11/xorg.conf<br />
<br />
====更多的创建/etc/X11/xorg.conf的办法====<br />
* 说明:如果你的电脑已经有一个配置好的xorg.conf文件,不管这个文件是在什么别的发行版下生成的,只要Xorg的版本一致,就可以把该文件复制到你的Arch系统的<code>/etc/X11/</code>目录下。<br />
* 可以使用程序<code>/usr/bin/hwd</code>生成xorg.conf。首先要安装这程序:<br />
# pacman -S hwd<br />
然后输入下面命令:<br />
# hwd -xa<br />
{{Box Note| 目前,hwd在生成的xorg.conf有一行失效。 使用完这程序后,需要手动删除或者是注释掉 Section &quot;Files&quot;下的RgbPath那一行。via nano /etc/X11/xorg.conf or your equivalent, as root/sudo.}}<br />
<br />
* 使用<code>/usr/bin/xorgcfg</code> 脚本生成xorg.conf:<br />
# xorgcfg <br />
* 使用<code>/usr/bin/xorgconfig</code>生成xorg.conf,这个程序以互动方式来创建该文件,输入下面命令运行:<br />
# xorgconfig<br />
<br />
====2、Input设备热插拔问题:请在测试X前阅读====<br />
<br />
xorg 1.5.x版本里已经开启热插拔Input设备。<br />
{{Box Note | 当热插拔开启后, X将清空xorg.conf里所有使用the kbd and mouse 驱动建立的设备。这将导致X被冻结,使得鼠标和键盘失去响应。下面是解决办法。'''方法只能二选一'''}}<br />
<br />
有两个办法可以修复这一问题:<br />
<br />
1) '''配置 input设备热插拔''':安装驱动 xf86-input-evdev,同时配置HAL使其能使用kbd/mouse驱动。<br />
<br />
安装xf86-input-evdev:<br />
# pacman -S xf86-input-evdev<br />
在X.org相关进程启动前,启动守护进程hal:<br />
# /etc/rc.d/hal start<br />
把hal加入/etc/rc.conf里的DAEMONS列表里,这样每次电脑启动,都会自动开启hal。详情请见[[Xorg input hotplugging]] 。<br />
<br />
说明: 开启hal必须首先有一个dbus用户和用户组,以root身份输入下面命令创建用户和用户组<br />
<br />
usr/sbin/groupadd -g 81 dbus<br />
usr/sbin/useradd -c 'System message bus' -u 81 -g dbus -d '/' -s /bin/false dbus<br />
<br />
2) '''关闭input设备热插拔''':在/etc/X11/xorg.conf的ServerFlags段,加入参数''Option &quot;AutoAddDevices&quot; &quot;False&quot;'' 这将忽略hal的硬件检测,并使用你xorg.conf的keyboard/mouse配置。步骤如下<br />
# nano /etc/X11/xorg.conf<br />
加入下面三行:<br />
Section &quot;ServerFlags&quot;<br />
Option &quot;AutoAddDevices&quot; &quot;False&quot;<br />
EndSection<br />
<br />
====3、测试 X====<br />
<br />
在所生成的xorg文件路径''path/to/xorg.conf''前,加入参数''-config'' ,运行 '''X'''脚本,可以测试脚本配置是否正确。<br />
比如要测试你上面生成的xorg是否配置正确,输入:<br />
X -config /root/xorg.conf.new<br />
'''X''' 将启动,在屏幕中央会有一个白色的 X ,鼠标或是触摸板可以移动它,按 CTRL-Alt-Backspace 可以退出 '''X'''<br />
<br />
====对xorg.conf除错====<br />
如果 X 出现错误不能运行,你需要手动检查你的配置文件:<br />
<br />
nano /root/xorg.conf.new<br />
<br />
* 确定 Xorg -configure 命令正确的识别了你的显卡,比如:<br />
Section &quot;Device&quot;<br />
<br />
...<br />
<br />
Driver &quot;savage&quot;<br />
<br />
...<br />
<br />
EndSection<br />
<br />
* 确定里面的 Section "Monitor" 设置了水平同步率和垂直刷新率,如果没有要把它加上:<br />
Section &quot;Monitor&quot;<br />
Identifier &quot;Monitor0&quot;<br />
VendorName &quot;Monitor Vendor&quot;<br />
ModelName &quot;Monitor Model&quot;<br />
HorizSync 30.0 - 130.0 # Safe for LCD's<br />
VertRefresh 50.0 - 100.0 # Safe for LCD's and most CRT's.<br />
EndSection<br />
如果你不知道这些刷新率到底是多少,你就得查一下你显示器的说明书。<br />
<br />
* 在section "Screen"配置默认色深(color depth):<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Card0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
(此处色深被设定为真彩24色。)<br />
<br />
<br />
* 在subsection &quot;Display&quot; 加入你需要的Modes, at least under the Depth 24 header, e.g.:<br />
SubSection &quot;Display&quot;<br />
Viewport 0 0<br />
Depth 24<br />
Modes &quot;1024x768&quot; &quot;800x600&quot; &quot;640x480&quot;<br />
* Add the following section, if you wish to enable eye candy which requires the composite extension: <br />
Section &quot;Extensions&quot;<br />
Option &quot;Composite&quot; &quot;Enable&quot;<br />
EndSection<br />
<br />
* 上述调整完成后,再测试你的配置:<br />
X -config /root/xorg.conf.new<br />
<br />
* 在确认 '''X''' session开启,没有错误之后,把测试好的配置文件移到 /etc/X11下,作为系统的xorg.conf配置文件:<br />
mv /root/xorg.conf.new /etc/X11/xorg.conf<br />
详细的介绍可见[[Xorg]] <br />
<br />
接下来可以简单作测试 '''[[#Simple baseline X test|Simple baseline X test]]'''<br />
<br />
====调整键盘布局====<br />
=====如果开启了input热插拔=====<br />
# cp /usr/share/hal/fdi/policy/10osvendor/10-keymap.fdi /etc/hal/fdi/policy/<br />
# nano /etc/hal/fdi/policy/10-keymap.fdi<br />
Edit the &quot;input.xkb.layout&quot; key and possibly the &quot;input.xkb.variant&quot; key in this file.<br />
Restart hal:<br />
# /etc/rc.d/hal restart<br />
<br />
=====如果关闭了input热插拔=====<br />
Add option lines in the &quot;InputDevice&quot; section of the /etc/X11/xorg.conf file specifying the keyboard layout and variant:<br />
Option &quot;XkbLayout&quot; &quot;be&quot;<br />
Option &quot;XkbVariant&quot; &quot;&quot;<br />
<br />
详情请见 [[Xorg input hotplugging]]。<br />
<br />
===简单的命令行界面X测试(如果需要)===<br />
<br />
在安装了xorg、合适的显卡驱动、创建了一个/etc/X11/xorg.conf文件之后,如果想在安装完整桌面环境之前,快速测试下你的配置,使用'''xterm'''可以实现! <br />
Xterm是个简单的终端模拟程序,作为base xorg软件包的一部分会被自动安装,运行在'''X '''Server环境里。通过配置~/.xinitrc,Xterm可以让我们快速测试显卡驱动和配置文件/etc/X11/xorg.conf是否被正确配置。(另外,如果在没有/etc/X11/xorg.conf的情况下,你想测试下'''X''' 自动检测是否满意,也可以使用这个)<br />
<br />
==== 准备工作:配置~/.xinitrc====<br />
<br />
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. <br />
{{Box Note | '''[[.xinitrc]]''' is a so-called 'dot' (.) file. 在UNIX文件系统下,文件名以 (.)开头的,是 '隐藏文件',,使用普通的命令'ls' 将不显示这些文件,使用加了参数命令'''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 &quot;Run Control&quot;.}}<br />
<br />
'''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. (说明: ''如果没有文件~/.xinitrc, /etc/X11/xinit/xinitrc 将被作为替代来使用,这是个使用TWM and Xterm的默认配置。'')<br />
<br />
切换到'''''普通, 非root'''''用户:<br />
# su - ''yourusername''<br />
* /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.<br />
* 如果没有~/.xinitrc这个文件,到该目录下创建一个,或者从/etc/skel/复制一个同样的文件到你的home目录:: <br />
<br />
$ cp /etc/skel/[[.xinitrc]] ~/<br />
<br />
* 编辑文件: <br />
$ nano ~/.xinitrc<br />
加入这行&quot;<code>exec xterm</code>&quot;像下面这样:<br />
<br />
#!/bin/sh<br />
#<br />
# ~/.xinitrc<br />
#<br />
# Executed by startx (run your window manager from here)<br />
#<br />
exec xterm<br />
# exec wmaker<br />
# exec startkde<br />
# exec icewm<br />
# exec blackbox<br />
# exec fluxbox<br />
<br />
{{Box Note | ''请确保~/.xinitrc''里,以'''exec'''开头的,只有'''一行'''的注释被去掉。}}<br />
<br />
====开始执行测试====<br />
<br />
* 以普通用户身份输入下面命令,开启'''X''',开始测试你的配置:<br />
<br />
$ startx<br />
或者是这命令<br />
$ xinit<br />
<br />
此时会打开一个'''xterm''' session,你可以在这里测试your keyboard and its layout<br />
<br />
* 按Ctrl+Alt+Backspace,或者输入"exit"可以退出'''X''' Server。<br />
* 如果开启'''X'''出现问题,在终端,查看日志文件/var/log/Xorg.0.log的错误信息。<br />
<br />
更多的Xorg configuration介绍可见[[Xorg]] .<br />
<br />
==第四部分:安装并配置桌面环境==<br />
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 icons, applets, windows, toolbars, folders, wallpapers, 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.<br />
<br />
* 如果你需要一个完整功能,类似于Windows和Mac OSX, 可以选择安装'''[[#KDE|KDE]]''' <br />
* If you want something slightly more minimalist, which follows the K.I.S.S. principle more closely, '''[[#GNOME|GNOME]]''' is a good choice<br />
* '''[[#Xfce|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.<br />
<br />
如果你的机器较老,或者是希望使用一个更轻量、更少GUI要求,可以选择只安装 '''Window Manager''', 或者 WM. A WM controls the placement and appearance of application windows in conjunction with the X Window System but does NOT provide such additions as panels, applets, icons, etc.<br />
* Lightweight floating WM's include: [[#Openbox|'''Openbox''']], [[#Fluxbox|'''Fluxbox''']], [[#fvwm2|'''fvwm2''']], '''Windowmaker, Pekwm, and TWM'''.<br />
* If you need something completely different, try '''Awesome, ion, wmii, dwm, or xmonad'''。<br />
<br />
===一、安装字体===<br />
在安装桌面环境/窗口管理器'''之前''',也许你会先安装些美观的字体。Dejavu和bitstream-vera都是不错的字体集。而对于网页,你还可能需要Microsoft字体。如下安装:<br />
pacman -S ttf-ms-fonts ttf-dejavu ttf-bitstream-vera<br />
对于中文字体,开源的文泉驿正黑矢量字体是不错的选择,它还内嵌了9pt-12pt的点阵宋体:<br />
pacman -S wqy-zenhei<br />
<br />
===二、选择默认启动的桌面环境 ~/.xinitrc===<br />
<br />
以普通用户身份编辑/home/username/.xinitrc,加入你要用的DE. This will allow you to use '''startx/xinit''' from the shell, in the future, to open your DE/WM of choice:<br />
<br />
nano ~/.xinitrc<br />
<br />
反注释或者加入相应的桌面环境/窗口管理器的''''exec''' ..'内容行。例如:使用Xfce4桌面环境:<br />
<br />
exec startxfce4 <br />
<br />
记住在~/.xinitrc中只反注释掉一行'''exec'''。这条命令将一直运行到你注销桌面登录。一般的,shell将等到kde完成加载之后,在运行下一条命令。在命令前加 &quot;exec&quot; ,是告诉the shell 这条命令最后执行, 这样shell就不用等待其他命令了,直接载入桌面。<br />
接下来安装你所选的桌面环境/窗口管理器。<br />
<br />
===三、选择安装一个桌面环境===<br />
====GNOME====<br />
=====关于GNOME=====<br />
GNOME是'''G'''NU '''N'''etwork '''O'''bject '''M'''odel '''E'''nvironment的缩写。GNOME项目有两大部分:GNOME桌面环境 ── 既直观又迷人的最终用户桌面,以及GNOME开发平台 ── 一个用来创建可与桌面集成的应用程序的庞大的框架。<br />
<br />
=====安装=====<br />
安装基本的GNOME环境:<br />
pacman -S gnome<br />
<br />
安装额外的GNOME环境:<br />
pacman -S gnome-extra<br />
然后选择提示的所有软件包。 <br />
<br />
=====对GNOME有用的守护进程=====<br />
如之前所述,守护进程(daemon)是运行在后台的程序,它等待事件发生并提供相应的服务。其中'''Hal'''守护进程可以自动挂载磁盘、光驱和U盘给GUI使用。'''Fam'''守护进程可以在GUI中实时反映文件的变动,如最近安装的程序、文件系统的变化等。'''Hal'''和'''fam'''使得GNOME的使用更为方便。Hal和fam软件包在安装GNOME时已一同安装,建议安装社区库的gamin来替代fam。<br />
<br />
{{Box Note|注意,fam是一个比较老的包,很容易造成较大的日志文件。}}<br />
<br />
{{Box Note|在当前的gnome环境中,你可以安装gamin来实现fam的功能。这时,你可以不用在DAEMONS中添加fam启动项了(不需要加入gamin,它会自动被启用)。}}<br />
<br />
* 你需要启动'''hal'''守护进程。<br />
<br />
启动hal:<br />
/etc/rc.d/hal start<br />
<br />
如果您想使用fam,同样需要启动:<br />
/etc/rc.d/fam start<br />
<br />
将hal加入到/etc/rc.conf的DAEMONS中以使得它们随系统启动而自动运行:<br />
nano /etc/rc.conf<br />
<br />
DAEMONS=(syslog-ng network crond alsa '''hal''')<br />
<br />
{{Box Note|注意,如果使用fam,那么把fam加入到hal后面。}}<br />
<br />
* 或许你还会希望安装一个图形界面的登录管理器。在GNOME下'''gdm'''守护进程是个不错的选择。<br />
以root身份运行:<br />
pacman -S gdm<br />
<br />
让gdm启用有两种方式,一种是直接加入到DAEMONS的末尾,通过rc.conf来启动;另外一种方式是用过配置inittab来加载gdm。<br />
<br />
* 通过inittab来加载gdm也很方便(推荐使用这种方式):<br />
nano /etc/inittab<br />
<br />
修改默认启动方式:<br />
<br />
将<br />
id:3:initdefault:<br />
改为<br />
id:5:initdefault:<br />
<br />
然后取消下面代码的注释:<br />
x:5:respawn:/usr/sbin/gdm -nodaemon<br />
<br />
{{Box Note|实际上,可以看到gdm/xdm/kdm/slim等,使用哪个取决于你的喜好,启用喜欢的那个,将其他的注释掉。当然,本章介绍的是gnome,所以推荐gdm,下章中将推荐kdm:)}}<br />
<br />
<br />
* 通过DAEMONS方式启动gdm也很方便:<br />
nano /etc/rc.conf<br />
<br />
DAEMONS=(syslog-ng network crond alsa hal gdm)<br />
<br />
{{Box Note|这是类似debian/ubuntu的做法,这种方式有一点不好:不管什么时候(非修复模式),系统总是会尝试进入gdm引导的X方式下。对于X已经配置得很好,并且不使用纯控制台的人可以使用这种方式。但是选择这种方式的话你将不能通过内核参数3或者5来区分进入纯字符控制台还是X11的gdm登录窗口。}}<br />
<br />
* 开启Gnome<br />
以普通用户身份启动X:<br />
startx<br />
或者这条命令也行:<br />
$ xinit<br />
如果你的 ~/.xinitrc一直没配置,那你将可以一直使用下面这条命令来开启Gnome:<br />
$ xinit /usr/bin/gnome-session<br />
<br />
关于安装和配置GNOME的高级指引可以参见[[GNOME (简体中文)|GNOME]]一文。接下来你可以浏览'''[[#优化和收尾|优化和收尾]]'''。或许你还会对[[ArchTips(简体中文)|Arch安装完后的小技巧]]一文感兴趣。<br />
<br />
=====美化=====<br />
如果不满足于缺省的GNOME主题和图标,那么可以安装一个不错的主题,比如murrine:<br />
pacman -S gtk-engine-murrine<br />
接着在System->Preferences->Theme里选择这个主题。<br />
<br />
Arch Linux也做了些不错的主题,根据你自己的审美观,选择满意的安装吧:<br />
<br />
# pacman -S gtk-engines gtk2-themes-collection gtk-aurora-engine gtk-candido-engine gtk-rezlooks-engine<br />
<br />
你还可以在[http://www.gnome-look.org Gnome Look]里找到更多的主题、图标和壁纸。<br />
<br />
====KDE====<br />
=====关于KDE=====<br />
KDE桌面环境('''K''' '''D'''esktop '''E'''nvironment)的缩写。 KDE是一种著名的运行于GNU/Linux 、 <code>UNIX</code> 工作站等的强大、自由图形工作环境。她拥有对系统内部各功能的强大整合能力、跨平台能力、易用性、优异的初始界面.<br />
<br />
=====安装=====<br />
Arch提供多个版本的kde: '''kde、kdebase 和 KDEmod'''. 选'''一个'''就行了,然后 '''[[#有用的KDE守护进程|有用的KDE守护进程]]''': <br />
<br />
'''1.)''' '''kde'''是完整的kde软件包,大概 ~300MB,适合主要使用kde软件的系统.<br />
pacman -S kde<br />
'''2.)''' '''kdebase'''是kde的基础软件包(里面没有kdm),大概 ~80MB,适合于只想把kde作为基础系统.<br />
pacman -S kdebase<br />
'''3.)''' '''KDEmod''' 是 Arch Linux独有的、社区驱动的项目,目标是把kde更加细致的模块化和达到其极致的运行效率。KDEmod项目的网站在http://chakra-project.org/ 。<br />
<br />
=====有用的KDE守护进程=====<br />
<br />
KDE 需要'''hal''' ('''H'''ardware '''A'''bstraction '''L'''ayer) 作为守护进程(daemons). '''kdm''' ( '''K''' '''D'''isplay '''M'''anager), 提供一个 '''图形化登录界面'''.<br />
{{Box Note|hal守护进程将自动开启dbus守护进程。kde4里已经不需要fam。kdm现在在kdebase-workstation这个包里,如果只安装kdebase,需要再安装此包才能使用kdm}}<br />
<br />
The hal daemon, among other things, will automate the mounting of disks, optical drives, and USB drives/thumbdrives for use in the GUI. <br />
<br />
-----<br />
启动hal进程:<br />
<br />
/etc/rc.d/hal start<br />
<br />
编辑/etc/rc.conf的 DAEMONS部分:<br />
nano /etc/rc.conf<br />
把 '''hal''' 加入 DAEMONS 部分,以便他们在系统启动时加载. 如果想要kde的图形化登录界面,把 '''kdm'''也加进去(或者不加,在/etc/inittab里面设置): <br />
DAEMONS=(syslog-ng network crond alsa '''hal kdm''')<br />
{{Box Note|如果你安装的是KDEmod3,则使用kdm3替换kdm}}<br />
<br />
*This method will start the system at runlevel 3, (/etc/inittab default, multiuser mode), and then start KDM as a daemon. <br />
<br />
*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 [[Adding a login manager (KDM, GDM, or XDM) to automatically boot on startup]] for more.<br />
<br />
*If you prefer to log into the '''console''' at runlevel 3, 手动启动 X, 则不加入kdm, 或者是加个前缀( ! )禁止它。<br />
<br />
* 现在可以试试效果了,用普通用户身份开启X Server:<br />
startx<br />
或者<br />
$ xinit<br />
更多关于安装和配置KDE的文章,请看[[KDE]].<br />
<br />
到此步,可以看 '''[[#优化和收尾]]'''这部分了. You may also be interested in the [[Post Installation Tips]] wiki article.<br />
<br />
====Xfce====<br />
=====关于Xfce=====<br />
和GNMOE、KDE一样,Xfce是一个桌面环境,其目标是快捷、轻量,同时又美观而易用。它还提供了一整套的应用程序如根窗口应用(root window app)、 窗口管理器、文件管理器、面板等等。 Xfce是用GTK2 toolkit编写的(类似GNOME),和其它大型桌面环境一样,它也有自己的开发环境(库文件、守护进程等)。但不象GNOME或者KDE,Xfce是轻量化的,其设计更接近于CDE而不是Windows或者Mac。它的开发周期比较慢,但是十分稳定、速度很快。在老硬件上Xfce可以运行得很好,而在新机器上更是运行如飞。<br />
<br />
=====安装=====<br />
安装完整的xfce环境以及主题和extras:<br />
pacman -S xfce4 xfce4-goodies gtk2-themes-collection <br />
<br />
如果你使用KDM或者GDM的话会显示一个xfce会话。另一种启动方式是:<br />
startxfce4<br />
<br />
关于安装和配置xfce的高级指引可以参见[[Xfce (简体中文)|Xfce]]一文。<br />
<br />
恭喜!欢迎来到Arch Linux系统的Xfce桌面环境!接下来你可以浏览'''[[#优化和收尾|优化和收尾]]''',或者下面的其它内容。或许你还会对[[ArchTips(简体中文)|Arch安装完后的小技巧]]一文感兴趣。<br />
<br />
====*box====<br />
=====Fluxbox=====<br />
Fluxbox © is yet another windowmanager for X.<br />
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).<br />
<br />
Install Fluxbox using <br />
pacman -S fluxbox fluxconf<br />
<br />
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:<br />
exec startfluxbox <br />
<br />
More information is available in the [[Fluxbox]] article.<br />
<br />
=====Openbox=====<br />
Openbox是一个标准的”温顺的“,快速的,轻量级的,可扩展的窗口管理器。<br />
<br />
Openbox与你的应用程序一起工作工作,并使你的的桌面便于管理。这是因为它的开发方式和通常的窗口管理器的方式是相悖的。 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.<br />
<br />
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. <br />
<br />
安装openbox<br />
pacman -S openbox obconf obmenu<br />
<br />
一旦openbox安装好,你将得到一个消息to move menu.xml & rc.xml to ~/.config/openbox/ in your home directory:<br />
<br />
mkdir -p ~/.config/openbox/<br />
cp /etc/xdg/openbox/rc.xml ~/.config/openbox/<br />
cp /etc/xdg/openbox/menu.xml ~/.config/openbox/<br />
<br />
In the file "rc.xml" you can change various settings for Openbox (or you can use OBconf). In "menu.xml" you can change your right-click menu.<br />
<br />
To be able to log into openbox you can either go via graphical login using KDM/GDM or startx, in which case you will need to edit your ~/.xinitrc (as user) and add the following:<br />
<br />
exec openbox<br />
<br />
For KDM there is nothing left to do; openbox is listed in the sessions menu in KDM.<br />
<br />
Useful programs for openbox are:<br />
* PyPanel or LXpanel if you want a panel<br />
* feh if you want to set the background<br />
* ROX if you want a simple file manager and desktop icons<br />
<br />
More information is available in the [[Openbox]] article.<br />
<br />
====fvwm2====<br />
FVWM是一个非常强大的面向X桌面系统的”ICCCM-compliant的多虚拟桌面的窗口管理器“(ICCCM-compliant multiple virtual desktop window manager)。开发活动很活跃,支持也是极好的。 <br />
<br />
输入下面命令安装 fvwm2 <br />
pacman -S fvwm <br />
<br />
fvwm会自动添加进 kdm/gdm会话列表. 如果没有的话,添加 <br />
exec fvwm <br />
<br />
到你的用户文件 .xinitrc.<br />
<br />
注意:这个稳定版已经有些年头了,如果需要最新的fvwm版本,可以安装unstable repo里的fvwm-devel 包.<br />
<br />
===四、优化和收尾===<br />
====HAL====<br />
如果你已经安装了一个桌面环境,但是又觉得用起来不是很方便,那么现在就是个安装HAL的好时机了。HAL使得你的手机、iPod、移动硬盘等等可以即插即用。它会挂载设备并在你的桌面或/和'My Computer'目录中创建相应的图标,使得你可以在插入设备后就能访问到它,无需每次都对每个新设备来手动配置/etc/fstab文件或者udev规则。<br />
<br />
KDE、GNOME和XFCE都使用到HAL。<br />
<br />
安装过程描述可以在[[HAL (简体中文)|HAL]]一文中找到。其它一些信息可以在[http://en.wikipedia.org/wiki/HAL_(software) Wikipedia]上找到。<br />
<br />
====启动时让守护进程在后台执行====<br />
<br />
要加速系统的启动过程,可以在/etc/rc.conf中给守护进程前加上'@'符号使之在后台执行,例如:<br />
<br />
DAEMONS=(@syslog-ng @network crond @alsa @hal @fam @kdm)<br />
这使得守护进程在后台被加载,无需等待它们加载结束。<br />
<br />
在守护进程前加上(!)可以禁止系统启动时加载它,例如:<br />
<br />
DAEMONS=(@syslog-ng @network !crond @alsa @hal @fam @kdm)<br />
<br />
另一种方式是直接将不需要的守护进程删除。<br />
<br />
====美化LCD下的字体====<br />
See [[Fonts]]<br />
<br />
====让所有的鼠标按键生效====<br />
看这个 [[Get All Mouse Buttons Working]]<br />
<br />
====笔记本电脑可能遇到的问题====<br />
(1) 触摸板问题<br />
参看http://wiki.archlinux.org/index.php/Touchpad_Synaptics<br />
<br />
(2) 摄像头问题<br />
参看http://wiki.archlinux.org/index.php/Webcam_Setup<br />
<br />
(3) 无线上网问题<br />
参看http://wiki.archlinux.org/index.php/Wireless<br />
<br />
(4) 快捷键问题<br />
参看http://wiki.archlinux.org/index.php/Extra_Keyboard_Keys<br />
<br />
====配置CPU频率====<br />
现在的处理器能够降低频率和电压,以降温和降低电源消耗。降温能使系统更稳定,笔记本用户肯定是想这样做的,但是即使是台式机也会对系统有利。<br />
<br />
安装CPU频率工具用:<br />
pacman -S cpufrequtils<br />
<br />
把CPU频率在/etc/rc.conf里加入到启动进程(daemons)中。编辑配置文件/etc/conf.d/cpufreq改<br />
governor="conservative"<br />
<br />
这使得在需要的情况下可以动态地增减CPU频率(这是对于台式机来说也是一个安全的选择)。改变最小频率(min_freq)和最大频率(max_freq)以匹配你的CPU的情况。如果你不知道频率,在载入频率测量模块后运行“cpufreq-info”。你也可以将min_freq和max_freq注释掉或删除,这样就能自动进行。加入频率测量模块到/etc/rc.conf的模块行。<br />
几乎所有的笔记本和台式机都可以简单地使用''acpi-cpufreq''驱动,但是也有其它的选择,如:''p4-clockmod, powernow-k6, powernow-k7, powernow-k8, and speedstep-centrino''。 <br />
<br />
通过下面这个命令载入这个模块:<br />
modprobe <modulname> <br />
通过下面命令行开启cpufreq:<br />
/etc/rc.d/cpufreq start<br />
更多细节,请看 [[Cpufrequtils]]<br />
<br />
==第五部分:常用的应用程序==<br />
更多信息,请看[[ArchLinux常用的应用程序(简体中文)]].<br />
<br />
==附录==<br />
新手指南附录[[ArchLinux新手指南附录 (简体中文)]]<br />
<br />
想得到更多的信息和支持,你可以去[http://www.archlinux.org/ homepage], [[Special:Search|search the wiki]],[http://bbs.archlinux.org/ forums],[[ArchChannel|IRC channel]],以及[http://www.archlinux.org/mailman/listinfo/ mailing lists]。<br />
=====问题答疑=====<br />
See [[Arch FAQs for newbies]]<br />
还有这里[http://bbs.archlinux.org/viewtopic.php?t=29055 Arch forum thread] 也是面向初学者的。<br />
<br />
=====术语=====<br />
更多信息关于Arch术语,查阅[[Arch Terminology/Jargon for newbies|this article]].<br />
<br />
=====接下来还有什么?=====<br />
<br />
你还可以阅读:<br />
<br />
[[Arch 官方安装指南 (简体中文)|Arch 官方安装指南]]<br />
<br />
[[Arch AUR (简体中文)|ArchLinux社区用户软件仓库 (AUR)]]<br />
<br />
[[Get All Mouse Buttons Working]]<br />
<br />
[[改善Pacman性能 (简体中文)|改善Pacman性能]]<br />
<br />
[[Kernel Compilation]]<br />
<br />
[[Pm-utils 电源管理 (简体中文)|Pm-utils 电源管理]]<br />
<br />
[[CPU 频率调节 (简体中文)|CPU 频率调节]]<br />
<br />
[[:Category:美化|美化]]</div>
Flydragon
https://wiki.archlinux.org/index.php?title=ArchLinux_%E6%96%B0%E6%89%8B%E6%8C%87%E5%8D%97_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=90858
ArchLinux 新手指南 (简体中文)
2010-01-04T10:58:49Z
<p>Flydragon: /* 五、安装建立Sudo (可选) */</p>
<hr />
<div>[[Category:简体中文]]<br />
[[Category:获取并安装Arch (简体中文)]]<br />
[[Category:关于Arch_(简体中文)]]<br />
[[Category:HOWTOs (简体中文)]]<br />
<br />
{{Article summary start}}<br />
{{Article summary text|本文针对新手,提供了极其详尽的Archlinux的安装过程向导,和相关的简要说明。}}<br />
{{Article summary heading|已有的语言版本}}<br />
{{Article summary heading|Available Languages}}<br />
{{i18n_entry|Česky|Průvodce začátečníka (Česky)}}<br />
{{i18n_entry|简体中文|Arch 新手安装指南 (简体中文)}}<br />
{{i18n_entry|正體中文|Beginner's Guide 新手指南}}<br />
{{i18n_entry|Dansk|Dansk_Begynderguide}}<br />
{{i18n_entry|Deutsch|Beginners Guide (Deutsch)}}<br />
{{i18n_entry|English|Beginners Guide}}<br />
{{i18n_entry|Español|Guía para Principiantes (Español)}}<br />
{{i18n_entry|Français|Manuel_du_Débutant_(Français)}}<br />
{{i18n_entry|Italiano|Beginners Guide (Italiano)}}<br />
{{i18n_entry|Indonesia|Beginners_Guide_(Indonesia)}}<br />
{{i18n_entry|Lietuviškai|Pradedančiųjų gidas (Lietuviškai)}}<br />
{{i18n_entry|Nederlands|Beginners_Guide_(Nederlands)}}<br />
{{i18n_entry|Português Brasil|Guia do Iniciante(Português do Brasil)}}<br />
{{i18n_entry|Português|Guia para Principiantes(Português)}}<br />
{{i18n_entry|Русский|Руководство_для_новичков}}<br />
{{i18n_entry|Türkçe|Başlangıç Rehberi (Türkçe)}}<br />
{{i18n_entry|हिन्दी|नौसिखिया गाइड(हिन्दी)}}<br />
{{Article summary heading|相关文章}}<br />
{{Article summary wiki|Arch 官方安装指南 (简体中文)}}(更通用的安装方式)<br />
{{Article summary wiki|ArchLinux新手指南附录 (简体中文)}}<br />
{{Article summary wiki|ArchLinux安装完后的小技巧 (简体中文)}}<br />
{{Article summary wiki|ArchLinux常用的应用程序(简体中文)}}<br />
{{Article summary wiki|Work and Play with Arch (Chinese)}}<br />
{{Article summary end}}<br />
<br />
==前言==<br />
<br />
=====所有你一直想知道的关于安装Arch的事=====<br />
这篇文档将会指导你安装和配置[[ArchLinux (简体中文)|Arch Linux]] ── 一个简洁、轻量级的GNU/Linux发行版,一个类<code>UNIX</code>的操作系统。本文是面向Arch新用户,因此尽力为所有人提供强大的参考资料和信息。本指南讲述该如何获得一个基本配置好的Arch Linux系统(拥有一个图形桌面环境),但显然是不可能涵盖(甚至是预见)所有的信息。因此本指南会专注于某些关键性的步骤,想要进一步深入了解你可以查看[[Main Page (简体中文)|Arch Linux Wiki]]或者[http://bbs.archlinux.org/ Arch Linux论坛]。同时有兴趣的话你还可以了解一下[[Arch 之道 (简体中文)|Arch 之道]],它概述了Arch Linux发行版背后的哲学思想。<br />
<br />
'''Arch Linux的相关特性:'''<br />
* '''[[The Arch Way | Simple]]''' design and philosophy<br />
* Community distro targeted at competent GNU/Linux users<br />
* All packages compiled for '''i686/x86-64'''<br />
* 从底层开始就可以让用户高度定制<br />
* '''[[The Arch boot process | BSD-style init]]''' scripts, featuring one centralized configuration file<br />
* '''滚动升级''' <br />
* '''[[Pacman]]''' package manager is fast, written in '''C''', lightweight and agile, with a very modest memory footprint<br />
* '''[[ABS]]''': The '''A'''rch '''B'''uild '''S'''ystem, a ports-like package building system makes it simple to create your own easily installable Arch packages from source, to use and/or share with the community on the [[AUR]]<br />
* '''[[AUR]]''': The Arch User Repository, offering many thousands of build scripts for Arch user-provided software packages<br />
<br />
=====别怕(DON'T PANIC)!=====<br />
要知道Arch Linux的安装方法和过程也许会和你所使用过的其它GNU/Linux发行版非常不同,特别你是个新手的话将更能体会到这点。通常,GNU/Linux发行版会在一张或者一堆CD(甚至是DVD)上捆绑了大量的软件,包含了缺省桌面环境、缺省的应用程序和设置、硬件自动检测和图形化的安装程序,一切都是替你选择好了的。相反的,Arch Linux系统是让'''用户自己'''只是用一个bash shell和基本系统工具,从ncurses installer和基础系统上建造起来的。这就是[[Arch 之道 (简体中文)|Arch 之道]]。不象其它大型发行版,它没有强加于用户的缺省环境或者配置。你可以在命令行使用[[pacman (简体中文)|pacman]]通过互联网连接从Arch软件仓库安装软件包,直到你的系统配置成你希望的样子。这给予了用户最大的弹性、选择性和对系统资源的控制。因为是'''你'''建造了它,所以你肯定能了解系统里具体细节,知道底层都有些什么。<br />
<br />
Arch Linux系统是通过编辑文本文件进行配置的,没有提供图形界面的工具,所以需要对系统和linux相对熟悉。<br />
Arch Linux针对的是有能力的GNU/Linux用户以及希望花费时间学习系统知识的用户。 <br />
<br />
''Arch是一个可以被用户塑造的工具。''<br />
<br />
=====授权协议=====<br />
<br />
Arch Linux, pacman, documentation, and scripts are copyright<br />
©2002-2007 by Judd Vinet, ©2007-2008 by Aaron Griffin and are licensed under the GNU General Public License Version 2.<br />
<br />
=====[[Arch 之道 (简体中文)|Arch 之道]]=====<br />
<br />
''Arch的设计思想是"保持简洁"(keeping it simple)。'' <br />
<br />
这里的‘简洁’并不是单指‘简单’或者‘用户友好’,而是‘没有不必要的增加、修改或者复杂性’。简而言之,即优雅、极简之法。<br />
<br />
<br />
''"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 crap." -Aaron Griffin''<br />
<br />
<br />
''"The extraordinary part of [my method] lies in its simplicity..I have always believed that the simple way is the right way."'' - Bruce Lee<br />
“(我的方法中)最超凡的部分是它的简单性,我一直相信简单的就是对的。” 李小龙(Bruce Lee)<br />
<br />
Occam's razor: ''Entia non sunt multiplicanda praeter necessitatem'' or "Entities should not be multiplied unnecessarily." The term razor refers to the act of shaving away unnecessary assumptions and complications to get to the simplest explanation, method or theory.<br />
<br />
{{Box Note |'''仔细遵循本指南是成功安装一个配置正常的Arch Linux系统的基本要点,因此''请''认真仔细的阅读本文'''}}<br />
* 你也可以将本指南打印出来,作为一个较为有用的Arch Linux用户手册。<br />
*''如果你想在这个wiki里增加内容,请适当描述清楚“为什么会这样”以及“该怎么办”。最佳的文档应该能教会我们如何做和为什么这么做!''<br />
* Arch的wiki是项优秀的资源,可以[http://wiki.archlinux.org/index.php/Main_Page 第一时间]用来解决日常问题; 如果找不到答案也可以求助IRC和[http://bbs.archlinux.org/ 论坛]。<br />
----<br />
----<br />
欢迎使用Arch!现在,让我们开始吧。<br />
<br />
本文按照安装过程分四大部分:<br />
<br />
'''[[#第一部分:安装基本系统|第一部分:安装基本系统]]'''<br />
<br />
'''[[#第二部分:完成基本系统并升级|第二部分:完成基本系统并升级]]'''<br />
<br />
'''[[#第三部分:安装X并配置ALSA|第三部分:安装X并配置ALSA]]'''<br />
<br />
'''[[#第四部分:安装并配置桌面环境|第四部分:安装并配置桌面环境]]'''<br />
<br />
==第一部分:安装基本系统==<br />
===一、获取最新的系统安装包===<br />
<br />
你可以从[http://archlinux.org/download/ 这里]获取Arch最新的官方系统安装包。最新版本是2009.08<br />
<br />
*不论是Core还是Netinstall系统安装包,都只是包含了安装'''Arch Linux基本系统'''所需的软件包. ''注意,基本系统是不包含GUI图形界面的。它主要包含了GNU的系列工具(编译器、汇编程序、链接、库、脚本,还有其它的一些有用的工具),Linux的内核,还有一些额外的库和模块。<br />
*Core映像文件可以较方便的通过CD或者网络进行安装。<br />
*Netinstall映像文件较小巧,本身没有提供软件包,整个系统都是通过internet来获取的。<br />
*isolinux映像文件是给那些使用grub版本时发生问题的用户的。两者没有其它区别。<br />
*Arch64问答( http://wiki.archlinux.org/index.php/Arch64_问答_(简体中文) )可以帮助你在32位版本和64位版本之间作出选择。<br />
<br />
====CD 系统安装包====<br />
把下载的.iso映像文件刻录到CD上。开机时用CD启动,出现界面,跳到[[#二、启动Arch Linux系统安装程序| 二、启动Arch Linux系统安装程序]]<br />
{{Box Note| 通常为了刻录的稳定可靠(速率越低刻录质量越有保证),推荐刻录的最大速度不超过16倍速。有些用户推荐'''''速度为 4x 或者 2x.''''' 如果所刻录的CD有问题,可以尝试使用你系统所支持的最小速度方式刻录。 }}<br />
<br />
<br />
====USB安装方式====<br />
{{Warning|这样做会把USB盘里面原有的数据格式化。}}<br />
<br />
'''<code>UNIX</code> 方式:'''<br />
<br />
插入USB盘,找到其路径,用<code>/bin/dd</code>命令把.img映像文件写入USB(Linux下):<br />
<br />
dd if=archlinux-2009.08-''{core|netinstall}''-''{i686|x86_64}''.img of=/dev/sd''x''<br />
<br />
if= 后面是.img镜像文件的路径,of= 是你的USB路径. 要使用/dev/sd''x''而不是/dev/sd''x1''.(就是要使用整个分区而不是第一分区)<br />
<br />
'''检查镜像的完整性md5sum (可选):'''<br />
<br />
记下读入和写出的记录区数目,然后执行以下命令进行检查:<br />
dd if=/dev/sd''x'' count=''记录区数目'' status=noxfer | md5sum<br />
<br />
md5sum命令返回的值(这是你检查U盘上文件得到的)要与你下载的archlinux镜像文件的md5sum校验值相同;它们都应该和镜像站点的md5sum文件列表里相应的值相同。<br />
<br />
'''Windows方式:'''<br />
<br />
从https://launchpad.net/win32-image-writer/+download 下载Disk Imager。插入U盘,启动Disk Imager并选择映像文件,再选择U盘相应的磁盘驱动号,点击"write"即可。<br />
<br />
===二、启动Arch Linux系统安装程序===<br />
Usually, the first item is the preferred selection. However, choose Boot Archlive or Boot Archlive [legacy IDE] if you have trouble with libata/PATA, or have no SATA (Serial ATA) drives.<br />
<br />
Also, to change boot options, press '''e''' for editing the boot lines. Many users may wish to change the resolution of the framebuffer, for more readable console output. Append:<br />
插入刻录好的光盘CD或者USB盘,然后用它启动电脑。可能需要在BIOS里(通常是启动后在加电自检过程中按DEL、F1、F2、F11或者F12)改变一下启动顺序使得CD或者USB先被启动。<br />
<br />
{{Note|内存需求:<br />
* Core : 160 MB RAM x86_64/i686 (选择所有软件包,开启交换分区)<br />
* Netinstall : 160 MB RAM x86_64/i686 (选择所有软件包,开启交换分区)}}<br />
<br />
启动了Arch Linux光盘后,用上下箭头高亮菜单,按下回车键进行选择。<br />
<br />
通常,推荐选择第一项菜单。不过如果使用libata/PATA出现问题或者没有SATA (Serial ATA)驱动器,你也可以选择Boot Archlive或者Boot Archlive [legacy IDE] 。<br />
<br />
如果你需要改变启动参数,可以按‘e ’键来编辑启动行内容。 含多用户可能希望改变framebuffer分辨率以得到更好的终端显示。将<br />
vga=773<br />
加到kernel一行的后面,然后按<ENTER>,就可以得到1024x768的framebuffer。设置完毕后按'''b'''则使用相应的选择项进行启动。<br />
<br />
系统将会启动并提示登录,这时可以用'root'进行登录(不要加上单引号)。<br />
<br />
如果你的机器从live CD启动时发生错误或者一些其它'''硬件hardware'''错误,请参看[[Installation Troubleshooting]]。<br />
<br />
<br />
====登录并根据需要更换键盘映射表====<br />
如果你使用non-US键盘布局,可以用命令选择相应的键盘映射表。<br />
# km<br />
或者是是用loadkeys命令<br />
# loadkeys ''layout''<br />
(把''layout''替换成你需要的,比如 &quot;<code>fr</code>&quot; 或者 &quot;<code>be-latin1</code>&quot;)<br />
<br />
====边安装边查看安装指南====<br />
在刻录的livecd里面,已经包含了官方安装指南,在安装的时候可以边安装边查看,按组合键<ALT>+F2 切换到控制台vc/2(alt+f3,alt+f4……分别可以切换到对应的控制台vc/3,vc/4……以此类推),然后输入:<br />
<br />
# less /arch/docs/official_installation_guide_en<br />
<br />
按组合键<ALT>+F1回到控制台vc/1,继续安装系统。安装过程中可以随时切换回vc/2来查看安装指南。<br />
<code>less</code> 是个文本查看程序,位于<code>/usr/bin/less</code><br />
{{tip|请注意,官方指南仅涵盖基本系统的安装和配置过程。一旦安装完毕,强烈建议回到本wiki浏览更多安装后续已经相关问题。}}<br />
<br />
===三、开始安装===<br />
键入<br />
/arch/setup <br />
开始安装。<br />
<br />
====1、选择安装来源====<br />
接着会出现一个选择安装来源的提示。如果你用core ISO的话请选择CD,如果使用FTP ISO的话则选择FTP。<br />
* 如果选择 CORE installer,可以直接看下面的硬盘分区配置。<br />
* FTP/HTTP only: 选择这个需要预先加载网络驱动以便联网安装. 使用Udev来加载这些模块非常有效.<br />
按组合键ALT+F3切换到控制台vc/3,确认一下看其是否生效 invoking ifconfig -a . (Select OK to continue.) ——把后面的网络配置提前看<br />
<br />
====2、设置时间====<br />
有两个选择:<br />
* UTC - 如果使用unix系统包括Linux, Freebsd等, 建议使用UTC<br />
* local - 如果和Windows共享多引导系统, 建议使用local<br />
<br />
====3、硬盘分区配置====<br />
选择第一个菜单项"Prepare Hard Drive"。请注意,"Auto-Prepare"(自动分区)并不是最佳的选择,因为它只分配了最基本的三个区( /,/home,swap)<br />
在这里我们用手工进行硬盘分区。选择"2. Partition Hard Drives",接着选要分区的硬盘(比如:/dev/sdx),然后按你需要编辑分区表。<br />
<br />
''Arch Linux安装程序使用cfdisk公用程序来对硬盘进行分区。''<br />
<br />
''接下来,熟悉GNU/Linux的用户可以跳过这段内容直接到下面'''[[#选择软件包|选择软件包]]'''。''<br />
<br />
=====分区信息=====<br />
<br />
对磁盘进行分区是指在磁盘上定义若干区域(分区),每个都象是一个独立的磁盘,可以在其上创建(格式化)一个文件系统。 分区的类型分为主分区(Primary)、扩展分区(Extended)和逻辑分区(Logical)三类。 <br />
<br />
主分区可以被启动,一个物理磁盘最多能有4个主分区。要使用超过4个的话,只能使用一个包含了逻辑分区的扩展分区。<br />
(译者注:为避免误解,较易懂的解释应该是:一个磁盘不算逻辑分区最多只能有4个分区,这4个要么全是主分区,要么就是3个主分区+1个扩展分区,当然你将整个磁盘划为1个主分区也是没问题的,只要不超过4个分区即可)<br />
<br />
扩展分区通常不会被直接使用,它是作为逻辑分区的“容器”存在。一个硬盘只能有一个扩展分区,可以在里面继续再划分逻辑分区。<br />
<br />
当对一个磁盘进行分区时,是按这种数字顺序命名:主分区为sda1-3,跟着是扩展分区sda4(译者注:在/dev和fdisk -l里是看不到这个sda4的),在扩展分区中划分出来的逻辑分区分别是sda5、sda6,如此类推。<br />
<br />
=====交换分区swap=====<br />
交换分区Swap是虚拟内存在硬盘上驻留的地方,内核可以用它来储存在物理内存中放不下的数据。<br />
<br />
过去,常用的规则是将交换分区大小设置为物理内存的两倍。但是随着时间推移,现在的计算机已经有更大的内存容量,这条规则已经不适用了。通常,512MB内存的计算机,两倍(1G)的还是够用的。而1G内存的计算机,一倍的也够用了。如果你有更大的内存(比如超过1GB),也许可以完全把交换分区忘了,不推荐这样做!<br />
* ''如果你打算使用休眠到磁盘的电源方案,你必须要有不小于内存容量大小的交换分区,有些用户甚至会推荐大于物理内存容量15%的大小。''<br />
<br />
=====规划分区=====<br />
磁盘分区的规划是十分个人的设置。每位用户的决策都会根据自己计算机的情况和需求而不同。至少需要有一个包含了根[http://en.wikipedia.org/wiki/File_system 文件系统] ( / )的主分区和一个交换分区。你还可以选择给/boot(主要用来存放内核文件)、/usr、/var和/home(用来存放用户个人数据)划出独立分区。一个较好的做法是给 / 和 /home都划分独立分区。这样的话,当你因为某些原因重装Arch Linux(或者其它发行版),你还可以保留你的个人数据例如音乐、图片、桌面环境配置等。<br />
<br />
在本案例中,我们划分一个分区给 /,一个给/home,另外还有一个交换分区。<br />
<br />
=====开始创建分区cfdisk=====<br />
让我们开始创建一个包含'''root'''(/)文件系统的主分区。 <br />
<br />
选择'''N'''ew -> Primary,然后输入你希望的分区大小(对一个完整的Linux系统,4到8G是个不错的选择)。分区要位于磁盘的开头部分。选择刚新建的分区,接着选择'''B'''ootable将它置为可启动。<br />
<br />
同时选择分区文件系统类型'''T'''ype,指定为'83 Linux'.。<br />
<br />
给你的/home目录创建另一个分区。选择另外一个主分区设成你想要的容量大小,这取决于你的用户会在他们的home目录里储存多少文件,其大小可能从几百M办公文档到上百G音频视频,所以这里我无法给出一个建议。如果你要使用磁盘所有的剩余空间,记得保给交换分区留一部分(例如1GB或1024MB)。<br />
<br />
同样的,选择'''T'''ype为'83 Linux'。 <br />
<br />
最后,我们给交换分区创建一个分区。选择一个介于512MB到1GB之间的大小并将'''T'''ype改为82 (Linux swap / Solaris)。<br />
<br />
现在的分区规划看起来应该象这样(基于你的选择大小也许会有所不同):<br />
<br />
Name Flags Part Type FS Type [Label] Size (MB)<br />
-------------------------------------------------------------------------<br />
sda1 Boot Primary Linux (4096 - 8192)<br />
sda2 Primary Linux (> 100)<br />
sda3 Primary Linux swap / Solaris (512 - 1024)<br />
<br />
选择'''W'''rite并输入''''yes''''。要注意如果你删除了分区的话,这个操作会破坏你磁盘上的数据。选择'''Q'''uit退出分区程序。<br />
选择Done离开此菜单,接着选择"Set Filesystem Mountpoints"。<br />
<br />
=====IDE设备,为什么看起来它们和SCSI设备一样?=====<br />
最新开发的Linux内核里包含了libata和PATA模块,所有的IDE、SATA和SCSI都采用sd''x''这种命名方式。这十分正常,无需担心。<br />
<br />
=====设置文件系统挂载点=====<br />
<br />
''' ”文件系统格式(filesystems)“和”文件系统结构(file systems)“的区别:'''<br />
<br />
从技术层面确切的说,'''文件系统格式(filesystems)'''是一种数据'''格式''',涉及信息吞吐,比如ext2;而”文件系统结构(file systems)“则是特定操作系统中文件和目录的布局,比如/home/username/games。因此,当你被问及是否创建'''文件系统格式(filesystems)'''时,是在问你是否要'''格式化'''该分区…但是当程序向你问及挂载点时,你应该给出的则是该分区应该出现在你的Arch Linux ”文件系统结构“中的位置。<br />
<br />
'''文件系统类型:'''<br />
<br />
'''强烈建议:'''创建一个交换分区(SWAP)。选择一个合适的分区(本例中使用的是sda3). 安装程序就会询问你是否要创建swap 文件系统; 选择 yes. 接下来, 选择根分区的挂载点(本例中就是 sda1). 然后安装程序就会询问你需要哪一种文件系统。<br />
<br />
{{Box Note| 采用何种文件系统的类型取决于实际应用需要,没有十全十美的文件系统,选择任何一个文件系统,都需要在数据安全和性能要求方面作出适当倾斜,下面只是简单的介绍各种Arch linux支持的文件系统 }}<br />
<br />
1. '''ext2''' - 古老、 可靠的 GNU/Linux 文件系统。非常的稳定,不过 ''不支持日志记录功能''。磁盘检测速度较慢,因而有些不便. ''ext2可以容易地转换成ext3''。一般认为/boot分区采用此系统最合适,因为/boot里的东西就开机的时候读取一次,而且很少有变动,不需要日志文件系统,如果采用日志文件系统,日志的体积很可能远远大于内核的大小。<br />
<br />
2. '''ext3''' - 基于ext2系统, 并添加了日志记录功能。 一般认为他比其他文件系统要 ''稍微的'' 慢一点, 不过 ''非常的'' 稳定并且使用最为广泛,由 GNU/Linux FS 负责维护和开发。<br />
<br />
'''高性能文件系统:'''<br />
<br />
3. '''ext4''' - 最近加入支持的文件系统,是ext2和ext3的后续发展版本,Ext4增加了48位块地址,最大支持1EB文件系统,和单个16TB的文件,增加子目录限制到64,000。新增了很多功能,提供在线碎片处理,速度比ext3快,系统开销比ext3小。<br />
{{Box Note| 由于此系统较新,目前仍存在一些问题,暂时建议/home分区不采用此文件系统,以保证个人数据安全。}}<br />
<br />
4. '''ReiserFS''' - Hans Reiser 主持编写的高性能的日志文件系统,使用一种非常独特有趣的数据存储检索方法。ReiserFS 效率非常高, 特别在处理很多小文件的时候更是如此。ReiserFS在挂载的时候相对比较慢. 性能稳定。 ReiserFS 现在的开发并不活跃(最新的版本是Reiser4).<br />
<br />
5. '''JFS''' - IBM提供的日志文件系统( '''J'''ournaled '''F'''ile'''S'''ystem首字母缩写). JFS 效率非常高并且CPU资源占用率比其他任何一个文件系统都要低。并且在挂载和磁盘检测的时候都非常快,在各方面的表现都非常突出,尤其是 conjunction with the deadline scheduler. (参见 [[JFS]].) 但是并不像ext或者ReiserFS那样应用广泛。<br />
<br />
6. '''XFS''' - 非常高效的日志文件系统,特别适合处理大文件。在处理小文件的时候稍慢。在挂载的时候也很快。由于 /var 需要处理很多的小文件,所以可能不太适合作为/var 分区的文件系统。 GNU/Linux 文件系统中,最先实现可用的在线碎片处理。应用不及ext和ReiserFS那么广泛。<br />
* JFS 和 XFS 不能被磁盘工具压缩(比如gparted 或者 parted magic)<br />
<br />
'''未来文件系统'''<br />
<br />
7、btrfs - 此文件系统尚未被Arch纳入正式支持。是Oracle提供的copy-on-write档案系统。目标在取代的ext3,提高ext3单一档案的大小,总档案系统大小或档案检查,加入目前ext3未支援的功能,比如:writable snapshots,snapshots of snapshots,内建磁盘阵列(RAID)支援,and subvolumes。<br />
<br />
最主要的差别在于[http://en.wikipedia.org/wiki/Journaling_file_system 日志系统] (一种类似的在数据库环境中记录着日志变更的东西). 除ext2之外,其他文件系统都支持日志记录功能. ext3 完全兼容 ext2,因此哪怕你可以用一个非常古老的CD来挂载他,也没问题。 根分区目前最安全的选择就是使用ext3文件系统。ReiserFS,XFS,和JFS也可以使用,因为GRUB (启动引导管理器,稍候在安装部分将会介绍到) 都可以从这些文件系统中启动。你可以通过选择‘’‘yes’‘’来创建文件系统(并格式化分区),接着你就会被提示添加附加分区。 在我们的例子中, 只有sda2了。 选择一个文件系统类型,并且把这个分区挂在到/home. 再次说明,创建文件系统并且选择Done。然后回到主菜单。<br />
<br />
====4、选择软件包====<br />
现在我们要选择安装哪些软件包到系统中。选择CD作为来源,如果你不止一个光驱的话还需要选择使用哪个的光驱。<br />
<br />
软件包选择分为两个阶段。首先要选择软件包分类,然后出现所选分类中软件包的详细列表供你微调。使用空格键进行选择和取消。<br />
<br />
''*BASE:包含最小的软件包集合,仅够构建一个可运行的系统骨架。''<br />
''*SUPPORT:供网络和文件系统用的额外软件包,例如gpm、fuse、dnsutils、无线驱动、ndiswrapper、ntfs-3g诸如此类。''<br />
''*DEVEL:软件创建工具,如GCC、autoconf、automake和make等等。''<br />
''*LIB:大量的库文件,如gmp、lebelf、libevent等等。''<br />
*''' 2008.06 版'''的软件包选择,只有一个: BASE ,选择之后进入其详细列表. <br />
<br />
在这里,我们对'Select all packages by default'选择'yes'。<br />
<br />
接下来屏幕将显示你所选的软件包。对于新手,较安全的做法是不修改它,而有经验的用户可能希望裁减掉一些不需要的软件包。(例如,不需要的文件系统类型公用程序,不需要的驱动等等。)<br />
<br />
====5、安装软件包====<br />
接着,选择'Install Packages'。你会被询问是否希望保留pacman缓冲里的软件包。如果你选'yes',日后你还可以选择对某些软件包进行降级,因此推荐保留(日后你还是可以清除这些缓存的)。安装脚本跟着就会安装所选软件包到你的系统中。这些软件包是二进制的、针对i686优化的,总共仅100MB,因此安装是相当便捷的。<br />
<br />
====6、配置系统====<br />
系统接着会询问你是否要选择[[Hwdetect|hwdetect]]来收集配置所需信息。新手应该选择是('yes')。<br />
<br />
如果是相当熟悉自己的硬件、所需模块,有能力从零开始手动配置/etc/mkinitcpio和/etc/fstab 的高级用户,可以选择否'no'。(当然,此选项是非常复杂的,已经超过本指南的范围,这里就不详细解释了。)<br />
<br />
接下来,系统会询问你是否需要支持从USB设备、FireWire设备、PCMCIA设备、NFS共享、软RAID阵列、LVM2卷和加密卷上启动。如果需要则选'yes',在本案例中以上都不选。<br />
<br />
新手还应该选择让/etc/mkinitcpio/kernel26-fallback.conf使用[[Hwdetect|hwdetect]]的结果,这将确保你的硬盘控制器相容次序。<br />
<br />
现在系统会询问你使用哪个文本编辑器;如果你不熟悉[http://en.wikipedia.org/wiki/Vim_%28text_editor%29 vi/vim]的话可以选择[http://en.wikipedia.org/wiki/Nano_%28text_editor%29 nano]。然后就会出现一个包含系统中大部分重要配置文件的菜单。如果你打算查找/etc/rc.conf中可用的选项,只需按Alt+F2切换到另外一个虚拟控制台进行查找,然后用Alt+F1切换回安装程序。<br />
<br />
======系统配置主文件'''/etc/rc.conf'''======<br />
Arch Linux继承FreeBSD的传统,使用'''/etc/rc.conf'''作为系统配置的主要文件。这个文件包含了广泛的配置信息,主要用于系统的启动。正如名字中所包含的意思,它还包含了供/etc/rc*文件使用的配置。/etc/rc.conf提供了一个Arch用户可以轻易访问到的,简洁而又范围广泛的精简系统资源配置方案。<br />
* '''LOCALIZATION'''部分<br />
** '''LOCALE'''=: 系统场所(locale)设置,被所有国际化(i18n-aware)的应用程序使用 。从命令行上运行locale可以列出可用的locale设置。此设置缺省是适合英文(US English)用户使用的en_US.utf8。(此处locale的设置必须与/etc/locale.gen一致,'''[[#/etc/locale.gen|详见下文]]'''。)中文一般是zh_CN.UTF-8,如果使用之后乱码,先换回en_US.utf8,等进图形界面后再换回来。<br />
** '''HARDWARECLOCK'''=: 指示开关机时进行同步的硬件时钟,是'''UTC'''时间(协调世界时(Universal Time Coordinated), 过去曾用格林威治平均时(GMT)来表示)还是'''localtime'''(本地时间)。通常UTC较为好,因为它大大简化了时区和日光节约时间(中国过去称为夏时制)的变更。而当你同时还有其它操作系统如windows进行双启动,就必须使用localtime(本地时间),它只把本地时间保存到硬件时钟里。<br />
** '''TIMEZONE'''=: 时区(TIMEZONE)。(所有可用的时区可在/usr/share/zoneinfo/里找到。)<br />
** '''KEYMAP'''=: 可用的键盘映射表可在/usr/share/kbd/keymaps里找到。请注意此设定仅在TTY中有效,在所有图形窗口管理器或者X中都不使用此设置!<br />
** '''CONSOLEFONT'''=: 如果你一定要修改此设置,可在/usr/share/kbd/consolefonts/中找到可用的字体。<br />
** '''CONSOLEMAP'''=: 定义了启动时setfont程序加载的控制台映射表。有需要的话,可在/usr/share/kbd/consoletrans里找到可用的映射表。<br />
** '''USECOLOR'''=: 如果你使用彩色显示器的话请选"yes"。<br />
<br />
LOCALE="zh_CN.UTF-8"<br />
HARDWARECLOCK="localtime"<br />
TIMEZONE="Asia/Shanghai"<br />
KEYMAP="us"<br />
CONSOLEFONT=<br />
CONSOLEMAP=<br />
USECOLOR="yes"<br />
* '''HARDWARE'''部分<br />
** '''MOD_AUTOLOAD'''=: 如果你使用'''udev'''在启动时探测硬件并加载相应模块。请设置为"yes",(适合缺省模块化的内核)。设置为"no"就得靠用户自己指定所需的有关信息。<br />
** '''MOD_BLACKLIST'''=: 模块黑名单。在下面的例子中,IPv6模块和pcspeaker都被列入黑名单而不被加载。<br />
** '''MODULES'''=: 指示了其它模块,如果你知道缺少哪个重要的模块可以加在里面。('''hwdetect'''应该已经填写了最重要的模块):<br />
# Scan hardware and load required modules at bootup<br />
MOD_AUTOLOAD="yes"<br />
# Module Blacklist - modules in this list will never be loaded by '''udev'''<br />
MOD_BLACKLIST=(net-pf-10 pcspkr)<br />
#<br />
MODULES=(e100 eepro100 mii slhc snd-ac97-codec snd-intel8x0 soundcore)<br />
* '''NETWORKING'''部分<br />
** '''HOSTNAME'''=:设置为你喜欢的主机名(HOSTNAME)。<br />
** '''lo'''=: 不修改此行。<br />
** '''eth0'''=: 如果使用'''静态IP'''的话请调整网络接口的IP地址、掩码和广播地址。如果使用'''DHCP'''的话则设为eth0="dhcp"。<br />
** '''INTERFACES'''=: 指定使用哪些网络接口。如果你不使用DHCP来配置设备,而是通过命令行用ifconfig手动配置设备的话,这里的变量值(名字必须等于打算进行配置的设备名一样)必须和ifconfig里加入的内容一样。<br />
** '''gateway'''=: 如果你使用'''静态IP''',将网关(gateway)地址设为路由器的IP。如果使用DHCP,则将此行用'#'注释掉。<br />
** '''ROUTES'''=: 如果你使用'''静态IP''',则将'gateway'前面的'!'去掉。如果使用'''DHCP'''的话则不需要修改此行。<br />
<br />
<br />
例如,当使用'''DHCP''':<br />
HOSTNAME="arch"<br />
lo="lo 127.0.0.1"<br />
#eth0="eth0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255" <br />
eth0="dhcp"<br />
INTERFACES=(lo eth0)<br />
#gateway="default gw 192.168.0.1"<br />
ROUTES=(!gateway)<br />
* '''DAEMONS'''部分<br />
这个序列罗列了位于/etc/rc.d/里需要在启动过程中启动的脚本名字。<br />
<br />
*如果脚本名字前有惊叹号(!),表示它不被执行。<br />
*如果脚本名字前有符号(@),则表示它会在后台被执行,启动序列不会等待此脚本成功执行完毕,而是继续执行下一个守护进程脚本。<br />
<br />
这种'BSD风格'的初始化就是Arch的处理办法,而其它发行版则是在一个init.d目录里使用一大堆符号链接(一个简单的文件 vs 一整个目录)。<br />
<br />
======关于守护进程======<br />
虽然此时你不需修改[[daemons]]行,不过还是有必要解释一下什么是守护进程,因为过一会儿在指南里我们会需要它。<br />
<br />
和Windows服务(service)类似,守护进程(daemon)是一个运行于后台的程序,等待事件发生并提供服务。一个较好的例子是webserver等待请求以发送页面,还有SSH服务等待用户登录。这些都是全功能的程序,还有些守护进程工作起来并不是那么明显的。例如向日志文件里写信息的守护进程(如syslog、metalog),当系统空闲时降低CPU频率的守护进程(如cpufreq),以及提供图形化登录的守护进程(如gdm、kdm)。所有这些程序都可以被加入到daemons行中,在系统启动时被执行。本指南会对一些较有用的守护进程进行介绍。<br />
按Ctrl+X退出nano编辑器。<br />
<br />
======磁盘和分区配置文件:/etc/fstab======<br />
'''fstab''' ('''f'''ile '''s'''ystems '''tab'''le的缩写) 是系统配置的一部分,该文件列出所有可用的磁盘和分区,并指明它们初始化的方式或整合至全局文件系统的方式。'''/etc/fstab'''文件一般被'''mount'''命令读取,以决定某一特定设备被挂载时所采用的选项。<br />
<br />
这是一个'''/etc/fstab'''的例子:<br />
<br />
#<br />
# /etc/fstab: static file system information<br />
#<br />
# <file system> <dir> <type> <options> <dump> <pass><br />
none /dev/pts devpts defaults 0 0<br />
none /dev/shm tmpfs defaults 0 0<br />
#/dev/cdrom /mnt/cdrom iso9660 ro,user,noauto,unhide 0 0<br />
#/dev/dvd /mnt/dvd udf ro,user,noauto,unhide 0 0<br />
#/dev/fd0 /mnt/fd0 vfat user,noauto 0 0<br />
/dev/sda1 / jfs defaults,noatime,nodiratime 0 1 <br />
/dev/sda2 /home jfs defaults,noatime,nodiratime 0 2<br />
/dev/sda3 swap swap defaults 0 0<br />
Hwdetect应该已经有效地配置了一个可用的'''fstab''',但最好还是简要地检查一下。<br />
<br />
*如果你打算用'''hal'''来自动挂载DVD之类的媒体,为了给即将安装的'''hal'''做准备,你可能要注释掉cdrom和dvd条目。 <br />
<br />
''在笔记本电脑和桌面系统上,可以给 / 和 /home加上'noatime'和'nodiratime'选项来提高速度、性能,同时还能省电。无论你采用何种文件系统,这样做都应该是安全的。''<br />
<br />
更多信息请参照[[Fstab]]<br />
<br />
======'''mkinitcpio.conf、modprobe.conf和kernel26-fallback.conf'''======<br />
此时我们无须去修改这些配置文件。'''mkinitcpio.conf'''负责配置ramdisk(例如从RAID、加密卷启动), '''modprobe.conf'''可以用来设置内核模块的的某些配置选项,而'''kernel26-fallback.conf'''则是initramfs后备配置。<br />
<br />
======(对于静态IP)网络配置文件:/etc/resolv.conf ======<br />
*''如果你使用DHCP,完全可以忽略此文件,缺省情况下dhcpd守护进程会自动创建和销毁此文件。''<br />
<br />
如果你使用静态IP,则可在/etc/resolv.conf里设置你的DNS服务器。每行的格式为nameserver <ip地址>,如果有多个DNS服务器则可以填入多行。<br />
<br />
如果你使用路由器,也许会希望由你的路由器本身指定DNS服务器,而在'''resolv.conf'''里只是写入你的路由器的IP(同时也是'''/etc/rc.conf'''里的网关),例如:<br />
nameserver 192.168.1.1<br />
可选的,逐个加入你的DNS服务器,例如:<br />
nameserver 4.2.2.1<br />
nameserver 4.2.2.2<br />
<br />
如果使用'''DHCP''',你也可以在你的路由器里指定你的DNS服务器,或者如果你的ISP支持的话由ISP自动指定。<br />
<br />
======/etc/hosts======<br />
可以在此文件中加入你想要的''hostname'',必须和/etc/rc.conf里的设置一致,因此它应该象这样:<br />
127.0.0.1 localhost.localdomain localhost '''''yourhostname'''''<br />
''为了程序的兼容性,必须严格遵照这个格式,'''包括'localhost' 这项'''!错误的句法可能会导致网络性能低下和/或某些程序运行缓慢甚至无法运行。这对新手来说是十分普遍的错误。''<br />
<br />
对于大部分用户,只要把''yourhostname''加入到行末就就可以了,不过有些用户推荐以下句法:<br />
127.0.0.1 '''''yourhostname'''''.domain.org localhost.localdomain localhost '''''yourhostname'''''<br />
如果你使用静态IP,可以用这种句法加入新行:<static-ip> hostname.domainname.org hostname,例如:<br />
192.168.1.100 '''''yourhostname'''''.domain.org '''''yourhostname'''''<br />
<br />
======/etc/hosts.deny和/etc/hosts.allow======<br />
如果你打算使用[[SSH|ssh]]的话,请根据自己的需要修改此配置。缺省设置是拒绝所有进入的连接,而不只是ssh连接。编辑'''/etc/hosts.allow '''文件加入:<br />
<br />
* 允许所有进入的ssh连接。<br />
sshd:all <br />
<br />
* 允许特定IP地址进入ssh连接。<br />
sshd: 192.168.0.1<br />
<br />
* 允许你指定的网段 (地址从 192.168.0.0 到 192.168.0.255)<br />
sshd: 192.168.0.<br />
<br />
* 允许某个IP地址范围<br />
sshd: 10.0.0.0/255.255.255.0<br />
<br />
如果你不打算使用[[SSH|ssh]],为安全起见请保持此文件的缺省设置(为空)。<br />
<br />
======/etc/locale.gen======<br />
<br />
'''locale-gen''' 命令从 '''/etc/locale.gen'''读取信息设定系统的locales. 这些设置稍后会被'''glibc''' 和其他一些支持本地化的程序或者库用于自动翻译输出各种语言的"独特" 文本, 并且合适的显示地域、货币、时区以及日期格式, 字符排列方式和其他一些本地化的特殊标准。设置默认本地化的功能是类<code>UNIX</code>操作系统的一大特质<br />
<br />
默认情况下 /etc/locale.gen 是一个仅包含注释文档的空文件.编辑后,这个文件将不会get touched again. 每次'''glibc'''更新之后'''locale-gen'''就会运行一次, 以在/etc/locale.gen重新生成所有的本地化设置.<br />
<br />
选定你需要的本地化类型(移除前面的#即可), 比如:<br />
en_US ISO-8859-1<br />
en_US.UTF-8 <br />
('''你这里的设置必须和上文中提到的/etc/rc.conf 的设置一致哦.''')<br />
<br />
现在,安装程序将运行locale-gen 脚本, 以生成你设定的locales。你以后可以通过修改文件/etc/locale.gen变更你的locale, 然后使用根用户(root)运行'locale-gen'脚本使之生效。<br />
<br />
''Note 如果你选择并设置了locale, 他将提示你 "The current locale is invalid..." 错误。可能是因为大多数新Arch用户都会犯的普遍的错误,也是在论坛中问得最多的问题。''<br />
<br />
======Root密码======<br />
最后,设置一个root密码并确定你已牢记它。返回主菜单然后接着安装启动加载器。<br />
<br />
======Pacman镜像======<br />
为'''pacman'''选择一个软件仓库镜像站。记住主站 archlinux.org 是有流量限制的,下载速度限于50KB/s.。<br />
<br />
在列表中仔细查看, 一般 xxx.cn 是中国镜像, xxx.au 是澳大利亚, 等等...<br />
<br />
*''如果你不熟悉现有的镜像和它们所处的位置,那就随便选一个。稍后你可以编辑 "/etc/pacman.d/mirrorlist", 或运行本指南后面提到的'''rankmirrors'''脚本,它将自动配置最接近你的镜像。''<br />
<br />
返回主菜单。<br />
<br />
====7、安装启动加载器====<br />
因为本案例中没有第二个操作系统,因此我们需要安装一个启动加载器。推荐选择[http://www.gnu.org/software/grub/ GNU GRUB]作为启动加载器。另外一种选择是[http://lilo.go.dyndns.org/ LILO]。缺省的'''GRUB'''配置('''/boot/grub/menu.lst''')应该足够了。唯一你可能想修改的是控制台的分辨率。将vga=<number>加入到第一个kernel行。(menu.lst中已列出一张分辨率和数字的对应表格可供查找。)<br />
title Arch Linux (Main)<br />
root (hd0,0)<br />
kernel /boot/vmlinuz26 root=/dev/sda1 ro vga=773<br />
initrd /boot/kernel26.img<br />
参数"vga=773"表示1024x768分辨率、256色的framebuffer。<br />
<br />
将'''GRUB'''启动加载器安装到主引导区(本例中为sda)。<br />
<br />
====8、系统重启====<br />
退出安装程序。<br />
*建议:为了方便接下来更进一步的安装配置,可以把光盘里的新手指南复制一份到电脑里,这样后面的安装就能查看相应的向导了<br />
<br />
cp /arch/beginnersguide.txt /mnt/home/beginnersguide.txt<br />
<br />
系统重启之后,进入控制台,可以使用下面命令查看这新手指南<br />
less /home/beginnersguide.txt<br />
所有安装完毕之后,可以删了这指南<br />
rm /home/beginnersguide.txt<br />
<br />
输入命令下面命令,重启:<br />
<br />
reboot<br />
<br />
一个新Arch Linux系统就会启动并进入登录提示符(你可能需要在'''BIOS'''将启动顺序改为优先从硬盘启动)。<br />
<br />
'''祝贺你,一个崭新的Arch Linux基础系统闪亮登场了!'''<br />
<br />
==第二部分:完成基本系统并升级==<br />
你的新Arch Linux基础系统现在已是一个功能完整的GNU/Linux环境了,随时可以进行定制。从现在开始,你可以按自己的意图和需求改造它。由于arch是滚动发布的,所以安装包不一定是最新的系统,所以我们在安装完成之后,需要立即更新系统。<br />
<br />
让我们开始吧。<br />
-----<br />
登录入你的root账号。我们将以root身份配置pacman和更新系统,然后创建一个普通用户账号。<br />
<br />
===一、配置网络(如果有需要)===<br />
*''如果安装脚本的自动配置不适合你,本段内容将帮助你配置大部分类型的网络。''<br />
-----<br />
如果一切正常的话,你的网络应该可以正常使用了。先ping www.google.com验证一下:<br />
ping -c 3 www.google.com<br />
<br />
''如果你已经成功建立网络连接,则跳到下面阅读[[#使用pacman更新、同步、升级系统|使用pacman更新、同步、升级系统]]'''。''<br />
<br />
如果ping www.google.com后得到"unknown host"的错误,可以认为你的网络尚未正确配置。你需要重新检查以下内容的完整性和正确性:<br />
'''/etc/rc.conf''' # 特别留意HOSTNAME= 和 NETWORKING 部分有无输入错误。<br />
<br />
'''/etc/hosts''' # 复核一下格式。(看之前的内容。)<br />
<br />
'''/etc/resolv.conf''' # 当你使用静态IP时需要检查。如果你使用DHCP,缺省这个文件会被自动创建和销毁,不过也可以改为你需要的内容。(参见[[Network]]。)<br />
<br />
高级的网络配置方法可以在[[Network]]一文中找到。<br />
<br />
=====有线网络=====<br />
<br />
用以下命令检查网络<br />
ifconfig<br />
你应该看到eth0这一项。如果有需要,你可以这样设置一个新的静态IP:<br />
ifconfig eth0 <ip address> netmask <netmask> up <br />
并且这样设置缺省网关:<br />
route add default gw <ip address of the gateway><br />
查看一下/etc/resolv.conf是否包含你的DNS服务器,不过缺失了则补填进去。<br />
再次用ping www.google.cn检查一下网络。如果一切正常,将/etc/rc.conf调整为刚才新设置的静态IP。如果你的网络使用DHCP服务器/路由器的话,输入:<br />
dhcpcd eth0<br />
如果这样可行的话,则将/etc/rc.conf按之前所述方法调整为动态IP。<br />
<br />
=====无线网络=====<br />
详见安装指南:[[无线设置 (简体中文)|无线设置]]<br />
<br />
=====模拟信号调制解调器=====<br />
<br />
如果你想使用外接电话线调制解调器, 你至少要安装ppp包. 根据需要修改配置文件 /etc/ppp/options 你可以参考 man pppd 的帮助.<br />
<br />
你还需要定制一个 chat 协议脚本, 在初始化握手连接建立以后, 提供你的ISP用户名和密码. 命令pppd 和 chat 的帮助里有例子不管你是菜鸟还是高手都应该能搞定连接了.<br />
使用 udev 的话, 串口设备一般是 /dev/tts/0 和 /dev/tts/1.<br />
<br />
Tip: Read [[Dialup without a dialer HOWTO]].<br />
<br />
如果你不想为了 pppd 拔光自己的头发, 你可能会选择安装 wvdial 或类似的配置工具来简化这个过程.<br />
如果你的猫是所谓的 WinModem, 也就是内置 PCI modem 卡, 你可以在这个网址找到大量信息: [http://www.linmodems.org/ LinModem]<br />
<br />
=====ISDN=====<br />
<br />
通过三步,完成 ISDN 的安装和配置:<br />
# 安装配置固件Install and configure hardware<br />
# 安装配置ISDN 管理工具<br />
# 添加ISP信息<br />
<br />
现在的 Arch stock kernels 已经包含了ISDN 所需要的modules, 所以不需要重新去编译内核,除非 you're about to use rather odd ISDN hardware. 把ISDN卡插入电脑或者插入USB ISDN-Box之后,you can try loading the modules with modprobe. 绝大部分的ISDN PCI 卡都能被module hisax处理,只需要两个参数:类型和协议。 如果使用的是1TR6标准,则协议设定为 '1' ,如果使用的是EuroISDN (EDSS1),协议设定为 '2', '3' if you're hooked to a so-called leased-line without D-channel, 如果使用的是US NI1,则设为'4'.<br />
<br />
所有配置细节都可以在kernel documentation, more specifically in the isdn subdirectory, and available online中获知。 类型的参数是根据电视卡来设定的,在README.HiSax kernel documentation中,有一个可能类型的列表。 用相应的参数加载moduleChoose,比如这个:<br />
<br />
modprobe hisax type=18 protocol=2<br />
<br />
这个将加载适用于电视卡类型为ELSA Quickstep 1000PCI,德国使用的EDSS1协议的模块hisax。可以在日志文件/var/log/everything.log中查看是否模块被预加载。额外的USB ISDN Adapter需要加载些USB模块才能正常工作。<br />
<br />
通过上述设定之后,如果电视卡能正常工作,那么把下面模块和参数加入/etc/modprobe.conf中:<br />
<br />
alias ippp0 hisax<br />
options hisax type=18 protocol=2<br />
<br />
这么做的好处是,这些模块在不使用时不会被加载。另外的方法是可以在这只加参数,把hisax加入/etc/rc.conf里面的MODULES,这样做的坏处就是不管这些模块是不是在使用,都加载了。 <br />
<br />
完成上述步骤之后,需要安装管理工具<br />
<br />
安装软件包isdn4k-utils,阅读关于isdnctrl的说明手册。在说明手册里,将有详细的说明:如何创建一个配置文件that can be parsed by isdnctrl,安装实例。 Please note that you have to add your SPID to your MSN setting separated by a colon if you use US NI1.<br />
<br />
使用isdnctrl utility配置ISDN卡之后,将可以拨号到你设定的PHONE_OUT参数的机器上,但提示用户名和密码错误。把用户名和密码加入到/etc/ppp/pap-secrets或者/etc/ppp/chap-secrets,这个主要根据的是你的ISP使用的协议授权方式,as if you were configuring a normal analogous PPP link。如果无法确定,可以两个文件都加。<br />
<br />
完成上述设定之后,用root帐号建立一个拨号连接:<br />
isdnctrl dial ippp0<br />
有啥问题,请检查日志文件!<br />
<br />
=====DSL (PPPoE)=====<br />
<br />
仅当需要你的计算机去主动拨号连接ISP的情况下才需参考本段内容。如果你使用独立的路由器来负责这类工作,你只需要设置一个缺省网关即可。<br />
<br />
在使用DSL连接前,你得先在计算机里安装一个连接到DSL-Modem的网卡。将你新装网卡加入到modules.conf/modprobe.conf或者MODULES列表之后,安装rp-pppoe软件包并运行pppoe-setup脚本来配置你的连接。当你输入完有关信息后,可以分别通过以下命令来进行连接和挂断:<br />
<br />
/etc/rc.d/adsl start<br />
<br />
和<br />
<br />
/etc/rc.d/adsl stop<br />
<br />
setup过程一般都是很容易、直观的,如果还有不懂可以阅读man手册。如果你想在启动时自动拨号,可以将adsl加入到DAEMONS列表中。<br />
<br />
<br />
===二、更新Pacman===<br />
<br />
====pacman是什么?====<br />
[[Pacman]]是Arch Linux的软件包管理器('''pac'''kage '''man'''ager)。Pacman是用C语言编写的,速度快,使用简便,功能强大。它可以管理整个软件包系统,负责软件包的安装、删除、降级(通过缓存),也支持自编译的软件包,自动分析依赖关系,可以搜索远程和本地软件仓库,还有大量其它功能。这里我们将用pacman来从远程软件仓库下载软件包并安装到系统中。<br />
<br />
对系统进行定制,pacman是Arch Linux最重要工具。<br />
<br />
====1、配置pacman====<br />
=====pacman总配置文件/etc/pacman.conf=====<br />
Arch通过pacman可以获得对下面 4软件仓库的管理:<br />
<br />
'''[core]'''<br />
<br />
[core](“核心”)仓库的简单原则是只提供一个基本的Arch Linux的基本工具:GNU系列工具,Linux内核,一个文字编辑器,一个命令行浏览器等(这里也有一些例外。比如说,vi和nano是同时提供的,允许用户选择一个或两个)。它包含所有使你的系统正常运转的“必须”安装的包,只有它们完美地工作,你的系统才能继续运行。这些是绝对“system-critical”(对系统来说至关重要)的包。由开发者负责维护。<br />
<br />
*''Core安装媒介(The Core installation media)简单地包含一个安装脚本,一个当前发布版本的核心仓库的快照(snapshot)。''<br />
<br />
'''[extra]'''<br />
<br />
[extra](“额外的”)仓库包含所有的对于一个基本的Arch系统不是必须,但是对于构建一个完整的系统环境有用的的Arch包。 比如'''X''', KDE和Apache,都可以在这里面找到。它也是由开发者维护的。<br />
<br />
'''[testing]'''<br />
<br />
[testing](“测试”)仓库包含的包是[core]和[extra]仓库的候选者。<br />
下面情况下,新的软件包将进入[testing]软件仓库:<br />
* 可能会导致系统出问题的升级,需要测试。<br />
* 需要重新打包其他软件包。这种情况下,所有需要重新打包的软件包将被放在[testing]仓库,直到所有重新打包完成,这些软件包才回归原有的软件仓库。 <br />
<br />
开发者维护。<br />
<br />
[testing]是唯一的一个在名义上与其它官方仓库有冲突的仓库。(that can have name collisions with any of the other official repositories. )<br />
<br />
<font color=&quot;blue&quot;>*如果开启, [testing]必须放在''pacman.conf''的软件仓库的第一个。</font><br />
<br />
<font color=&quot;red&quot;>'''警告''': '''''开启[testing]软件仓库,容易导致系统崩溃,因此只建议有经验的用户开启。'''''</font><br />
<br />
'''[community]'''<br />
<br />
[community](“社区”)仓库是由“信任用户”(''Trusted Users (TUs)'')维护的,是''Arch User Repository ([[AUR]])''(Arch用户仓库)的一部分。它包含的是二进制的包,在用户仓库中有足够的“票数”,并由''信任用戶''挑选出来的。像其它上面列出的仓库一样,[community] 可以用pacman获取。<br />
<br />
'''[[AUR]]''' 也包含'''unsupported''' 分支,这不能直接通过pacman获取。*. [unsupported] 包含多达海量PKGBUILD脚本,用来从源代码编译。这从其它仓库中是不能使用的。 <br />
<br />
<nowiki>*</nowiki> '''''[[AUR Helpers]]''''' 能帮助你无缝地使用AUR。<br />
<br />
'''/etc/pacman.conf'''<br />
<br />
每次调用pacman,它都会读取/etc/pacman.conf文件。这个配置文件分若干段,每一段定义了一个pacman用来搜索软件的仓库。唯一例外的是options段,它定义了全局选项。<br />
nano /etc/pacman.conf<br />
范例:<br />
#<br />
# /etc/pacman.conf<br />
#<br />
# See the pacman.conf(5) manpage for option and repository directives<br />
<br />
#<br />
# GENERAL OPTIONS<br />
#<br />
[options]<br />
# The following paths are commented out with their default values listed.<br />
# If you wish to use different paths, uncomment and update the paths.<br />
#RootDir = /<br />
#DBPath = /var/lib/pacman/<br />
#CacheDir = /var/cache/pacman/pkg/<br />
#LogFile = /var/log/pacman.log<br />
HoldPkg = pacman glibc<br />
# If upgrades are available for these packages they will be asked for first<br />
SyncFirst = pacman<br />
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u<br />
#XferCommand = /usr/bin/curl %u > %o<br />
<br />
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup<br />
#IgnorePkg =<br />
#IgnoreGroup =<br />
<br />
#NoUpgrade =<br />
#NoExtract =<br />
<br />
# Misc options (all disabled by default)<br />
#NoPassiveFtp<br />
#UseSyslog<br />
#ShowSize<br />
#UseDelta<br />
#TotalDownload<br />
#<br />
# REPOSITORIES<br />
# - can be defined here or included from another file<br />
# - pacman will search repositories in the order defined here<br />
# - local/custom mirrors can be added here or in separate files<br />
# - repositories listed first will take precedence when packages<br />
# have identical names, regardless of version number<br />
# - URLs will have $repo replaced by the name of the current repo<br />
#<br />
# Repository entries are of the format:<br />
# [repo-name]<br />
# Server = ServerName<br />
# Include = IncludePath<br />
#<br />
# The header [repo-name] is crucial - it must be present and<br />
# uncommented to enable the repo.<br />
# <br />
<br />
# Testing is disabled by default. To enable, uncomment the following<br />
# two lines. You can add preferred servers immediately after the header,<br />
# and they will be used before the default mirrors.<br />
#[testing]<br />
#Include = /etc/pacman.d/mirrorlist<br />
<br />
[core]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
[extra]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist <br />
<br />
[community]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
# An example of a custom package repository. See the pacman manpage for<br />
# tips on creating your own repositories.<br />
#[custom]<br />
#Server = file:///home/custompkgs<br />
要开启一个软件仓库,只需要将'Include ='和'[repository]'行前的注释符号(#)去除。<br />
<br />
*"Server ="行如果取消注释,将会强制此服务器被首先搜索,详细的仓库配置位于/etc/pacman.d/下。<br />
* 注意:选择仓库时,请确认将仓库名和'Include ='行都一同取消注释。没有这样做的话会导致你选择的仓库被忽略!这是个很普遍的错误。<br />
<br />
=====(如果有必要)配置镜像列表 /etc/pacman.d/mirrorlist=====<br />
更快的镜像能显著改善pacman的性能和你对Arch Linux的总体体验。<br />
<br />
*手动编辑/etc/pacman.d/mirrorlist:<br />
nano /etc/pacman.d/mirrorlist<br />
删除所有不在你所在洲或者太远的镜像。(在nano里你可以用CTRL-K删除每个不需要的行。)保存文件并退出。<br />
<br />
*'''rankmirrors'''脚本可以根据镜像的响应延迟对其自动排名。'''Rankmirrors'''是python脚本,需要安装python:<br />
<br />
pacman -S python<br />
<br />
然后,运行'''rankmirrors'''脚本按响应延迟顺序对镜像进行排名:<br />
rankmirrors -v /etc/pacman.d/mirrorlist<br />
输出会列出所有镜像和它们的响应延迟(ping),例如:<br />
<br />
# United States<br />
# http://mirrors.easynews.com/linux/archlinux/$repo/os/i686 ... 0.96<br />
# ftp://ftp.nethat.com/pub/linux/archlinux/$repo/os/i686 ... unreachable<br />
# ftp://locke.suu.edu/linux/dist/archlinux/$repo/os/i686 ... 2.43<br />
# ftp://mirrors.unixheads.org/archlinux/$repo/os/i686 ... 1.96<br />
<br />
脚本将从低到高的响应延迟顺序显示:<br />
Server = http://mirrors.easynews.com/linux/archlinux/$repo/os/i686<br />
Server = ftp://mirrors.unixheads.org/archlinux/$repo/os/i686<br />
Server = ftp://locke.suu.edu/linux/dist/archlinux/$repo/os/i686<br />
Server = ftp://ftp.nethat.com/pub/linux/archlinux/$repo/os/i686<br />
<br />
要注意的是这个结果对于镜像排列并非很精确,最接近你的镜像或者延迟最低的镜像并不一定是最佳选择。(反应迅速但是内容过时的镜像、或者低延迟但是窄带宽的镜像对你毫无用处)。<br />
<br />
编辑/etc/pacman.d/mirrorlist,将最佳的镜像置于在列表顶端。为了体验多个镜像你可能要不断修改此配置文件,请精明地选择。<br />
<br />
====常用的命令====<br />
<br />
与远程软件仓库同步和更新本地包数据库 (推荐在安装和更新包之前这样做):<br />
pacman -Sy<br />
<br />
'''升级'''系统中所有的包:<br />
pacman -Su<br />
<br />
一条同步、更新、'''升级''' 所有系统中的包的命令:<br />
pacman -Syu<br />
<br />
安装或者升级单个软件包或者一串包(包括其依赖包):<br />
pacman -S packageA packageB<br />
<br />
同步、更新数据库并安装软件包:<br />
pacman -Sy packageA packageB<br />
<br />
移除软件包, 但保留依赖的包:<br />
pacman -R package<br />
<br />
移除单个包,并且移除没有被别的软件依赖的依赖包:<br />
pacman -Rs package<br />
<br />
移除包所有不需要的依赖包并删除其配置文件:<br />
pacman -Rsn package<br />
<br />
通过给定关键词(列表)搜索远程软件仓库数据库(repo):<br />
pacman -Ss keyword<br />
<br />
列出系统中所有的包<br />
pacman -Q<br />
<br />
在本地包数据库搜索 (查询)指定软件包:<br />
pacman -Q package <br />
<br />
在本地包数据库搜索 (查询)指定软件包并列出相关信息:<br />
pacman -Qi package<br />
<br />
To defragment pacman的数据库缓存和速度优化选项:<br />
pacman-optimize<br />
<br />
统计当前系统中的包数量:<br />
pacman -Q | wc -l<br />
<br />
使用ABS和makepkg从源代码编译安装包:<br />
pacman -U packagename.pkg.tar.gz<br />
<br />
Note: pacman有很多很多的选项和功能组合。你可以试试man pacman或者查阅lt the [[pacman]]维基条目<br />
<br />
====软件包管理增强工具====<br />
* Yaourt 可查询aur的pacman增强工具<br />
* Tupac 快速查询的yaourt增强工具<br />
* Powerpill 多进程下载的pacman增强工具<br />
{{Box Note| 强烈建议更新系统完毕后,安装yaourt和powerpill,以便更充分享受Arch Linux的方便和强大。}}<br />
在/etc/pacman.conf文件里,最后添加两行(如果是i686的话,把x86_64换成i686即可):<br />
[archlinuxfr]<br />
Server = http://repo.archlinux.fr/x86_64<br />
然后使用pacman安装yaourt<br />
pacman -Sy yaourt<br />
<br />
以后就可以使用yaourt命令来查找并安装包括[[AUR]]里的软件了。比如bcm无线网卡,需要安装b43-firmware(此软件包在[[AUR]]仓库里,使用pacman无法查找到),使用yaourt命令查找并安装:<br />
yaourt b43-firmware<br />
找到之后,根据相应提示,一直到安装完成。<br />
<br />
====图形化管理工具====<br />
* qt界面的shaman:比较成熟的pacman 图形化管理工具<br />
* gtk界面的gtkpacman :目前BUG比较多,不稳定。<br />
<br />
====Pacman的更多信息====<br />
用此命令查看pacman手册:<br />
man pacman<br />
有空的话可以看看[[pacman (简体中文)]]维基条目。<br />
<br />
====2、更新Pacman自己====<br />
<br />
一开始,系统可能会提示你先更新pacman自身,这取决于Arch安装包的新旧程度:<br />
pacman -Sy pacman<br />
pacman开始查看是否需要更新,如果有提示需要更新,则按‘y’,开始pacman更新。<br />
<br />
'''''有时候,还需要用户主动修改某些配置;请仔细阅读升级过程中的输出获取相关信息。'''''<br />
<br />
===三、更新系统===<br />
====使用[[pacman (简体中文)|pacman]]====<br />
现在我们要用[[pacman (简体中文)|pacman]]来更新系统。要更新、同步并'''升级'''你的系统,可以使用命令:<br />
pacman -Syu<br />
pacman就会获取所有最新可用软件包信息并进行升级。(此时你可能会被提示先升级pacman自身。如果是这样,回答'yes',然后在完毕后再运行一次pacman -Syu命令。)<br />
<br />
===='''滚动发布'''之美====<br />
Arch是一个'''rolling release'''(滚动发布)的发行版。这意味着没有必要重新安装或执行完整的系统重建来升级到最新版本。只需要执行'''pacman -Syu''',就能保持你的系统更新到最新和bleeding edge(表示最新的、因而也并非完美的技术)。<br />
<br />
===四、增加一个用户并设置用户组===<br />
用root账号来处理日常工作是很危险的。Root是用来处理系统管理的任务。我们可以用以下命令增加一个普通用户账号:<br />
adduser<br />
大部分缺省选项都是没问题的,你可能还需要将storage、audio、video、optical和wheel加入到你的用户组中 ── 特别是在你打算使用一个完整功能的桌面环境的情况下。<br />
<br />
用户组和用户的关联定义在/etc/group文件中: <br />
<br />
它包含了:<br />
<br />
*'''audio''' - 关于声卡和相关软件的任务<br />
<br />
*'''wheel''' - 给sudo使用<br />
<br />
*'''storage''' - 负责存储设备<br />
<br />
*'''video''' - 视频任务和3D加速<br />
<br />
*'''optical''' - 和光驱有关的任务<br />
<br />
*'''floppy''' - 软驱访问<br />
<br />
*'''lp''' - 打印任务<br />
<br />
请参看[[Groups]]一文了解你应该属于哪些用户组。<br />
你还可能需要将你的用户账号加入到以下用户组(需要以root身份运行此命令):<br />
usermod -aG audio,video,floppy,lp,optical,network,storage,wheel,dbus,hal USERNAME<br />
详情可看usermod和gpasswd的man手册。<br />
<br />
===五、安装建立Sudo (可选)===<br />
安装Sudo:<br />
# pacman -S sudo<br />
以root身份,运行命令visudo,把用户加入sudo用户 (a &quot;sudoer&quot;).如果不知道怎么使用vi,你可以在用visudo前设置VISUAL 或 EDITOR环境变量为你喜欢的编辑器。例如:<br />
# export VISUAL=vim<br />
或<br />
# export EDITOR=nano<br />
如果你对于用vi很适应,去掉EDITOR=nano这个变量就行:<br />
# visudo<br />
这命令将在一个特殊的vi会话中打开文件 /etc/sudoers 。visudo复制文件到一个可编辑的临时文件中,用一个编辑器编辑它(vi是默认的),接下来运行一个安全检查(“sanity check”)。如果通过,这个临时文件就有正确的权限将重写的原始文件。t<br />
<br />
<font color=&quot;red&quot;>'''注意:不要直接用编辑器编辑 /etc/sudoers ; 否则会出现这样的提示:Errors in syntax can cause annoyances (像root帐户不能使用的描述一样)。 必须使用 ''visudo'' 命令来编辑 /etc/sudoers.'''</font><br />
<br />
当用户输入以 &quot;sudo&quot;, 作为开始的命令行时,临时授予该用户root权限。加入下面一行:<br />
USER_NAME ALL=(ALL) ALL<br />
USER_NAME 就是单个用户名。<br />
<br />
更多信息,比如按<TAB> 自动命令补全,请见[[Sudo]]<br />
<br />
==第三部分:安装X并配置ALSA==<br />
一共有三步工作:<br />
*1、安装声卡驱动<br />
*2、安装x-window(包括显卡驱动)<br />
*3、配置X<br />
<br />
{{Box Note | '''在热插拔未配置正确的情况下,或者是/etc/rc.d/hal未启动的情况下,请不要启动开启X(包括重启使用gdm或者kdm登陆),否则可能导致鼠标键盘失去响应!!!'''}}<br />
<br />
===一、配置声卡:使用alsamixer===<br />
高级Linux声音架构(Advanced Linux Sound Architecture,简称ALSA)是一个Linux内核组件。它替换了原有的开放声音系统(OSS),为声卡提供了设备驱动。除了声音设备驱动以外,'''ALSA'''还给应用程序开发人员提供了一个用户空间库,可使更高级的API无需直接与内核驱动打交道就能使用驱动功能。<br />
<br />
{{Box Note| Alsa已经包含进最新的内核kernel,udev 将在系统启动时自动检测硬件,并自动根据声卡加载相应的内核模块。虽然声卡已经在工作,但电脑的声音默认是静音。}}<br />
{{Box Note| OSS4.1已经放出,相对于老的版本,这是一个显著的提升的版本,如果使用ALSA有问题, 或者是想尝试新的功能,可以使用 OSS4.1。 相关说明可见: [[OSS]]}} <br />
<br />
Alsa-utils软件包里的alsamixer让我们可以从命令行来配置声音设备。(你也可以稍后在'''X'''环境中使用alsamixer。)<br />
默认情况下,内核加载模块snd_pcsp,这是一个alsa pc speaker模块。 snd_pcsp通常先于&quot;你实际的&quot;声卡模块加载。大部分情况下,这模块最后加载更好,因为可以让alsamixer正确控制需要的声卡。<br />
<br />
在/etc/modprobe.conf中加入这行,可以使得snd_pcsp最后加载:<br />
options snd-pcsp index=2<br />
<br />
当然,如果你不想让snd_pcsp加载,可以把它放入黑名单,或者是在/etc/rc.conf的Modules里禁止它:<br />
MODULES=(... !snd_pcsp)<br />
<br />
{{Box Note | 想要生效,需要释放并重新加载所有声音模块,当然,系统重启就可以简单解决这问题。 }}<br />
<br />
* 安装alsa-utils软件包:<br />
pacman -S alsa-utils<br />
<br />
* 为了解决Alsa声卡独占问题,可以安装alsa-oss:<br />
# pacman -S alsa-oss <br />
<br />
* 把你的普通用户账号加入到audio用户组中:以root身份,运行<code>/usr/bin/gpasswd</code>程序:<br />
gpasswd -a yourusername audio<br />
*以普通用户身份运行: <br />
alsamixer<br />
用左右光标键移动到Master和PCM声道上,按'''M'''取消掉静音。用向上键增加音量。(70-90的音量是较合适的范围)按ESC键离开alsamixer。<br />
有'''Speaker'''的,需要同时取消静音并调整之. <br />
<br />
====测试声音====<br />
以普通用户身份,使用 <code>/usr/bin/aplay</code>程序来测试你的声音配置:<br />
aplay /usr/share/sounds/alsa/Front_Center.wav<br />
你应该会听到一个女性声音说:“Front,center。”<br />
<br />
====保存声音配置====<br />
以root身份运行<code>/usr/bin/alsactl</code> :<br />
alsactl store<br />
这将创建'/etc/asound.state'文件,用来保存alsamixer的设置。<br />
<br />
为了每次启动都可以自动恢复混音器设置,可将守护进程''alsa''加入到你的/etc/rc.conf中的DAEMONS列表。<br />
nano /etc/rc.conf<br />
DAEMONS=(syslog-ng network crond '''alsa''')<br />
''注意,alsa守护进程在启动过程中仅仅是恢复音量设置。它和alsa音频库(和内核级API)是完全不同的。''<br />
<br />
更多详情请参看[[ALSA 安装设置 (简体中文)|ALSA 安装设置]]。<br />
<br />
===二、安装X===<br />
'''X''' 窗口系统(一般叫'''X11'''或者更简单的叫'''X''') 是一个网络互动和显示服务,提供位图显示器窗口. 提供标准化工具包(toolkit)和协议,用于<code>UNIX</code>类操作系统,构建一个图形界面(GUIs) <br />
<br />
'''X''' 提供最基本、基础的框架,用于构建一个图形操作界面环境。包括:绘图、屏幕窗口移动,与鼠标或者键盘的交互。 '''X''' 并不负责用户交互界面的部分:有独立的客户端程序负责处理这部分。 比如gnome、kde。<br />
<br />
'''X''' 因为它先于'''W'''窗口系统,最初由斯坦福大学开发。 <br />
<br />
*''注意: 如果想使用一个'''开源''' 显卡驱动, 需要3d加速,强烈建议在安装Xorg之前安装库 libgl :''<br />
pacman -S libgl<br />
''(拥有专利的视频驱动提供它们自己的gl库安装(implementations).)''<br />
----- <br />
====1、安装X====<br />
构建一个GUI的第一步:用pacman来安装Xorg包.<br />
<br />
# pacman -S xorg<br />
对于新版的xorg,建议(可能大部分情况下是必须的)安装输入设备驱动evdev。它本来应该作为xorg-server的一个依赖被安装的,不过不知道为什么貌似缺失了:<br />
# pacman -S xf86-input-evdev<br />
3d的工具比如glxgears包含在包'''mesa''' 里(如果需要,也安装):<br />
# pacman -S mesa<br />
<br />
====2、安装显卡驱动====<br />
到这一步,已经有了运行'''X''' Server的基本软件包,接下来需要把显卡的驱动安装到电脑里(e.g. xf86-video-<name>). 最简单的X.org配置方法就是安装正确的驱动包,然后使用自动脚本对 /etc/X11/xorg.conf 进行初始化,比如使用 Xorg -configure(arch团队提供hwd工具,但据以前用户的反映,这个现在还老出问题,新手可以使用,以后有能力再配置其他).<br />
<br />
如果不知道显卡类型,输入下面命令:<br />
lspci | grep VGA<br />
<br />
输入下面命令,查看所有'''开源'''驱动: <br />
pacman -Ss xf86-video | less<br />
<br />
下面是一个'''开源'''的显卡列表和相关说明:<br />
*'''xf86-video-apm''' Alliance ProMotion video driver<br />
*'''xf86-video-ark''' ark video driver<br />
*'''xf86-video-ati''' ati video driver<br />
*'''xf86-video-chips''' Chips and Technologies video driver<br />
*'''xf86-video-cirrus''' Cirrus Logic video driver<br />
*'''xf86-video-dummy''' dummy video driver<br />
*'''xf86-video-fbdev''' framebuffer video driver<br />
*'''xf86-video-glint''' GLINT/Permedia video driver<br />
*'''xf86-video-i128''' Number 0 i128 video driver<br />
*'''xf86-video-i740''' Intel i740 video driver<br />
*'''xf86-video-i810''' Intel i810/i830/i9xx video drivers (deprecated - use -intel)<br />
*'''xf86-video-intel''' Newer Version of Intel i810/i830/i9xx video drivers<br />
*'''xf86-video-imstt''' Integrated Micro Solutions Twin Turbo vidoe driver<br />
*'''xf86-video-mach64''' mach64 video driver <br />
*'''xf86-video-mga''' mga video driver (Matrox Graphics Adapter) <br />
*'''xf86-video-neomagic''' neomagic video driver<br />
*'''xf86-video-nouveau''' Open Source 3D acceleration driver for nVidia cards (eperimental)<br />
*'''xf86-video-nv''' nvidia nv video driver<br />
*'''xf86-video-openchrome''' Openchrome drivers<br />
*'''xf86-video-r128''' ati Rage128 video driver<br />
*'''xf86-video-radeonhd''' Experimental Radeon HD video driver for r500 and r600 ATI cards<br />
*'''xf86-video-rendition''' Rendition video driver<br />
*'''xf86-video-s3''' S3 video driver<br />
*'''xf86-video-s3virge''' S3 Virge video driver<br />
*'''xf86-video-savage''' savage video driver<br />
*'''xf86-video-siliconmotion''' siliconmotion video driver<br />
*'''xf86-video-sis''' SiS video driver<br />
*'''xf86-video-sisusb''' SiS USB video driver<br />
*'''xf86-video-tdfx''' tdfx video driver<br />
*'''xf86-video-trident''' Trident video driver<br />
*'''xf86-video-tseng''' tseng video driver<br />
*'''xf86-video-unichrome''' Unichrome video drivers<br />
*'''xf86-video-v4l''' v4l video driver<br />
*'''xf86-video-vesa''' vesa video driver<br />
*'''xf86-video-vga''' VGA 16 color video driver<br />
*'''xf86-video-via''' via video driver<br />
*'''xf86-video-vmware''' vmware video driver<br />
*'''xf86-video-voodoo''' voodoo video driver<br />
<br />
* 说明:'''vesa'''驱动是最原汁原味的,适用于大部分的显卡。如果实在无法找到合适的显卡驱动,就选用vesa。(这是原话,好像夸张了点!If you cannot find a suitable driver for your video chipset, vesa '''should''' work.)<br />
<br />
用pacman来安装适合你显卡的驱动。例如:<br />
pacman -S xf86-video-savage<br />
(给Savage显卡的驱动。)<br />
<br />
* 如果实在不确定需要安装那个显卡驱动,可以安装所有显卡驱动包, 输入下面命令:<br />
pacman -S xorg-video-drivers<br />
<br />
*如果显卡是nVIDIA 或者ATI的,并'''想安装nVIDIA或者ATI官方提供的显卡驱动,请看下面。'''<br />
-----<br />
<br />
====nVIDIA图形显示卡====<br />
nVIDIA显示卡的驱动程序被许多人认为是非常好的质量,而且带有高级3D性能。<br />
<br />
在设置您的你nVIDIA显卡之前您先要选择您要使用的驱动程序。Arch现在有3种不一样的nVIDIA驱动程序,各自支持不同型号的显卡:<br />
<br />
'''1. nvidia-96xx''' ''直到Ge Force 4的较新显卡''<br />
<br />
'''2. nvidia-173xx''' ''Geforce FX系列显卡''<br />
<br />
'''3. nvidia''' ''在GF FX之后的最新GPU''<br />
<br />
{{Box Note| 一些特别老如TNT和TNT2之类的显卡所需的Nvidia-71xx系列闭源驱动,由于无法在Arch所用的新版Xorg下正常运行,并且nvidia也已不再继续支持它们,因此已被删除。你可以改用xf86-video-nv或者xf86-video-vesa驱动。}}<br />
<br />
到nVIDIA主页,看哪个适合你电脑.区别只是安装,配置过程是一样的.<br />
<br />
''根据你的显卡'',选择合适的nVIDIA驱动安装,比如: <br />
pacman -S nvidia-96xx<br />
<br />
nVIDIA软件包有个工具能自动升级你已有的nVIDIA驱动的配置文件/etc/X11/xorg.conf,输入下列命令即可实现:<br />
nvidia-xconfig<br />
<br />
它也有一些选项,用于更深入和具体地配置xorg.conf文件的内容和选项,例如:<br />
<br />
<br />
nvidia-xconfig --composite --add-argb-glx-visuals<br />
<br />
更详细的信息,请参考:nvidia-xconfig(1).<br />
<br />
一些有用的妙法可用在“device“部分(你要清楚它们不一定都能对你的系统有用):<br />
Option "RenderAccel" "true"<br />
Option "NoLogo" "true"<br />
Option "AGPFastWrite" "true"<br />
Option "EnablePageFlip" "true"<br />
将所有的DRI注释掉:<br />
# Load "dri"<br />
<br />
多检查几次你的/etc/X11/xorg.conf以确定你的默认的depth(色深),horizontal sync(水平同步),垂直刷新率,以及分辨率是可以接受的。<br />
<br />
使用<code>/sbin/depmod</code>命令来更新内核模块依赖:<br />
depmod -a<br />
(也许需要重启。)<br />
{{Tip|nvidia配置的高级的说明参考文章[[NVIDIA]] 。}}<br />
<br />
现在你可以跳到'''[[#三、配置X:创建并修改/etc/X11/xorg.conf|配置X]]'''来进一步熟悉,或者跳到'''[[#3、测试 X|测试 X]]'''继续安装过程。<br />
<br />
====ATI图形显示卡====<br />
ATI用户的驱动可以有几种选择。<br />
* '''xf86-video-ati'''软件包提供的开源'''''radeon'''''驱动。<br />
** 原创的、完全支持Radeon芯片组到X1950(最新的R500芯片组)的逆向工程开源驱动。对9200系列以前的显卡完全支持,可以稳定的提供全2D和3D加速。从9500到X1950完全支持2D加速特性,良好的3D加速,不过缺乏某些闭源驱动的特性(例如能源节省特性仍处于测试阶段)。xf86-video-ati支持从HD2xxx (R6xx)到最新的显卡,不过目前仅提供2D支持。<br />
* '''xf86-video-radeonhd'''软件包提供了开源的'''''radeonhd'''''驱动。<br />
** 此驱动支持ATI R500(Radeon X1000系列)以及更新的芯片组。该驱动由AMD提供文档,Novell为之开发。它支持RandR 1.2,目前的开发工作非常活跃。因此所支持的不同系列显卡的功能可以不一致。(有些用户反映它性能优异,而有些则说它很糟)。它还支持带音频的HDMI。<br />
* AUR中的Catalyst软件包提供了闭源'''''fglrx'''''驱动。稍后将介绍闭源驱动。<br />
开源驱动通常可以满足大部分需求而且较少出问题。<br />
<br />
安装'''''radeon'''''ATI驱动:<br />
# pacman -S xf86-video-ati libgl ati-dri<br />
安装'''''radeonhd'''''ATI驱动:<br />
# pacman -S xf86-video-radeonhd libgl ati-dri<br />
<br />
Arch的<code>extra</code>官方仓库曾经提供过闭源ATI驱动'''Catalyst'''的预编译包,不过在2009年3月以后,由于对闭源驱动的质量和开发进度不满意,官方取消了对它的支持。目前catalyst驱动可以在[http://aur.archlinux.org/packages.php?ID=22899 AUR]中找到。Catalyst驱动的安装信息可以在[[ATI#Proprietary_ATI_Catalyst_driver|这里]]找到。<br />
<br />
{{Warning| 闭源ATI驱动仅支持R600和更新的显卡(即HD2xxx及以上系列),不支持旧系列(X1xxx系列及以下)。}}<br />
<br />
{{Tip|ATI配置的高级指引可以参看[[ATI | ATI wiki 文章]]。}}<br />
<br />
====3、安装输入设备驱动软件包====<br />
最新的X需要你为包括键盘和鼠标在内的输入设备安装驱动。查看可用输入设备驱动的完整列表:<br />
# pacman -Ss xf86-input | less<br />
<br />
对大部分用户,xf86-input-keyboard和xf86-input-mouse应该可以满足基本配置。使用pacman来为你的输入设备安装需要的驱动,例如:<br />
# pacman -S xf86-input-keyboard<br />
===三、配置X:创建并修改/etc/X11/xorg.conf===<br />
====xorg.conf文件====<br />
/etc/X11/xorg.conf 是你的 X-Window-System 的主要配置文件,你的 GUI('''G'''raphical '''U'''ser '''I'''nterface)的基础,它是一个普通的文本文件,里面由 “section” 和 “subsection” 来安排。重要的 section 有 ''Files, InputDevice, Module, Monitor, Modes, Screen, Device'' 和 ''ServerLayout''。各个section安排的前后次序没有关系,对同一种类型的设备也可以有多个section,比如你可能有多个显示器,或者你的本本既有鼠标又有触摸板。<br />
------<br />
从X11R7.2版开始Xserver引入了自动配置特性。在大多情况下,即使没有xorg.conf文件它也能很好地运作。如果''自动检测功能工作正常'',而且你又不需要开启如 aiglx、compositing 等功能的话,你甚至不需要创建这个配置文件。<br />
<br />
====1、创建 /etc/X11/xorg.conf====<br />
<br />
高级用户可以手动创建他们的xorg.conf文件。一般用户可以使用程序<code>/usr/bin/Xorg</code>附加参数-configure来生成一个基本的配置文件;以root身份输入下面命令:<br />
# Xorg -configure<br />
这里生成的文件是/root/xorg.conf.new <br />
<br />
把这文件复制到 <code>/etc/X11/</code>:<br />
# cp /root/xorg.xonf.new /etc/X11/xorg.conf<br />
<br />
====更多的创建/etc/X11/xorg.conf的办法====<br />
* 说明:如果你的电脑已经有一个配置好的xorg.conf文件,不管这个文件是在什么别的发行版下生成的,只要Xorg的版本一致,就可以把该文件复制到你的Arch系统的<code>/etc/X11/</code>目录下。<br />
* 可以使用程序<code>/usr/bin/hwd</code>生成xorg.conf。首先要安装这程序:<br />
# pacman -S hwd<br />
然后输入下面命令:<br />
# hwd -xa<br />
{{Box Note| 目前,hwd在生成的xorg.conf有一行失效。 使用完这程序后,需要手动删除或者是注释掉 Section &quot;Files&quot;下的RgbPath那一行。via nano /etc/X11/xorg.conf or your equivalent, as root/sudo.}}<br />
<br />
* 使用<code>/usr/bin/xorgcfg</code> 脚本生成xorg.conf:<br />
# xorgcfg <br />
* 使用<code>/usr/bin/xorgconfig</code>生成xorg.conf,这个程序以互动方式来创建该文件,输入下面命令运行:<br />
# xorgconfig<br />
<br />
====2、Input设备热插拔问题:请在测试X前阅读====<br />
<br />
xorg 1.5.x版本里已经开启热插拔Input设备。<br />
{{Box Note | 当热插拔开启后, X将清空xorg.conf里所有使用the kbd and mouse 驱动建立的设备。这将导致X被冻结,使得鼠标和键盘失去响应。下面是解决办法。'''方法只能二选一'''}}<br />
<br />
有两个办法可以修复这一问题:<br />
<br />
1) '''配置 input设备热插拔''':安装驱动 xf86-input-evdev,同时配置HAL使其能使用kbd/mouse驱动。<br />
<br />
安装xf86-input-evdev:<br />
# pacman -S xf86-input-evdev<br />
在X.org相关进程启动前,启动守护进程hal:<br />
# /etc/rc.d/hal start<br />
把hal加入/etc/rc.conf里的DAEMONS列表里,这样每次电脑启动,都会自动开启hal。详情请见[[Xorg input hotplugging]] 。<br />
<br />
说明: 开启hal必须首先有一个dbus用户和用户组,以root身份输入下面命令创建用户和用户组<br />
<br />
usr/sbin/groupadd -g 81 dbus<br />
usr/sbin/useradd -c 'System message bus' -u 81 -g dbus -d '/' -s /bin/false dbus<br />
<br />
2) '''关闭input设备热插拔''':在/etc/X11/xorg.conf的ServerFlags段,加入参数''Option &quot;AutoAddDevices&quot; &quot;False&quot;'' 这将忽略hal的硬件检测,并使用你xorg.conf的keyboard/mouse配置。步骤如下<br />
# nano /etc/X11/xorg.conf<br />
加入下面三行:<br />
Section &quot;ServerFlags&quot;<br />
Option &quot;AutoAddDevices&quot; &quot;False&quot;<br />
EndSection<br />
<br />
====3、测试 X====<br />
<br />
在所生成的xorg文件路径''path/to/xorg.conf''前,加入参数''-config'' ,运行 '''X'''脚本,可以测试脚本配置是否正确。<br />
比如要测试你上面生成的xorg是否配置正确,输入:<br />
X -config /root/xorg.conf.new<br />
'''X''' 将启动,在屏幕中央会有一个白色的 X ,鼠标或是触摸板可以移动它,按 CTRL-Alt-Backspace 可以退出 '''X'''<br />
<br />
====对xorg.conf除错====<br />
如果 X 出现错误不能运行,你需要手动检查你的配置文件:<br />
<br />
nano /root/xorg.conf.new<br />
<br />
* 确定 Xorg -configure 命令正确的识别了你的显卡,比如:<br />
Section &quot;Device&quot;<br />
<br />
...<br />
<br />
Driver &quot;savage&quot;<br />
<br />
...<br />
<br />
EndSection<br />
<br />
* 确定里面的 Section "Monitor" 设置了水平同步率和垂直刷新率,如果没有要把它加上:<br />
Section &quot;Monitor&quot;<br />
Identifier &quot;Monitor0&quot;<br />
VendorName &quot;Monitor Vendor&quot;<br />
ModelName &quot;Monitor Model&quot;<br />
HorizSync 30.0 - 130.0 # Safe for LCD's<br />
VertRefresh 50.0 - 100.0 # Safe for LCD's and most CRT's.<br />
EndSection<br />
如果你不知道这些刷新率到底是多少,你就得查一下你显示器的说明书。<br />
<br />
* 在section "Screen"配置默认色深(color depth):<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Card0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
(此处色深被设定为真彩24色。)<br />
<br />
<br />
* 在subsection &quot;Display&quot; 加入你需要的Modes, at least under the Depth 24 header, e.g.:<br />
SubSection &quot;Display&quot;<br />
Viewport 0 0<br />
Depth 24<br />
Modes &quot;1024x768&quot; &quot;800x600&quot; &quot;640x480&quot;<br />
* Add the following section, if you wish to enable eye candy which requires the composite extension: <br />
Section &quot;Extensions&quot;<br />
Option &quot;Composite&quot; &quot;Enable&quot;<br />
EndSection<br />
<br />
* 上述调整完成后,再测试你的配置:<br />
X -config /root/xorg.conf.new<br />
<br />
* 在确认 '''X''' session开启,没有错误之后,把测试好的配置文件移到 /etc/X11下,作为系统的xorg.conf配置文件:<br />
mv /root/xorg.conf.new /etc/X11/xorg.conf<br />
详细的介绍可见[[Xorg]] <br />
<br />
接下来可以简单作测试 '''[[#Simple baseline X test|Simple baseline X test]]'''<br />
<br />
====调整键盘布局====<br />
=====如果开启了input热插拔=====<br />
# cp /usr/share/hal/fdi/policy/10osvendor/10-keymap.fdi /etc/hal/fdi/policy/<br />
# nano /etc/hal/fdi/policy/10-keymap.fdi<br />
Edit the &quot;input.xkb.layout&quot; key and possibly the &quot;input.xkb.variant&quot; key in this file.<br />
Restart hal:<br />
# /etc/rc.d/hal restart<br />
<br />
=====如果关闭了input热插拔=====<br />
Add option lines in the &quot;InputDevice&quot; section of the /etc/X11/xorg.conf file specifying the keyboard layout and variant:<br />
Option &quot;XkbLayout&quot; &quot;be&quot;<br />
Option &quot;XkbVariant&quot; &quot;&quot;<br />
<br />
详情请见 [[Xorg input hotplugging]]。<br />
<br />
===简单的命令行界面X测试(如果需要)===<br />
<br />
在安装了xorg、合适的显卡驱动、创建了一个/etc/X11/xorg.conf文件之后,如果想在安装完整桌面环境之前,快速测试下你的配置,使用'''xterm'''可以实现! <br />
Xterm是个简单的终端模拟程序,作为base xorg软件包的一部分会被自动安装,运行在'''X '''Server环境里。通过配置~/.xinitrc,Xterm可以让我们快速测试显卡驱动和配置文件/etc/X11/xorg.conf是否被正确配置。(另外,如果在没有/etc/X11/xorg.conf的情况下,你想测试下'''X''' 自动检测是否满意,也可以使用这个)<br />
<br />
==== 准备工作:配置~/.xinitrc====<br />
<br />
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. <br />
{{Box Note | '''[[.xinitrc]]''' is a so-called 'dot' (.) file. 在UNIX文件系统下,文件名以 (.)开头的,是 '隐藏文件',,使用普通的命令'ls' 将不显示这些文件,使用加了参数命令'''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 &quot;Run Control&quot;.}}<br />
<br />
'''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. (说明: ''如果没有文件~/.xinitrc, /etc/X11/xinit/xinitrc 将被作为替代来使用,这是个使用TWM and Xterm的默认配置。'')<br />
<br />
切换到'''''普通, 非root'''''用户:<br />
# su - ''yourusername''<br />
* /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.<br />
* 如果没有~/.xinitrc这个文件,到该目录下创建一个,或者从/etc/skel/复制一个同样的文件到你的home目录:: <br />
<br />
$ cp /etc/skel/[[.xinitrc]] ~/<br />
<br />
* 编辑文件: <br />
$ nano ~/.xinitrc<br />
加入这行&quot;<code>exec xterm</code>&quot;像下面这样:<br />
<br />
#!/bin/sh<br />
#<br />
# ~/.xinitrc<br />
#<br />
# Executed by startx (run your window manager from here)<br />
#<br />
exec xterm<br />
# exec wmaker<br />
# exec startkde<br />
# exec icewm<br />
# exec blackbox<br />
# exec fluxbox<br />
<br />
{{Box Note | ''请确保~/.xinitrc''里,以'''exec'''开头的,只有'''一行'''的注释被去掉。}}<br />
<br />
====开始执行测试====<br />
<br />
* 以普通用户身份输入下面命令,开启'''X''',开始测试你的配置:<br />
<br />
$ startx<br />
或者是这命令<br />
$ xinit<br />
<br />
此时会打开一个'''xterm''' session,你可以在这里测试your keyboard and its layout<br />
<br />
* 按Ctrl+Alt+Backspace,或者输入"exit"可以退出'''X''' Server。<br />
* 如果开启'''X'''出现问题,在终端,查看日志文件/var/log/Xorg.0.log的错误信息。<br />
<br />
更多的Xorg configuration介绍可见[[Xorg]] .<br />
<br />
==第四部分:安装并配置桌面环境==<br />
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 icons, applets, windows, toolbars, folders, wallpapers, 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.<br />
<br />
* 如果你需要一个完整功能,类似于Windows和Mac OSX, 可以选择安装'''[[#KDE|KDE]]''' <br />
* If you want something slightly more minimalist, which follows the K.I.S.S. principle more closely, '''[[#GNOME|GNOME]]''' is a good choice<br />
* '''[[#Xfce|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.<br />
<br />
如果你的机器较老,或者是希望使用一个更轻量、更少GUI要求,可以选择只安装 '''Window Manager''', 或者 WM. A WM controls the placement and appearance of application windows in conjunction with the X Window System but does NOT provide such additions as panels, applets, icons, etc.<br />
* Lightweight floating WM's include: [[#Openbox|'''Openbox''']], [[#Fluxbox|'''Fluxbox''']], [[#fvwm2|'''fvwm2''']], '''Windowmaker, Pekwm, and TWM'''.<br />
* If you need something completely different, try '''Awesome, ion, wmii, dwm, or xmonad'''。<br />
<br />
===一、安装字体===<br />
在安装桌面环境/窗口管理器'''之前''',也许你会先安装些美观的字体。Dejavu和bitstream-vera都是不错的字体集。而对于网页,你还可能需要Microsoft字体。如下安装:<br />
pacman -S ttf-ms-fonts ttf-dejavu ttf-bitstream-vera<br />
对于中文字体,开源的文泉驿正黑矢量字体是不错的选择,它还内嵌了9pt-12pt的点阵宋体:<br />
pacman -S wqy-zenhei<br />
<br />
===二、选择默认启动的桌面环境 ~/.xinitrc===<br />
<br />
以普通用户身份编辑/home/username/.xinitrc,加入你要用的DE. This will allow you to use '''startx/xinit''' from the shell, in the future, to open your DE/WM of choice:<br />
<br />
nano ~/.xinitrc<br />
<br />
反注释或者加入相应的桌面环境/窗口管理器的''''exec''' ..'内容行。例如:使用Xfce4桌面环境:<br />
<br />
exec startxfce4 <br />
<br />
记住在~/.xinitrc中只反注释掉一行'''exec'''。这条命令将一直运行到你注销桌面登录。一般的,shell将等到kde完成加载之后,在运行下一条命令。在命令前加 &quot;exec&quot; ,是告诉the shell 这条命令最后执行, 这样shell就不用等待其他命令了,直接载入桌面。<br />
接下来安装你所选的桌面环境/窗口管理器。<br />
<br />
===三、选择安装一个桌面环境===<br />
====GNOME====<br />
=====关于GNOME=====<br />
GNOME是'''G'''NU '''N'''etwork '''O'''bject '''M'''odel '''E'''nvironment的缩写。GNOME项目有两大部分:GNOME桌面环境 ── 既直观又迷人的最终用户桌面,以及GNOME开发平台 ── 一个用来创建可与桌面集成的应用程序的庞大的框架。<br />
<br />
=====安装=====<br />
安装基本的GNOME环境:<br />
pacman -S gnome<br />
<br />
安装额外的GNOME环境:<br />
pacman -S gnome-extra<br />
然后选择提示的所有软件包。 <br />
<br />
=====对GNOME有用的守护进程=====<br />
如之前所述,守护进程(daemon)是运行在后台的程序,它等待事件发生并提供相应的服务。其中'''Hal'''守护进程可以自动挂载磁盘、光驱和U盘给GUI使用。'''Fam'''守护进程可以在GUI中实时反映文件的变动,如最近安装的程序、文件系统的变化等。'''Hal'''和'''fam'''使得GNOME的使用更为方便。Hal和fam软件包在安装GNOME时已一同安装,建议安装社区库的gamin来替代fam。<br />
<br />
{{Box Note|注意,fam是一个比较老的包,很容易造成较大的日志文件。}}<br />
<br />
{{Box Note|在当前的gnome环境中,你可以安装gamin来实现fam的功能。这时,你可以不用在DAEMONS中添加fam启动项了(不需要加入gamin,它会自动被启用)。}}<br />
<br />
* 你需要启动'''hal'''守护进程。<br />
<br />
启动hal:<br />
/etc/rc.d/hal start<br />
<br />
如果您想使用fam,同样需要启动:<br />
/etc/rc.d/fam start<br />
<br />
将hal加入到/etc/rc.conf的DAEMONS中以使得它们随系统启动而自动运行:<br />
nano /etc/rc.conf<br />
<br />
DAEMONS=(syslog-ng network crond alsa '''hal''')<br />
<br />
{{Box Note|注意,如果使用fam,那么把fam加入到hal后面。}}<br />
<br />
* 或许你还会希望安装一个图形界面的登录管理器。在GNOME下'''gdm'''守护进程是个不错的选择。<br />
以root身份运行:<br />
pacman -S gdm<br />
<br />
让gdm启用有两种方式,一种是直接加入到DAEMONS的末尾,通过rc.conf来启动;另外一种方式是用过配置inittab来加载gdm。<br />
<br />
* 通过inittab来加载gdm也很方便(推荐使用这种方式):<br />
nano /etc/inittab<br />
<br />
修改默认启动方式:<br />
<br />
将<br />
id:3:initdefault:<br />
改为<br />
id:5:initdefault:<br />
<br />
然后取消下面代码的注释:<br />
x:5:respawn:/usr/sbin/gdm -nodaemon<br />
<br />
{{Box Note|实际上,可以看到gdm/xdm/kdm/slim等,使用哪个取决于你的喜好,启用喜欢的那个,将其他的注释掉。当然,本章介绍的是gnome,所以推荐gdm,下章中将推荐kdm:)}}<br />
<br />
<br />
* 通过DAEMONS方式启动gdm也很方便:<br />
nano /etc/rc.conf<br />
<br />
DAEMONS=(syslog-ng network crond alsa hal gdm)<br />
<br />
{{Box Note|这是类似debian/ubuntu的做法,这种方式有一点不好:不管什么时候(非修复模式),系统总是会尝试进入gdm引导的X方式下。对于X已经配置得很好,并且不使用纯控制台的人可以使用这种方式。但是选择这种方式的话你将不能通过内核参数3或者5来区分进入纯字符控制台还是X11的gdm登录窗口。}}<br />
<br />
* 开启Gnome<br />
以普通用户身份启动X:<br />
startx<br />
或者这条命令也行:<br />
$ xinit<br />
如果你的 ~/.xinitrc一直没配置,那你将可以一直使用下面这条命令来开启Gnome:<br />
$ xinit /usr/bin/gnome-session<br />
<br />
关于安装和配置GNOME的高级指引可以参见[[GNOME (简体中文)|GNOME]]一文。接下来你可以浏览'''[[#优化和收尾|优化和收尾]]'''。或许你还会对[[ArchTips(简体中文)|Arch安装完后的小技巧]]一文感兴趣。<br />
<br />
=====美化=====<br />
如果不满足于缺省的GNOME主题和图标,那么可以安装一个不错的主题,比如murrine:<br />
pacman -S gtk-engine-murrine<br />
接着在System->Preferences->Theme里选择这个主题。<br />
<br />
Arch Linux也做了些不错的主题,根据你自己的审美观,选择满意的安装吧:<br />
<br />
# pacman -S gtk-engines gtk2-themes-collection gtk-aurora-engine gtk-candido-engine gtk-rezlooks-engine<br />
<br />
你还可以在[http://www.gnome-look.org Gnome Look]里找到更多的主题、图标和壁纸。<br />
<br />
====KDE====<br />
=====关于KDE=====<br />
KDE桌面环境('''K''' '''D'''esktop '''E'''nvironment)的缩写。 KDE是一种著名的运行于GNU/Linux 、 <code>UNIX</code> 工作站等的强大、自由图形工作环境。她拥有对系统内部各功能的强大整合能力、跨平台能力、易用性、优异的初始界面.<br />
<br />
=====安装=====<br />
Arch提供多个版本的kde: '''kde、kdebase 和 KDEmod'''. 选'''一个'''就行了,然后 '''[[#有用的KDE守护进程|有用的KDE守护进程]]''': <br />
<br />
'''1.)''' '''kde'''是完整的kde软件包,大概 ~300MB,适合主要使用kde软件的系统.<br />
pacman -S kde<br />
'''2.)''' '''kdebase'''是kde的基础软件包(里面没有kdm),大概 ~80MB,适合于只想把kde作为基础系统.<br />
pacman -S kdebase<br />
'''3.)''' '''KDEmod''' 是 Arch Linux独有的、社区驱动的项目,目标是把kde更加细致的模块化和达到其极致的运行效率。KDEmod项目的网站在http://chakra-project.org/ 。<br />
<br />
=====有用的KDE守护进程=====<br />
<br />
KDE 需要'''hal''' ('''H'''ardware '''A'''bstraction '''L'''ayer) 作为守护进程(daemons). '''kdm''' ( '''K''' '''D'''isplay '''M'''anager), 提供一个 '''图形化登录界面'''.<br />
{{Box Note|hal守护进程将自动开启dbus守护进程。kde4里已经不需要fam。kdm现在在kdebase-workstation这个包里,如果只安装kdebase,需要再安装此包才能使用kdm}}<br />
<br />
The hal daemon, among other things, will automate the mounting of disks, optical drives, and USB drives/thumbdrives for use in the GUI. <br />
<br />
-----<br />
启动hal进程:<br />
<br />
/etc/rc.d/hal start<br />
<br />
编辑/etc/rc.conf的 DAEMONS部分:<br />
nano /etc/rc.conf<br />
把 '''hal''' 加入 DAEMONS 部分,以便他们在系统启动时加载. 如果想要kde的图形化登录界面,把 '''kdm'''也加进去(或者不加,在/etc/inittab里面设置): <br />
DAEMONS=(syslog-ng network crond alsa '''hal kdm''')<br />
{{Box Note|如果你安装的是KDEmod3,则使用kdm3替换kdm}}<br />
<br />
*This method will start the system at runlevel 3, (/etc/inittab default, multiuser mode), and then start KDM as a daemon. <br />
<br />
*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 [[Adding a login manager (KDM, GDM, or XDM) to automatically boot on startup]] for more.<br />
<br />
*If you prefer to log into the '''console''' at runlevel 3, 手动启动 X, 则不加入kdm, 或者是加个前缀( ! )禁止它。<br />
<br />
* 现在可以试试效果了,用普通用户身份开启X Server:<br />
startx<br />
或者<br />
$ xinit<br />
更多关于安装和配置KDE的文章,请看[[KDE]].<br />
<br />
到此步,可以看 '''[[#优化和收尾]]'''这部分了. You may also be interested in the [[Post Installation Tips]] wiki article.<br />
<br />
====Xfce====<br />
=====关于Xfce=====<br />
和GNMOE、KDE一样,Xfce是一个桌面环境,其目标是快捷、轻量,同时又美观而易用。它还提供了一整套的应用程序如根窗口应用(root window app)、 窗口管理器、文件管理器、面板等等。 Xfce是用GTK2 toolkit编写的(类似GNOME),和其它大型桌面环境一样,它也有自己的开发环境(库文件、守护进程等)。但不象GNOME或者KDE,Xfce是轻量化的,其设计更接近于CDE而不是Windows或者Mac。它的开发周期比较慢,但是十分稳定、速度很快。在老硬件上Xfce可以运行得很好,而在新机器上更是运行如飞。<br />
<br />
=====安装=====<br />
安装完整的xfce环境以及主题和extras:<br />
pacman -S xfce4 xfce4-goodies gtk2-themes-collection <br />
<br />
如果你使用KDM或者GDM的话会显示一个xfce会话。另一种启动方式是:<br />
startxfce4<br />
<br />
关于安装和配置xfce的高级指引可以参见[[Xfce (简体中文)|Xfce]]一文。<br />
<br />
恭喜!欢迎来到Arch Linux系统的Xfce桌面环境!接下来你可以浏览'''[[#优化和收尾|优化和收尾]]''',或者下面的其它内容。或许你还会对[[ArchTips(简体中文)|Arch安装完后的小技巧]]一文感兴趣。<br />
<br />
====*box====<br />
=====Fluxbox=====<br />
Fluxbox © is yet another windowmanager for X.<br />
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).<br />
<br />
Install Fluxbox using <br />
pacman -S fluxbox fluxconf<br />
<br />
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:<br />
exec startfluxbox <br />
<br />
More information is available in the [[Fluxbox]] article.<br />
<br />
=====Openbox=====<br />
Openbox是一个标准的”温顺的“,快速的,轻量级的,可扩展的窗口管理器。<br />
<br />
Openbox与你的应用程序一起工作工作,并使你的的桌面便于管理。这是因为它的开发方式和通常的窗口管理器的方式是相悖的。 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.<br />
<br />
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. <br />
<br />
安装openbox<br />
pacman -S openbox obconf obmenu<br />
<br />
一旦openbox安装好,你将得到一个消息to move menu.xml & rc.xml to ~/.config/openbox/ in your home directory:<br />
<br />
mkdir -p ~/.config/openbox/<br />
cp /etc/xdg/openbox/rc.xml ~/.config/openbox/<br />
cp /etc/xdg/openbox/menu.xml ~/.config/openbox/<br />
<br />
In the file "rc.xml" you can change various settings for Openbox (or you can use OBconf). In "menu.xml" you can change your right-click menu.<br />
<br />
To be able to log into openbox you can either go via graphical login using KDM/GDM or startx, in which case you will need to edit your ~/.xinitrc (as user) and add the following:<br />
<br />
exec openbox<br />
<br />
For KDM there is nothing left to do; openbox is listed in the sessions menu in KDM.<br />
<br />
Useful programs for openbox are:<br />
* PyPanel or LXpanel if you want a panel<br />
* feh if you want to set the background<br />
* ROX if you want a simple file manager and desktop icons<br />
<br />
More information is available in the [[Openbox]] article.<br />
<br />
====fvwm2====<br />
FVWM是一个非常强大的面向X桌面系统的”ICCCM-compliant的多虚拟桌面的窗口管理器“(ICCCM-compliant multiple virtual desktop window manager)。开发活动很活跃,支持也是极好的。 <br />
<br />
输入下面命令安装 fvwm2 <br />
pacman -S fvwm <br />
<br />
fvwm会自动添加进 kdm/gdm会话列表. 如果没有的话,添加 <br />
exec fvwm <br />
<br />
到你的用户文件 .xinitrc.<br />
<br />
注意:这个稳定版已经有些年头了,如果需要最新的fvwm版本,可以安装unstable repo里的fvwm-devel 包.<br />
<br />
===四、优化和收尾===<br />
====HAL====<br />
如果你已经安装了一个桌面环境,但是又觉得用起来不是很方便,那么现在就是个安装HAL的好时机了。HAL使得你的手机、iPod、移动硬盘等等可以即插即用。它会挂载设备并在你的桌面或/和'My Computer'目录中创建相应的图标,使得你可以在插入设备后就能访问到它,无需每次都对每个新设备来手动配置/etc/fstab文件或者udev规则。<br />
<br />
KDE、GNOME和XFCE都使用到HAL。<br />
<br />
安装过程描述可以在[[HAL (简体中文)|HAL]]一文中找到。其它一些信息可以在[http://en.wikipedia.org/wiki/HAL_(software) Wikipedia]上找到。<br />
<br />
====启动时让守护进程在后台执行====<br />
<br />
要加速系统的启动过程,可以在/etc/rc.conf中给守护进程前加上'@'符号使之在后台执行,例如:<br />
<br />
DAEMONS=(@syslog-ng @network crond @alsa @hal @fam @kdm)<br />
这使得守护进程在后台被加载,无需等待它们加载结束。<br />
<br />
在守护进程前加上(!)可以禁止系统启动时加载它,例如:<br />
<br />
DAEMONS=(@syslog-ng @network !crond @alsa @hal @fam @kdm)<br />
<br />
另一种方式是直接将不需要的守护进程删除。<br />
<br />
====美化LCD下的字体====<br />
See [[Fonts]]<br />
<br />
====让所有的鼠标按键生效====<br />
看这个 [[Get All Mouse Buttons Working]]<br />
<br />
====笔记本电脑可能遇到的问题====<br />
(1) 触摸板问题<br />
参看http://wiki.archlinux.org/index.php/Touchpad_Synaptics<br />
<br />
(2) 摄像头问题<br />
参看http://wiki.archlinux.org/index.php/Webcam_Setup<br />
<br />
(3) 无线上网问题<br />
参看http://wiki.archlinux.org/index.php/Wireless<br />
<br />
(4) 快捷键问题<br />
参看http://wiki.archlinux.org/index.php/Extra_Keyboard_Keys<br />
<br />
====配置CPU频率====<br />
现在的处理器能够降低频率和电压,以降温和降低电源消耗。降温能使系统更稳定,笔记本用户肯定是想这样做的,但是即使是台式机也会对系统有利。<br />
<br />
安装CPU频率工具用:<br />
pacman -S cpufrequtils<br />
<br />
把CPU频率在/etc/rc.conf里加入到启动进程(daemons)中。编辑配置文件/etc/conf.d/cpufreq改<br />
governor="conservative"<br />
<br />
这使得在需要的情况下可以动态地增减CPU频率(这是对于台式机来说也是一个安全的选择)。改变最小频率(min_freq)和最大频率(max_freq)以匹配你的CPU的情况。如果你不知道频率,在载入频率测量模块后运行“cpufreq-info”。你也可以将min_freq和max_freq注释掉或删除,这样就能自动进行。加入频率测量模块到/etc/rc.conf的模块行。<br />
几乎所有的笔记本和台式机都可以简单地使用''acpi-cpufreq''驱动,但是也有其它的选择,如:''p4-clockmod, powernow-k6, powernow-k7, powernow-k8, and speedstep-centrino''。 <br />
<br />
通过下面这个命令载入这个模块:<br />
modprobe <modulname> <br />
通过下面命令行开启cpufreq:<br />
/etc/rc.d/cpufreq start<br />
更多细节,请看 [[Cpufrequtils]]<br />
<br />
==第五部分:常用的应用程序==<br />
更多信息,请看[[ArchLinux常用的应用程序(简体中文)]].<br />
<br />
==附录==<br />
新手指南附录[[ArchLinux新手指南附录 (简体中文)]]<br />
<br />
想得到更多的信息和支持,你可以去[http://www.archlinux.org/ homepage], [[Special:Search|search the wiki]],[http://bbs.archlinux.org/ forums],[[ArchChannel|IRC channel]],以及[http://www.archlinux.org/mailman/listinfo/ mailing lists]。<br />
=====问题答疑=====<br />
See [[Arch FAQs for newbies]]<br />
还有这里[http://bbs.archlinux.org/viewtopic.php?t=29055 Arch forum thread] 也是面向初学者的。<br />
<br />
=====术语=====<br />
更多信息关于Arch术语,查阅[[Arch Terminology/Jargon for newbies|this article]].<br />
<br />
=====接下来还有什么?=====<br />
<br />
你还可以阅读:<br />
<br />
[[Arch 官方安装指南 (简体中文)|Arch 官方安装指南]]<br />
<br />
[[Arch AUR (简体中文)|ArchLinux社区用户软件仓库 (AUR)]]<br />
<br />
[[Get All Mouse Buttons Working]]<br />
<br />
[[改善Pacman性能 (简体中文)|改善Pacman性能]]<br />
<br />
[[Kernel Compilation]]<br />
<br />
[[Pm-utils 电源管理 (简体中文)|Pm-utils 电源管理]]<br />
<br />
[[CPU 频率调节 (简体中文)|CPU 频率调节]]<br />
<br />
[[:Category:美化|美化]]</div>
Flydragon
https://wiki.archlinux.org/index.php?title=ArchLinux_%E6%96%B0%E6%89%8B%E6%8C%87%E5%8D%97_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=90856
ArchLinux 新手指南 (简体中文)
2010-01-04T10:32:01Z
<p>Flydragon: /* 五、安装建立Sudo (可选) */</p>
<hr />
<div>[[Category:简体中文]]<br />
[[Category:获取并安装Arch (简体中文)]]<br />
[[Category:关于Arch_(简体中文)]]<br />
[[Category:HOWTOs (简体中文)]]<br />
<br />
{{Article summary start}}<br />
{{Article summary text|本文针对新手,提供了极其详尽的Archlinux的安装过程向导,和相关的简要说明。}}<br />
{{Article summary heading|已有的语言版本}}<br />
{{Article summary heading|Available Languages}}<br />
{{i18n_entry|Česky|Průvodce začátečníka (Česky)}}<br />
{{i18n_entry|简体中文|Arch 新手安装指南 (简体中文)}}<br />
{{i18n_entry|正體中文|Beginner's Guide 新手指南}}<br />
{{i18n_entry|Dansk|Dansk_Begynderguide}}<br />
{{i18n_entry|Deutsch|Beginners Guide (Deutsch)}}<br />
{{i18n_entry|English|Beginners Guide}}<br />
{{i18n_entry|Español|Guía para Principiantes (Español)}}<br />
{{i18n_entry|Français|Manuel_du_Débutant_(Français)}}<br />
{{i18n_entry|Italiano|Beginners Guide (Italiano)}}<br />
{{i18n_entry|Indonesia|Beginners_Guide_(Indonesia)}}<br />
{{i18n_entry|Lietuviškai|Pradedančiųjų gidas (Lietuviškai)}}<br />
{{i18n_entry|Nederlands|Beginners_Guide_(Nederlands)}}<br />
{{i18n_entry|Português Brasil|Guia do Iniciante(Português do Brasil)}}<br />
{{i18n_entry|Português|Guia para Principiantes(Português)}}<br />
{{i18n_entry|Русский|Руководство_для_новичков}}<br />
{{i18n_entry|Türkçe|Başlangıç Rehberi (Türkçe)}}<br />
{{i18n_entry|हिन्दी|नौसिखिया गाइड(हिन्दी)}}<br />
{{Article summary heading|相关文章}}<br />
{{Article summary wiki|Arch 官方安装指南 (简体中文)}}(更通用的安装方式)<br />
{{Article summary wiki|ArchLinux新手指南附录 (简体中文)}}<br />
{{Article summary wiki|ArchLinux安装完后的小技巧 (简体中文)}}<br />
{{Article summary wiki|ArchLinux常用的应用程序(简体中文)}}<br />
{{Article summary wiki|Work and Play with Arch (Chinese)}}<br />
{{Article summary end}}<br />
<br />
==前言==<br />
<br />
=====所有你一直想知道的关于安装Arch的事=====<br />
这篇文档将会指导你安装和配置[[ArchLinux (简体中文)|Arch Linux]] ── 一个简洁、轻量级的GNU/Linux发行版,一个类<code>UNIX</code>的操作系统。本文是面向Arch新用户,因此尽力为所有人提供强大的参考资料和信息。本指南讲述该如何获得一个基本配置好的Arch Linux系统(拥有一个图形桌面环境),但显然是不可能涵盖(甚至是预见)所有的信息。因此本指南会专注于某些关键性的步骤,想要进一步深入了解你可以查看[[Main Page (简体中文)|Arch Linux Wiki]]或者[http://bbs.archlinux.org/ Arch Linux论坛]。同时有兴趣的话你还可以了解一下[[Arch 之道 (简体中文)|Arch 之道]],它概述了Arch Linux发行版背后的哲学思想。<br />
<br />
'''Arch Linux的相关特性:'''<br />
* '''[[The Arch Way | Simple]]''' design and philosophy<br />
* Community distro targeted at competent GNU/Linux users<br />
* All packages compiled for '''i686/x86-64'''<br />
* 从底层开始就可以让用户高度定制<br />
* '''[[The Arch boot process | BSD-style init]]''' scripts, featuring one centralized configuration file<br />
* '''滚动升级''' <br />
* '''[[Pacman]]''' package manager is fast, written in '''C''', lightweight and agile, with a very modest memory footprint<br />
* '''[[ABS]]''': The '''A'''rch '''B'''uild '''S'''ystem, a ports-like package building system makes it simple to create your own easily installable Arch packages from source, to use and/or share with the community on the [[AUR]]<br />
* '''[[AUR]]''': The Arch User Repository, offering many thousands of build scripts for Arch user-provided software packages<br />
<br />
=====别怕(DON'T PANIC)!=====<br />
要知道Arch Linux的安装方法和过程也许会和你所使用过的其它GNU/Linux发行版非常不同,特别你是个新手的话将更能体会到这点。通常,GNU/Linux发行版会在一张或者一堆CD(甚至是DVD)上捆绑了大量的软件,包含了缺省桌面环境、缺省的应用程序和设置、硬件自动检测和图形化的安装程序,一切都是替你选择好了的。相反的,Arch Linux系统是让'''用户自己'''只是用一个bash shell和基本系统工具,从ncurses installer和基础系统上建造起来的。这就是[[Arch 之道 (简体中文)|Arch 之道]]。不象其它大型发行版,它没有强加于用户的缺省环境或者配置。你可以在命令行使用[[pacman (简体中文)|pacman]]通过互联网连接从Arch软件仓库安装软件包,直到你的系统配置成你希望的样子。这给予了用户最大的弹性、选择性和对系统资源的控制。因为是'''你'''建造了它,所以你肯定能了解系统里具体细节,知道底层都有些什么。<br />
<br />
Arch Linux系统是通过编辑文本文件进行配置的,没有提供图形界面的工具,所以需要对系统和linux相对熟悉。<br />
Arch Linux针对的是有能力的GNU/Linux用户以及希望花费时间学习系统知识的用户。 <br />
<br />
''Arch是一个可以被用户塑造的工具。''<br />
<br />
=====授权协议=====<br />
<br />
Arch Linux, pacman, documentation, and scripts are copyright<br />
©2002-2007 by Judd Vinet, ©2007-2008 by Aaron Griffin and are licensed under the GNU General Public License Version 2.<br />
<br />
=====[[Arch 之道 (简体中文)|Arch 之道]]=====<br />
<br />
''Arch的设计思想是"保持简洁"(keeping it simple)。'' <br />
<br />
这里的‘简洁’并不是单指‘简单’或者‘用户友好’,而是‘没有不必要的增加、修改或者复杂性’。简而言之,即优雅、极简之法。<br />
<br />
<br />
''"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 crap." -Aaron Griffin''<br />
<br />
<br />
''"The extraordinary part of [my method] lies in its simplicity..I have always believed that the simple way is the right way."'' - Bruce Lee<br />
“(我的方法中)最超凡的部分是它的简单性,我一直相信简单的就是对的。” 李小龙(Bruce Lee)<br />
<br />
Occam's razor: ''Entia non sunt multiplicanda praeter necessitatem'' or "Entities should not be multiplied unnecessarily." The term razor refers to the act of shaving away unnecessary assumptions and complications to get to the simplest explanation, method or theory.<br />
<br />
{{Box Note |'''仔细遵循本指南是成功安装一个配置正常的Arch Linux系统的基本要点,因此''请''认真仔细的阅读本文'''}}<br />
* 你也可以将本指南打印出来,作为一个较为有用的Arch Linux用户手册。<br />
*''如果你想在这个wiki里增加内容,请适当描述清楚“为什么会这样”以及“该怎么办”。最佳的文档应该能教会我们如何做和为什么这么做!''<br />
* Arch的wiki是项优秀的资源,可以[http://wiki.archlinux.org/index.php/Main_Page 第一时间]用来解决日常问题; 如果找不到答案也可以求助IRC和[http://bbs.archlinux.org/ 论坛]。<br />
----<br />
----<br />
欢迎使用Arch!现在,让我们开始吧。<br />
<br />
本文按照安装过程分四大部分:<br />
<br />
'''[[#第一部分:安装基本系统|第一部分:安装基本系统]]'''<br />
<br />
'''[[#第二部分:完成基本系统并升级|第二部分:完成基本系统并升级]]'''<br />
<br />
'''[[#第三部分:安装X并配置ALSA|第三部分:安装X并配置ALSA]]'''<br />
<br />
'''[[#第四部分:安装并配置桌面环境|第四部分:安装并配置桌面环境]]'''<br />
<br />
==第一部分:安装基本系统==<br />
===一、获取最新的系统安装包===<br />
<br />
你可以从[http://archlinux.org/download/ 这里]获取Arch最新的官方系统安装包。最新版本是2009.08<br />
<br />
*不论是Core还是Netinstall系统安装包,都只是包含了安装'''Arch Linux基本系统'''所需的软件包. ''注意,基本系统是不包含GUI图形界面的。它主要包含了GNU的系列工具(编译器、汇编程序、链接、库、脚本,还有其它的一些有用的工具),Linux的内核,还有一些额外的库和模块。<br />
*Core映像文件可以较方便的通过CD或者网络进行安装。<br />
*Netinstall映像文件较小巧,本身没有提供软件包,整个系统都是通过internet来获取的。<br />
*isolinux映像文件是给那些使用grub版本时发生问题的用户的。两者没有其它区别。<br />
*Arch64问答( http://wiki.archlinux.org/index.php/Arch64_问答_(简体中文) )可以帮助你在32位版本和64位版本之间作出选择。<br />
<br />
====CD 系统安装包====<br />
把下载的.iso映像文件刻录到CD上。开机时用CD启动,出现界面,跳到[[#二、启动Arch Linux系统安装程序| 二、启动Arch Linux系统安装程序]]<br />
{{Box Note| 通常为了刻录的稳定可靠(速率越低刻录质量越有保证),推荐刻录的最大速度不超过16倍速。有些用户推荐'''''速度为 4x 或者 2x.''''' 如果所刻录的CD有问题,可以尝试使用你系统所支持的最小速度方式刻录。 }}<br />
<br />
<br />
====USB安装方式====<br />
{{Warning|这样做会把USB盘里面原有的数据格式化。}}<br />
<br />
'''<code>UNIX</code> 方式:'''<br />
<br />
插入USB盘,找到其路径,用<code>/bin/dd</code>命令把.img映像文件写入USB(Linux下):<br />
<br />
dd if=archlinux-2009.08-''{core|netinstall}''-''{i686|x86_64}''.img of=/dev/sd''x''<br />
<br />
if= 后面是.img镜像文件的路径,of= 是你的USB路径. 要使用/dev/sd''x''而不是/dev/sd''x1''.(就是要使用整个分区而不是第一分区)<br />
<br />
'''检查镜像的完整性md5sum (可选):'''<br />
<br />
记下读入和写出的记录区数目,然后执行以下命令进行检查:<br />
dd if=/dev/sd''x'' count=''记录区数目'' status=noxfer | md5sum<br />
<br />
md5sum命令返回的值(这是你检查U盘上文件得到的)要与你下载的archlinux镜像文件的md5sum校验值相同;它们都应该和镜像站点的md5sum文件列表里相应的值相同。<br />
<br />
'''Windows方式:'''<br />
<br />
从https://launchpad.net/win32-image-writer/+download 下载Disk Imager。插入U盘,启动Disk Imager并选择映像文件,再选择U盘相应的磁盘驱动号,点击"write"即可。<br />
<br />
===二、启动Arch Linux系统安装程序===<br />
Usually, the first item is the preferred selection. However, choose Boot Archlive or Boot Archlive [legacy IDE] if you have trouble with libata/PATA, or have no SATA (Serial ATA) drives.<br />
<br />
Also, to change boot options, press '''e''' for editing the boot lines. Many users may wish to change the resolution of the framebuffer, for more readable console output. Append:<br />
插入刻录好的光盘CD或者USB盘,然后用它启动电脑。可能需要在BIOS里(通常是启动后在加电自检过程中按DEL、F1、F2、F11或者F12)改变一下启动顺序使得CD或者USB先被启动。<br />
<br />
{{Note|内存需求:<br />
* Core : 160 MB RAM x86_64/i686 (选择所有软件包,开启交换分区)<br />
* Netinstall : 160 MB RAM x86_64/i686 (选择所有软件包,开启交换分区)}}<br />
<br />
启动了Arch Linux光盘后,用上下箭头高亮菜单,按下回车键进行选择。<br />
<br />
通常,推荐选择第一项菜单。不过如果使用libata/PATA出现问题或者没有SATA (Serial ATA)驱动器,你也可以选择Boot Archlive或者Boot Archlive [legacy IDE] 。<br />
<br />
如果你需要改变启动参数,可以按‘e ’键来编辑启动行内容。 含多用户可能希望改变framebuffer分辨率以得到更好的终端显示。将<br />
vga=773<br />
加到kernel一行的后面,然后按<ENTER>,就可以得到1024x768的framebuffer。设置完毕后按'''b'''则使用相应的选择项进行启动。<br />
<br />
系统将会启动并提示登录,这时可以用'root'进行登录(不要加上单引号)。<br />
<br />
如果你的机器从live CD启动时发生错误或者一些其它'''硬件hardware'''错误,请参看[[Installation Troubleshooting]]。<br />
<br />
<br />
====登录并根据需要更换键盘映射表====<br />
如果你使用non-US键盘布局,可以用命令选择相应的键盘映射表。<br />
# km<br />
或者是是用loadkeys命令<br />
# loadkeys ''layout''<br />
(把''layout''替换成你需要的,比如 &quot;<code>fr</code>&quot; 或者 &quot;<code>be-latin1</code>&quot;)<br />
<br />
====边安装边查看安装指南====<br />
在刻录的livecd里面,已经包含了官方安装指南,在安装的时候可以边安装边查看,按组合键<ALT>+F2 切换到控制台vc/2(alt+f3,alt+f4……分别可以切换到对应的控制台vc/3,vc/4……以此类推),然后输入:<br />
<br />
# less /arch/docs/official_installation_guide_en<br />
<br />
按组合键<ALT>+F1回到控制台vc/1,继续安装系统。安装过程中可以随时切换回vc/2来查看安装指南。<br />
<code>less</code> 是个文本查看程序,位于<code>/usr/bin/less</code><br />
{{tip|请注意,官方指南仅涵盖基本系统的安装和配置过程。一旦安装完毕,强烈建议回到本wiki浏览更多安装后续已经相关问题。}}<br />
<br />
===三、开始安装===<br />
键入<br />
/arch/setup <br />
开始安装。<br />
<br />
====1、选择安装来源====<br />
接着会出现一个选择安装来源的提示。如果你用core ISO的话请选择CD,如果使用FTP ISO的话则选择FTP。<br />
* 如果选择 CORE installer,可以直接看下面的硬盘分区配置。<br />
* FTP/HTTP only: 选择这个需要预先加载网络驱动以便联网安装. 使用Udev来加载这些模块非常有效.<br />
按组合键ALT+F3切换到控制台vc/3,确认一下看其是否生效 invoking ifconfig -a . (Select OK to continue.) ——把后面的网络配置提前看<br />
<br />
====2、设置时间====<br />
有两个选择:<br />
* UTC - 如果使用unix系统包括Linux, Freebsd等, 建议使用UTC<br />
* local - 如果和Windows共享多引导系统, 建议使用local<br />
<br />
====3、硬盘分区配置====<br />
选择第一个菜单项"Prepare Hard Drive"。请注意,"Auto-Prepare"(自动分区)并不是最佳的选择,因为它只分配了最基本的三个区( /,/home,swap)<br />
在这里我们用手工进行硬盘分区。选择"2. Partition Hard Drives",接着选要分区的硬盘(比如:/dev/sdx),然后按你需要编辑分区表。<br />
<br />
''Arch Linux安装程序使用cfdisk公用程序来对硬盘进行分区。''<br />
<br />
''接下来,熟悉GNU/Linux的用户可以跳过这段内容直接到下面'''[[#选择软件包|选择软件包]]'''。''<br />
<br />
=====分区信息=====<br />
<br />
对磁盘进行分区是指在磁盘上定义若干区域(分区),每个都象是一个独立的磁盘,可以在其上创建(格式化)一个文件系统。 分区的类型分为主分区(Primary)、扩展分区(Extended)和逻辑分区(Logical)三类。 <br />
<br />
主分区可以被启动,一个物理磁盘最多能有4个主分区。要使用超过4个的话,只能使用一个包含了逻辑分区的扩展分区。<br />
(译者注:为避免误解,较易懂的解释应该是:一个磁盘不算逻辑分区最多只能有4个分区,这4个要么全是主分区,要么就是3个主分区+1个扩展分区,当然你将整个磁盘划为1个主分区也是没问题的,只要不超过4个分区即可)<br />
<br />
扩展分区通常不会被直接使用,它是作为逻辑分区的“容器”存在。一个硬盘只能有一个扩展分区,可以在里面继续再划分逻辑分区。<br />
<br />
当对一个磁盘进行分区时,是按这种数字顺序命名:主分区为sda1-3,跟着是扩展分区sda4(译者注:在/dev和fdisk -l里是看不到这个sda4的),在扩展分区中划分出来的逻辑分区分别是sda5、sda6,如此类推。<br />
<br />
=====交换分区swap=====<br />
交换分区Swap是虚拟内存在硬盘上驻留的地方,内核可以用它来储存在物理内存中放不下的数据。<br />
<br />
过去,常用的规则是将交换分区大小设置为物理内存的两倍。但是随着时间推移,现在的计算机已经有更大的内存容量,这条规则已经不适用了。通常,512MB内存的计算机,两倍(1G)的还是够用的。而1G内存的计算机,一倍的也够用了。如果你有更大的内存(比如超过1GB),也许可以完全把交换分区忘了,不推荐这样做!<br />
* ''如果你打算使用休眠到磁盘的电源方案,你必须要有不小于内存容量大小的交换分区,有些用户甚至会推荐大于物理内存容量15%的大小。''<br />
<br />
=====规划分区=====<br />
磁盘分区的规划是十分个人的设置。每位用户的决策都会根据自己计算机的情况和需求而不同。至少需要有一个包含了根[http://en.wikipedia.org/wiki/File_system 文件系统] ( / )的主分区和一个交换分区。你还可以选择给/boot(主要用来存放内核文件)、/usr、/var和/home(用来存放用户个人数据)划出独立分区。一个较好的做法是给 / 和 /home都划分独立分区。这样的话,当你因为某些原因重装Arch Linux(或者其它发行版),你还可以保留你的个人数据例如音乐、图片、桌面环境配置等。<br />
<br />
在本案例中,我们划分一个分区给 /,一个给/home,另外还有一个交换分区。<br />
<br />
=====开始创建分区cfdisk=====<br />
让我们开始创建一个包含'''root'''(/)文件系统的主分区。 <br />
<br />
选择'''N'''ew -> Primary,然后输入你希望的分区大小(对一个完整的Linux系统,4到8G是个不错的选择)。分区要位于磁盘的开头部分。选择刚新建的分区,接着选择'''B'''ootable将它置为可启动。<br />
<br />
同时选择分区文件系统类型'''T'''ype,指定为'83 Linux'.。<br />
<br />
给你的/home目录创建另一个分区。选择另外一个主分区设成你想要的容量大小,这取决于你的用户会在他们的home目录里储存多少文件,其大小可能从几百M办公文档到上百G音频视频,所以这里我无法给出一个建议。如果你要使用磁盘所有的剩余空间,记得保给交换分区留一部分(例如1GB或1024MB)。<br />
<br />
同样的,选择'''T'''ype为'83 Linux'。 <br />
<br />
最后,我们给交换分区创建一个分区。选择一个介于512MB到1GB之间的大小并将'''T'''ype改为82 (Linux swap / Solaris)。<br />
<br />
现在的分区规划看起来应该象这样(基于你的选择大小也许会有所不同):<br />
<br />
Name Flags Part Type FS Type [Label] Size (MB)<br />
-------------------------------------------------------------------------<br />
sda1 Boot Primary Linux (4096 - 8192)<br />
sda2 Primary Linux (> 100)<br />
sda3 Primary Linux swap / Solaris (512 - 1024)<br />
<br />
选择'''W'''rite并输入''''yes''''。要注意如果你删除了分区的话,这个操作会破坏你磁盘上的数据。选择'''Q'''uit退出分区程序。<br />
选择Done离开此菜单,接着选择"Set Filesystem Mountpoints"。<br />
<br />
=====IDE设备,为什么看起来它们和SCSI设备一样?=====<br />
最新开发的Linux内核里包含了libata和PATA模块,所有的IDE、SATA和SCSI都采用sd''x''这种命名方式。这十分正常,无需担心。<br />
<br />
=====设置文件系统挂载点=====<br />
<br />
''' ”文件系统格式(filesystems)“和”文件系统结构(file systems)“的区别:'''<br />
<br />
从技术层面确切的说,'''文件系统格式(filesystems)'''是一种数据'''格式''',涉及信息吞吐,比如ext2;而”文件系统结构(file systems)“则是特定操作系统中文件和目录的布局,比如/home/username/games。因此,当你被问及是否创建'''文件系统格式(filesystems)'''时,是在问你是否要'''格式化'''该分区…但是当程序向你问及挂载点时,你应该给出的则是该分区应该出现在你的Arch Linux ”文件系统结构“中的位置。<br />
<br />
'''文件系统类型:'''<br />
<br />
'''强烈建议:'''创建一个交换分区(SWAP)。选择一个合适的分区(本例中使用的是sda3). 安装程序就会询问你是否要创建swap 文件系统; 选择 yes. 接下来, 选择根分区的挂载点(本例中就是 sda1). 然后安装程序就会询问你需要哪一种文件系统。<br />
<br />
{{Box Note| 采用何种文件系统的类型取决于实际应用需要,没有十全十美的文件系统,选择任何一个文件系统,都需要在数据安全和性能要求方面作出适当倾斜,下面只是简单的介绍各种Arch linux支持的文件系统 }}<br />
<br />
1. '''ext2''' - 古老、 可靠的 GNU/Linux 文件系统。非常的稳定,不过 ''不支持日志记录功能''。磁盘检测速度较慢,因而有些不便. ''ext2可以容易地转换成ext3''。一般认为/boot分区采用此系统最合适,因为/boot里的东西就开机的时候读取一次,而且很少有变动,不需要日志文件系统,如果采用日志文件系统,日志的体积很可能远远大于内核的大小。<br />
<br />
2. '''ext3''' - 基于ext2系统, 并添加了日志记录功能。 一般认为他比其他文件系统要 ''稍微的'' 慢一点, 不过 ''非常的'' 稳定并且使用最为广泛,由 GNU/Linux FS 负责维护和开发。<br />
<br />
'''高性能文件系统:'''<br />
<br />
3. '''ext4''' - 最近加入支持的文件系统,是ext2和ext3的后续发展版本,Ext4增加了48位块地址,最大支持1EB文件系统,和单个16TB的文件,增加子目录限制到64,000。新增了很多功能,提供在线碎片处理,速度比ext3快,系统开销比ext3小。<br />
{{Box Note| 由于此系统较新,目前仍存在一些问题,暂时建议/home分区不采用此文件系统,以保证个人数据安全。}}<br />
<br />
4. '''ReiserFS''' - Hans Reiser 主持编写的高性能的日志文件系统,使用一种非常独特有趣的数据存储检索方法。ReiserFS 效率非常高, 特别在处理很多小文件的时候更是如此。ReiserFS在挂载的时候相对比较慢. 性能稳定。 ReiserFS 现在的开发并不活跃(最新的版本是Reiser4).<br />
<br />
5. '''JFS''' - IBM提供的日志文件系统( '''J'''ournaled '''F'''ile'''S'''ystem首字母缩写). JFS 效率非常高并且CPU资源占用率比其他任何一个文件系统都要低。并且在挂载和磁盘检测的时候都非常快,在各方面的表现都非常突出,尤其是 conjunction with the deadline scheduler. (参见 [[JFS]].) 但是并不像ext或者ReiserFS那样应用广泛。<br />
<br />
6. '''XFS''' - 非常高效的日志文件系统,特别适合处理大文件。在处理小文件的时候稍慢。在挂载的时候也很快。由于 /var 需要处理很多的小文件,所以可能不太适合作为/var 分区的文件系统。 GNU/Linux 文件系统中,最先实现可用的在线碎片处理。应用不及ext和ReiserFS那么广泛。<br />
* JFS 和 XFS 不能被磁盘工具压缩(比如gparted 或者 parted magic)<br />
<br />
'''未来文件系统'''<br />
<br />
7、btrfs - 此文件系统尚未被Arch纳入正式支持。是Oracle提供的copy-on-write档案系统。目标在取代的ext3,提高ext3单一档案的大小,总档案系统大小或档案检查,加入目前ext3未支援的功能,比如:writable snapshots,snapshots of snapshots,内建磁盘阵列(RAID)支援,and subvolumes。<br />
<br />
最主要的差别在于[http://en.wikipedia.org/wiki/Journaling_file_system 日志系统] (一种类似的在数据库环境中记录着日志变更的东西). 除ext2之外,其他文件系统都支持日志记录功能. ext3 完全兼容 ext2,因此哪怕你可以用一个非常古老的CD来挂载他,也没问题。 根分区目前最安全的选择就是使用ext3文件系统。ReiserFS,XFS,和JFS也可以使用,因为GRUB (启动引导管理器,稍候在安装部分将会介绍到) 都可以从这些文件系统中启动。你可以通过选择‘’‘yes’‘’来创建文件系统(并格式化分区),接着你就会被提示添加附加分区。 在我们的例子中, 只有sda2了。 选择一个文件系统类型,并且把这个分区挂在到/home. 再次说明,创建文件系统并且选择Done。然后回到主菜单。<br />
<br />
====4、选择软件包====<br />
现在我们要选择安装哪些软件包到系统中。选择CD作为来源,如果你不止一个光驱的话还需要选择使用哪个的光驱。<br />
<br />
软件包选择分为两个阶段。首先要选择软件包分类,然后出现所选分类中软件包的详细列表供你微调。使用空格键进行选择和取消。<br />
<br />
''*BASE:包含最小的软件包集合,仅够构建一个可运行的系统骨架。''<br />
''*SUPPORT:供网络和文件系统用的额外软件包,例如gpm、fuse、dnsutils、无线驱动、ndiswrapper、ntfs-3g诸如此类。''<br />
''*DEVEL:软件创建工具,如GCC、autoconf、automake和make等等。''<br />
''*LIB:大量的库文件,如gmp、lebelf、libevent等等。''<br />
*''' 2008.06 版'''的软件包选择,只有一个: BASE ,选择之后进入其详细列表. <br />
<br />
在这里,我们对'Select all packages by default'选择'yes'。<br />
<br />
接下来屏幕将显示你所选的软件包。对于新手,较安全的做法是不修改它,而有经验的用户可能希望裁减掉一些不需要的软件包。(例如,不需要的文件系统类型公用程序,不需要的驱动等等。)<br />
<br />
====5、安装软件包====<br />
接着,选择'Install Packages'。你会被询问是否希望保留pacman缓冲里的软件包。如果你选'yes',日后你还可以选择对某些软件包进行降级,因此推荐保留(日后你还是可以清除这些缓存的)。安装脚本跟着就会安装所选软件包到你的系统中。这些软件包是二进制的、针对i686优化的,总共仅100MB,因此安装是相当便捷的。<br />
<br />
====6、配置系统====<br />
系统接着会询问你是否要选择[[Hwdetect|hwdetect]]来收集配置所需信息。新手应该选择是('yes')。<br />
<br />
如果是相当熟悉自己的硬件、所需模块,有能力从零开始手动配置/etc/mkinitcpio和/etc/fstab 的高级用户,可以选择否'no'。(当然,此选项是非常复杂的,已经超过本指南的范围,这里就不详细解释了。)<br />
<br />
接下来,系统会询问你是否需要支持从USB设备、FireWire设备、PCMCIA设备、NFS共享、软RAID阵列、LVM2卷和加密卷上启动。如果需要则选'yes',在本案例中以上都不选。<br />
<br />
新手还应该选择让/etc/mkinitcpio/kernel26-fallback.conf使用[[Hwdetect|hwdetect]]的结果,这将确保你的硬盘控制器相容次序。<br />
<br />
现在系统会询问你使用哪个文本编辑器;如果你不熟悉[http://en.wikipedia.org/wiki/Vim_%28text_editor%29 vi/vim]的话可以选择[http://en.wikipedia.org/wiki/Nano_%28text_editor%29 nano]。然后就会出现一个包含系统中大部分重要配置文件的菜单。如果你打算查找/etc/rc.conf中可用的选项,只需按Alt+F2切换到另外一个虚拟控制台进行查找,然后用Alt+F1切换回安装程序。<br />
<br />
======系统配置主文件'''/etc/rc.conf'''======<br />
Arch Linux继承FreeBSD的传统,使用'''/etc/rc.conf'''作为系统配置的主要文件。这个文件包含了广泛的配置信息,主要用于系统的启动。正如名字中所包含的意思,它还包含了供/etc/rc*文件使用的配置。/etc/rc.conf提供了一个Arch用户可以轻易访问到的,简洁而又范围广泛的精简系统资源配置方案。<br />
* '''LOCALIZATION'''部分<br />
** '''LOCALE'''=: 系统场所(locale)设置,被所有国际化(i18n-aware)的应用程序使用 。从命令行上运行locale可以列出可用的locale设置。此设置缺省是适合英文(US English)用户使用的en_US.utf8。(此处locale的设置必须与/etc/locale.gen一致,'''[[#/etc/locale.gen|详见下文]]'''。)中文一般是zh_CN.UTF-8,如果使用之后乱码,先换回en_US.utf8,等进图形界面后再换回来。<br />
** '''HARDWARECLOCK'''=: 指示开关机时进行同步的硬件时钟,是'''UTC'''时间(协调世界时(Universal Time Coordinated), 过去曾用格林威治平均时(GMT)来表示)还是'''localtime'''(本地时间)。通常UTC较为好,因为它大大简化了时区和日光节约时间(中国过去称为夏时制)的变更。而当你同时还有其它操作系统如windows进行双启动,就必须使用localtime(本地时间),它只把本地时间保存到硬件时钟里。<br />
** '''TIMEZONE'''=: 时区(TIMEZONE)。(所有可用的时区可在/usr/share/zoneinfo/里找到。)<br />
** '''KEYMAP'''=: 可用的键盘映射表可在/usr/share/kbd/keymaps里找到。请注意此设定仅在TTY中有效,在所有图形窗口管理器或者X中都不使用此设置!<br />
** '''CONSOLEFONT'''=: 如果你一定要修改此设置,可在/usr/share/kbd/consolefonts/中找到可用的字体。<br />
** '''CONSOLEMAP'''=: 定义了启动时setfont程序加载的控制台映射表。有需要的话,可在/usr/share/kbd/consoletrans里找到可用的映射表。<br />
** '''USECOLOR'''=: 如果你使用彩色显示器的话请选"yes"。<br />
<br />
LOCALE="zh_CN.UTF-8"<br />
HARDWARECLOCK="localtime"<br />
TIMEZONE="Asia/Shanghai"<br />
KEYMAP="us"<br />
CONSOLEFONT=<br />
CONSOLEMAP=<br />
USECOLOR="yes"<br />
* '''HARDWARE'''部分<br />
** '''MOD_AUTOLOAD'''=: 如果你使用'''udev'''在启动时探测硬件并加载相应模块。请设置为"yes",(适合缺省模块化的内核)。设置为"no"就得靠用户自己指定所需的有关信息。<br />
** '''MOD_BLACKLIST'''=: 模块黑名单。在下面的例子中,IPv6模块和pcspeaker都被列入黑名单而不被加载。<br />
** '''MODULES'''=: 指示了其它模块,如果你知道缺少哪个重要的模块可以加在里面。('''hwdetect'''应该已经填写了最重要的模块):<br />
# Scan hardware and load required modules at bootup<br />
MOD_AUTOLOAD="yes"<br />
# Module Blacklist - modules in this list will never be loaded by '''udev'''<br />
MOD_BLACKLIST=(net-pf-10 pcspkr)<br />
#<br />
MODULES=(e100 eepro100 mii slhc snd-ac97-codec snd-intel8x0 soundcore)<br />
* '''NETWORKING'''部分<br />
** '''HOSTNAME'''=:设置为你喜欢的主机名(HOSTNAME)。<br />
** '''lo'''=: 不修改此行。<br />
** '''eth0'''=: 如果使用'''静态IP'''的话请调整网络接口的IP地址、掩码和广播地址。如果使用'''DHCP'''的话则设为eth0="dhcp"。<br />
** '''INTERFACES'''=: 指定使用哪些网络接口。如果你不使用DHCP来配置设备,而是通过命令行用ifconfig手动配置设备的话,这里的变量值(名字必须等于打算进行配置的设备名一样)必须和ifconfig里加入的内容一样。<br />
** '''gateway'''=: 如果你使用'''静态IP''',将网关(gateway)地址设为路由器的IP。如果使用DHCP,则将此行用'#'注释掉。<br />
** '''ROUTES'''=: 如果你使用'''静态IP''',则将'gateway'前面的'!'去掉。如果使用'''DHCP'''的话则不需要修改此行。<br />
<br />
<br />
例如,当使用'''DHCP''':<br />
HOSTNAME="arch"<br />
lo="lo 127.0.0.1"<br />
#eth0="eth0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255" <br />
eth0="dhcp"<br />
INTERFACES=(lo eth0)<br />
#gateway="default gw 192.168.0.1"<br />
ROUTES=(!gateway)<br />
* '''DAEMONS'''部分<br />
这个序列罗列了位于/etc/rc.d/里需要在启动过程中启动的脚本名字。<br />
<br />
*如果脚本名字前有惊叹号(!),表示它不被执行。<br />
*如果脚本名字前有符号(@),则表示它会在后台被执行,启动序列不会等待此脚本成功执行完毕,而是继续执行下一个守护进程脚本。<br />
<br />
这种'BSD风格'的初始化就是Arch的处理办法,而其它发行版则是在一个init.d目录里使用一大堆符号链接(一个简单的文件 vs 一整个目录)。<br />
<br />
======关于守护进程======<br />
虽然此时你不需修改[[daemons]]行,不过还是有必要解释一下什么是守护进程,因为过一会儿在指南里我们会需要它。<br />
<br />
和Windows服务(service)类似,守护进程(daemon)是一个运行于后台的程序,等待事件发生并提供服务。一个较好的例子是webserver等待请求以发送页面,还有SSH服务等待用户登录。这些都是全功能的程序,还有些守护进程工作起来并不是那么明显的。例如向日志文件里写信息的守护进程(如syslog、metalog),当系统空闲时降低CPU频率的守护进程(如cpufreq),以及提供图形化登录的守护进程(如gdm、kdm)。所有这些程序都可以被加入到daemons行中,在系统启动时被执行。本指南会对一些较有用的守护进程进行介绍。<br />
按Ctrl+X退出nano编辑器。<br />
<br />
======磁盘和分区配置文件:/etc/fstab======<br />
'''fstab''' ('''f'''ile '''s'''ystems '''tab'''le的缩写) 是系统配置的一部分,该文件列出所有可用的磁盘和分区,并指明它们初始化的方式或整合至全局文件系统的方式。'''/etc/fstab'''文件一般被'''mount'''命令读取,以决定某一特定设备被挂载时所采用的选项。<br />
<br />
这是一个'''/etc/fstab'''的例子:<br />
<br />
#<br />
# /etc/fstab: static file system information<br />
#<br />
# <file system> <dir> <type> <options> <dump> <pass><br />
none /dev/pts devpts defaults 0 0<br />
none /dev/shm tmpfs defaults 0 0<br />
#/dev/cdrom /mnt/cdrom iso9660 ro,user,noauto,unhide 0 0<br />
#/dev/dvd /mnt/dvd udf ro,user,noauto,unhide 0 0<br />
#/dev/fd0 /mnt/fd0 vfat user,noauto 0 0<br />
/dev/sda1 / jfs defaults,noatime,nodiratime 0 1 <br />
/dev/sda2 /home jfs defaults,noatime,nodiratime 0 2<br />
/dev/sda3 swap swap defaults 0 0<br />
Hwdetect应该已经有效地配置了一个可用的'''fstab''',但最好还是简要地检查一下。<br />
<br />
*如果你打算用'''hal'''来自动挂载DVD之类的媒体,为了给即将安装的'''hal'''做准备,你可能要注释掉cdrom和dvd条目。 <br />
<br />
''在笔记本电脑和桌面系统上,可以给 / 和 /home加上'noatime'和'nodiratime'选项来提高速度、性能,同时还能省电。无论你采用何种文件系统,这样做都应该是安全的。''<br />
<br />
更多信息请参照[[Fstab]]<br />
<br />
======'''mkinitcpio.conf、modprobe.conf和kernel26-fallback.conf'''======<br />
此时我们无须去修改这些配置文件。'''mkinitcpio.conf'''负责配置ramdisk(例如从RAID、加密卷启动), '''modprobe.conf'''可以用来设置内核模块的的某些配置选项,而'''kernel26-fallback.conf'''则是initramfs后备配置。<br />
<br />
======(对于静态IP)网络配置文件:/etc/resolv.conf ======<br />
*''如果你使用DHCP,完全可以忽略此文件,缺省情况下dhcpd守护进程会自动创建和销毁此文件。''<br />
<br />
如果你使用静态IP,则可在/etc/resolv.conf里设置你的DNS服务器。每行的格式为nameserver <ip地址>,如果有多个DNS服务器则可以填入多行。<br />
<br />
如果你使用路由器,也许会希望由你的路由器本身指定DNS服务器,而在'''resolv.conf'''里只是写入你的路由器的IP(同时也是'''/etc/rc.conf'''里的网关),例如:<br />
nameserver 192.168.1.1<br />
可选的,逐个加入你的DNS服务器,例如:<br />
nameserver 4.2.2.1<br />
nameserver 4.2.2.2<br />
<br />
如果使用'''DHCP''',你也可以在你的路由器里指定你的DNS服务器,或者如果你的ISP支持的话由ISP自动指定。<br />
<br />
======/etc/hosts======<br />
可以在此文件中加入你想要的''hostname'',必须和/etc/rc.conf里的设置一致,因此它应该象这样:<br />
127.0.0.1 localhost.localdomain localhost '''''yourhostname'''''<br />
''为了程序的兼容性,必须严格遵照这个格式,'''包括'localhost' 这项'''!错误的句法可能会导致网络性能低下和/或某些程序运行缓慢甚至无法运行。这对新手来说是十分普遍的错误。''<br />
<br />
对于大部分用户,只要把''yourhostname''加入到行末就就可以了,不过有些用户推荐以下句法:<br />
127.0.0.1 '''''yourhostname'''''.domain.org localhost.localdomain localhost '''''yourhostname'''''<br />
如果你使用静态IP,可以用这种句法加入新行:<static-ip> hostname.domainname.org hostname,例如:<br />
192.168.1.100 '''''yourhostname'''''.domain.org '''''yourhostname'''''<br />
<br />
======/etc/hosts.deny和/etc/hosts.allow======<br />
如果你打算使用[[SSH|ssh]]的话,请根据自己的需要修改此配置。缺省设置是拒绝所有进入的连接,而不只是ssh连接。编辑'''/etc/hosts.allow '''文件加入:<br />
<br />
* 允许所有进入的ssh连接。<br />
sshd:all <br />
<br />
* 允许特定IP地址进入ssh连接。<br />
sshd: 192.168.0.1<br />
<br />
* 允许你指定的网段 (地址从 192.168.0.0 到 192.168.0.255)<br />
sshd: 192.168.0.<br />
<br />
* 允许某个IP地址范围<br />
sshd: 10.0.0.0/255.255.255.0<br />
<br />
如果你不打算使用[[SSH|ssh]],为安全起见请保持此文件的缺省设置(为空)。<br />
<br />
======/etc/locale.gen======<br />
<br />
'''locale-gen''' 命令从 '''/etc/locale.gen'''读取信息设定系统的locales. 这些设置稍后会被'''glibc''' 和其他一些支持本地化的程序或者库用于自动翻译输出各种语言的"独特" 文本, 并且合适的显示地域、货币、时区以及日期格式, 字符排列方式和其他一些本地化的特殊标准。设置默认本地化的功能是类<code>UNIX</code>操作系统的一大特质<br />
<br />
默认情况下 /etc/locale.gen 是一个仅包含注释文档的空文件.编辑后,这个文件将不会get touched again. 每次'''glibc'''更新之后'''locale-gen'''就会运行一次, 以在/etc/locale.gen重新生成所有的本地化设置.<br />
<br />
选定你需要的本地化类型(移除前面的#即可), 比如:<br />
en_US ISO-8859-1<br />
en_US.UTF-8 <br />
('''你这里的设置必须和上文中提到的/etc/rc.conf 的设置一致哦.''')<br />
<br />
现在,安装程序将运行locale-gen 脚本, 以生成你设定的locales。你以后可以通过修改文件/etc/locale.gen变更你的locale, 然后使用根用户(root)运行'locale-gen'脚本使之生效。<br />
<br />
''Note 如果你选择并设置了locale, 他将提示你 "The current locale is invalid..." 错误。可能是因为大多数新Arch用户都会犯的普遍的错误,也是在论坛中问得最多的问题。''<br />
<br />
======Root密码======<br />
最后,设置一个root密码并确定你已牢记它。返回主菜单然后接着安装启动加载器。<br />
<br />
======Pacman镜像======<br />
为'''pacman'''选择一个软件仓库镜像站。记住主站 archlinux.org 是有流量限制的,下载速度限于50KB/s.。<br />
<br />
在列表中仔细查看, 一般 xxx.cn 是中国镜像, xxx.au 是澳大利亚, 等等...<br />
<br />
*''如果你不熟悉现有的镜像和它们所处的位置,那就随便选一个。稍后你可以编辑 "/etc/pacman.d/mirrorlist", 或运行本指南后面提到的'''rankmirrors'''脚本,它将自动配置最接近你的镜像。''<br />
<br />
返回主菜单。<br />
<br />
====7、安装启动加载器====<br />
因为本案例中没有第二个操作系统,因此我们需要安装一个启动加载器。推荐选择[http://www.gnu.org/software/grub/ GNU GRUB]作为启动加载器。另外一种选择是[http://lilo.go.dyndns.org/ LILO]。缺省的'''GRUB'''配置('''/boot/grub/menu.lst''')应该足够了。唯一你可能想修改的是控制台的分辨率。将vga=<number>加入到第一个kernel行。(menu.lst中已列出一张分辨率和数字的对应表格可供查找。)<br />
title Arch Linux (Main)<br />
root (hd0,0)<br />
kernel /boot/vmlinuz26 root=/dev/sda1 ro vga=773<br />
initrd /boot/kernel26.img<br />
参数"vga=773"表示1024x768分辨率、256色的framebuffer。<br />
<br />
将'''GRUB'''启动加载器安装到主引导区(本例中为sda)。<br />
<br />
====8、系统重启====<br />
退出安装程序。<br />
*建议:为了方便接下来更进一步的安装配置,可以把光盘里的新手指南复制一份到电脑里,这样后面的安装就能查看相应的向导了<br />
<br />
cp /arch/beginnersguide.txt /mnt/home/beginnersguide.txt<br />
<br />
系统重启之后,进入控制台,可以使用下面命令查看这新手指南<br />
less /home/beginnersguide.txt<br />
所有安装完毕之后,可以删了这指南<br />
rm /home/beginnersguide.txt<br />
<br />
输入命令下面命令,重启:<br />
<br />
reboot<br />
<br />
一个新Arch Linux系统就会启动并进入登录提示符(你可能需要在'''BIOS'''将启动顺序改为优先从硬盘启动)。<br />
<br />
'''祝贺你,一个崭新的Arch Linux基础系统闪亮登场了!'''<br />
<br />
==第二部分:完成基本系统并升级==<br />
你的新Arch Linux基础系统现在已是一个功能完整的GNU/Linux环境了,随时可以进行定制。从现在开始,你可以按自己的意图和需求改造它。由于arch是滚动发布的,所以安装包不一定是最新的系统,所以我们在安装完成之后,需要立即更新系统。<br />
<br />
让我们开始吧。<br />
-----<br />
登录入你的root账号。我们将以root身份配置pacman和更新系统,然后创建一个普通用户账号。<br />
<br />
===一、配置网络(如果有需要)===<br />
*''如果安装脚本的自动配置不适合你,本段内容将帮助你配置大部分类型的网络。''<br />
-----<br />
如果一切正常的话,你的网络应该可以正常使用了。先ping www.google.com验证一下:<br />
ping -c 3 www.google.com<br />
<br />
''如果你已经成功建立网络连接,则跳到下面阅读[[#使用pacman更新、同步、升级系统|使用pacman更新、同步、升级系统]]'''。''<br />
<br />
如果ping www.google.com后得到"unknown host"的错误,可以认为你的网络尚未正确配置。你需要重新检查以下内容的完整性和正确性:<br />
'''/etc/rc.conf''' # 特别留意HOSTNAME= 和 NETWORKING 部分有无输入错误。<br />
<br />
'''/etc/hosts''' # 复核一下格式。(看之前的内容。)<br />
<br />
'''/etc/resolv.conf''' # 当你使用静态IP时需要检查。如果你使用DHCP,缺省这个文件会被自动创建和销毁,不过也可以改为你需要的内容。(参见[[Network]]。)<br />
<br />
高级的网络配置方法可以在[[Network]]一文中找到。<br />
<br />
=====有线网络=====<br />
<br />
用以下命令检查网络<br />
ifconfig<br />
你应该看到eth0这一项。如果有需要,你可以这样设置一个新的静态IP:<br />
ifconfig eth0 <ip address> netmask <netmask> up <br />
并且这样设置缺省网关:<br />
route add default gw <ip address of the gateway><br />
查看一下/etc/resolv.conf是否包含你的DNS服务器,不过缺失了则补填进去。<br />
再次用ping www.google.cn检查一下网络。如果一切正常,将/etc/rc.conf调整为刚才新设置的静态IP。如果你的网络使用DHCP服务器/路由器的话,输入:<br />
dhcpcd eth0<br />
如果这样可行的话,则将/etc/rc.conf按之前所述方法调整为动态IP。<br />
<br />
=====无线网络=====<br />
详见安装指南:[[无线设置 (简体中文)|无线设置]]<br />
<br />
=====模拟信号调制解调器=====<br />
<br />
如果你想使用外接电话线调制解调器, 你至少要安装ppp包. 根据需要修改配置文件 /etc/ppp/options 你可以参考 man pppd 的帮助.<br />
<br />
你还需要定制一个 chat 协议脚本, 在初始化握手连接建立以后, 提供你的ISP用户名和密码. 命令pppd 和 chat 的帮助里有例子不管你是菜鸟还是高手都应该能搞定连接了.<br />
使用 udev 的话, 串口设备一般是 /dev/tts/0 和 /dev/tts/1.<br />
<br />
Tip: Read [[Dialup without a dialer HOWTO]].<br />
<br />
如果你不想为了 pppd 拔光自己的头发, 你可能会选择安装 wvdial 或类似的配置工具来简化这个过程.<br />
如果你的猫是所谓的 WinModem, 也就是内置 PCI modem 卡, 你可以在这个网址找到大量信息: [http://www.linmodems.org/ LinModem]<br />
<br />
=====ISDN=====<br />
<br />
通过三步,完成 ISDN 的安装和配置:<br />
# 安装配置固件Install and configure hardware<br />
# 安装配置ISDN 管理工具<br />
# 添加ISP信息<br />
<br />
现在的 Arch stock kernels 已经包含了ISDN 所需要的modules, 所以不需要重新去编译内核,除非 you're about to use rather odd ISDN hardware. 把ISDN卡插入电脑或者插入USB ISDN-Box之后,you can try loading the modules with modprobe. 绝大部分的ISDN PCI 卡都能被module hisax处理,只需要两个参数:类型和协议。 如果使用的是1TR6标准,则协议设定为 '1' ,如果使用的是EuroISDN (EDSS1),协议设定为 '2', '3' if you're hooked to a so-called leased-line without D-channel, 如果使用的是US NI1,则设为'4'.<br />
<br />
所有配置细节都可以在kernel documentation, more specifically in the isdn subdirectory, and available online中获知。 类型的参数是根据电视卡来设定的,在README.HiSax kernel documentation中,有一个可能类型的列表。 用相应的参数加载moduleChoose,比如这个:<br />
<br />
modprobe hisax type=18 protocol=2<br />
<br />
这个将加载适用于电视卡类型为ELSA Quickstep 1000PCI,德国使用的EDSS1协议的模块hisax。可以在日志文件/var/log/everything.log中查看是否模块被预加载。额外的USB ISDN Adapter需要加载些USB模块才能正常工作。<br />
<br />
通过上述设定之后,如果电视卡能正常工作,那么把下面模块和参数加入/etc/modprobe.conf中:<br />
<br />
alias ippp0 hisax<br />
options hisax type=18 protocol=2<br />
<br />
这么做的好处是,这些模块在不使用时不会被加载。另外的方法是可以在这只加参数,把hisax加入/etc/rc.conf里面的MODULES,这样做的坏处就是不管这些模块是不是在使用,都加载了。 <br />
<br />
完成上述步骤之后,需要安装管理工具<br />
<br />
安装软件包isdn4k-utils,阅读关于isdnctrl的说明手册。在说明手册里,将有详细的说明:如何创建一个配置文件that can be parsed by isdnctrl,安装实例。 Please note that you have to add your SPID to your MSN setting separated by a colon if you use US NI1.<br />
<br />
使用isdnctrl utility配置ISDN卡之后,将可以拨号到你设定的PHONE_OUT参数的机器上,但提示用户名和密码错误。把用户名和密码加入到/etc/ppp/pap-secrets或者/etc/ppp/chap-secrets,这个主要根据的是你的ISP使用的协议授权方式,as if you were configuring a normal analogous PPP link。如果无法确定,可以两个文件都加。<br />
<br />
完成上述设定之后,用root帐号建立一个拨号连接:<br />
isdnctrl dial ippp0<br />
有啥问题,请检查日志文件!<br />
<br />
=====DSL (PPPoE)=====<br />
<br />
仅当需要你的计算机去主动拨号连接ISP的情况下才需参考本段内容。如果你使用独立的路由器来负责这类工作,你只需要设置一个缺省网关即可。<br />
<br />
在使用DSL连接前,你得先在计算机里安装一个连接到DSL-Modem的网卡。将你新装网卡加入到modules.conf/modprobe.conf或者MODULES列表之后,安装rp-pppoe软件包并运行pppoe-setup脚本来配置你的连接。当你输入完有关信息后,可以分别通过以下命令来进行连接和挂断:<br />
<br />
/etc/rc.d/adsl start<br />
<br />
和<br />
<br />
/etc/rc.d/adsl stop<br />
<br />
setup过程一般都是很容易、直观的,如果还有不懂可以阅读man手册。如果你想在启动时自动拨号,可以将adsl加入到DAEMONS列表中。<br />
<br />
<br />
===二、更新Pacman===<br />
<br />
====pacman是什么?====<br />
[[Pacman]]是Arch Linux的软件包管理器('''pac'''kage '''man'''ager)。Pacman是用C语言编写的,速度快,使用简便,功能强大。它可以管理整个软件包系统,负责软件包的安装、删除、降级(通过缓存),也支持自编译的软件包,自动分析依赖关系,可以搜索远程和本地软件仓库,还有大量其它功能。这里我们将用pacman来从远程软件仓库下载软件包并安装到系统中。<br />
<br />
对系统进行定制,pacman是Arch Linux最重要工具。<br />
<br />
====1、配置pacman====<br />
=====pacman总配置文件/etc/pacman.conf=====<br />
Arch通过pacman可以获得对下面 4软件仓库的管理:<br />
<br />
'''[core]'''<br />
<br />
[core](“核心”)仓库的简单原则是只提供一个基本的Arch Linux的基本工具:GNU系列工具,Linux内核,一个文字编辑器,一个命令行浏览器等(这里也有一些例外。比如说,vi和nano是同时提供的,允许用户选择一个或两个)。它包含所有使你的系统正常运转的“必须”安装的包,只有它们完美地工作,你的系统才能继续运行。这些是绝对“system-critical”(对系统来说至关重要)的包。由开发者负责维护。<br />
<br />
*''Core安装媒介(The Core installation media)简单地包含一个安装脚本,一个当前发布版本的核心仓库的快照(snapshot)。''<br />
<br />
'''[extra]'''<br />
<br />
[extra](“额外的”)仓库包含所有的对于一个基本的Arch系统不是必须,但是对于构建一个完整的系统环境有用的的Arch包。 比如'''X''', KDE和Apache,都可以在这里面找到。它也是由开发者维护的。<br />
<br />
'''[testing]'''<br />
<br />
[testing](“测试”)仓库包含的包是[core]和[extra]仓库的候选者。<br />
下面情况下,新的软件包将进入[testing]软件仓库:<br />
* 可能会导致系统出问题的升级,需要测试。<br />
* 需要重新打包其他软件包。这种情况下,所有需要重新打包的软件包将被放在[testing]仓库,直到所有重新打包完成,这些软件包才回归原有的软件仓库。 <br />
<br />
开发者维护。<br />
<br />
[testing]是唯一的一个在名义上与其它官方仓库有冲突的仓库。(that can have name collisions with any of the other official repositories. )<br />
<br />
<font color=&quot;blue&quot;>*如果开启, [testing]必须放在''pacman.conf''的软件仓库的第一个。</font><br />
<br />
<font color=&quot;red&quot;>'''警告''': '''''开启[testing]软件仓库,容易导致系统崩溃,因此只建议有经验的用户开启。'''''</font><br />
<br />
'''[community]'''<br />
<br />
[community](“社区”)仓库是由“信任用户”(''Trusted Users (TUs)'')维护的,是''Arch User Repository ([[AUR]])''(Arch用户仓库)的一部分。它包含的是二进制的包,在用户仓库中有足够的“票数”,并由''信任用戶''挑选出来的。像其它上面列出的仓库一样,[community] 可以用pacman获取。<br />
<br />
'''[[AUR]]''' 也包含'''unsupported''' 分支,这不能直接通过pacman获取。*. [unsupported] 包含多达海量PKGBUILD脚本,用来从源代码编译。这从其它仓库中是不能使用的。 <br />
<br />
<nowiki>*</nowiki> '''''[[AUR Helpers]]''''' 能帮助你无缝地使用AUR。<br />
<br />
'''/etc/pacman.conf'''<br />
<br />
每次调用pacman,它都会读取/etc/pacman.conf文件。这个配置文件分若干段,每一段定义了一个pacman用来搜索软件的仓库。唯一例外的是options段,它定义了全局选项。<br />
nano /etc/pacman.conf<br />
范例:<br />
#<br />
# /etc/pacman.conf<br />
#<br />
# See the pacman.conf(5) manpage for option and repository directives<br />
<br />
#<br />
# GENERAL OPTIONS<br />
#<br />
[options]<br />
# The following paths are commented out with their default values listed.<br />
# If you wish to use different paths, uncomment and update the paths.<br />
#RootDir = /<br />
#DBPath = /var/lib/pacman/<br />
#CacheDir = /var/cache/pacman/pkg/<br />
#LogFile = /var/log/pacman.log<br />
HoldPkg = pacman glibc<br />
# If upgrades are available for these packages they will be asked for first<br />
SyncFirst = pacman<br />
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u<br />
#XferCommand = /usr/bin/curl %u > %o<br />
<br />
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup<br />
#IgnorePkg =<br />
#IgnoreGroup =<br />
<br />
#NoUpgrade =<br />
#NoExtract =<br />
<br />
# Misc options (all disabled by default)<br />
#NoPassiveFtp<br />
#UseSyslog<br />
#ShowSize<br />
#UseDelta<br />
#TotalDownload<br />
#<br />
# REPOSITORIES<br />
# - can be defined here or included from another file<br />
# - pacman will search repositories in the order defined here<br />
# - local/custom mirrors can be added here or in separate files<br />
# - repositories listed first will take precedence when packages<br />
# have identical names, regardless of version number<br />
# - URLs will have $repo replaced by the name of the current repo<br />
#<br />
# Repository entries are of the format:<br />
# [repo-name]<br />
# Server = ServerName<br />
# Include = IncludePath<br />
#<br />
# The header [repo-name] is crucial - it must be present and<br />
# uncommented to enable the repo.<br />
# <br />
<br />
# Testing is disabled by default. To enable, uncomment the following<br />
# two lines. You can add preferred servers immediately after the header,<br />
# and they will be used before the default mirrors.<br />
#[testing]<br />
#Include = /etc/pacman.d/mirrorlist<br />
<br />
[core]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
[extra]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist <br />
<br />
[community]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
# An example of a custom package repository. See the pacman manpage for<br />
# tips on creating your own repositories.<br />
#[custom]<br />
#Server = file:///home/custompkgs<br />
要开启一个软件仓库,只需要将'Include ='和'[repository]'行前的注释符号(#)去除。<br />
<br />
*"Server ="行如果取消注释,将会强制此服务器被首先搜索,详细的仓库配置位于/etc/pacman.d/下。<br />
* 注意:选择仓库时,请确认将仓库名和'Include ='行都一同取消注释。没有这样做的话会导致你选择的仓库被忽略!这是个很普遍的错误。<br />
<br />
=====(如果有必要)配置镜像列表 /etc/pacman.d/mirrorlist=====<br />
更快的镜像能显著改善pacman的性能和你对Arch Linux的总体体验。<br />
<br />
*手动编辑/etc/pacman.d/mirrorlist:<br />
nano /etc/pacman.d/mirrorlist<br />
删除所有不在你所在洲或者太远的镜像。(在nano里你可以用CTRL-K删除每个不需要的行。)保存文件并退出。<br />
<br />
*'''rankmirrors'''脚本可以根据镜像的响应延迟对其自动排名。'''Rankmirrors'''是python脚本,需要安装python:<br />
<br />
pacman -S python<br />
<br />
然后,运行'''rankmirrors'''脚本按响应延迟顺序对镜像进行排名:<br />
rankmirrors -v /etc/pacman.d/mirrorlist<br />
输出会列出所有镜像和它们的响应延迟(ping),例如:<br />
<br />
# United States<br />
# http://mirrors.easynews.com/linux/archlinux/$repo/os/i686 ... 0.96<br />
# ftp://ftp.nethat.com/pub/linux/archlinux/$repo/os/i686 ... unreachable<br />
# ftp://locke.suu.edu/linux/dist/archlinux/$repo/os/i686 ... 2.43<br />
# ftp://mirrors.unixheads.org/archlinux/$repo/os/i686 ... 1.96<br />
<br />
脚本将从低到高的响应延迟顺序显示:<br />
Server = http://mirrors.easynews.com/linux/archlinux/$repo/os/i686<br />
Server = ftp://mirrors.unixheads.org/archlinux/$repo/os/i686<br />
Server = ftp://locke.suu.edu/linux/dist/archlinux/$repo/os/i686<br />
Server = ftp://ftp.nethat.com/pub/linux/archlinux/$repo/os/i686<br />
<br />
要注意的是这个结果对于镜像排列并非很精确,最接近你的镜像或者延迟最低的镜像并不一定是最佳选择。(反应迅速但是内容过时的镜像、或者低延迟但是窄带宽的镜像对你毫无用处)。<br />
<br />
编辑/etc/pacman.d/mirrorlist,将最佳的镜像置于在列表顶端。为了体验多个镜像你可能要不断修改此配置文件,请精明地选择。<br />
<br />
====常用的命令====<br />
<br />
与远程软件仓库同步和更新本地包数据库 (推荐在安装和更新包之前这样做):<br />
pacman -Sy<br />
<br />
'''升级'''系统中所有的包:<br />
pacman -Su<br />
<br />
一条同步、更新、'''升级''' 所有系统中的包的命令:<br />
pacman -Syu<br />
<br />
安装或者升级单个软件包或者一串包(包括其依赖包):<br />
pacman -S packageA packageB<br />
<br />
同步、更新数据库并安装软件包:<br />
pacman -Sy packageA packageB<br />
<br />
移除软件包, 但保留依赖的包:<br />
pacman -R package<br />
<br />
移除单个包,并且移除没有被别的软件依赖的依赖包:<br />
pacman -Rs package<br />
<br />
移除包所有不需要的依赖包并删除其配置文件:<br />
pacman -Rsn package<br />
<br />
通过给定关键词(列表)搜索远程软件仓库数据库(repo):<br />
pacman -Ss keyword<br />
<br />
列出系统中所有的包<br />
pacman -Q<br />
<br />
在本地包数据库搜索 (查询)指定软件包:<br />
pacman -Q package <br />
<br />
在本地包数据库搜索 (查询)指定软件包并列出相关信息:<br />
pacman -Qi package<br />
<br />
To defragment pacman的数据库缓存和速度优化选项:<br />
pacman-optimize<br />
<br />
统计当前系统中的包数量:<br />
pacman -Q | wc -l<br />
<br />
使用ABS和makepkg从源代码编译安装包:<br />
pacman -U packagename.pkg.tar.gz<br />
<br />
Note: pacman有很多很多的选项和功能组合。你可以试试man pacman或者查阅lt the [[pacman]]维基条目<br />
<br />
====软件包管理增强工具====<br />
* Yaourt 可查询aur的pacman增强工具<br />
* Tupac 快速查询的yaourt增强工具<br />
* Powerpill 多进程下载的pacman增强工具<br />
{{Box Note| 强烈建议更新系统完毕后,安装yaourt和powerpill,以便更充分享受Arch Linux的方便和强大。}}<br />
在/etc/pacman.conf文件里,最后添加两行(如果是i686的话,把x86_64换成i686即可):<br />
[archlinuxfr]<br />
Server = http://repo.archlinux.fr/x86_64<br />
然后使用pacman安装yaourt<br />
pacman -Sy yaourt<br />
<br />
以后就可以使用yaourt命令来查找并安装包括[[AUR]]里的软件了。比如bcm无线网卡,需要安装b43-firmware(此软件包在[[AUR]]仓库里,使用pacman无法查找到),使用yaourt命令查找并安装:<br />
yaourt b43-firmware<br />
找到之后,根据相应提示,一直到安装完成。<br />
<br />
====图形化管理工具====<br />
* qt界面的shaman:比较成熟的pacman 图形化管理工具<br />
* gtk界面的gtkpacman :目前BUG比较多,不稳定。<br />
<br />
====Pacman的更多信息====<br />
用此命令查看pacman手册:<br />
man pacman<br />
有空的话可以看看[[pacman (简体中文)]]维基条目。<br />
<br />
====2、更新Pacman自己====<br />
<br />
一开始,系统可能会提示你先更新pacman自身,这取决于Arch安装包的新旧程度:<br />
pacman -Sy pacman<br />
pacman开始查看是否需要更新,如果有提示需要更新,则按‘y’,开始pacman更新。<br />
<br />
'''''有时候,还需要用户主动修改某些配置;请仔细阅读升级过程中的输出获取相关信息。'''''<br />
<br />
===三、更新系统===<br />
====使用[[pacman (简体中文)|pacman]]====<br />
现在我们要用[[pacman (简体中文)|pacman]]来更新系统。要更新、同步并'''升级'''你的系统,可以使用命令:<br />
pacman -Syu<br />
pacman就会获取所有最新可用软件包信息并进行升级。(此时你可能会被提示先升级pacman自身。如果是这样,回答'yes',然后在完毕后再运行一次pacman -Syu命令。)<br />
<br />
===='''滚动发布'''之美====<br />
Arch是一个'''rolling release'''(滚动发布)的发行版。这意味着没有必要重新安装或执行完整的系统重建来升级到最新版本。只需要执行'''pacman -Syu''',就能保持你的系统更新到最新和bleeding edge(表示最新的、因而也并非完美的技术)。<br />
<br />
===四、增加一个用户并设置用户组===<br />
用root账号来处理日常工作是很危险的。Root是用来处理系统管理的任务。我们可以用以下命令增加一个普通用户账号:<br />
adduser<br />
大部分缺省选项都是没问题的,你可能还需要将storage、audio、video、optical和wheel加入到你的用户组中 ── 特别是在你打算使用一个完整功能的桌面环境的情况下。<br />
<br />
用户组和用户的关联定义在/etc/group文件中: <br />
<br />
它包含了:<br />
<br />
*'''audio''' - 关于声卡和相关软件的任务<br />
<br />
*'''wheel''' - 给sudo使用<br />
<br />
*'''storage''' - 负责存储设备<br />
<br />
*'''video''' - 视频任务和3D加速<br />
<br />
*'''optical''' - 和光驱有关的任务<br />
<br />
*'''floppy''' - 软驱访问<br />
<br />
*'''lp''' - 打印任务<br />
<br />
请参看[[Groups]]一文了解你应该属于哪些用户组。<br />
你还可能需要将你的用户账号加入到以下用户组(需要以root身份运行此命令):<br />
usermod -aG audio,video,floppy,lp,optical,network,storage,wheel,dbus,hal USERNAME<br />
详情可看usermod和gpasswd的man手册。<br />
<br />
===五、安装建立Sudo (可选)===<br />
安装Sudo:<br />
# pacman -S sudo<br />
以root身份,运行命令visudo,把用户加入sudo用户 (a &quot;sudoer&quot;).如果不知道怎么使用vi,你可以在用visudo前设置EDITOR环境变量为你喜欢的编辑器。例如:<br />
# EDITOR=nano<br />
如果你对于用vi很适应,去掉EDITOR=nano这个变量就行:<br />
# visudo<br />
这命令将在一个特殊的vi会话中打开文件 /etc/sudoers 。visudo复制文件到一个可编辑的临时文件中,用一个编辑器编辑它(vi是默认的),接下来运行一个安全检查(“sanity check”)。如果通过,这个临时文件就有正确的权限将重写的原始文件。t<br />
<br />
<font color=&quot;red&quot;>'''注意:不要直接用编辑器编辑 /etc/sudoers ; 否则会出现这样的提示:Errors in syntax can cause annoyances (像root帐户不能使用的描述一样)。 必须使用 ''visudo'' 命令来编辑 /etc/sudoers.'''</font><br />
<br />
当用户输入以 &quot;sudo&quot;, 作为开始的命令行时,临时授予该用户root权限。加入下面一行:<br />
USER_NAME ALL=(ALL) ALL<br />
USER_NAME 就是单个用户名。<br />
<br />
更多信息,比如按<TAB> 自动命令补全,请见[[Sudo]]<br />
<br />
==第三部分:安装X并配置ALSA==<br />
一共有三步工作:<br />
*1、安装声卡驱动<br />
*2、安装x-window(包括显卡驱动)<br />
*3、配置X<br />
<br />
{{Box Note | '''在热插拔未配置正确的情况下,或者是/etc/rc.d/hal未启动的情况下,请不要启动开启X(包括重启使用gdm或者kdm登陆),否则可能导致鼠标键盘失去响应!!!'''}}<br />
<br />
===一、配置声卡:使用alsamixer===<br />
高级Linux声音架构(Advanced Linux Sound Architecture,简称ALSA)是一个Linux内核组件。它替换了原有的开放声音系统(OSS),为声卡提供了设备驱动。除了声音设备驱动以外,'''ALSA'''还给应用程序开发人员提供了一个用户空间库,可使更高级的API无需直接与内核驱动打交道就能使用驱动功能。<br />
<br />
{{Box Note| Alsa已经包含进最新的内核kernel,udev 将在系统启动时自动检测硬件,并自动根据声卡加载相应的内核模块。虽然声卡已经在工作,但电脑的声音默认是静音。}}<br />
{{Box Note| OSS4.1已经放出,相对于老的版本,这是一个显著的提升的版本,如果使用ALSA有问题, 或者是想尝试新的功能,可以使用 OSS4.1。 相关说明可见: [[OSS]]}} <br />
<br />
Alsa-utils软件包里的alsamixer让我们可以从命令行来配置声音设备。(你也可以稍后在'''X'''环境中使用alsamixer。)<br />
默认情况下,内核加载模块snd_pcsp,这是一个alsa pc speaker模块。 snd_pcsp通常先于&quot;你实际的&quot;声卡模块加载。大部分情况下,这模块最后加载更好,因为可以让alsamixer正确控制需要的声卡。<br />
<br />
在/etc/modprobe.conf中加入这行,可以使得snd_pcsp最后加载:<br />
options snd-pcsp index=2<br />
<br />
当然,如果你不想让snd_pcsp加载,可以把它放入黑名单,或者是在/etc/rc.conf的Modules里禁止它:<br />
MODULES=(... !snd_pcsp)<br />
<br />
{{Box Note | 想要生效,需要释放并重新加载所有声音模块,当然,系统重启就可以简单解决这问题。 }}<br />
<br />
* 安装alsa-utils软件包:<br />
pacman -S alsa-utils<br />
<br />
* 为了解决Alsa声卡独占问题,可以安装alsa-oss:<br />
# pacman -S alsa-oss <br />
<br />
* 把你的普通用户账号加入到audio用户组中:以root身份,运行<code>/usr/bin/gpasswd</code>程序:<br />
gpasswd -a yourusername audio<br />
*以普通用户身份运行: <br />
alsamixer<br />
用左右光标键移动到Master和PCM声道上,按'''M'''取消掉静音。用向上键增加音量。(70-90的音量是较合适的范围)按ESC键离开alsamixer。<br />
有'''Speaker'''的,需要同时取消静音并调整之. <br />
<br />
====测试声音====<br />
以普通用户身份,使用 <code>/usr/bin/aplay</code>程序来测试你的声音配置:<br />
aplay /usr/share/sounds/alsa/Front_Center.wav<br />
你应该会听到一个女性声音说:“Front,center。”<br />
<br />
====保存声音配置====<br />
以root身份运行<code>/usr/bin/alsactl</code> :<br />
alsactl store<br />
这将创建'/etc/asound.state'文件,用来保存alsamixer的设置。<br />
<br />
为了每次启动都可以自动恢复混音器设置,可将守护进程''alsa''加入到你的/etc/rc.conf中的DAEMONS列表。<br />
nano /etc/rc.conf<br />
DAEMONS=(syslog-ng network crond '''alsa''')<br />
''注意,alsa守护进程在启动过程中仅仅是恢复音量设置。它和alsa音频库(和内核级API)是完全不同的。''<br />
<br />
更多详情请参看[[ALSA 安装设置 (简体中文)|ALSA 安装设置]]。<br />
<br />
===二、安装X===<br />
'''X''' 窗口系统(一般叫'''X11'''或者更简单的叫'''X''') 是一个网络互动和显示服务,提供位图显示器窗口. 提供标准化工具包(toolkit)和协议,用于<code>UNIX</code>类操作系统,构建一个图形界面(GUIs) <br />
<br />
'''X''' 提供最基本、基础的框架,用于构建一个图形操作界面环境。包括:绘图、屏幕窗口移动,与鼠标或者键盘的交互。 '''X''' 并不负责用户交互界面的部分:有独立的客户端程序负责处理这部分。 比如gnome、kde。<br />
<br />
'''X''' 因为它先于'''W'''窗口系统,最初由斯坦福大学开发。 <br />
<br />
*''注意: 如果想使用一个'''开源''' 显卡驱动, 需要3d加速,强烈建议在安装Xorg之前安装库 libgl :''<br />
pacman -S libgl<br />
''(拥有专利的视频驱动提供它们自己的gl库安装(implementations).)''<br />
----- <br />
====1、安装X====<br />
构建一个GUI的第一步:用pacman来安装Xorg包.<br />
<br />
# pacman -S xorg<br />
对于新版的xorg,建议(可能大部分情况下是必须的)安装输入设备驱动evdev。它本来应该作为xorg-server的一个依赖被安装的,不过不知道为什么貌似缺失了:<br />
# pacman -S xf86-input-evdev<br />
3d的工具比如glxgears包含在包'''mesa''' 里(如果需要,也安装):<br />
# pacman -S mesa<br />
<br />
====2、安装显卡驱动====<br />
到这一步,已经有了运行'''X''' Server的基本软件包,接下来需要把显卡的驱动安装到电脑里(e.g. xf86-video-<name>). 最简单的X.org配置方法就是安装正确的驱动包,然后使用自动脚本对 /etc/X11/xorg.conf 进行初始化,比如使用 Xorg -configure(arch团队提供hwd工具,但据以前用户的反映,这个现在还老出问题,新手可以使用,以后有能力再配置其他).<br />
<br />
如果不知道显卡类型,输入下面命令:<br />
lspci | grep VGA<br />
<br />
输入下面命令,查看所有'''开源'''驱动: <br />
pacman -Ss xf86-video | less<br />
<br />
下面是一个'''开源'''的显卡列表和相关说明:<br />
*'''xf86-video-apm''' Alliance ProMotion video driver<br />
*'''xf86-video-ark''' ark video driver<br />
*'''xf86-video-ati''' ati video driver<br />
*'''xf86-video-chips''' Chips and Technologies video driver<br />
*'''xf86-video-cirrus''' Cirrus Logic video driver<br />
*'''xf86-video-dummy''' dummy video driver<br />
*'''xf86-video-fbdev''' framebuffer video driver<br />
*'''xf86-video-glint''' GLINT/Permedia video driver<br />
*'''xf86-video-i128''' Number 0 i128 video driver<br />
*'''xf86-video-i740''' Intel i740 video driver<br />
*'''xf86-video-i810''' Intel i810/i830/i9xx video drivers (deprecated - use -intel)<br />
*'''xf86-video-intel''' Newer Version of Intel i810/i830/i9xx video drivers<br />
*'''xf86-video-imstt''' Integrated Micro Solutions Twin Turbo vidoe driver<br />
*'''xf86-video-mach64''' mach64 video driver <br />
*'''xf86-video-mga''' mga video driver (Matrox Graphics Adapter) <br />
*'''xf86-video-neomagic''' neomagic video driver<br />
*'''xf86-video-nouveau''' Open Source 3D acceleration driver for nVidia cards (eperimental)<br />
*'''xf86-video-nv''' nvidia nv video driver<br />
*'''xf86-video-openchrome''' Openchrome drivers<br />
*'''xf86-video-r128''' ati Rage128 video driver<br />
*'''xf86-video-radeonhd''' Experimental Radeon HD video driver for r500 and r600 ATI cards<br />
*'''xf86-video-rendition''' Rendition video driver<br />
*'''xf86-video-s3''' S3 video driver<br />
*'''xf86-video-s3virge''' S3 Virge video driver<br />
*'''xf86-video-savage''' savage video driver<br />
*'''xf86-video-siliconmotion''' siliconmotion video driver<br />
*'''xf86-video-sis''' SiS video driver<br />
*'''xf86-video-sisusb''' SiS USB video driver<br />
*'''xf86-video-tdfx''' tdfx video driver<br />
*'''xf86-video-trident''' Trident video driver<br />
*'''xf86-video-tseng''' tseng video driver<br />
*'''xf86-video-unichrome''' Unichrome video drivers<br />
*'''xf86-video-v4l''' v4l video driver<br />
*'''xf86-video-vesa''' vesa video driver<br />
*'''xf86-video-vga''' VGA 16 color video driver<br />
*'''xf86-video-via''' via video driver<br />
*'''xf86-video-vmware''' vmware video driver<br />
*'''xf86-video-voodoo''' voodoo video driver<br />
<br />
* 说明:'''vesa'''驱动是最原汁原味的,适用于大部分的显卡。如果实在无法找到合适的显卡驱动,就选用vesa。(这是原话,好像夸张了点!If you cannot find a suitable driver for your video chipset, vesa '''should''' work.)<br />
<br />
用pacman来安装适合你显卡的驱动。例如:<br />
pacman -S xf86-video-savage<br />
(给Savage显卡的驱动。)<br />
<br />
* 如果实在不确定需要安装那个显卡驱动,可以安装所有显卡驱动包, 输入下面命令:<br />
pacman -S xorg-video-drivers<br />
<br />
*如果显卡是nVIDIA 或者ATI的,并'''想安装nVIDIA或者ATI官方提供的显卡驱动,请看下面。'''<br />
-----<br />
<br />
====nVIDIA图形显示卡====<br />
nVIDIA显示卡的驱动程序被许多人认为是非常好的质量,而且带有高级3D性能。<br />
<br />
在设置您的你nVIDIA显卡之前您先要选择您要使用的驱动程序。Arch现在有3种不一样的nVIDIA驱动程序,各自支持不同型号的显卡:<br />
<br />
'''1. nvidia-96xx''' ''直到Ge Force 4的较新显卡''<br />
<br />
'''2. nvidia-173xx''' ''Geforce FX系列显卡''<br />
<br />
'''3. nvidia''' ''在GF FX之后的最新GPU''<br />
<br />
{{Box Note| 一些特别老如TNT和TNT2之类的显卡所需的Nvidia-71xx系列闭源驱动,由于无法在Arch所用的新版Xorg下正常运行,并且nvidia也已不再继续支持它们,因此已被删除。你可以改用xf86-video-nv或者xf86-video-vesa驱动。}}<br />
<br />
到nVIDIA主页,看哪个适合你电脑.区别只是安装,配置过程是一样的.<br />
<br />
''根据你的显卡'',选择合适的nVIDIA驱动安装,比如: <br />
pacman -S nvidia-96xx<br />
<br />
nVIDIA软件包有个工具能自动升级你已有的nVIDIA驱动的配置文件/etc/X11/xorg.conf,输入下列命令即可实现:<br />
nvidia-xconfig<br />
<br />
它也有一些选项,用于更深入和具体地配置xorg.conf文件的内容和选项,例如:<br />
<br />
<br />
nvidia-xconfig --composite --add-argb-glx-visuals<br />
<br />
更详细的信息,请参考:nvidia-xconfig(1).<br />
<br />
一些有用的妙法可用在“device“部分(你要清楚它们不一定都能对你的系统有用):<br />
Option "RenderAccel" "true"<br />
Option "NoLogo" "true"<br />
Option "AGPFastWrite" "true"<br />
Option "EnablePageFlip" "true"<br />
将所有的DRI注释掉:<br />
# Load "dri"<br />
<br />
多检查几次你的/etc/X11/xorg.conf以确定你的默认的depth(色深),horizontal sync(水平同步),垂直刷新率,以及分辨率是可以接受的。<br />
<br />
使用<code>/sbin/depmod</code>命令来更新内核模块依赖:<br />
depmod -a<br />
(也许需要重启。)<br />
{{Tip|nvidia配置的高级的说明参考文章[[NVIDIA]] 。}}<br />
<br />
现在你可以跳到'''[[#三、配置X:创建并修改/etc/X11/xorg.conf|配置X]]'''来进一步熟悉,或者跳到'''[[#3、测试 X|测试 X]]'''继续安装过程。<br />
<br />
====ATI图形显示卡====<br />
ATI用户的驱动可以有几种选择。<br />
* '''xf86-video-ati'''软件包提供的开源'''''radeon'''''驱动。<br />
** 原创的、完全支持Radeon芯片组到X1950(最新的R500芯片组)的逆向工程开源驱动。对9200系列以前的显卡完全支持,可以稳定的提供全2D和3D加速。从9500到X1950完全支持2D加速特性,良好的3D加速,不过缺乏某些闭源驱动的特性(例如能源节省特性仍处于测试阶段)。xf86-video-ati支持从HD2xxx (R6xx)到最新的显卡,不过目前仅提供2D支持。<br />
* '''xf86-video-radeonhd'''软件包提供了开源的'''''radeonhd'''''驱动。<br />
** 此驱动支持ATI R500(Radeon X1000系列)以及更新的芯片组。该驱动由AMD提供文档,Novell为之开发。它支持RandR 1.2,目前的开发工作非常活跃。因此所支持的不同系列显卡的功能可以不一致。(有些用户反映它性能优异,而有些则说它很糟)。它还支持带音频的HDMI。<br />
* AUR中的Catalyst软件包提供了闭源'''''fglrx'''''驱动。稍后将介绍闭源驱动。<br />
开源驱动通常可以满足大部分需求而且较少出问题。<br />
<br />
安装'''''radeon'''''ATI驱动:<br />
# pacman -S xf86-video-ati libgl ati-dri<br />
安装'''''radeonhd'''''ATI驱动:<br />
# pacman -S xf86-video-radeonhd libgl ati-dri<br />
<br />
Arch的<code>extra</code>官方仓库曾经提供过闭源ATI驱动'''Catalyst'''的预编译包,不过在2009年3月以后,由于对闭源驱动的质量和开发进度不满意,官方取消了对它的支持。目前catalyst驱动可以在[http://aur.archlinux.org/packages.php?ID=22899 AUR]中找到。Catalyst驱动的安装信息可以在[[ATI#Proprietary_ATI_Catalyst_driver|这里]]找到。<br />
<br />
{{Warning| 闭源ATI驱动仅支持R600和更新的显卡(即HD2xxx及以上系列),不支持旧系列(X1xxx系列及以下)。}}<br />
<br />
{{Tip|ATI配置的高级指引可以参看[[ATI | ATI wiki 文章]]。}}<br />
<br />
====3、安装输入设备驱动软件包====<br />
最新的X需要你为包括键盘和鼠标在内的输入设备安装驱动。查看可用输入设备驱动的完整列表:<br />
# pacman -Ss xf86-input | less<br />
<br />
对大部分用户,xf86-input-keyboard和xf86-input-mouse应该可以满足基本配置。使用pacman来为你的输入设备安装需要的驱动,例如:<br />
# pacman -S xf86-input-keyboard<br />
===三、配置X:创建并修改/etc/X11/xorg.conf===<br />
====xorg.conf文件====<br />
/etc/X11/xorg.conf 是你的 X-Window-System 的主要配置文件,你的 GUI('''G'''raphical '''U'''ser '''I'''nterface)的基础,它是一个普通的文本文件,里面由 “section” 和 “subsection” 来安排。重要的 section 有 ''Files, InputDevice, Module, Monitor, Modes, Screen, Device'' 和 ''ServerLayout''。各个section安排的前后次序没有关系,对同一种类型的设备也可以有多个section,比如你可能有多个显示器,或者你的本本既有鼠标又有触摸板。<br />
------<br />
从X11R7.2版开始Xserver引入了自动配置特性。在大多情况下,即使没有xorg.conf文件它也能很好地运作。如果''自动检测功能工作正常'',而且你又不需要开启如 aiglx、compositing 等功能的话,你甚至不需要创建这个配置文件。<br />
<br />
====1、创建 /etc/X11/xorg.conf====<br />
<br />
高级用户可以手动创建他们的xorg.conf文件。一般用户可以使用程序<code>/usr/bin/Xorg</code>附加参数-configure来生成一个基本的配置文件;以root身份输入下面命令:<br />
# Xorg -configure<br />
这里生成的文件是/root/xorg.conf.new <br />
<br />
把这文件复制到 <code>/etc/X11/</code>:<br />
# cp /root/xorg.xonf.new /etc/X11/xorg.conf<br />
<br />
====更多的创建/etc/X11/xorg.conf的办法====<br />
* 说明:如果你的电脑已经有一个配置好的xorg.conf文件,不管这个文件是在什么别的发行版下生成的,只要Xorg的版本一致,就可以把该文件复制到你的Arch系统的<code>/etc/X11/</code>目录下。<br />
* 可以使用程序<code>/usr/bin/hwd</code>生成xorg.conf。首先要安装这程序:<br />
# pacman -S hwd<br />
然后输入下面命令:<br />
# hwd -xa<br />
{{Box Note| 目前,hwd在生成的xorg.conf有一行失效。 使用完这程序后,需要手动删除或者是注释掉 Section &quot;Files&quot;下的RgbPath那一行。via nano /etc/X11/xorg.conf or your equivalent, as root/sudo.}}<br />
<br />
* 使用<code>/usr/bin/xorgcfg</code> 脚本生成xorg.conf:<br />
# xorgcfg <br />
* 使用<code>/usr/bin/xorgconfig</code>生成xorg.conf,这个程序以互动方式来创建该文件,输入下面命令运行:<br />
# xorgconfig<br />
<br />
====2、Input设备热插拔问题:请在测试X前阅读====<br />
<br />
xorg 1.5.x版本里已经开启热插拔Input设备。<br />
{{Box Note | 当热插拔开启后, X将清空xorg.conf里所有使用the kbd and mouse 驱动建立的设备。这将导致X被冻结,使得鼠标和键盘失去响应。下面是解决办法。'''方法只能二选一'''}}<br />
<br />
有两个办法可以修复这一问题:<br />
<br />
1) '''配置 input设备热插拔''':安装驱动 xf86-input-evdev,同时配置HAL使其能使用kbd/mouse驱动。<br />
<br />
安装xf86-input-evdev:<br />
# pacman -S xf86-input-evdev<br />
在X.org相关进程启动前,启动守护进程hal:<br />
# /etc/rc.d/hal start<br />
把hal加入/etc/rc.conf里的DAEMONS列表里,这样每次电脑启动,都会自动开启hal。详情请见[[Xorg input hotplugging]] 。<br />
<br />
说明: 开启hal必须首先有一个dbus用户和用户组,以root身份输入下面命令创建用户和用户组<br />
<br />
usr/sbin/groupadd -g 81 dbus<br />
usr/sbin/useradd -c 'System message bus' -u 81 -g dbus -d '/' -s /bin/false dbus<br />
<br />
2) '''关闭input设备热插拔''':在/etc/X11/xorg.conf的ServerFlags段,加入参数''Option &quot;AutoAddDevices&quot; &quot;False&quot;'' 这将忽略hal的硬件检测,并使用你xorg.conf的keyboard/mouse配置。步骤如下<br />
# nano /etc/X11/xorg.conf<br />
加入下面三行:<br />
Section &quot;ServerFlags&quot;<br />
Option &quot;AutoAddDevices&quot; &quot;False&quot;<br />
EndSection<br />
<br />
====3、测试 X====<br />
<br />
在所生成的xorg文件路径''path/to/xorg.conf''前,加入参数''-config'' ,运行 '''X'''脚本,可以测试脚本配置是否正确。<br />
比如要测试你上面生成的xorg是否配置正确,输入:<br />
X -config /root/xorg.conf.new<br />
'''X''' 将启动,在屏幕中央会有一个白色的 X ,鼠标或是触摸板可以移动它,按 CTRL-Alt-Backspace 可以退出 '''X'''<br />
<br />
====对xorg.conf除错====<br />
如果 X 出现错误不能运行,你需要手动检查你的配置文件:<br />
<br />
nano /root/xorg.conf.new<br />
<br />
* 确定 Xorg -configure 命令正确的识别了你的显卡,比如:<br />
Section &quot;Device&quot;<br />
<br />
...<br />
<br />
Driver &quot;savage&quot;<br />
<br />
...<br />
<br />
EndSection<br />
<br />
* 确定里面的 Section "Monitor" 设置了水平同步率和垂直刷新率,如果没有要把它加上:<br />
Section &quot;Monitor&quot;<br />
Identifier &quot;Monitor0&quot;<br />
VendorName &quot;Monitor Vendor&quot;<br />
ModelName &quot;Monitor Model&quot;<br />
HorizSync 30.0 - 130.0 # Safe for LCD's<br />
VertRefresh 50.0 - 100.0 # Safe for LCD's and most CRT's.<br />
EndSection<br />
如果你不知道这些刷新率到底是多少,你就得查一下你显示器的说明书。<br />
<br />
* 在section "Screen"配置默认色深(color depth):<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Card0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
(此处色深被设定为真彩24色。)<br />
<br />
<br />
* 在subsection &quot;Display&quot; 加入你需要的Modes, at least under the Depth 24 header, e.g.:<br />
SubSection &quot;Display&quot;<br />
Viewport 0 0<br />
Depth 24<br />
Modes &quot;1024x768&quot; &quot;800x600&quot; &quot;640x480&quot;<br />
* Add the following section, if you wish to enable eye candy which requires the composite extension: <br />
Section &quot;Extensions&quot;<br />
Option &quot;Composite&quot; &quot;Enable&quot;<br />
EndSection<br />
<br />
* 上述调整完成后,再测试你的配置:<br />
X -config /root/xorg.conf.new<br />
<br />
* 在确认 '''X''' session开启,没有错误之后,把测试好的配置文件移到 /etc/X11下,作为系统的xorg.conf配置文件:<br />
mv /root/xorg.conf.new /etc/X11/xorg.conf<br />
详细的介绍可见[[Xorg]] <br />
<br />
接下来可以简单作测试 '''[[#Simple baseline X test|Simple baseline X test]]'''<br />
<br />
====调整键盘布局====<br />
=====如果开启了input热插拔=====<br />
# cp /usr/share/hal/fdi/policy/10osvendor/10-keymap.fdi /etc/hal/fdi/policy/<br />
# nano /etc/hal/fdi/policy/10-keymap.fdi<br />
Edit the &quot;input.xkb.layout&quot; key and possibly the &quot;input.xkb.variant&quot; key in this file.<br />
Restart hal:<br />
# /etc/rc.d/hal restart<br />
<br />
=====如果关闭了input热插拔=====<br />
Add option lines in the &quot;InputDevice&quot; section of the /etc/X11/xorg.conf file specifying the keyboard layout and variant:<br />
Option &quot;XkbLayout&quot; &quot;be&quot;<br />
Option &quot;XkbVariant&quot; &quot;&quot;<br />
<br />
详情请见 [[Xorg input hotplugging]]。<br />
<br />
===简单的命令行界面X测试(如果需要)===<br />
<br />
在安装了xorg、合适的显卡驱动、创建了一个/etc/X11/xorg.conf文件之后,如果想在安装完整桌面环境之前,快速测试下你的配置,使用'''xterm'''可以实现! <br />
Xterm是个简单的终端模拟程序,作为base xorg软件包的一部分会被自动安装,运行在'''X '''Server环境里。通过配置~/.xinitrc,Xterm可以让我们快速测试显卡驱动和配置文件/etc/X11/xorg.conf是否被正确配置。(另外,如果在没有/etc/X11/xorg.conf的情况下,你想测试下'''X''' 自动检测是否满意,也可以使用这个)<br />
<br />
==== 准备工作:配置~/.xinitrc====<br />
<br />
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. <br />
{{Box Note | '''[[.xinitrc]]''' is a so-called 'dot' (.) file. 在UNIX文件系统下,文件名以 (.)开头的,是 '隐藏文件',,使用普通的命令'ls' 将不显示这些文件,使用加了参数命令'''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 &quot;Run Control&quot;.}}<br />
<br />
'''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. (说明: ''如果没有文件~/.xinitrc, /etc/X11/xinit/xinitrc 将被作为替代来使用,这是个使用TWM and Xterm的默认配置。'')<br />
<br />
切换到'''''普通, 非root'''''用户:<br />
# su - ''yourusername''<br />
* /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.<br />
* 如果没有~/.xinitrc这个文件,到该目录下创建一个,或者从/etc/skel/复制一个同样的文件到你的home目录:: <br />
<br />
$ cp /etc/skel/[[.xinitrc]] ~/<br />
<br />
* 编辑文件: <br />
$ nano ~/.xinitrc<br />
加入这行&quot;<code>exec xterm</code>&quot;像下面这样:<br />
<br />
#!/bin/sh<br />
#<br />
# ~/.xinitrc<br />
#<br />
# Executed by startx (run your window manager from here)<br />
#<br />
exec xterm<br />
# exec wmaker<br />
# exec startkde<br />
# exec icewm<br />
# exec blackbox<br />
# exec fluxbox<br />
<br />
{{Box Note | ''请确保~/.xinitrc''里,以'''exec'''开头的,只有'''一行'''的注释被去掉。}}<br />
<br />
====开始执行测试====<br />
<br />
* 以普通用户身份输入下面命令,开启'''X''',开始测试你的配置:<br />
<br />
$ startx<br />
或者是这命令<br />
$ xinit<br />
<br />
此时会打开一个'''xterm''' session,你可以在这里测试your keyboard and its layout<br />
<br />
* 按Ctrl+Alt+Backspace,或者输入"exit"可以退出'''X''' Server。<br />
* 如果开启'''X'''出现问题,在终端,查看日志文件/var/log/Xorg.0.log的错误信息。<br />
<br />
更多的Xorg configuration介绍可见[[Xorg]] .<br />
<br />
==第四部分:安装并配置桌面环境==<br />
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 icons, applets, windows, toolbars, folders, wallpapers, 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.<br />
<br />
* 如果你需要一个完整功能,类似于Windows和Mac OSX, 可以选择安装'''[[#KDE|KDE]]''' <br />
* If you want something slightly more minimalist, which follows the K.I.S.S. principle more closely, '''[[#GNOME|GNOME]]''' is a good choice<br />
* '''[[#Xfce|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.<br />
<br />
如果你的机器较老,或者是希望使用一个更轻量、更少GUI要求,可以选择只安装 '''Window Manager''', 或者 WM. A WM controls the placement and appearance of application windows in conjunction with the X Window System but does NOT provide such additions as panels, applets, icons, etc.<br />
* Lightweight floating WM's include: [[#Openbox|'''Openbox''']], [[#Fluxbox|'''Fluxbox''']], [[#fvwm2|'''fvwm2''']], '''Windowmaker, Pekwm, and TWM'''.<br />
* If you need something completely different, try '''Awesome, ion, wmii, dwm, or xmonad'''。<br />
<br />
===一、安装字体===<br />
在安装桌面环境/窗口管理器'''之前''',也许你会先安装些美观的字体。Dejavu和bitstream-vera都是不错的字体集。而对于网页,你还可能需要Microsoft字体。如下安装:<br />
pacman -S ttf-ms-fonts ttf-dejavu ttf-bitstream-vera<br />
对于中文字体,开源的文泉驿正黑矢量字体是不错的选择,它还内嵌了9pt-12pt的点阵宋体:<br />
pacman -S wqy-zenhei<br />
<br />
===二、选择默认启动的桌面环境 ~/.xinitrc===<br />
<br />
以普通用户身份编辑/home/username/.xinitrc,加入你要用的DE. This will allow you to use '''startx/xinit''' from the shell, in the future, to open your DE/WM of choice:<br />
<br />
nano ~/.xinitrc<br />
<br />
反注释或者加入相应的桌面环境/窗口管理器的''''exec''' ..'内容行。例如:使用Xfce4桌面环境:<br />
<br />
exec startxfce4 <br />
<br />
记住在~/.xinitrc中只反注释掉一行'''exec'''。这条命令将一直运行到你注销桌面登录。一般的,shell将等到kde完成加载之后,在运行下一条命令。在命令前加 &quot;exec&quot; ,是告诉the shell 这条命令最后执行, 这样shell就不用等待其他命令了,直接载入桌面。<br />
接下来安装你所选的桌面环境/窗口管理器。<br />
<br />
===三、选择安装一个桌面环境===<br />
====GNOME====<br />
=====关于GNOME=====<br />
GNOME是'''G'''NU '''N'''etwork '''O'''bject '''M'''odel '''E'''nvironment的缩写。GNOME项目有两大部分:GNOME桌面环境 ── 既直观又迷人的最终用户桌面,以及GNOME开发平台 ── 一个用来创建可与桌面集成的应用程序的庞大的框架。<br />
<br />
=====安装=====<br />
安装基本的GNOME环境:<br />
pacman -S gnome<br />
<br />
安装额外的GNOME环境:<br />
pacman -S gnome-extra<br />
然后选择提示的所有软件包。 <br />
<br />
=====对GNOME有用的守护进程=====<br />
如之前所述,守护进程(daemon)是运行在后台的程序,它等待事件发生并提供相应的服务。其中'''Hal'''守护进程可以自动挂载磁盘、光驱和U盘给GUI使用。'''Fam'''守护进程可以在GUI中实时反映文件的变动,如最近安装的程序、文件系统的变化等。'''Hal'''和'''fam'''使得GNOME的使用更为方便。Hal和fam软件包在安装GNOME时已一同安装,建议安装社区库的gamin来替代fam。<br />
<br />
{{Box Note|注意,fam是一个比较老的包,很容易造成较大的日志文件。}}<br />
<br />
{{Box Note|在当前的gnome环境中,你可以安装gamin来实现fam的功能。这时,你可以不用在DAEMONS中添加fam启动项了(不需要加入gamin,它会自动被启用)。}}<br />
<br />
* 你需要启动'''hal'''守护进程。<br />
<br />
启动hal:<br />
/etc/rc.d/hal start<br />
<br />
如果您想使用fam,同样需要启动:<br />
/etc/rc.d/fam start<br />
<br />
将hal加入到/etc/rc.conf的DAEMONS中以使得它们随系统启动而自动运行:<br />
nano /etc/rc.conf<br />
<br />
DAEMONS=(syslog-ng network crond alsa '''hal''')<br />
<br />
{{Box Note|注意,如果使用fam,那么把fam加入到hal后面。}}<br />
<br />
* 或许你还会希望安装一个图形界面的登录管理器。在GNOME下'''gdm'''守护进程是个不错的选择。<br />
以root身份运行:<br />
pacman -S gdm<br />
<br />
让gdm启用有两种方式,一种是直接加入到DAEMONS的末尾,通过rc.conf来启动;另外一种方式是用过配置inittab来加载gdm。<br />
<br />
* 通过inittab来加载gdm也很方便(推荐使用这种方式):<br />
nano /etc/inittab<br />
<br />
修改默认启动方式:<br />
<br />
将<br />
id:3:initdefault:<br />
改为<br />
id:5:initdefault:<br />
<br />
然后取消下面代码的注释:<br />
x:5:respawn:/usr/sbin/gdm -nodaemon<br />
<br />
{{Box Note|实际上,可以看到gdm/xdm/kdm/slim等,使用哪个取决于你的喜好,启用喜欢的那个,将其他的注释掉。当然,本章介绍的是gnome,所以推荐gdm,下章中将推荐kdm:)}}<br />
<br />
<br />
* 通过DAEMONS方式启动gdm也很方便:<br />
nano /etc/rc.conf<br />
<br />
DAEMONS=(syslog-ng network crond alsa hal gdm)<br />
<br />
{{Box Note|这是类似debian/ubuntu的做法,这种方式有一点不好:不管什么时候(非修复模式),系统总是会尝试进入gdm引导的X方式下。对于X已经配置得很好,并且不使用纯控制台的人可以使用这种方式。但是选择这种方式的话你将不能通过内核参数3或者5来区分进入纯字符控制台还是X11的gdm登录窗口。}}<br />
<br />
* 开启Gnome<br />
以普通用户身份启动X:<br />
startx<br />
或者这条命令也行:<br />
$ xinit<br />
如果你的 ~/.xinitrc一直没配置,那你将可以一直使用下面这条命令来开启Gnome:<br />
$ xinit /usr/bin/gnome-session<br />
<br />
关于安装和配置GNOME的高级指引可以参见[[GNOME (简体中文)|GNOME]]一文。接下来你可以浏览'''[[#优化和收尾|优化和收尾]]'''。或许你还会对[[ArchTips(简体中文)|Arch安装完后的小技巧]]一文感兴趣。<br />
<br />
=====美化=====<br />
如果不满足于缺省的GNOME主题和图标,那么可以安装一个不错的主题,比如murrine:<br />
pacman -S gtk-engine-murrine<br />
接着在System->Preferences->Theme里选择这个主题。<br />
<br />
Arch Linux也做了些不错的主题,根据你自己的审美观,选择满意的安装吧:<br />
<br />
# pacman -S gtk-engines gtk2-themes-collection gtk-aurora-engine gtk-candido-engine gtk-rezlooks-engine<br />
<br />
你还可以在[http://www.gnome-look.org Gnome Look]里找到更多的主题、图标和壁纸。<br />
<br />
====KDE====<br />
=====关于KDE=====<br />
KDE桌面环境('''K''' '''D'''esktop '''E'''nvironment)的缩写。 KDE是一种著名的运行于GNU/Linux 、 <code>UNIX</code> 工作站等的强大、自由图形工作环境。她拥有对系统内部各功能的强大整合能力、跨平台能力、易用性、优异的初始界面.<br />
<br />
=====安装=====<br />
Arch提供多个版本的kde: '''kde、kdebase 和 KDEmod'''. 选'''一个'''就行了,然后 '''[[#有用的KDE守护进程|有用的KDE守护进程]]''': <br />
<br />
'''1.)''' '''kde'''是完整的kde软件包,大概 ~300MB,适合主要使用kde软件的系统.<br />
pacman -S kde<br />
'''2.)''' '''kdebase'''是kde的基础软件包(里面没有kdm),大概 ~80MB,适合于只想把kde作为基础系统.<br />
pacman -S kdebase<br />
'''3.)''' '''KDEmod''' 是 Arch Linux独有的、社区驱动的项目,目标是把kde更加细致的模块化和达到其极致的运行效率。KDEmod项目的网站在http://chakra-project.org/ 。<br />
<br />
=====有用的KDE守护进程=====<br />
<br />
KDE 需要'''hal''' ('''H'''ardware '''A'''bstraction '''L'''ayer) 作为守护进程(daemons). '''kdm''' ( '''K''' '''D'''isplay '''M'''anager), 提供一个 '''图形化登录界面'''.<br />
{{Box Note|hal守护进程将自动开启dbus守护进程。kde4里已经不需要fam。kdm现在在kdebase-workstation这个包里,如果只安装kdebase,需要再安装此包才能使用kdm}}<br />
<br />
The hal daemon, among other things, will automate the mounting of disks, optical drives, and USB drives/thumbdrives for use in the GUI. <br />
<br />
-----<br />
启动hal进程:<br />
<br />
/etc/rc.d/hal start<br />
<br />
编辑/etc/rc.conf的 DAEMONS部分:<br />
nano /etc/rc.conf<br />
把 '''hal''' 加入 DAEMONS 部分,以便他们在系统启动时加载. 如果想要kde的图形化登录界面,把 '''kdm'''也加进去(或者不加,在/etc/inittab里面设置): <br />
DAEMONS=(syslog-ng network crond alsa '''hal kdm''')<br />
{{Box Note|如果你安装的是KDEmod3,则使用kdm3替换kdm}}<br />
<br />
*This method will start the system at runlevel 3, (/etc/inittab default, multiuser mode), and then start KDM as a daemon. <br />
<br />
*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 [[Adding a login manager (KDM, GDM, or XDM) to automatically boot on startup]] for more.<br />
<br />
*If you prefer to log into the '''console''' at runlevel 3, 手动启动 X, 则不加入kdm, 或者是加个前缀( ! )禁止它。<br />
<br />
* 现在可以试试效果了,用普通用户身份开启X Server:<br />
startx<br />
或者<br />
$ xinit<br />
更多关于安装和配置KDE的文章,请看[[KDE]].<br />
<br />
到此步,可以看 '''[[#优化和收尾]]'''这部分了. You may also be interested in the [[Post Installation Tips]] wiki article.<br />
<br />
====Xfce====<br />
=====关于Xfce=====<br />
和GNMOE、KDE一样,Xfce是一个桌面环境,其目标是快捷、轻量,同时又美观而易用。它还提供了一整套的应用程序如根窗口应用(root window app)、 窗口管理器、文件管理器、面板等等。 Xfce是用GTK2 toolkit编写的(类似GNOME),和其它大型桌面环境一样,它也有自己的开发环境(库文件、守护进程等)。但不象GNOME或者KDE,Xfce是轻量化的,其设计更接近于CDE而不是Windows或者Mac。它的开发周期比较慢,但是十分稳定、速度很快。在老硬件上Xfce可以运行得很好,而在新机器上更是运行如飞。<br />
<br />
=====安装=====<br />
安装完整的xfce环境以及主题和extras:<br />
pacman -S xfce4 xfce4-goodies gtk2-themes-collection <br />
<br />
如果你使用KDM或者GDM的话会显示一个xfce会话。另一种启动方式是:<br />
startxfce4<br />
<br />
关于安装和配置xfce的高级指引可以参见[[Xfce (简体中文)|Xfce]]一文。<br />
<br />
恭喜!欢迎来到Arch Linux系统的Xfce桌面环境!接下来你可以浏览'''[[#优化和收尾|优化和收尾]]''',或者下面的其它内容。或许你还会对[[ArchTips(简体中文)|Arch安装完后的小技巧]]一文感兴趣。<br />
<br />
====*box====<br />
=====Fluxbox=====<br />
Fluxbox © is yet another windowmanager for X.<br />
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).<br />
<br />
Install Fluxbox using <br />
pacman -S fluxbox fluxconf<br />
<br />
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:<br />
exec startfluxbox <br />
<br />
More information is available in the [[Fluxbox]] article.<br />
<br />
=====Openbox=====<br />
Openbox是一个标准的”温顺的“,快速的,轻量级的,可扩展的窗口管理器。<br />
<br />
Openbox与你的应用程序一起工作工作,并使你的的桌面便于管理。这是因为它的开发方式和通常的窗口管理器的方式是相悖的。 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.<br />
<br />
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. <br />
<br />
安装openbox<br />
pacman -S openbox obconf obmenu<br />
<br />
一旦openbox安装好,你将得到一个消息to move menu.xml & rc.xml to ~/.config/openbox/ in your home directory:<br />
<br />
mkdir -p ~/.config/openbox/<br />
cp /etc/xdg/openbox/rc.xml ~/.config/openbox/<br />
cp /etc/xdg/openbox/menu.xml ~/.config/openbox/<br />
<br />
In the file "rc.xml" you can change various settings for Openbox (or you can use OBconf). In "menu.xml" you can change your right-click menu.<br />
<br />
To be able to log into openbox you can either go via graphical login using KDM/GDM or startx, in which case you will need to edit your ~/.xinitrc (as user) and add the following:<br />
<br />
exec openbox<br />
<br />
For KDM there is nothing left to do; openbox is listed in the sessions menu in KDM.<br />
<br />
Useful programs for openbox are:<br />
* PyPanel or LXpanel if you want a panel<br />
* feh if you want to set the background<br />
* ROX if you want a simple file manager and desktop icons<br />
<br />
More information is available in the [[Openbox]] article.<br />
<br />
====fvwm2====<br />
FVWM是一个非常强大的面向X桌面系统的”ICCCM-compliant的多虚拟桌面的窗口管理器“(ICCCM-compliant multiple virtual desktop window manager)。开发活动很活跃,支持也是极好的。 <br />
<br />
输入下面命令安装 fvwm2 <br />
pacman -S fvwm <br />
<br />
fvwm会自动添加进 kdm/gdm会话列表. 如果没有的话,添加 <br />
exec fvwm <br />
<br />
到你的用户文件 .xinitrc.<br />
<br />
注意:这个稳定版已经有些年头了,如果需要最新的fvwm版本,可以安装unstable repo里的fvwm-devel 包.<br />
<br />
===四、优化和收尾===<br />
====HAL====<br />
如果你已经安装了一个桌面环境,但是又觉得用起来不是很方便,那么现在就是个安装HAL的好时机了。HAL使得你的手机、iPod、移动硬盘等等可以即插即用。它会挂载设备并在你的桌面或/和'My Computer'目录中创建相应的图标,使得你可以在插入设备后就能访问到它,无需每次都对每个新设备来手动配置/etc/fstab文件或者udev规则。<br />
<br />
KDE、GNOME和XFCE都使用到HAL。<br />
<br />
安装过程描述可以在[[HAL (简体中文)|HAL]]一文中找到。其它一些信息可以在[http://en.wikipedia.org/wiki/HAL_(software) Wikipedia]上找到。<br />
<br />
====启动时让守护进程在后台执行====<br />
<br />
要加速系统的启动过程,可以在/etc/rc.conf中给守护进程前加上'@'符号使之在后台执行,例如:<br />
<br />
DAEMONS=(@syslog-ng @network crond @alsa @hal @fam @kdm)<br />
这使得守护进程在后台被加载,无需等待它们加载结束。<br />
<br />
在守护进程前加上(!)可以禁止系统启动时加载它,例如:<br />
<br />
DAEMONS=(@syslog-ng @network !crond @alsa @hal @fam @kdm)<br />
<br />
另一种方式是直接将不需要的守护进程删除。<br />
<br />
====美化LCD下的字体====<br />
See [[Fonts]]<br />
<br />
====让所有的鼠标按键生效====<br />
看这个 [[Get All Mouse Buttons Working]]<br />
<br />
====笔记本电脑可能遇到的问题====<br />
(1) 触摸板问题<br />
参看http://wiki.archlinux.org/index.php/Touchpad_Synaptics<br />
<br />
(2) 摄像头问题<br />
参看http://wiki.archlinux.org/index.php/Webcam_Setup<br />
<br />
(3) 无线上网问题<br />
参看http://wiki.archlinux.org/index.php/Wireless<br />
<br />
(4) 快捷键问题<br />
参看http://wiki.archlinux.org/index.php/Extra_Keyboard_Keys<br />
<br />
====配置CPU频率====<br />
现在的处理器能够降低频率和电压,以降温和降低电源消耗。降温能使系统更稳定,笔记本用户肯定是想这样做的,但是即使是台式机也会对系统有利。<br />
<br />
安装CPU频率工具用:<br />
pacman -S cpufrequtils<br />
<br />
把CPU频率在/etc/rc.conf里加入到启动进程(daemons)中。编辑配置文件/etc/conf.d/cpufreq改<br />
governor="conservative"<br />
<br />
这使得在需要的情况下可以动态地增减CPU频率(这是对于台式机来说也是一个安全的选择)。改变最小频率(min_freq)和最大频率(max_freq)以匹配你的CPU的情况。如果你不知道频率,在载入频率测量模块后运行“cpufreq-info”。你也可以将min_freq和max_freq注释掉或删除,这样就能自动进行。加入频率测量模块到/etc/rc.conf的模块行。<br />
几乎所有的笔记本和台式机都可以简单地使用''acpi-cpufreq''驱动,但是也有其它的选择,如:''p4-clockmod, powernow-k6, powernow-k7, powernow-k8, and speedstep-centrino''。 <br />
<br />
通过下面这个命令载入这个模块:<br />
modprobe <modulname> <br />
通过下面命令行开启cpufreq:<br />
/etc/rc.d/cpufreq start<br />
更多细节,请看 [[Cpufrequtils]]<br />
<br />
==第五部分:常用的应用程序==<br />
更多信息,请看[[ArchLinux常用的应用程序(简体中文)]].<br />
<br />
==附录==<br />
新手指南附录[[ArchLinux新手指南附录 (简体中文)]]<br />
<br />
想得到更多的信息和支持,你可以去[http://www.archlinux.org/ homepage], [[Special:Search|search the wiki]],[http://bbs.archlinux.org/ forums],[[ArchChannel|IRC channel]],以及[http://www.archlinux.org/mailman/listinfo/ mailing lists]。<br />
=====问题答疑=====<br />
See [[Arch FAQs for newbies]]<br />
还有这里[http://bbs.archlinux.org/viewtopic.php?t=29055 Arch forum thread] 也是面向初学者的。<br />
<br />
=====术语=====<br />
更多信息关于Arch术语,查阅[[Arch Terminology/Jargon for newbies|this article]].<br />
<br />
=====接下来还有什么?=====<br />
<br />
你还可以阅读:<br />
<br />
[[Arch 官方安装指南 (简体中文)|Arch 官方安装指南]]<br />
<br />
[[Arch AUR (简体中文)|ArchLinux社区用户软件仓库 (AUR)]]<br />
<br />
[[Get All Mouse Buttons Working]]<br />
<br />
[[改善Pacman性能 (简体中文)|改善Pacman性能]]<br />
<br />
[[Kernel Compilation]]<br />
<br />
[[Pm-utils 电源管理 (简体中文)|Pm-utils 电源管理]]<br />
<br />
[[CPU 频率调节 (简体中文)|CPU 频率调节]]<br />
<br />
[[:Category:美化|美化]]</div>
Flydragon
https://wiki.archlinux.org/index.php?title=ArchLinux_%E6%96%B0%E6%89%8B%E6%8C%87%E5%8D%97_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=90855
ArchLinux 新手指南 (简体中文)
2010-01-04T10:22:26Z
<p>Flydragon: /* 模拟信号调制解调器 */</p>
<hr />
<div>[[Category:简体中文]]<br />
[[Category:获取并安装Arch (简体中文)]]<br />
[[Category:关于Arch_(简体中文)]]<br />
[[Category:HOWTOs (简体中文)]]<br />
<br />
{{Article summary start}}<br />
{{Article summary text|本文针对新手,提供了极其详尽的Archlinux的安装过程向导,和相关的简要说明。}}<br />
{{Article summary heading|已有的语言版本}}<br />
{{Article summary heading|Available Languages}}<br />
{{i18n_entry|Česky|Průvodce začátečníka (Česky)}}<br />
{{i18n_entry|简体中文|Arch 新手安装指南 (简体中文)}}<br />
{{i18n_entry|正體中文|Beginner's Guide 新手指南}}<br />
{{i18n_entry|Dansk|Dansk_Begynderguide}}<br />
{{i18n_entry|Deutsch|Beginners Guide (Deutsch)}}<br />
{{i18n_entry|English|Beginners Guide}}<br />
{{i18n_entry|Español|Guía para Principiantes (Español)}}<br />
{{i18n_entry|Français|Manuel_du_Débutant_(Français)}}<br />
{{i18n_entry|Italiano|Beginners Guide (Italiano)}}<br />
{{i18n_entry|Indonesia|Beginners_Guide_(Indonesia)}}<br />
{{i18n_entry|Lietuviškai|Pradedančiųjų gidas (Lietuviškai)}}<br />
{{i18n_entry|Nederlands|Beginners_Guide_(Nederlands)}}<br />
{{i18n_entry|Português Brasil|Guia do Iniciante(Português do Brasil)}}<br />
{{i18n_entry|Português|Guia para Principiantes(Português)}}<br />
{{i18n_entry|Русский|Руководство_для_новичков}}<br />
{{i18n_entry|Türkçe|Başlangıç Rehberi (Türkçe)}}<br />
{{i18n_entry|हिन्दी|नौसिखिया गाइड(हिन्दी)}}<br />
{{Article summary heading|相关文章}}<br />
{{Article summary wiki|Arch 官方安装指南 (简体中文)}}(更通用的安装方式)<br />
{{Article summary wiki|ArchLinux新手指南附录 (简体中文)}}<br />
{{Article summary wiki|ArchLinux安装完后的小技巧 (简体中文)}}<br />
{{Article summary wiki|ArchLinux常用的应用程序(简体中文)}}<br />
{{Article summary wiki|Work and Play with Arch (Chinese)}}<br />
{{Article summary end}}<br />
<br />
==前言==<br />
<br />
=====所有你一直想知道的关于安装Arch的事=====<br />
这篇文档将会指导你安装和配置[[ArchLinux (简体中文)|Arch Linux]] ── 一个简洁、轻量级的GNU/Linux发行版,一个类<code>UNIX</code>的操作系统。本文是面向Arch新用户,因此尽力为所有人提供强大的参考资料和信息。本指南讲述该如何获得一个基本配置好的Arch Linux系统(拥有一个图形桌面环境),但显然是不可能涵盖(甚至是预见)所有的信息。因此本指南会专注于某些关键性的步骤,想要进一步深入了解你可以查看[[Main Page (简体中文)|Arch Linux Wiki]]或者[http://bbs.archlinux.org/ Arch Linux论坛]。同时有兴趣的话你还可以了解一下[[Arch 之道 (简体中文)|Arch 之道]],它概述了Arch Linux发行版背后的哲学思想。<br />
<br />
'''Arch Linux的相关特性:'''<br />
* '''[[The Arch Way | Simple]]''' design and philosophy<br />
* Community distro targeted at competent GNU/Linux users<br />
* All packages compiled for '''i686/x86-64'''<br />
* 从底层开始就可以让用户高度定制<br />
* '''[[The Arch boot process | BSD-style init]]''' scripts, featuring one centralized configuration file<br />
* '''滚动升级''' <br />
* '''[[Pacman]]''' package manager is fast, written in '''C''', lightweight and agile, with a very modest memory footprint<br />
* '''[[ABS]]''': The '''A'''rch '''B'''uild '''S'''ystem, a ports-like package building system makes it simple to create your own easily installable Arch packages from source, to use and/or share with the community on the [[AUR]]<br />
* '''[[AUR]]''': The Arch User Repository, offering many thousands of build scripts for Arch user-provided software packages<br />
<br />
=====别怕(DON'T PANIC)!=====<br />
要知道Arch Linux的安装方法和过程也许会和你所使用过的其它GNU/Linux发行版非常不同,特别你是个新手的话将更能体会到这点。通常,GNU/Linux发行版会在一张或者一堆CD(甚至是DVD)上捆绑了大量的软件,包含了缺省桌面环境、缺省的应用程序和设置、硬件自动检测和图形化的安装程序,一切都是替你选择好了的。相反的,Arch Linux系统是让'''用户自己'''只是用一个bash shell和基本系统工具,从ncurses installer和基础系统上建造起来的。这就是[[Arch 之道 (简体中文)|Arch 之道]]。不象其它大型发行版,它没有强加于用户的缺省环境或者配置。你可以在命令行使用[[pacman (简体中文)|pacman]]通过互联网连接从Arch软件仓库安装软件包,直到你的系统配置成你希望的样子。这给予了用户最大的弹性、选择性和对系统资源的控制。因为是'''你'''建造了它,所以你肯定能了解系统里具体细节,知道底层都有些什么。<br />
<br />
Arch Linux系统是通过编辑文本文件进行配置的,没有提供图形界面的工具,所以需要对系统和linux相对熟悉。<br />
Arch Linux针对的是有能力的GNU/Linux用户以及希望花费时间学习系统知识的用户。 <br />
<br />
''Arch是一个可以被用户塑造的工具。''<br />
<br />
=====授权协议=====<br />
<br />
Arch Linux, pacman, documentation, and scripts are copyright<br />
©2002-2007 by Judd Vinet, ©2007-2008 by Aaron Griffin and are licensed under the GNU General Public License Version 2.<br />
<br />
=====[[Arch 之道 (简体中文)|Arch 之道]]=====<br />
<br />
''Arch的设计思想是"保持简洁"(keeping it simple)。'' <br />
<br />
这里的‘简洁’并不是单指‘简单’或者‘用户友好’,而是‘没有不必要的增加、修改或者复杂性’。简而言之,即优雅、极简之法。<br />
<br />
<br />
''"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 crap." -Aaron Griffin''<br />
<br />
<br />
''"The extraordinary part of [my method] lies in its simplicity..I have always believed that the simple way is the right way."'' - Bruce Lee<br />
“(我的方法中)最超凡的部分是它的简单性,我一直相信简单的就是对的。” 李小龙(Bruce Lee)<br />
<br />
Occam's razor: ''Entia non sunt multiplicanda praeter necessitatem'' or "Entities should not be multiplied unnecessarily." The term razor refers to the act of shaving away unnecessary assumptions and complications to get to the simplest explanation, method or theory.<br />
<br />
{{Box Note |'''仔细遵循本指南是成功安装一个配置正常的Arch Linux系统的基本要点,因此''请''认真仔细的阅读本文'''}}<br />
* 你也可以将本指南打印出来,作为一个较为有用的Arch Linux用户手册。<br />
*''如果你想在这个wiki里增加内容,请适当描述清楚“为什么会这样”以及“该怎么办”。最佳的文档应该能教会我们如何做和为什么这么做!''<br />
* Arch的wiki是项优秀的资源,可以[http://wiki.archlinux.org/index.php/Main_Page 第一时间]用来解决日常问题; 如果找不到答案也可以求助IRC和[http://bbs.archlinux.org/ 论坛]。<br />
----<br />
----<br />
欢迎使用Arch!现在,让我们开始吧。<br />
<br />
本文按照安装过程分四大部分:<br />
<br />
'''[[#第一部分:安装基本系统|第一部分:安装基本系统]]'''<br />
<br />
'''[[#第二部分:完成基本系统并升级|第二部分:完成基本系统并升级]]'''<br />
<br />
'''[[#第三部分:安装X并配置ALSA|第三部分:安装X并配置ALSA]]'''<br />
<br />
'''[[#第四部分:安装并配置桌面环境|第四部分:安装并配置桌面环境]]'''<br />
<br />
==第一部分:安装基本系统==<br />
===一、获取最新的系统安装包===<br />
<br />
你可以从[http://archlinux.org/download/ 这里]获取Arch最新的官方系统安装包。最新版本是2009.08<br />
<br />
*不论是Core还是Netinstall系统安装包,都只是包含了安装'''Arch Linux基本系统'''所需的软件包. ''注意,基本系统是不包含GUI图形界面的。它主要包含了GNU的系列工具(编译器、汇编程序、链接、库、脚本,还有其它的一些有用的工具),Linux的内核,还有一些额外的库和模块。<br />
*Core映像文件可以较方便的通过CD或者网络进行安装。<br />
*Netinstall映像文件较小巧,本身没有提供软件包,整个系统都是通过internet来获取的。<br />
*isolinux映像文件是给那些使用grub版本时发生问题的用户的。两者没有其它区别。<br />
*Arch64问答( http://wiki.archlinux.org/index.php/Arch64_问答_(简体中文) )可以帮助你在32位版本和64位版本之间作出选择。<br />
<br />
====CD 系统安装包====<br />
把下载的.iso映像文件刻录到CD上。开机时用CD启动,出现界面,跳到[[#二、启动Arch Linux系统安装程序| 二、启动Arch Linux系统安装程序]]<br />
{{Box Note| 通常为了刻录的稳定可靠(速率越低刻录质量越有保证),推荐刻录的最大速度不超过16倍速。有些用户推荐'''''速度为 4x 或者 2x.''''' 如果所刻录的CD有问题,可以尝试使用你系统所支持的最小速度方式刻录。 }}<br />
<br />
<br />
====USB安装方式====<br />
{{Warning|这样做会把USB盘里面原有的数据格式化。}}<br />
<br />
'''<code>UNIX</code> 方式:'''<br />
<br />
插入USB盘,找到其路径,用<code>/bin/dd</code>命令把.img映像文件写入USB(Linux下):<br />
<br />
dd if=archlinux-2009.08-''{core|netinstall}''-''{i686|x86_64}''.img of=/dev/sd''x''<br />
<br />
if= 后面是.img镜像文件的路径,of= 是你的USB路径. 要使用/dev/sd''x''而不是/dev/sd''x1''.(就是要使用整个分区而不是第一分区)<br />
<br />
'''检查镜像的完整性md5sum (可选):'''<br />
<br />
记下读入和写出的记录区数目,然后执行以下命令进行检查:<br />
dd if=/dev/sd''x'' count=''记录区数目'' status=noxfer | md5sum<br />
<br />
md5sum命令返回的值(这是你检查U盘上文件得到的)要与你下载的archlinux镜像文件的md5sum校验值相同;它们都应该和镜像站点的md5sum文件列表里相应的值相同。<br />
<br />
'''Windows方式:'''<br />
<br />
从https://launchpad.net/win32-image-writer/+download 下载Disk Imager。插入U盘,启动Disk Imager并选择映像文件,再选择U盘相应的磁盘驱动号,点击"write"即可。<br />
<br />
===二、启动Arch Linux系统安装程序===<br />
Usually, the first item is the preferred selection. However, choose Boot Archlive or Boot Archlive [legacy IDE] if you have trouble with libata/PATA, or have no SATA (Serial ATA) drives.<br />
<br />
Also, to change boot options, press '''e''' for editing the boot lines. Many users may wish to change the resolution of the framebuffer, for more readable console output. Append:<br />
插入刻录好的光盘CD或者USB盘,然后用它启动电脑。可能需要在BIOS里(通常是启动后在加电自检过程中按DEL、F1、F2、F11或者F12)改变一下启动顺序使得CD或者USB先被启动。<br />
<br />
{{Note|内存需求:<br />
* Core : 160 MB RAM x86_64/i686 (选择所有软件包,开启交换分区)<br />
* Netinstall : 160 MB RAM x86_64/i686 (选择所有软件包,开启交换分区)}}<br />
<br />
启动了Arch Linux光盘后,用上下箭头高亮菜单,按下回车键进行选择。<br />
<br />
通常,推荐选择第一项菜单。不过如果使用libata/PATA出现问题或者没有SATA (Serial ATA)驱动器,你也可以选择Boot Archlive或者Boot Archlive [legacy IDE] 。<br />
<br />
如果你需要改变启动参数,可以按‘e ’键来编辑启动行内容。 含多用户可能希望改变framebuffer分辨率以得到更好的终端显示。将<br />
vga=773<br />
加到kernel一行的后面,然后按<ENTER>,就可以得到1024x768的framebuffer。设置完毕后按'''b'''则使用相应的选择项进行启动。<br />
<br />
系统将会启动并提示登录,这时可以用'root'进行登录(不要加上单引号)。<br />
<br />
如果你的机器从live CD启动时发生错误或者一些其它'''硬件hardware'''错误,请参看[[Installation Troubleshooting]]。<br />
<br />
<br />
====登录并根据需要更换键盘映射表====<br />
如果你使用non-US键盘布局,可以用命令选择相应的键盘映射表。<br />
# km<br />
或者是是用loadkeys命令<br />
# loadkeys ''layout''<br />
(把''layout''替换成你需要的,比如 &quot;<code>fr</code>&quot; 或者 &quot;<code>be-latin1</code>&quot;)<br />
<br />
====边安装边查看安装指南====<br />
在刻录的livecd里面,已经包含了官方安装指南,在安装的时候可以边安装边查看,按组合键<ALT>+F2 切换到控制台vc/2(alt+f3,alt+f4……分别可以切换到对应的控制台vc/3,vc/4……以此类推),然后输入:<br />
<br />
# less /arch/docs/official_installation_guide_en<br />
<br />
按组合键<ALT>+F1回到控制台vc/1,继续安装系统。安装过程中可以随时切换回vc/2来查看安装指南。<br />
<code>less</code> 是个文本查看程序,位于<code>/usr/bin/less</code><br />
{{tip|请注意,官方指南仅涵盖基本系统的安装和配置过程。一旦安装完毕,强烈建议回到本wiki浏览更多安装后续已经相关问题。}}<br />
<br />
===三、开始安装===<br />
键入<br />
/arch/setup <br />
开始安装。<br />
<br />
====1、选择安装来源====<br />
接着会出现一个选择安装来源的提示。如果你用core ISO的话请选择CD,如果使用FTP ISO的话则选择FTP。<br />
* 如果选择 CORE installer,可以直接看下面的硬盘分区配置。<br />
* FTP/HTTP only: 选择这个需要预先加载网络驱动以便联网安装. 使用Udev来加载这些模块非常有效.<br />
按组合键ALT+F3切换到控制台vc/3,确认一下看其是否生效 invoking ifconfig -a . (Select OK to continue.) ——把后面的网络配置提前看<br />
<br />
====2、设置时间====<br />
有两个选择:<br />
* UTC - 如果使用unix系统包括Linux, Freebsd等, 建议使用UTC<br />
* local - 如果和Windows共享多引导系统, 建议使用local<br />
<br />
====3、硬盘分区配置====<br />
选择第一个菜单项"Prepare Hard Drive"。请注意,"Auto-Prepare"(自动分区)并不是最佳的选择,因为它只分配了最基本的三个区( /,/home,swap)<br />
在这里我们用手工进行硬盘分区。选择"2. Partition Hard Drives",接着选要分区的硬盘(比如:/dev/sdx),然后按你需要编辑分区表。<br />
<br />
''Arch Linux安装程序使用cfdisk公用程序来对硬盘进行分区。''<br />
<br />
''接下来,熟悉GNU/Linux的用户可以跳过这段内容直接到下面'''[[#选择软件包|选择软件包]]'''。''<br />
<br />
=====分区信息=====<br />
<br />
对磁盘进行分区是指在磁盘上定义若干区域(分区),每个都象是一个独立的磁盘,可以在其上创建(格式化)一个文件系统。 分区的类型分为主分区(Primary)、扩展分区(Extended)和逻辑分区(Logical)三类。 <br />
<br />
主分区可以被启动,一个物理磁盘最多能有4个主分区。要使用超过4个的话,只能使用一个包含了逻辑分区的扩展分区。<br />
(译者注:为避免误解,较易懂的解释应该是:一个磁盘不算逻辑分区最多只能有4个分区,这4个要么全是主分区,要么就是3个主分区+1个扩展分区,当然你将整个磁盘划为1个主分区也是没问题的,只要不超过4个分区即可)<br />
<br />
扩展分区通常不会被直接使用,它是作为逻辑分区的“容器”存在。一个硬盘只能有一个扩展分区,可以在里面继续再划分逻辑分区。<br />
<br />
当对一个磁盘进行分区时,是按这种数字顺序命名:主分区为sda1-3,跟着是扩展分区sda4(译者注:在/dev和fdisk -l里是看不到这个sda4的),在扩展分区中划分出来的逻辑分区分别是sda5、sda6,如此类推。<br />
<br />
=====交换分区swap=====<br />
交换分区Swap是虚拟内存在硬盘上驻留的地方,内核可以用它来储存在物理内存中放不下的数据。<br />
<br />
过去,常用的规则是将交换分区大小设置为物理内存的两倍。但是随着时间推移,现在的计算机已经有更大的内存容量,这条规则已经不适用了。通常,512MB内存的计算机,两倍(1G)的还是够用的。而1G内存的计算机,一倍的也够用了。如果你有更大的内存(比如超过1GB),也许可以完全把交换分区忘了,不推荐这样做!<br />
* ''如果你打算使用休眠到磁盘的电源方案,你必须要有不小于内存容量大小的交换分区,有些用户甚至会推荐大于物理内存容量15%的大小。''<br />
<br />
=====规划分区=====<br />
磁盘分区的规划是十分个人的设置。每位用户的决策都会根据自己计算机的情况和需求而不同。至少需要有一个包含了根[http://en.wikipedia.org/wiki/File_system 文件系统] ( / )的主分区和一个交换分区。你还可以选择给/boot(主要用来存放内核文件)、/usr、/var和/home(用来存放用户个人数据)划出独立分区。一个较好的做法是给 / 和 /home都划分独立分区。这样的话,当你因为某些原因重装Arch Linux(或者其它发行版),你还可以保留你的个人数据例如音乐、图片、桌面环境配置等。<br />
<br />
在本案例中,我们划分一个分区给 /,一个给/home,另外还有一个交换分区。<br />
<br />
=====开始创建分区cfdisk=====<br />
让我们开始创建一个包含'''root'''(/)文件系统的主分区。 <br />
<br />
选择'''N'''ew -> Primary,然后输入你希望的分区大小(对一个完整的Linux系统,4到8G是个不错的选择)。分区要位于磁盘的开头部分。选择刚新建的分区,接着选择'''B'''ootable将它置为可启动。<br />
<br />
同时选择分区文件系统类型'''T'''ype,指定为'83 Linux'.。<br />
<br />
给你的/home目录创建另一个分区。选择另外一个主分区设成你想要的容量大小,这取决于你的用户会在他们的home目录里储存多少文件,其大小可能从几百M办公文档到上百G音频视频,所以这里我无法给出一个建议。如果你要使用磁盘所有的剩余空间,记得保给交换分区留一部分(例如1GB或1024MB)。<br />
<br />
同样的,选择'''T'''ype为'83 Linux'。 <br />
<br />
最后,我们给交换分区创建一个分区。选择一个介于512MB到1GB之间的大小并将'''T'''ype改为82 (Linux swap / Solaris)。<br />
<br />
现在的分区规划看起来应该象这样(基于你的选择大小也许会有所不同):<br />
<br />
Name Flags Part Type FS Type [Label] Size (MB)<br />
-------------------------------------------------------------------------<br />
sda1 Boot Primary Linux (4096 - 8192)<br />
sda2 Primary Linux (> 100)<br />
sda3 Primary Linux swap / Solaris (512 - 1024)<br />
<br />
选择'''W'''rite并输入''''yes''''。要注意如果你删除了分区的话,这个操作会破坏你磁盘上的数据。选择'''Q'''uit退出分区程序。<br />
选择Done离开此菜单,接着选择"Set Filesystem Mountpoints"。<br />
<br />
=====IDE设备,为什么看起来它们和SCSI设备一样?=====<br />
最新开发的Linux内核里包含了libata和PATA模块,所有的IDE、SATA和SCSI都采用sd''x''这种命名方式。这十分正常,无需担心。<br />
<br />
=====设置文件系统挂载点=====<br />
<br />
''' ”文件系统格式(filesystems)“和”文件系统结构(file systems)“的区别:'''<br />
<br />
从技术层面确切的说,'''文件系统格式(filesystems)'''是一种数据'''格式''',涉及信息吞吐,比如ext2;而”文件系统结构(file systems)“则是特定操作系统中文件和目录的布局,比如/home/username/games。因此,当你被问及是否创建'''文件系统格式(filesystems)'''时,是在问你是否要'''格式化'''该分区…但是当程序向你问及挂载点时,你应该给出的则是该分区应该出现在你的Arch Linux ”文件系统结构“中的位置。<br />
<br />
'''文件系统类型:'''<br />
<br />
'''强烈建议:'''创建一个交换分区(SWAP)。选择一个合适的分区(本例中使用的是sda3). 安装程序就会询问你是否要创建swap 文件系统; 选择 yes. 接下来, 选择根分区的挂载点(本例中就是 sda1). 然后安装程序就会询问你需要哪一种文件系统。<br />
<br />
{{Box Note| 采用何种文件系统的类型取决于实际应用需要,没有十全十美的文件系统,选择任何一个文件系统,都需要在数据安全和性能要求方面作出适当倾斜,下面只是简单的介绍各种Arch linux支持的文件系统 }}<br />
<br />
1. '''ext2''' - 古老、 可靠的 GNU/Linux 文件系统。非常的稳定,不过 ''不支持日志记录功能''。磁盘检测速度较慢,因而有些不便. ''ext2可以容易地转换成ext3''。一般认为/boot分区采用此系统最合适,因为/boot里的东西就开机的时候读取一次,而且很少有变动,不需要日志文件系统,如果采用日志文件系统,日志的体积很可能远远大于内核的大小。<br />
<br />
2. '''ext3''' - 基于ext2系统, 并添加了日志记录功能。 一般认为他比其他文件系统要 ''稍微的'' 慢一点, 不过 ''非常的'' 稳定并且使用最为广泛,由 GNU/Linux FS 负责维护和开发。<br />
<br />
'''高性能文件系统:'''<br />
<br />
3. '''ext4''' - 最近加入支持的文件系统,是ext2和ext3的后续发展版本,Ext4增加了48位块地址,最大支持1EB文件系统,和单个16TB的文件,增加子目录限制到64,000。新增了很多功能,提供在线碎片处理,速度比ext3快,系统开销比ext3小。<br />
{{Box Note| 由于此系统较新,目前仍存在一些问题,暂时建议/home分区不采用此文件系统,以保证个人数据安全。}}<br />
<br />
4. '''ReiserFS''' - Hans Reiser 主持编写的高性能的日志文件系统,使用一种非常独特有趣的数据存储检索方法。ReiserFS 效率非常高, 特别在处理很多小文件的时候更是如此。ReiserFS在挂载的时候相对比较慢. 性能稳定。 ReiserFS 现在的开发并不活跃(最新的版本是Reiser4).<br />
<br />
5. '''JFS''' - IBM提供的日志文件系统( '''J'''ournaled '''F'''ile'''S'''ystem首字母缩写). JFS 效率非常高并且CPU资源占用率比其他任何一个文件系统都要低。并且在挂载和磁盘检测的时候都非常快,在各方面的表现都非常突出,尤其是 conjunction with the deadline scheduler. (参见 [[JFS]].) 但是并不像ext或者ReiserFS那样应用广泛。<br />
<br />
6. '''XFS''' - 非常高效的日志文件系统,特别适合处理大文件。在处理小文件的时候稍慢。在挂载的时候也很快。由于 /var 需要处理很多的小文件,所以可能不太适合作为/var 分区的文件系统。 GNU/Linux 文件系统中,最先实现可用的在线碎片处理。应用不及ext和ReiserFS那么广泛。<br />
* JFS 和 XFS 不能被磁盘工具压缩(比如gparted 或者 parted magic)<br />
<br />
'''未来文件系统'''<br />
<br />
7、btrfs - 此文件系统尚未被Arch纳入正式支持。是Oracle提供的copy-on-write档案系统。目标在取代的ext3,提高ext3单一档案的大小,总档案系统大小或档案检查,加入目前ext3未支援的功能,比如:writable snapshots,snapshots of snapshots,内建磁盘阵列(RAID)支援,and subvolumes。<br />
<br />
最主要的差别在于[http://en.wikipedia.org/wiki/Journaling_file_system 日志系统] (一种类似的在数据库环境中记录着日志变更的东西). 除ext2之外,其他文件系统都支持日志记录功能. ext3 完全兼容 ext2,因此哪怕你可以用一个非常古老的CD来挂载他,也没问题。 根分区目前最安全的选择就是使用ext3文件系统。ReiserFS,XFS,和JFS也可以使用,因为GRUB (启动引导管理器,稍候在安装部分将会介绍到) 都可以从这些文件系统中启动。你可以通过选择‘’‘yes’‘’来创建文件系统(并格式化分区),接着你就会被提示添加附加分区。 在我们的例子中, 只有sda2了。 选择一个文件系统类型,并且把这个分区挂在到/home. 再次说明,创建文件系统并且选择Done。然后回到主菜单。<br />
<br />
====4、选择软件包====<br />
现在我们要选择安装哪些软件包到系统中。选择CD作为来源,如果你不止一个光驱的话还需要选择使用哪个的光驱。<br />
<br />
软件包选择分为两个阶段。首先要选择软件包分类,然后出现所选分类中软件包的详细列表供你微调。使用空格键进行选择和取消。<br />
<br />
''*BASE:包含最小的软件包集合,仅够构建一个可运行的系统骨架。''<br />
''*SUPPORT:供网络和文件系统用的额外软件包,例如gpm、fuse、dnsutils、无线驱动、ndiswrapper、ntfs-3g诸如此类。''<br />
''*DEVEL:软件创建工具,如GCC、autoconf、automake和make等等。''<br />
''*LIB:大量的库文件,如gmp、lebelf、libevent等等。''<br />
*''' 2008.06 版'''的软件包选择,只有一个: BASE ,选择之后进入其详细列表. <br />
<br />
在这里,我们对'Select all packages by default'选择'yes'。<br />
<br />
接下来屏幕将显示你所选的软件包。对于新手,较安全的做法是不修改它,而有经验的用户可能希望裁减掉一些不需要的软件包。(例如,不需要的文件系统类型公用程序,不需要的驱动等等。)<br />
<br />
====5、安装软件包====<br />
接着,选择'Install Packages'。你会被询问是否希望保留pacman缓冲里的软件包。如果你选'yes',日后你还可以选择对某些软件包进行降级,因此推荐保留(日后你还是可以清除这些缓存的)。安装脚本跟着就会安装所选软件包到你的系统中。这些软件包是二进制的、针对i686优化的,总共仅100MB,因此安装是相当便捷的。<br />
<br />
====6、配置系统====<br />
系统接着会询问你是否要选择[[Hwdetect|hwdetect]]来收集配置所需信息。新手应该选择是('yes')。<br />
<br />
如果是相当熟悉自己的硬件、所需模块,有能力从零开始手动配置/etc/mkinitcpio和/etc/fstab 的高级用户,可以选择否'no'。(当然,此选项是非常复杂的,已经超过本指南的范围,这里就不详细解释了。)<br />
<br />
接下来,系统会询问你是否需要支持从USB设备、FireWire设备、PCMCIA设备、NFS共享、软RAID阵列、LVM2卷和加密卷上启动。如果需要则选'yes',在本案例中以上都不选。<br />
<br />
新手还应该选择让/etc/mkinitcpio/kernel26-fallback.conf使用[[Hwdetect|hwdetect]]的结果,这将确保你的硬盘控制器相容次序。<br />
<br />
现在系统会询问你使用哪个文本编辑器;如果你不熟悉[http://en.wikipedia.org/wiki/Vim_%28text_editor%29 vi/vim]的话可以选择[http://en.wikipedia.org/wiki/Nano_%28text_editor%29 nano]。然后就会出现一个包含系统中大部分重要配置文件的菜单。如果你打算查找/etc/rc.conf中可用的选项,只需按Alt+F2切换到另外一个虚拟控制台进行查找,然后用Alt+F1切换回安装程序。<br />
<br />
======系统配置主文件'''/etc/rc.conf'''======<br />
Arch Linux继承FreeBSD的传统,使用'''/etc/rc.conf'''作为系统配置的主要文件。这个文件包含了广泛的配置信息,主要用于系统的启动。正如名字中所包含的意思,它还包含了供/etc/rc*文件使用的配置。/etc/rc.conf提供了一个Arch用户可以轻易访问到的,简洁而又范围广泛的精简系统资源配置方案。<br />
* '''LOCALIZATION'''部分<br />
** '''LOCALE'''=: 系统场所(locale)设置,被所有国际化(i18n-aware)的应用程序使用 。从命令行上运行locale可以列出可用的locale设置。此设置缺省是适合英文(US English)用户使用的en_US.utf8。(此处locale的设置必须与/etc/locale.gen一致,'''[[#/etc/locale.gen|详见下文]]'''。)中文一般是zh_CN.UTF-8,如果使用之后乱码,先换回en_US.utf8,等进图形界面后再换回来。<br />
** '''HARDWARECLOCK'''=: 指示开关机时进行同步的硬件时钟,是'''UTC'''时间(协调世界时(Universal Time Coordinated), 过去曾用格林威治平均时(GMT)来表示)还是'''localtime'''(本地时间)。通常UTC较为好,因为它大大简化了时区和日光节约时间(中国过去称为夏时制)的变更。而当你同时还有其它操作系统如windows进行双启动,就必须使用localtime(本地时间),它只把本地时间保存到硬件时钟里。<br />
** '''TIMEZONE'''=: 时区(TIMEZONE)。(所有可用的时区可在/usr/share/zoneinfo/里找到。)<br />
** '''KEYMAP'''=: 可用的键盘映射表可在/usr/share/kbd/keymaps里找到。请注意此设定仅在TTY中有效,在所有图形窗口管理器或者X中都不使用此设置!<br />
** '''CONSOLEFONT'''=: 如果你一定要修改此设置,可在/usr/share/kbd/consolefonts/中找到可用的字体。<br />
** '''CONSOLEMAP'''=: 定义了启动时setfont程序加载的控制台映射表。有需要的话,可在/usr/share/kbd/consoletrans里找到可用的映射表。<br />
** '''USECOLOR'''=: 如果你使用彩色显示器的话请选"yes"。<br />
<br />
LOCALE="zh_CN.UTF-8"<br />
HARDWARECLOCK="localtime"<br />
TIMEZONE="Asia/Shanghai"<br />
KEYMAP="us"<br />
CONSOLEFONT=<br />
CONSOLEMAP=<br />
USECOLOR="yes"<br />
* '''HARDWARE'''部分<br />
** '''MOD_AUTOLOAD'''=: 如果你使用'''udev'''在启动时探测硬件并加载相应模块。请设置为"yes",(适合缺省模块化的内核)。设置为"no"就得靠用户自己指定所需的有关信息。<br />
** '''MOD_BLACKLIST'''=: 模块黑名单。在下面的例子中,IPv6模块和pcspeaker都被列入黑名单而不被加载。<br />
** '''MODULES'''=: 指示了其它模块,如果你知道缺少哪个重要的模块可以加在里面。('''hwdetect'''应该已经填写了最重要的模块):<br />
# Scan hardware and load required modules at bootup<br />
MOD_AUTOLOAD="yes"<br />
# Module Blacklist - modules in this list will never be loaded by '''udev'''<br />
MOD_BLACKLIST=(net-pf-10 pcspkr)<br />
#<br />
MODULES=(e100 eepro100 mii slhc snd-ac97-codec snd-intel8x0 soundcore)<br />
* '''NETWORKING'''部分<br />
** '''HOSTNAME'''=:设置为你喜欢的主机名(HOSTNAME)。<br />
** '''lo'''=: 不修改此行。<br />
** '''eth0'''=: 如果使用'''静态IP'''的话请调整网络接口的IP地址、掩码和广播地址。如果使用'''DHCP'''的话则设为eth0="dhcp"。<br />
** '''INTERFACES'''=: 指定使用哪些网络接口。如果你不使用DHCP来配置设备,而是通过命令行用ifconfig手动配置设备的话,这里的变量值(名字必须等于打算进行配置的设备名一样)必须和ifconfig里加入的内容一样。<br />
** '''gateway'''=: 如果你使用'''静态IP''',将网关(gateway)地址设为路由器的IP。如果使用DHCP,则将此行用'#'注释掉。<br />
** '''ROUTES'''=: 如果你使用'''静态IP''',则将'gateway'前面的'!'去掉。如果使用'''DHCP'''的话则不需要修改此行。<br />
<br />
<br />
例如,当使用'''DHCP''':<br />
HOSTNAME="arch"<br />
lo="lo 127.0.0.1"<br />
#eth0="eth0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255" <br />
eth0="dhcp"<br />
INTERFACES=(lo eth0)<br />
#gateway="default gw 192.168.0.1"<br />
ROUTES=(!gateway)<br />
* '''DAEMONS'''部分<br />
这个序列罗列了位于/etc/rc.d/里需要在启动过程中启动的脚本名字。<br />
<br />
*如果脚本名字前有惊叹号(!),表示它不被执行。<br />
*如果脚本名字前有符号(@),则表示它会在后台被执行,启动序列不会等待此脚本成功执行完毕,而是继续执行下一个守护进程脚本。<br />
<br />
这种'BSD风格'的初始化就是Arch的处理办法,而其它发行版则是在一个init.d目录里使用一大堆符号链接(一个简单的文件 vs 一整个目录)。<br />
<br />
======关于守护进程======<br />
虽然此时你不需修改[[daemons]]行,不过还是有必要解释一下什么是守护进程,因为过一会儿在指南里我们会需要它。<br />
<br />
和Windows服务(service)类似,守护进程(daemon)是一个运行于后台的程序,等待事件发生并提供服务。一个较好的例子是webserver等待请求以发送页面,还有SSH服务等待用户登录。这些都是全功能的程序,还有些守护进程工作起来并不是那么明显的。例如向日志文件里写信息的守护进程(如syslog、metalog),当系统空闲时降低CPU频率的守护进程(如cpufreq),以及提供图形化登录的守护进程(如gdm、kdm)。所有这些程序都可以被加入到daemons行中,在系统启动时被执行。本指南会对一些较有用的守护进程进行介绍。<br />
按Ctrl+X退出nano编辑器。<br />
<br />
======磁盘和分区配置文件:/etc/fstab======<br />
'''fstab''' ('''f'''ile '''s'''ystems '''tab'''le的缩写) 是系统配置的一部分,该文件列出所有可用的磁盘和分区,并指明它们初始化的方式或整合至全局文件系统的方式。'''/etc/fstab'''文件一般被'''mount'''命令读取,以决定某一特定设备被挂载时所采用的选项。<br />
<br />
这是一个'''/etc/fstab'''的例子:<br />
<br />
#<br />
# /etc/fstab: static file system information<br />
#<br />
# <file system> <dir> <type> <options> <dump> <pass><br />
none /dev/pts devpts defaults 0 0<br />
none /dev/shm tmpfs defaults 0 0<br />
#/dev/cdrom /mnt/cdrom iso9660 ro,user,noauto,unhide 0 0<br />
#/dev/dvd /mnt/dvd udf ro,user,noauto,unhide 0 0<br />
#/dev/fd0 /mnt/fd0 vfat user,noauto 0 0<br />
/dev/sda1 / jfs defaults,noatime,nodiratime 0 1 <br />
/dev/sda2 /home jfs defaults,noatime,nodiratime 0 2<br />
/dev/sda3 swap swap defaults 0 0<br />
Hwdetect应该已经有效地配置了一个可用的'''fstab''',但最好还是简要地检查一下。<br />
<br />
*如果你打算用'''hal'''来自动挂载DVD之类的媒体,为了给即将安装的'''hal'''做准备,你可能要注释掉cdrom和dvd条目。 <br />
<br />
''在笔记本电脑和桌面系统上,可以给 / 和 /home加上'noatime'和'nodiratime'选项来提高速度、性能,同时还能省电。无论你采用何种文件系统,这样做都应该是安全的。''<br />
<br />
更多信息请参照[[Fstab]]<br />
<br />
======'''mkinitcpio.conf、modprobe.conf和kernel26-fallback.conf'''======<br />
此时我们无须去修改这些配置文件。'''mkinitcpio.conf'''负责配置ramdisk(例如从RAID、加密卷启动), '''modprobe.conf'''可以用来设置内核模块的的某些配置选项,而'''kernel26-fallback.conf'''则是initramfs后备配置。<br />
<br />
======(对于静态IP)网络配置文件:/etc/resolv.conf ======<br />
*''如果你使用DHCP,完全可以忽略此文件,缺省情况下dhcpd守护进程会自动创建和销毁此文件。''<br />
<br />
如果你使用静态IP,则可在/etc/resolv.conf里设置你的DNS服务器。每行的格式为nameserver <ip地址>,如果有多个DNS服务器则可以填入多行。<br />
<br />
如果你使用路由器,也许会希望由你的路由器本身指定DNS服务器,而在'''resolv.conf'''里只是写入你的路由器的IP(同时也是'''/etc/rc.conf'''里的网关),例如:<br />
nameserver 192.168.1.1<br />
可选的,逐个加入你的DNS服务器,例如:<br />
nameserver 4.2.2.1<br />
nameserver 4.2.2.2<br />
<br />
如果使用'''DHCP''',你也可以在你的路由器里指定你的DNS服务器,或者如果你的ISP支持的话由ISP自动指定。<br />
<br />
======/etc/hosts======<br />
可以在此文件中加入你想要的''hostname'',必须和/etc/rc.conf里的设置一致,因此它应该象这样:<br />
127.0.0.1 localhost.localdomain localhost '''''yourhostname'''''<br />
''为了程序的兼容性,必须严格遵照这个格式,'''包括'localhost' 这项'''!错误的句法可能会导致网络性能低下和/或某些程序运行缓慢甚至无法运行。这对新手来说是十分普遍的错误。''<br />
<br />
对于大部分用户,只要把''yourhostname''加入到行末就就可以了,不过有些用户推荐以下句法:<br />
127.0.0.1 '''''yourhostname'''''.domain.org localhost.localdomain localhost '''''yourhostname'''''<br />
如果你使用静态IP,可以用这种句法加入新行:<static-ip> hostname.domainname.org hostname,例如:<br />
192.168.1.100 '''''yourhostname'''''.domain.org '''''yourhostname'''''<br />
<br />
======/etc/hosts.deny和/etc/hosts.allow======<br />
如果你打算使用[[SSH|ssh]]的话,请根据自己的需要修改此配置。缺省设置是拒绝所有进入的连接,而不只是ssh连接。编辑'''/etc/hosts.allow '''文件加入:<br />
<br />
* 允许所有进入的ssh连接。<br />
sshd:all <br />
<br />
* 允许特定IP地址进入ssh连接。<br />
sshd: 192.168.0.1<br />
<br />
* 允许你指定的网段 (地址从 192.168.0.0 到 192.168.0.255)<br />
sshd: 192.168.0.<br />
<br />
* 允许某个IP地址范围<br />
sshd: 10.0.0.0/255.255.255.0<br />
<br />
如果你不打算使用[[SSH|ssh]],为安全起见请保持此文件的缺省设置(为空)。<br />
<br />
======/etc/locale.gen======<br />
<br />
'''locale-gen''' 命令从 '''/etc/locale.gen'''读取信息设定系统的locales. 这些设置稍后会被'''glibc''' 和其他一些支持本地化的程序或者库用于自动翻译输出各种语言的"独特" 文本, 并且合适的显示地域、货币、时区以及日期格式, 字符排列方式和其他一些本地化的特殊标准。设置默认本地化的功能是类<code>UNIX</code>操作系统的一大特质<br />
<br />
默认情况下 /etc/locale.gen 是一个仅包含注释文档的空文件.编辑后,这个文件将不会get touched again. 每次'''glibc'''更新之后'''locale-gen'''就会运行一次, 以在/etc/locale.gen重新生成所有的本地化设置.<br />
<br />
选定你需要的本地化类型(移除前面的#即可), 比如:<br />
en_US ISO-8859-1<br />
en_US.UTF-8 <br />
('''你这里的设置必须和上文中提到的/etc/rc.conf 的设置一致哦.''')<br />
<br />
现在,安装程序将运行locale-gen 脚本, 以生成你设定的locales。你以后可以通过修改文件/etc/locale.gen变更你的locale, 然后使用根用户(root)运行'locale-gen'脚本使之生效。<br />
<br />
''Note 如果你选择并设置了locale, 他将提示你 "The current locale is invalid..." 错误。可能是因为大多数新Arch用户都会犯的普遍的错误,也是在论坛中问得最多的问题。''<br />
<br />
======Root密码======<br />
最后,设置一个root密码并确定你已牢记它。返回主菜单然后接着安装启动加载器。<br />
<br />
======Pacman镜像======<br />
为'''pacman'''选择一个软件仓库镜像站。记住主站 archlinux.org 是有流量限制的,下载速度限于50KB/s.。<br />
<br />
在列表中仔细查看, 一般 xxx.cn 是中国镜像, xxx.au 是澳大利亚, 等等...<br />
<br />
*''如果你不熟悉现有的镜像和它们所处的位置,那就随便选一个。稍后你可以编辑 "/etc/pacman.d/mirrorlist", 或运行本指南后面提到的'''rankmirrors'''脚本,它将自动配置最接近你的镜像。''<br />
<br />
返回主菜单。<br />
<br />
====7、安装启动加载器====<br />
因为本案例中没有第二个操作系统,因此我们需要安装一个启动加载器。推荐选择[http://www.gnu.org/software/grub/ GNU GRUB]作为启动加载器。另外一种选择是[http://lilo.go.dyndns.org/ LILO]。缺省的'''GRUB'''配置('''/boot/grub/menu.lst''')应该足够了。唯一你可能想修改的是控制台的分辨率。将vga=<number>加入到第一个kernel行。(menu.lst中已列出一张分辨率和数字的对应表格可供查找。)<br />
title Arch Linux (Main)<br />
root (hd0,0)<br />
kernel /boot/vmlinuz26 root=/dev/sda1 ro vga=773<br />
initrd /boot/kernel26.img<br />
参数"vga=773"表示1024x768分辨率、256色的framebuffer。<br />
<br />
将'''GRUB'''启动加载器安装到主引导区(本例中为sda)。<br />
<br />
====8、系统重启====<br />
退出安装程序。<br />
*建议:为了方便接下来更进一步的安装配置,可以把光盘里的新手指南复制一份到电脑里,这样后面的安装就能查看相应的向导了<br />
<br />
cp /arch/beginnersguide.txt /mnt/home/beginnersguide.txt<br />
<br />
系统重启之后,进入控制台,可以使用下面命令查看这新手指南<br />
less /home/beginnersguide.txt<br />
所有安装完毕之后,可以删了这指南<br />
rm /home/beginnersguide.txt<br />
<br />
输入命令下面命令,重启:<br />
<br />
reboot<br />
<br />
一个新Arch Linux系统就会启动并进入登录提示符(你可能需要在'''BIOS'''将启动顺序改为优先从硬盘启动)。<br />
<br />
'''祝贺你,一个崭新的Arch Linux基础系统闪亮登场了!'''<br />
<br />
==第二部分:完成基本系统并升级==<br />
你的新Arch Linux基础系统现在已是一个功能完整的GNU/Linux环境了,随时可以进行定制。从现在开始,你可以按自己的意图和需求改造它。由于arch是滚动发布的,所以安装包不一定是最新的系统,所以我们在安装完成之后,需要立即更新系统。<br />
<br />
让我们开始吧。<br />
-----<br />
登录入你的root账号。我们将以root身份配置pacman和更新系统,然后创建一个普通用户账号。<br />
<br />
===一、配置网络(如果有需要)===<br />
*''如果安装脚本的自动配置不适合你,本段内容将帮助你配置大部分类型的网络。''<br />
-----<br />
如果一切正常的话,你的网络应该可以正常使用了。先ping www.google.com验证一下:<br />
ping -c 3 www.google.com<br />
<br />
''如果你已经成功建立网络连接,则跳到下面阅读[[#使用pacman更新、同步、升级系统|使用pacman更新、同步、升级系统]]'''。''<br />
<br />
如果ping www.google.com后得到"unknown host"的错误,可以认为你的网络尚未正确配置。你需要重新检查以下内容的完整性和正确性:<br />
'''/etc/rc.conf''' # 特别留意HOSTNAME= 和 NETWORKING 部分有无输入错误。<br />
<br />
'''/etc/hosts''' # 复核一下格式。(看之前的内容。)<br />
<br />
'''/etc/resolv.conf''' # 当你使用静态IP时需要检查。如果你使用DHCP,缺省这个文件会被自动创建和销毁,不过也可以改为你需要的内容。(参见[[Network]]。)<br />
<br />
高级的网络配置方法可以在[[Network]]一文中找到。<br />
<br />
=====有线网络=====<br />
<br />
用以下命令检查网络<br />
ifconfig<br />
你应该看到eth0这一项。如果有需要,你可以这样设置一个新的静态IP:<br />
ifconfig eth0 <ip address> netmask <netmask> up <br />
并且这样设置缺省网关:<br />
route add default gw <ip address of the gateway><br />
查看一下/etc/resolv.conf是否包含你的DNS服务器,不过缺失了则补填进去。<br />
再次用ping www.google.cn检查一下网络。如果一切正常,将/etc/rc.conf调整为刚才新设置的静态IP。如果你的网络使用DHCP服务器/路由器的话,输入:<br />
dhcpcd eth0<br />
如果这样可行的话,则将/etc/rc.conf按之前所述方法调整为动态IP。<br />
<br />
=====无线网络=====<br />
详见安装指南:[[无线设置 (简体中文)|无线设置]]<br />
<br />
=====模拟信号调制解调器=====<br />
<br />
如果你想使用外接电话线调制解调器, 你至少要安装ppp包. 根据需要修改配置文件 /etc/ppp/options 你可以参考 man pppd 的帮助.<br />
<br />
你还需要定制一个 chat 协议脚本, 在初始化握手连接建立以后, 提供你的ISP用户名和密码. 命令pppd 和 chat 的帮助里有例子不管你是菜鸟还是高手都应该能搞定连接了.<br />
使用 udev 的话, 串口设备一般是 /dev/tts/0 和 /dev/tts/1.<br />
<br />
Tip: Read [[Dialup without a dialer HOWTO]].<br />
<br />
如果你不想为了 pppd 拔光自己的头发, 你可能会选择安装 wvdial 或类似的配置工具来简化这个过程.<br />
如果你的猫是所谓的 WinModem, 也就是内置 PCI modem 卡, 你可以在这个网址找到大量信息: [http://www.linmodems.org/ LinModem]<br />
<br />
=====ISDN=====<br />
<br />
通过三步,完成 ISDN 的安装和配置:<br />
# 安装配置固件Install and configure hardware<br />
# 安装配置ISDN 管理工具<br />
# 添加ISP信息<br />
<br />
现在的 Arch stock kernels 已经包含了ISDN 所需要的modules, 所以不需要重新去编译内核,除非 you're about to use rather odd ISDN hardware. 把ISDN卡插入电脑或者插入USB ISDN-Box之后,you can try loading the modules with modprobe. 绝大部分的ISDN PCI 卡都能被module hisax处理,只需要两个参数:类型和协议。 如果使用的是1TR6标准,则协议设定为 '1' ,如果使用的是EuroISDN (EDSS1),协议设定为 '2', '3' if you're hooked to a so-called leased-line without D-channel, 如果使用的是US NI1,则设为'4'.<br />
<br />
所有配置细节都可以在kernel documentation, more specifically in the isdn subdirectory, and available online中获知。 类型的参数是根据电视卡来设定的,在README.HiSax kernel documentation中,有一个可能类型的列表。 用相应的参数加载moduleChoose,比如这个:<br />
<br />
modprobe hisax type=18 protocol=2<br />
<br />
这个将加载适用于电视卡类型为ELSA Quickstep 1000PCI,德国使用的EDSS1协议的模块hisax。可以在日志文件/var/log/everything.log中查看是否模块被预加载。额外的USB ISDN Adapter需要加载些USB模块才能正常工作。<br />
<br />
通过上述设定之后,如果电视卡能正常工作,那么把下面模块和参数加入/etc/modprobe.conf中:<br />
<br />
alias ippp0 hisax<br />
options hisax type=18 protocol=2<br />
<br />
这么做的好处是,这些模块在不使用时不会被加载。另外的方法是可以在这只加参数,把hisax加入/etc/rc.conf里面的MODULES,这样做的坏处就是不管这些模块是不是在使用,都加载了。 <br />
<br />
完成上述步骤之后,需要安装管理工具<br />
<br />
安装软件包isdn4k-utils,阅读关于isdnctrl的说明手册。在说明手册里,将有详细的说明:如何创建一个配置文件that can be parsed by isdnctrl,安装实例。 Please note that you have to add your SPID to your MSN setting separated by a colon if you use US NI1.<br />
<br />
使用isdnctrl utility配置ISDN卡之后,将可以拨号到你设定的PHONE_OUT参数的机器上,但提示用户名和密码错误。把用户名和密码加入到/etc/ppp/pap-secrets或者/etc/ppp/chap-secrets,这个主要根据的是你的ISP使用的协议授权方式,as if you were configuring a normal analogous PPP link。如果无法确定,可以两个文件都加。<br />
<br />
完成上述设定之后,用root帐号建立一个拨号连接:<br />
isdnctrl dial ippp0<br />
有啥问题,请检查日志文件!<br />
<br />
=====DSL (PPPoE)=====<br />
<br />
仅当需要你的计算机去主动拨号连接ISP的情况下才需参考本段内容。如果你使用独立的路由器来负责这类工作,你只需要设置一个缺省网关即可。<br />
<br />
在使用DSL连接前,你得先在计算机里安装一个连接到DSL-Modem的网卡。将你新装网卡加入到modules.conf/modprobe.conf或者MODULES列表之后,安装rp-pppoe软件包并运行pppoe-setup脚本来配置你的连接。当你输入完有关信息后,可以分别通过以下命令来进行连接和挂断:<br />
<br />
/etc/rc.d/adsl start<br />
<br />
和<br />
<br />
/etc/rc.d/adsl stop<br />
<br />
setup过程一般都是很容易、直观的,如果还有不懂可以阅读man手册。如果你想在启动时自动拨号,可以将adsl加入到DAEMONS列表中。<br />
<br />
<br />
===二、更新Pacman===<br />
<br />
====pacman是什么?====<br />
[[Pacman]]是Arch Linux的软件包管理器('''pac'''kage '''man'''ager)。Pacman是用C语言编写的,速度快,使用简便,功能强大。它可以管理整个软件包系统,负责软件包的安装、删除、降级(通过缓存),也支持自编译的软件包,自动分析依赖关系,可以搜索远程和本地软件仓库,还有大量其它功能。这里我们将用pacman来从远程软件仓库下载软件包并安装到系统中。<br />
<br />
对系统进行定制,pacman是Arch Linux最重要工具。<br />
<br />
====1、配置pacman====<br />
=====pacman总配置文件/etc/pacman.conf=====<br />
Arch通过pacman可以获得对下面 4软件仓库的管理:<br />
<br />
'''[core]'''<br />
<br />
[core](“核心”)仓库的简单原则是只提供一个基本的Arch Linux的基本工具:GNU系列工具,Linux内核,一个文字编辑器,一个命令行浏览器等(这里也有一些例外。比如说,vi和nano是同时提供的,允许用户选择一个或两个)。它包含所有使你的系统正常运转的“必须”安装的包,只有它们完美地工作,你的系统才能继续运行。这些是绝对“system-critical”(对系统来说至关重要)的包。由开发者负责维护。<br />
<br />
*''Core安装媒介(The Core installation media)简单地包含一个安装脚本,一个当前发布版本的核心仓库的快照(snapshot)。''<br />
<br />
'''[extra]'''<br />
<br />
[extra](“额外的”)仓库包含所有的对于一个基本的Arch系统不是必须,但是对于构建一个完整的系统环境有用的的Arch包。 比如'''X''', KDE和Apache,都可以在这里面找到。它也是由开发者维护的。<br />
<br />
'''[testing]'''<br />
<br />
[testing](“测试”)仓库包含的包是[core]和[extra]仓库的候选者。<br />
下面情况下,新的软件包将进入[testing]软件仓库:<br />
* 可能会导致系统出问题的升级,需要测试。<br />
* 需要重新打包其他软件包。这种情况下,所有需要重新打包的软件包将被放在[testing]仓库,直到所有重新打包完成,这些软件包才回归原有的软件仓库。 <br />
<br />
开发者维护。<br />
<br />
[testing]是唯一的一个在名义上与其它官方仓库有冲突的仓库。(that can have name collisions with any of the other official repositories. )<br />
<br />
<font color=&quot;blue&quot;>*如果开启, [testing]必须放在''pacman.conf''的软件仓库的第一个。</font><br />
<br />
<font color=&quot;red&quot;>'''警告''': '''''开启[testing]软件仓库,容易导致系统崩溃,因此只建议有经验的用户开启。'''''</font><br />
<br />
'''[community]'''<br />
<br />
[community](“社区”)仓库是由“信任用户”(''Trusted Users (TUs)'')维护的,是''Arch User Repository ([[AUR]])''(Arch用户仓库)的一部分。它包含的是二进制的包,在用户仓库中有足够的“票数”,并由''信任用戶''挑选出来的。像其它上面列出的仓库一样,[community] 可以用pacman获取。<br />
<br />
'''[[AUR]]''' 也包含'''unsupported''' 分支,这不能直接通过pacman获取。*. [unsupported] 包含多达海量PKGBUILD脚本,用来从源代码编译。这从其它仓库中是不能使用的。 <br />
<br />
<nowiki>*</nowiki> '''''[[AUR Helpers]]''''' 能帮助你无缝地使用AUR。<br />
<br />
'''/etc/pacman.conf'''<br />
<br />
每次调用pacman,它都会读取/etc/pacman.conf文件。这个配置文件分若干段,每一段定义了一个pacman用来搜索软件的仓库。唯一例外的是options段,它定义了全局选项。<br />
nano /etc/pacman.conf<br />
范例:<br />
#<br />
# /etc/pacman.conf<br />
#<br />
# See the pacman.conf(5) manpage for option and repository directives<br />
<br />
#<br />
# GENERAL OPTIONS<br />
#<br />
[options]<br />
# The following paths are commented out with their default values listed.<br />
# If you wish to use different paths, uncomment and update the paths.<br />
#RootDir = /<br />
#DBPath = /var/lib/pacman/<br />
#CacheDir = /var/cache/pacman/pkg/<br />
#LogFile = /var/log/pacman.log<br />
HoldPkg = pacman glibc<br />
# If upgrades are available for these packages they will be asked for first<br />
SyncFirst = pacman<br />
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u<br />
#XferCommand = /usr/bin/curl %u > %o<br />
<br />
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup<br />
#IgnorePkg =<br />
#IgnoreGroup =<br />
<br />
#NoUpgrade =<br />
#NoExtract =<br />
<br />
# Misc options (all disabled by default)<br />
#NoPassiveFtp<br />
#UseSyslog<br />
#ShowSize<br />
#UseDelta<br />
#TotalDownload<br />
#<br />
# REPOSITORIES<br />
# - can be defined here or included from another file<br />
# - pacman will search repositories in the order defined here<br />
# - local/custom mirrors can be added here or in separate files<br />
# - repositories listed first will take precedence when packages<br />
# have identical names, regardless of version number<br />
# - URLs will have $repo replaced by the name of the current repo<br />
#<br />
# Repository entries are of the format:<br />
# [repo-name]<br />
# Server = ServerName<br />
# Include = IncludePath<br />
#<br />
# The header [repo-name] is crucial - it must be present and<br />
# uncommented to enable the repo.<br />
# <br />
<br />
# Testing is disabled by default. To enable, uncomment the following<br />
# two lines. You can add preferred servers immediately after the header,<br />
# and they will be used before the default mirrors.<br />
#[testing]<br />
#Include = /etc/pacman.d/mirrorlist<br />
<br />
[core]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
[extra]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist <br />
<br />
[community]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
# An example of a custom package repository. See the pacman manpage for<br />
# tips on creating your own repositories.<br />
#[custom]<br />
#Server = file:///home/custompkgs<br />
要开启一个软件仓库,只需要将'Include ='和'[repository]'行前的注释符号(#)去除。<br />
<br />
*"Server ="行如果取消注释,将会强制此服务器被首先搜索,详细的仓库配置位于/etc/pacman.d/下。<br />
* 注意:选择仓库时,请确认将仓库名和'Include ='行都一同取消注释。没有这样做的话会导致你选择的仓库被忽略!这是个很普遍的错误。<br />
<br />
=====(如果有必要)配置镜像列表 /etc/pacman.d/mirrorlist=====<br />
更快的镜像能显著改善pacman的性能和你对Arch Linux的总体体验。<br />
<br />
*手动编辑/etc/pacman.d/mirrorlist:<br />
nano /etc/pacman.d/mirrorlist<br />
删除所有不在你所在洲或者太远的镜像。(在nano里你可以用CTRL-K删除每个不需要的行。)保存文件并退出。<br />
<br />
*'''rankmirrors'''脚本可以根据镜像的响应延迟对其自动排名。'''Rankmirrors'''是python脚本,需要安装python:<br />
<br />
pacman -S python<br />
<br />
然后,运行'''rankmirrors'''脚本按响应延迟顺序对镜像进行排名:<br />
rankmirrors -v /etc/pacman.d/mirrorlist<br />
输出会列出所有镜像和它们的响应延迟(ping),例如:<br />
<br />
# United States<br />
# http://mirrors.easynews.com/linux/archlinux/$repo/os/i686 ... 0.96<br />
# ftp://ftp.nethat.com/pub/linux/archlinux/$repo/os/i686 ... unreachable<br />
# ftp://locke.suu.edu/linux/dist/archlinux/$repo/os/i686 ... 2.43<br />
# ftp://mirrors.unixheads.org/archlinux/$repo/os/i686 ... 1.96<br />
<br />
脚本将从低到高的响应延迟顺序显示:<br />
Server = http://mirrors.easynews.com/linux/archlinux/$repo/os/i686<br />
Server = ftp://mirrors.unixheads.org/archlinux/$repo/os/i686<br />
Server = ftp://locke.suu.edu/linux/dist/archlinux/$repo/os/i686<br />
Server = ftp://ftp.nethat.com/pub/linux/archlinux/$repo/os/i686<br />
<br />
要注意的是这个结果对于镜像排列并非很精确,最接近你的镜像或者延迟最低的镜像并不一定是最佳选择。(反应迅速但是内容过时的镜像、或者低延迟但是窄带宽的镜像对你毫无用处)。<br />
<br />
编辑/etc/pacman.d/mirrorlist,将最佳的镜像置于在列表顶端。为了体验多个镜像你可能要不断修改此配置文件,请精明地选择。<br />
<br />
====常用的命令====<br />
<br />
与远程软件仓库同步和更新本地包数据库 (推荐在安装和更新包之前这样做):<br />
pacman -Sy<br />
<br />
'''升级'''系统中所有的包:<br />
pacman -Su<br />
<br />
一条同步、更新、'''升级''' 所有系统中的包的命令:<br />
pacman -Syu<br />
<br />
安装或者升级单个软件包或者一串包(包括其依赖包):<br />
pacman -S packageA packageB<br />
<br />
同步、更新数据库并安装软件包:<br />
pacman -Sy packageA packageB<br />
<br />
移除软件包, 但保留依赖的包:<br />
pacman -R package<br />
<br />
移除单个包,并且移除没有被别的软件依赖的依赖包:<br />
pacman -Rs package<br />
<br />
移除包所有不需要的依赖包并删除其配置文件:<br />
pacman -Rsn package<br />
<br />
通过给定关键词(列表)搜索远程软件仓库数据库(repo):<br />
pacman -Ss keyword<br />
<br />
列出系统中所有的包<br />
pacman -Q<br />
<br />
在本地包数据库搜索 (查询)指定软件包:<br />
pacman -Q package <br />
<br />
在本地包数据库搜索 (查询)指定软件包并列出相关信息:<br />
pacman -Qi package<br />
<br />
To defragment pacman的数据库缓存和速度优化选项:<br />
pacman-optimize<br />
<br />
统计当前系统中的包数量:<br />
pacman -Q | wc -l<br />
<br />
使用ABS和makepkg从源代码编译安装包:<br />
pacman -U packagename.pkg.tar.gz<br />
<br />
Note: pacman有很多很多的选项和功能组合。你可以试试man pacman或者查阅lt the [[pacman]]维基条目<br />
<br />
====软件包管理增强工具====<br />
* Yaourt 可查询aur的pacman增强工具<br />
* Tupac 快速查询的yaourt增强工具<br />
* Powerpill 多进程下载的pacman增强工具<br />
{{Box Note| 强烈建议更新系统完毕后,安装yaourt和powerpill,以便更充分享受Arch Linux的方便和强大。}}<br />
在/etc/pacman.conf文件里,最后添加两行(如果是i686的话,把x86_64换成i686即可):<br />
[archlinuxfr]<br />
Server = http://repo.archlinux.fr/x86_64<br />
然后使用pacman安装yaourt<br />
pacman -Sy yaourt<br />
<br />
以后就可以使用yaourt命令来查找并安装包括[[AUR]]里的软件了。比如bcm无线网卡,需要安装b43-firmware(此软件包在[[AUR]]仓库里,使用pacman无法查找到),使用yaourt命令查找并安装:<br />
yaourt b43-firmware<br />
找到之后,根据相应提示,一直到安装完成。<br />
<br />
====图形化管理工具====<br />
* qt界面的shaman:比较成熟的pacman 图形化管理工具<br />
* gtk界面的gtkpacman :目前BUG比较多,不稳定。<br />
<br />
====Pacman的更多信息====<br />
用此命令查看pacman手册:<br />
man pacman<br />
有空的话可以看看[[pacman (简体中文)]]维基条目。<br />
<br />
====2、更新Pacman自己====<br />
<br />
一开始,系统可能会提示你先更新pacman自身,这取决于Arch安装包的新旧程度:<br />
pacman -Sy pacman<br />
pacman开始查看是否需要更新,如果有提示需要更新,则按‘y’,开始pacman更新。<br />
<br />
'''''有时候,还需要用户主动修改某些配置;请仔细阅读升级过程中的输出获取相关信息。'''''<br />
<br />
===三、更新系统===<br />
====使用[[pacman (简体中文)|pacman]]====<br />
现在我们要用[[pacman (简体中文)|pacman]]来更新系统。要更新、同步并'''升级'''你的系统,可以使用命令:<br />
pacman -Syu<br />
pacman就会获取所有最新可用软件包信息并进行升级。(此时你可能会被提示先升级pacman自身。如果是这样,回答'yes',然后在完毕后再运行一次pacman -Syu命令。)<br />
<br />
===='''滚动发布'''之美====<br />
Arch是一个'''rolling release'''(滚动发布)的发行版。这意味着没有必要重新安装或执行完整的系统重建来升级到最新版本。只需要执行'''pacman -Syu''',就能保持你的系统更新到最新和bleeding edge(表示最新的、因而也并非完美的技术)。<br />
<br />
===四、增加一个用户并设置用户组===<br />
用root账号来处理日常工作是很危险的。Root是用来处理系统管理的任务。我们可以用以下命令增加一个普通用户账号:<br />
adduser<br />
大部分缺省选项都是没问题的,你可能还需要将storage、audio、video、optical和wheel加入到你的用户组中 ── 特别是在你打算使用一个完整功能的桌面环境的情况下。<br />
<br />
用户组和用户的关联定义在/etc/group文件中: <br />
<br />
它包含了:<br />
<br />
*'''audio''' - 关于声卡和相关软件的任务<br />
<br />
*'''wheel''' - 给sudo使用<br />
<br />
*'''storage''' - 负责存储设备<br />
<br />
*'''video''' - 视频任务和3D加速<br />
<br />
*'''optical''' - 和光驱有关的任务<br />
<br />
*'''floppy''' - 软驱访问<br />
<br />
*'''lp''' - 打印任务<br />
<br />
请参看[[Groups]]一文了解你应该属于哪些用户组。<br />
你还可能需要将你的用户账号加入到以下用户组(需要以root身份运行此命令):<br />
usermod -aG audio,video,floppy,lp,optical,network,storage,wheel,dbus,hal USERNAME<br />
详情可看usermod和gpasswd的man手册。<br />
<br />
===五、安装建立Sudo (可选)===<br />
安装Sudo:<br />
# pacman -S sudo<br />
以root身份,运行命令visudo,把用户加入sudo用户 (a &quot;sudoer&quot;).如果不知道怎么使用vi,你可以在用visudo前设置EDITOR环境变量为你喜欢的编辑器。例如:<br />
# EDITOR=nano visudo<br />
如果你对于用vi很适应,去掉EDITOR=nano这个变量就行:<br />
# visudo<br />
这命令将在一个特殊的vi会话中打开文件 /etc/sudoers 。visudo复制文件到一个可编辑的临时文件中,用一个编辑器编辑它(vi是默认的),接下来运行一个安全检查(“sanity check”)。如果通过,这个临时文件就有正确的权限将重写的原始文件。t<br />
<br />
<font color=&quot;red&quot;>'''注意:不要直接用编辑器编辑 /etc/sudoers ; 否则会出现这样的提示:Errors in syntax can cause annoyances (像root帐户不能使用的描述一样)。 必须使用 ''visudo'' 命令来编辑 /etc/sudoers.'''</font><br />
<br />
当用户输入以 &quot;sudo&quot;, 作为开始的命令行时,临时授予该用户root权限。加入下面一行:<br />
USER_NAME ALL=(ALL) ALL<br />
USER_NAME 就是单个用户名。<br />
<br />
更多信息,比如按<TAB> 自动命令补全,请见[[Sudo]]<br />
<br />
==第三部分:安装X并配置ALSA==<br />
一共有三步工作:<br />
*1、安装声卡驱动<br />
*2、安装x-window(包括显卡驱动)<br />
*3、配置X<br />
<br />
{{Box Note | '''在热插拔未配置正确的情况下,或者是/etc/rc.d/hal未启动的情况下,请不要启动开启X(包括重启使用gdm或者kdm登陆),否则可能导致鼠标键盘失去响应!!!'''}}<br />
<br />
===一、配置声卡:使用alsamixer===<br />
高级Linux声音架构(Advanced Linux Sound Architecture,简称ALSA)是一个Linux内核组件。它替换了原有的开放声音系统(OSS),为声卡提供了设备驱动。除了声音设备驱动以外,'''ALSA'''还给应用程序开发人员提供了一个用户空间库,可使更高级的API无需直接与内核驱动打交道就能使用驱动功能。<br />
<br />
{{Box Note| Alsa已经包含进最新的内核kernel,udev 将在系统启动时自动检测硬件,并自动根据声卡加载相应的内核模块。虽然声卡已经在工作,但电脑的声音默认是静音。}}<br />
{{Box Note| OSS4.1已经放出,相对于老的版本,这是一个显著的提升的版本,如果使用ALSA有问题, 或者是想尝试新的功能,可以使用 OSS4.1。 相关说明可见: [[OSS]]}} <br />
<br />
Alsa-utils软件包里的alsamixer让我们可以从命令行来配置声音设备。(你也可以稍后在'''X'''环境中使用alsamixer。)<br />
默认情况下,内核加载模块snd_pcsp,这是一个alsa pc speaker模块。 snd_pcsp通常先于&quot;你实际的&quot;声卡模块加载。大部分情况下,这模块最后加载更好,因为可以让alsamixer正确控制需要的声卡。<br />
<br />
在/etc/modprobe.conf中加入这行,可以使得snd_pcsp最后加载:<br />
options snd-pcsp index=2<br />
<br />
当然,如果你不想让snd_pcsp加载,可以把它放入黑名单,或者是在/etc/rc.conf的Modules里禁止它:<br />
MODULES=(... !snd_pcsp)<br />
<br />
{{Box Note | 想要生效,需要释放并重新加载所有声音模块,当然,系统重启就可以简单解决这问题。 }}<br />
<br />
* 安装alsa-utils软件包:<br />
pacman -S alsa-utils<br />
<br />
* 为了解决Alsa声卡独占问题,可以安装alsa-oss:<br />
# pacman -S alsa-oss <br />
<br />
* 把你的普通用户账号加入到audio用户组中:以root身份,运行<code>/usr/bin/gpasswd</code>程序:<br />
gpasswd -a yourusername audio<br />
*以普通用户身份运行: <br />
alsamixer<br />
用左右光标键移动到Master和PCM声道上,按'''M'''取消掉静音。用向上键增加音量。(70-90的音量是较合适的范围)按ESC键离开alsamixer。<br />
有'''Speaker'''的,需要同时取消静音并调整之. <br />
<br />
====测试声音====<br />
以普通用户身份,使用 <code>/usr/bin/aplay</code>程序来测试你的声音配置:<br />
aplay /usr/share/sounds/alsa/Front_Center.wav<br />
你应该会听到一个女性声音说:“Front,center。”<br />
<br />
====保存声音配置====<br />
以root身份运行<code>/usr/bin/alsactl</code> :<br />
alsactl store<br />
这将创建'/etc/asound.state'文件,用来保存alsamixer的设置。<br />
<br />
为了每次启动都可以自动恢复混音器设置,可将守护进程''alsa''加入到你的/etc/rc.conf中的DAEMONS列表。<br />
nano /etc/rc.conf<br />
DAEMONS=(syslog-ng network crond '''alsa''')<br />
''注意,alsa守护进程在启动过程中仅仅是恢复音量设置。它和alsa音频库(和内核级API)是完全不同的。''<br />
<br />
更多详情请参看[[ALSA 安装设置 (简体中文)|ALSA 安装设置]]。<br />
<br />
===二、安装X===<br />
'''X''' 窗口系统(一般叫'''X11'''或者更简单的叫'''X''') 是一个网络互动和显示服务,提供位图显示器窗口. 提供标准化工具包(toolkit)和协议,用于<code>UNIX</code>类操作系统,构建一个图形界面(GUIs) <br />
<br />
'''X''' 提供最基本、基础的框架,用于构建一个图形操作界面环境。包括:绘图、屏幕窗口移动,与鼠标或者键盘的交互。 '''X''' 并不负责用户交互界面的部分:有独立的客户端程序负责处理这部分。 比如gnome、kde。<br />
<br />
'''X''' 因为它先于'''W'''窗口系统,最初由斯坦福大学开发。 <br />
<br />
*''注意: 如果想使用一个'''开源''' 显卡驱动, 需要3d加速,强烈建议在安装Xorg之前安装库 libgl :''<br />
pacman -S libgl<br />
''(拥有专利的视频驱动提供它们自己的gl库安装(implementations).)''<br />
----- <br />
====1、安装X====<br />
构建一个GUI的第一步:用pacman来安装Xorg包.<br />
<br />
# pacman -S xorg<br />
对于新版的xorg,建议(可能大部分情况下是必须的)安装输入设备驱动evdev。它本来应该作为xorg-server的一个依赖被安装的,不过不知道为什么貌似缺失了:<br />
# pacman -S xf86-input-evdev<br />
3d的工具比如glxgears包含在包'''mesa''' 里(如果需要,也安装):<br />
# pacman -S mesa<br />
<br />
====2、安装显卡驱动====<br />
到这一步,已经有了运行'''X''' Server的基本软件包,接下来需要把显卡的驱动安装到电脑里(e.g. xf86-video-<name>). 最简单的X.org配置方法就是安装正确的驱动包,然后使用自动脚本对 /etc/X11/xorg.conf 进行初始化,比如使用 Xorg -configure(arch团队提供hwd工具,但据以前用户的反映,这个现在还老出问题,新手可以使用,以后有能力再配置其他).<br />
<br />
如果不知道显卡类型,输入下面命令:<br />
lspci | grep VGA<br />
<br />
输入下面命令,查看所有'''开源'''驱动: <br />
pacman -Ss xf86-video | less<br />
<br />
下面是一个'''开源'''的显卡列表和相关说明:<br />
*'''xf86-video-apm''' Alliance ProMotion video driver<br />
*'''xf86-video-ark''' ark video driver<br />
*'''xf86-video-ati''' ati video driver<br />
*'''xf86-video-chips''' Chips and Technologies video driver<br />
*'''xf86-video-cirrus''' Cirrus Logic video driver<br />
*'''xf86-video-dummy''' dummy video driver<br />
*'''xf86-video-fbdev''' framebuffer video driver<br />
*'''xf86-video-glint''' GLINT/Permedia video driver<br />
*'''xf86-video-i128''' Number 0 i128 video driver<br />
*'''xf86-video-i740''' Intel i740 video driver<br />
*'''xf86-video-i810''' Intel i810/i830/i9xx video drivers (deprecated - use -intel)<br />
*'''xf86-video-intel''' Newer Version of Intel i810/i830/i9xx video drivers<br />
*'''xf86-video-imstt''' Integrated Micro Solutions Twin Turbo vidoe driver<br />
*'''xf86-video-mach64''' mach64 video driver <br />
*'''xf86-video-mga''' mga video driver (Matrox Graphics Adapter) <br />
*'''xf86-video-neomagic''' neomagic video driver<br />
*'''xf86-video-nouveau''' Open Source 3D acceleration driver for nVidia cards (eperimental)<br />
*'''xf86-video-nv''' nvidia nv video driver<br />
*'''xf86-video-openchrome''' Openchrome drivers<br />
*'''xf86-video-r128''' ati Rage128 video driver<br />
*'''xf86-video-radeonhd''' Experimental Radeon HD video driver for r500 and r600 ATI cards<br />
*'''xf86-video-rendition''' Rendition video driver<br />
*'''xf86-video-s3''' S3 video driver<br />
*'''xf86-video-s3virge''' S3 Virge video driver<br />
*'''xf86-video-savage''' savage video driver<br />
*'''xf86-video-siliconmotion''' siliconmotion video driver<br />
*'''xf86-video-sis''' SiS video driver<br />
*'''xf86-video-sisusb''' SiS USB video driver<br />
*'''xf86-video-tdfx''' tdfx video driver<br />
*'''xf86-video-trident''' Trident video driver<br />
*'''xf86-video-tseng''' tseng video driver<br />
*'''xf86-video-unichrome''' Unichrome video drivers<br />
*'''xf86-video-v4l''' v4l video driver<br />
*'''xf86-video-vesa''' vesa video driver<br />
*'''xf86-video-vga''' VGA 16 color video driver<br />
*'''xf86-video-via''' via video driver<br />
*'''xf86-video-vmware''' vmware video driver<br />
*'''xf86-video-voodoo''' voodoo video driver<br />
<br />
* 说明:'''vesa'''驱动是最原汁原味的,适用于大部分的显卡。如果实在无法找到合适的显卡驱动,就选用vesa。(这是原话,好像夸张了点!If you cannot find a suitable driver for your video chipset, vesa '''should''' work.)<br />
<br />
用pacman来安装适合你显卡的驱动。例如:<br />
pacman -S xf86-video-savage<br />
(给Savage显卡的驱动。)<br />
<br />
* 如果实在不确定需要安装那个显卡驱动,可以安装所有显卡驱动包, 输入下面命令:<br />
pacman -S xorg-video-drivers<br />
<br />
*如果显卡是nVIDIA 或者ATI的,并'''想安装nVIDIA或者ATI官方提供的显卡驱动,请看下面。'''<br />
-----<br />
<br />
====nVIDIA图形显示卡====<br />
nVIDIA显示卡的驱动程序被许多人认为是非常好的质量,而且带有高级3D性能。<br />
<br />
在设置您的你nVIDIA显卡之前您先要选择您要使用的驱动程序。Arch现在有3种不一样的nVIDIA驱动程序,各自支持不同型号的显卡:<br />
<br />
'''1. nvidia-96xx''' ''直到Ge Force 4的较新显卡''<br />
<br />
'''2. nvidia-173xx''' ''Geforce FX系列显卡''<br />
<br />
'''3. nvidia''' ''在GF FX之后的最新GPU''<br />
<br />
{{Box Note| 一些特别老如TNT和TNT2之类的显卡所需的Nvidia-71xx系列闭源驱动,由于无法在Arch所用的新版Xorg下正常运行,并且nvidia也已不再继续支持它们,因此已被删除。你可以改用xf86-video-nv或者xf86-video-vesa驱动。}}<br />
<br />
到nVIDIA主页,看哪个适合你电脑.区别只是安装,配置过程是一样的.<br />
<br />
''根据你的显卡'',选择合适的nVIDIA驱动安装,比如: <br />
pacman -S nvidia-96xx<br />
<br />
nVIDIA软件包有个工具能自动升级你已有的nVIDIA驱动的配置文件/etc/X11/xorg.conf,输入下列命令即可实现:<br />
nvidia-xconfig<br />
<br />
它也有一些选项,用于更深入和具体地配置xorg.conf文件的内容和选项,例如:<br />
<br />
<br />
nvidia-xconfig --composite --add-argb-glx-visuals<br />
<br />
更详细的信息,请参考:nvidia-xconfig(1).<br />
<br />
一些有用的妙法可用在“device“部分(你要清楚它们不一定都能对你的系统有用):<br />
Option "RenderAccel" "true"<br />
Option "NoLogo" "true"<br />
Option "AGPFastWrite" "true"<br />
Option "EnablePageFlip" "true"<br />
将所有的DRI注释掉:<br />
# Load "dri"<br />
<br />
多检查几次你的/etc/X11/xorg.conf以确定你的默认的depth(色深),horizontal sync(水平同步),垂直刷新率,以及分辨率是可以接受的。<br />
<br />
使用<code>/sbin/depmod</code>命令来更新内核模块依赖:<br />
depmod -a<br />
(也许需要重启。)<br />
{{Tip|nvidia配置的高级的说明参考文章[[NVIDIA]] 。}}<br />
<br />
现在你可以跳到'''[[#三、配置X:创建并修改/etc/X11/xorg.conf|配置X]]'''来进一步熟悉,或者跳到'''[[#3、测试 X|测试 X]]'''继续安装过程。<br />
<br />
====ATI图形显示卡====<br />
ATI用户的驱动可以有几种选择。<br />
* '''xf86-video-ati'''软件包提供的开源'''''radeon'''''驱动。<br />
** 原创的、完全支持Radeon芯片组到X1950(最新的R500芯片组)的逆向工程开源驱动。对9200系列以前的显卡完全支持,可以稳定的提供全2D和3D加速。从9500到X1950完全支持2D加速特性,良好的3D加速,不过缺乏某些闭源驱动的特性(例如能源节省特性仍处于测试阶段)。xf86-video-ati支持从HD2xxx (R6xx)到最新的显卡,不过目前仅提供2D支持。<br />
* '''xf86-video-radeonhd'''软件包提供了开源的'''''radeonhd'''''驱动。<br />
** 此驱动支持ATI R500(Radeon X1000系列)以及更新的芯片组。该驱动由AMD提供文档,Novell为之开发。它支持RandR 1.2,目前的开发工作非常活跃。因此所支持的不同系列显卡的功能可以不一致。(有些用户反映它性能优异,而有些则说它很糟)。它还支持带音频的HDMI。<br />
* AUR中的Catalyst软件包提供了闭源'''''fglrx'''''驱动。稍后将介绍闭源驱动。<br />
开源驱动通常可以满足大部分需求而且较少出问题。<br />
<br />
安装'''''radeon'''''ATI驱动:<br />
# pacman -S xf86-video-ati libgl ati-dri<br />
安装'''''radeonhd'''''ATI驱动:<br />
# pacman -S xf86-video-radeonhd libgl ati-dri<br />
<br />
Arch的<code>extra</code>官方仓库曾经提供过闭源ATI驱动'''Catalyst'''的预编译包,不过在2009年3月以后,由于对闭源驱动的质量和开发进度不满意,官方取消了对它的支持。目前catalyst驱动可以在[http://aur.archlinux.org/packages.php?ID=22899 AUR]中找到。Catalyst驱动的安装信息可以在[[ATI#Proprietary_ATI_Catalyst_driver|这里]]找到。<br />
<br />
{{Warning| 闭源ATI驱动仅支持R600和更新的显卡(即HD2xxx及以上系列),不支持旧系列(X1xxx系列及以下)。}}<br />
<br />
{{Tip|ATI配置的高级指引可以参看[[ATI | ATI wiki 文章]]。}}<br />
<br />
====3、安装输入设备驱动软件包====<br />
最新的X需要你为包括键盘和鼠标在内的输入设备安装驱动。查看可用输入设备驱动的完整列表:<br />
# pacman -Ss xf86-input | less<br />
<br />
对大部分用户,xf86-input-keyboard和xf86-input-mouse应该可以满足基本配置。使用pacman来为你的输入设备安装需要的驱动,例如:<br />
# pacman -S xf86-input-keyboard<br />
===三、配置X:创建并修改/etc/X11/xorg.conf===<br />
====xorg.conf文件====<br />
/etc/X11/xorg.conf 是你的 X-Window-System 的主要配置文件,你的 GUI('''G'''raphical '''U'''ser '''I'''nterface)的基础,它是一个普通的文本文件,里面由 “section” 和 “subsection” 来安排。重要的 section 有 ''Files, InputDevice, Module, Monitor, Modes, Screen, Device'' 和 ''ServerLayout''。各个section安排的前后次序没有关系,对同一种类型的设备也可以有多个section,比如你可能有多个显示器,或者你的本本既有鼠标又有触摸板。<br />
------<br />
从X11R7.2版开始Xserver引入了自动配置特性。在大多情况下,即使没有xorg.conf文件它也能很好地运作。如果''自动检测功能工作正常'',而且你又不需要开启如 aiglx、compositing 等功能的话,你甚至不需要创建这个配置文件。<br />
<br />
====1、创建 /etc/X11/xorg.conf====<br />
<br />
高级用户可以手动创建他们的xorg.conf文件。一般用户可以使用程序<code>/usr/bin/Xorg</code>附加参数-configure来生成一个基本的配置文件;以root身份输入下面命令:<br />
# Xorg -configure<br />
这里生成的文件是/root/xorg.conf.new <br />
<br />
把这文件复制到 <code>/etc/X11/</code>:<br />
# cp /root/xorg.xonf.new /etc/X11/xorg.conf<br />
<br />
====更多的创建/etc/X11/xorg.conf的办法====<br />
* 说明:如果你的电脑已经有一个配置好的xorg.conf文件,不管这个文件是在什么别的发行版下生成的,只要Xorg的版本一致,就可以把该文件复制到你的Arch系统的<code>/etc/X11/</code>目录下。<br />
* 可以使用程序<code>/usr/bin/hwd</code>生成xorg.conf。首先要安装这程序:<br />
# pacman -S hwd<br />
然后输入下面命令:<br />
# hwd -xa<br />
{{Box Note| 目前,hwd在生成的xorg.conf有一行失效。 使用完这程序后,需要手动删除或者是注释掉 Section &quot;Files&quot;下的RgbPath那一行。via nano /etc/X11/xorg.conf or your equivalent, as root/sudo.}}<br />
<br />
* 使用<code>/usr/bin/xorgcfg</code> 脚本生成xorg.conf:<br />
# xorgcfg <br />
* 使用<code>/usr/bin/xorgconfig</code>生成xorg.conf,这个程序以互动方式来创建该文件,输入下面命令运行:<br />
# xorgconfig<br />
<br />
====2、Input设备热插拔问题:请在测试X前阅读====<br />
<br />
xorg 1.5.x版本里已经开启热插拔Input设备。<br />
{{Box Note | 当热插拔开启后, X将清空xorg.conf里所有使用the kbd and mouse 驱动建立的设备。这将导致X被冻结,使得鼠标和键盘失去响应。下面是解决办法。'''方法只能二选一'''}}<br />
<br />
有两个办法可以修复这一问题:<br />
<br />
1) '''配置 input设备热插拔''':安装驱动 xf86-input-evdev,同时配置HAL使其能使用kbd/mouse驱动。<br />
<br />
安装xf86-input-evdev:<br />
# pacman -S xf86-input-evdev<br />
在X.org相关进程启动前,启动守护进程hal:<br />
# /etc/rc.d/hal start<br />
把hal加入/etc/rc.conf里的DAEMONS列表里,这样每次电脑启动,都会自动开启hal。详情请见[[Xorg input hotplugging]] 。<br />
<br />
说明: 开启hal必须首先有一个dbus用户和用户组,以root身份输入下面命令创建用户和用户组<br />
<br />
usr/sbin/groupadd -g 81 dbus<br />
usr/sbin/useradd -c 'System message bus' -u 81 -g dbus -d '/' -s /bin/false dbus<br />
<br />
2) '''关闭input设备热插拔''':在/etc/X11/xorg.conf的ServerFlags段,加入参数''Option &quot;AutoAddDevices&quot; &quot;False&quot;'' 这将忽略hal的硬件检测,并使用你xorg.conf的keyboard/mouse配置。步骤如下<br />
# nano /etc/X11/xorg.conf<br />
加入下面三行:<br />
Section &quot;ServerFlags&quot;<br />
Option &quot;AutoAddDevices&quot; &quot;False&quot;<br />
EndSection<br />
<br />
====3、测试 X====<br />
<br />
在所生成的xorg文件路径''path/to/xorg.conf''前,加入参数''-config'' ,运行 '''X'''脚本,可以测试脚本配置是否正确。<br />
比如要测试你上面生成的xorg是否配置正确,输入:<br />
X -config /root/xorg.conf.new<br />
'''X''' 将启动,在屏幕中央会有一个白色的 X ,鼠标或是触摸板可以移动它,按 CTRL-Alt-Backspace 可以退出 '''X'''<br />
<br />
====对xorg.conf除错====<br />
如果 X 出现错误不能运行,你需要手动检查你的配置文件:<br />
<br />
nano /root/xorg.conf.new<br />
<br />
* 确定 Xorg -configure 命令正确的识别了你的显卡,比如:<br />
Section &quot;Device&quot;<br />
<br />
...<br />
<br />
Driver &quot;savage&quot;<br />
<br />
...<br />
<br />
EndSection<br />
<br />
* 确定里面的 Section "Monitor" 设置了水平同步率和垂直刷新率,如果没有要把它加上:<br />
Section &quot;Monitor&quot;<br />
Identifier &quot;Monitor0&quot;<br />
VendorName &quot;Monitor Vendor&quot;<br />
ModelName &quot;Monitor Model&quot;<br />
HorizSync 30.0 - 130.0 # Safe for LCD's<br />
VertRefresh 50.0 - 100.0 # Safe for LCD's and most CRT's.<br />
EndSection<br />
如果你不知道这些刷新率到底是多少,你就得查一下你显示器的说明书。<br />
<br />
* 在section "Screen"配置默认色深(color depth):<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Card0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
(此处色深被设定为真彩24色。)<br />
<br />
<br />
* 在subsection &quot;Display&quot; 加入你需要的Modes, at least under the Depth 24 header, e.g.:<br />
SubSection &quot;Display&quot;<br />
Viewport 0 0<br />
Depth 24<br />
Modes &quot;1024x768&quot; &quot;800x600&quot; &quot;640x480&quot;<br />
* Add the following section, if you wish to enable eye candy which requires the composite extension: <br />
Section &quot;Extensions&quot;<br />
Option &quot;Composite&quot; &quot;Enable&quot;<br />
EndSection<br />
<br />
* 上述调整完成后,再测试你的配置:<br />
X -config /root/xorg.conf.new<br />
<br />
* 在确认 '''X''' session开启,没有错误之后,把测试好的配置文件移到 /etc/X11下,作为系统的xorg.conf配置文件:<br />
mv /root/xorg.conf.new /etc/X11/xorg.conf<br />
详细的介绍可见[[Xorg]] <br />
<br />
接下来可以简单作测试 '''[[#Simple baseline X test|Simple baseline X test]]'''<br />
<br />
====调整键盘布局====<br />
=====如果开启了input热插拔=====<br />
# cp /usr/share/hal/fdi/policy/10osvendor/10-keymap.fdi /etc/hal/fdi/policy/<br />
# nano /etc/hal/fdi/policy/10-keymap.fdi<br />
Edit the &quot;input.xkb.layout&quot; key and possibly the &quot;input.xkb.variant&quot; key in this file.<br />
Restart hal:<br />
# /etc/rc.d/hal restart<br />
<br />
=====如果关闭了input热插拔=====<br />
Add option lines in the &quot;InputDevice&quot; section of the /etc/X11/xorg.conf file specifying the keyboard layout and variant:<br />
Option &quot;XkbLayout&quot; &quot;be&quot;<br />
Option &quot;XkbVariant&quot; &quot;&quot;<br />
<br />
详情请见 [[Xorg input hotplugging]]。<br />
<br />
===简单的命令行界面X测试(如果需要)===<br />
<br />
在安装了xorg、合适的显卡驱动、创建了一个/etc/X11/xorg.conf文件之后,如果想在安装完整桌面环境之前,快速测试下你的配置,使用'''xterm'''可以实现! <br />
Xterm是个简单的终端模拟程序,作为base xorg软件包的一部分会被自动安装,运行在'''X '''Server环境里。通过配置~/.xinitrc,Xterm可以让我们快速测试显卡驱动和配置文件/etc/X11/xorg.conf是否被正确配置。(另外,如果在没有/etc/X11/xorg.conf的情况下,你想测试下'''X''' 自动检测是否满意,也可以使用这个)<br />
<br />
==== 准备工作:配置~/.xinitrc====<br />
<br />
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. <br />
{{Box Note | '''[[.xinitrc]]''' is a so-called 'dot' (.) file. 在UNIX文件系统下,文件名以 (.)开头的,是 '隐藏文件',,使用普通的命令'ls' 将不显示这些文件,使用加了参数命令'''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 &quot;Run Control&quot;.}}<br />
<br />
'''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. (说明: ''如果没有文件~/.xinitrc, /etc/X11/xinit/xinitrc 将被作为替代来使用,这是个使用TWM and Xterm的默认配置。'')<br />
<br />
切换到'''''普通, 非root'''''用户:<br />
# su - ''yourusername''<br />
* /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.<br />
* 如果没有~/.xinitrc这个文件,到该目录下创建一个,或者从/etc/skel/复制一个同样的文件到你的home目录:: <br />
<br />
$ cp /etc/skel/[[.xinitrc]] ~/<br />
<br />
* 编辑文件: <br />
$ nano ~/.xinitrc<br />
加入这行&quot;<code>exec xterm</code>&quot;像下面这样:<br />
<br />
#!/bin/sh<br />
#<br />
# ~/.xinitrc<br />
#<br />
# Executed by startx (run your window manager from here)<br />
#<br />
exec xterm<br />
# exec wmaker<br />
# exec startkde<br />
# exec icewm<br />
# exec blackbox<br />
# exec fluxbox<br />
<br />
{{Box Note | ''请确保~/.xinitrc''里,以'''exec'''开头的,只有'''一行'''的注释被去掉。}}<br />
<br />
====开始执行测试====<br />
<br />
* 以普通用户身份输入下面命令,开启'''X''',开始测试你的配置:<br />
<br />
$ startx<br />
或者是这命令<br />
$ xinit<br />
<br />
此时会打开一个'''xterm''' session,你可以在这里测试your keyboard and its layout<br />
<br />
* 按Ctrl+Alt+Backspace,或者输入"exit"可以退出'''X''' Server。<br />
* 如果开启'''X'''出现问题,在终端,查看日志文件/var/log/Xorg.0.log的错误信息。<br />
<br />
更多的Xorg configuration介绍可见[[Xorg]] .<br />
<br />
==第四部分:安装并配置桌面环境==<br />
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 icons, applets, windows, toolbars, folders, wallpapers, 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.<br />
<br />
* 如果你需要一个完整功能,类似于Windows和Mac OSX, 可以选择安装'''[[#KDE|KDE]]''' <br />
* If you want something slightly more minimalist, which follows the K.I.S.S. principle more closely, '''[[#GNOME|GNOME]]''' is a good choice<br />
* '''[[#Xfce|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.<br />
<br />
如果你的机器较老,或者是希望使用一个更轻量、更少GUI要求,可以选择只安装 '''Window Manager''', 或者 WM. A WM controls the placement and appearance of application windows in conjunction with the X Window System but does NOT provide such additions as panels, applets, icons, etc.<br />
* Lightweight floating WM's include: [[#Openbox|'''Openbox''']], [[#Fluxbox|'''Fluxbox''']], [[#fvwm2|'''fvwm2''']], '''Windowmaker, Pekwm, and TWM'''.<br />
* If you need something completely different, try '''Awesome, ion, wmii, dwm, or xmonad'''。<br />
<br />
===一、安装字体===<br />
在安装桌面环境/窗口管理器'''之前''',也许你会先安装些美观的字体。Dejavu和bitstream-vera都是不错的字体集。而对于网页,你还可能需要Microsoft字体。如下安装:<br />
pacman -S ttf-ms-fonts ttf-dejavu ttf-bitstream-vera<br />
对于中文字体,开源的文泉驿正黑矢量字体是不错的选择,它还内嵌了9pt-12pt的点阵宋体:<br />
pacman -S wqy-zenhei<br />
<br />
===二、选择默认启动的桌面环境 ~/.xinitrc===<br />
<br />
以普通用户身份编辑/home/username/.xinitrc,加入你要用的DE. This will allow you to use '''startx/xinit''' from the shell, in the future, to open your DE/WM of choice:<br />
<br />
nano ~/.xinitrc<br />
<br />
反注释或者加入相应的桌面环境/窗口管理器的''''exec''' ..'内容行。例如:使用Xfce4桌面环境:<br />
<br />
exec startxfce4 <br />
<br />
记住在~/.xinitrc中只反注释掉一行'''exec'''。这条命令将一直运行到你注销桌面登录。一般的,shell将等到kde完成加载之后,在运行下一条命令。在命令前加 &quot;exec&quot; ,是告诉the shell 这条命令最后执行, 这样shell就不用等待其他命令了,直接载入桌面。<br />
接下来安装你所选的桌面环境/窗口管理器。<br />
<br />
===三、选择安装一个桌面环境===<br />
====GNOME====<br />
=====关于GNOME=====<br />
GNOME是'''G'''NU '''N'''etwork '''O'''bject '''M'''odel '''E'''nvironment的缩写。GNOME项目有两大部分:GNOME桌面环境 ── 既直观又迷人的最终用户桌面,以及GNOME开发平台 ── 一个用来创建可与桌面集成的应用程序的庞大的框架。<br />
<br />
=====安装=====<br />
安装基本的GNOME环境:<br />
pacman -S gnome<br />
<br />
安装额外的GNOME环境:<br />
pacman -S gnome-extra<br />
然后选择提示的所有软件包。 <br />
<br />
=====对GNOME有用的守护进程=====<br />
如之前所述,守护进程(daemon)是运行在后台的程序,它等待事件发生并提供相应的服务。其中'''Hal'''守护进程可以自动挂载磁盘、光驱和U盘给GUI使用。'''Fam'''守护进程可以在GUI中实时反映文件的变动,如最近安装的程序、文件系统的变化等。'''Hal'''和'''fam'''使得GNOME的使用更为方便。Hal和fam软件包在安装GNOME时已一同安装,建议安装社区库的gamin来替代fam。<br />
<br />
{{Box Note|注意,fam是一个比较老的包,很容易造成较大的日志文件。}}<br />
<br />
{{Box Note|在当前的gnome环境中,你可以安装gamin来实现fam的功能。这时,你可以不用在DAEMONS中添加fam启动项了(不需要加入gamin,它会自动被启用)。}}<br />
<br />
* 你需要启动'''hal'''守护进程。<br />
<br />
启动hal:<br />
/etc/rc.d/hal start<br />
<br />
如果您想使用fam,同样需要启动:<br />
/etc/rc.d/fam start<br />
<br />
将hal加入到/etc/rc.conf的DAEMONS中以使得它们随系统启动而自动运行:<br />
nano /etc/rc.conf<br />
<br />
DAEMONS=(syslog-ng network crond alsa '''hal''')<br />
<br />
{{Box Note|注意,如果使用fam,那么把fam加入到hal后面。}}<br />
<br />
* 或许你还会希望安装一个图形界面的登录管理器。在GNOME下'''gdm'''守护进程是个不错的选择。<br />
以root身份运行:<br />
pacman -S gdm<br />
<br />
让gdm启用有两种方式,一种是直接加入到DAEMONS的末尾,通过rc.conf来启动;另外一种方式是用过配置inittab来加载gdm。<br />
<br />
* 通过inittab来加载gdm也很方便(推荐使用这种方式):<br />
nano /etc/inittab<br />
<br />
修改默认启动方式:<br />
<br />
将<br />
id:3:initdefault:<br />
改为<br />
id:5:initdefault:<br />
<br />
然后取消下面代码的注释:<br />
x:5:respawn:/usr/sbin/gdm -nodaemon<br />
<br />
{{Box Note|实际上,可以看到gdm/xdm/kdm/slim等,使用哪个取决于你的喜好,启用喜欢的那个,将其他的注释掉。当然,本章介绍的是gnome,所以推荐gdm,下章中将推荐kdm:)}}<br />
<br />
<br />
* 通过DAEMONS方式启动gdm也很方便:<br />
nano /etc/rc.conf<br />
<br />
DAEMONS=(syslog-ng network crond alsa hal gdm)<br />
<br />
{{Box Note|这是类似debian/ubuntu的做法,这种方式有一点不好:不管什么时候(非修复模式),系统总是会尝试进入gdm引导的X方式下。对于X已经配置得很好,并且不使用纯控制台的人可以使用这种方式。但是选择这种方式的话你将不能通过内核参数3或者5来区分进入纯字符控制台还是X11的gdm登录窗口。}}<br />
<br />
* 开启Gnome<br />
以普通用户身份启动X:<br />
startx<br />
或者这条命令也行:<br />
$ xinit<br />
如果你的 ~/.xinitrc一直没配置,那你将可以一直使用下面这条命令来开启Gnome:<br />
$ xinit /usr/bin/gnome-session<br />
<br />
关于安装和配置GNOME的高级指引可以参见[[GNOME (简体中文)|GNOME]]一文。接下来你可以浏览'''[[#优化和收尾|优化和收尾]]'''。或许你还会对[[ArchTips(简体中文)|Arch安装完后的小技巧]]一文感兴趣。<br />
<br />
=====美化=====<br />
如果不满足于缺省的GNOME主题和图标,那么可以安装一个不错的主题,比如murrine:<br />
pacman -S gtk-engine-murrine<br />
接着在System->Preferences->Theme里选择这个主题。<br />
<br />
Arch Linux也做了些不错的主题,根据你自己的审美观,选择满意的安装吧:<br />
<br />
# pacman -S gtk-engines gtk2-themes-collection gtk-aurora-engine gtk-candido-engine gtk-rezlooks-engine<br />
<br />
你还可以在[http://www.gnome-look.org Gnome Look]里找到更多的主题、图标和壁纸。<br />
<br />
====KDE====<br />
=====关于KDE=====<br />
KDE桌面环境('''K''' '''D'''esktop '''E'''nvironment)的缩写。 KDE是一种著名的运行于GNU/Linux 、 <code>UNIX</code> 工作站等的强大、自由图形工作环境。她拥有对系统内部各功能的强大整合能力、跨平台能力、易用性、优异的初始界面.<br />
<br />
=====安装=====<br />
Arch提供多个版本的kde: '''kde、kdebase 和 KDEmod'''. 选'''一个'''就行了,然后 '''[[#有用的KDE守护进程|有用的KDE守护进程]]''': <br />
<br />
'''1.)''' '''kde'''是完整的kde软件包,大概 ~300MB,适合主要使用kde软件的系统.<br />
pacman -S kde<br />
'''2.)''' '''kdebase'''是kde的基础软件包(里面没有kdm),大概 ~80MB,适合于只想把kde作为基础系统.<br />
pacman -S kdebase<br />
'''3.)''' '''KDEmod''' 是 Arch Linux独有的、社区驱动的项目,目标是把kde更加细致的模块化和达到其极致的运行效率。KDEmod项目的网站在http://chakra-project.org/ 。<br />
<br />
=====有用的KDE守护进程=====<br />
<br />
KDE 需要'''hal''' ('''H'''ardware '''A'''bstraction '''L'''ayer) 作为守护进程(daemons). '''kdm''' ( '''K''' '''D'''isplay '''M'''anager), 提供一个 '''图形化登录界面'''.<br />
{{Box Note|hal守护进程将自动开启dbus守护进程。kde4里已经不需要fam。kdm现在在kdebase-workstation这个包里,如果只安装kdebase,需要再安装此包才能使用kdm}}<br />
<br />
The hal daemon, among other things, will automate the mounting of disks, optical drives, and USB drives/thumbdrives for use in the GUI. <br />
<br />
-----<br />
启动hal进程:<br />
<br />
/etc/rc.d/hal start<br />
<br />
编辑/etc/rc.conf的 DAEMONS部分:<br />
nano /etc/rc.conf<br />
把 '''hal''' 加入 DAEMONS 部分,以便他们在系统启动时加载. 如果想要kde的图形化登录界面,把 '''kdm'''也加进去(或者不加,在/etc/inittab里面设置): <br />
DAEMONS=(syslog-ng network crond alsa '''hal kdm''')<br />
{{Box Note|如果你安装的是KDEmod3,则使用kdm3替换kdm}}<br />
<br />
*This method will start the system at runlevel 3, (/etc/inittab default, multiuser mode), and then start KDM as a daemon. <br />
<br />
*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 [[Adding a login manager (KDM, GDM, or XDM) to automatically boot on startup]] for more.<br />
<br />
*If you prefer to log into the '''console''' at runlevel 3, 手动启动 X, 则不加入kdm, 或者是加个前缀( ! )禁止它。<br />
<br />
* 现在可以试试效果了,用普通用户身份开启X Server:<br />
startx<br />
或者<br />
$ xinit<br />
更多关于安装和配置KDE的文章,请看[[KDE]].<br />
<br />
到此步,可以看 '''[[#优化和收尾]]'''这部分了. You may also be interested in the [[Post Installation Tips]] wiki article.<br />
<br />
====Xfce====<br />
=====关于Xfce=====<br />
和GNMOE、KDE一样,Xfce是一个桌面环境,其目标是快捷、轻量,同时又美观而易用。它还提供了一整套的应用程序如根窗口应用(root window app)、 窗口管理器、文件管理器、面板等等。 Xfce是用GTK2 toolkit编写的(类似GNOME),和其它大型桌面环境一样,它也有自己的开发环境(库文件、守护进程等)。但不象GNOME或者KDE,Xfce是轻量化的,其设计更接近于CDE而不是Windows或者Mac。它的开发周期比较慢,但是十分稳定、速度很快。在老硬件上Xfce可以运行得很好,而在新机器上更是运行如飞。<br />
<br />
=====安装=====<br />
安装完整的xfce环境以及主题和extras:<br />
pacman -S xfce4 xfce4-goodies gtk2-themes-collection <br />
<br />
如果你使用KDM或者GDM的话会显示一个xfce会话。另一种启动方式是:<br />
startxfce4<br />
<br />
关于安装和配置xfce的高级指引可以参见[[Xfce (简体中文)|Xfce]]一文。<br />
<br />
恭喜!欢迎来到Arch Linux系统的Xfce桌面环境!接下来你可以浏览'''[[#优化和收尾|优化和收尾]]''',或者下面的其它内容。或许你还会对[[ArchTips(简体中文)|Arch安装完后的小技巧]]一文感兴趣。<br />
<br />
====*box====<br />
=====Fluxbox=====<br />
Fluxbox © is yet another windowmanager for X.<br />
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).<br />
<br />
Install Fluxbox using <br />
pacman -S fluxbox fluxconf<br />
<br />
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:<br />
exec startfluxbox <br />
<br />
More information is available in the [[Fluxbox]] article.<br />
<br />
=====Openbox=====<br />
Openbox是一个标准的”温顺的“,快速的,轻量级的,可扩展的窗口管理器。<br />
<br />
Openbox与你的应用程序一起工作工作,并使你的的桌面便于管理。这是因为它的开发方式和通常的窗口管理器的方式是相悖的。 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.<br />
<br />
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. <br />
<br />
安装openbox<br />
pacman -S openbox obconf obmenu<br />
<br />
一旦openbox安装好,你将得到一个消息to move menu.xml & rc.xml to ~/.config/openbox/ in your home directory:<br />
<br />
mkdir -p ~/.config/openbox/<br />
cp /etc/xdg/openbox/rc.xml ~/.config/openbox/<br />
cp /etc/xdg/openbox/menu.xml ~/.config/openbox/<br />
<br />
In the file "rc.xml" you can change various settings for Openbox (or you can use OBconf). In "menu.xml" you can change your right-click menu.<br />
<br />
To be able to log into openbox you can either go via graphical login using KDM/GDM or startx, in which case you will need to edit your ~/.xinitrc (as user) and add the following:<br />
<br />
exec openbox<br />
<br />
For KDM there is nothing left to do; openbox is listed in the sessions menu in KDM.<br />
<br />
Useful programs for openbox are:<br />
* PyPanel or LXpanel if you want a panel<br />
* feh if you want to set the background<br />
* ROX if you want a simple file manager and desktop icons<br />
<br />
More information is available in the [[Openbox]] article.<br />
<br />
====fvwm2====<br />
FVWM是一个非常强大的面向X桌面系统的”ICCCM-compliant的多虚拟桌面的窗口管理器“(ICCCM-compliant multiple virtual desktop window manager)。开发活动很活跃,支持也是极好的。 <br />
<br />
输入下面命令安装 fvwm2 <br />
pacman -S fvwm <br />
<br />
fvwm会自动添加进 kdm/gdm会话列表. 如果没有的话,添加 <br />
exec fvwm <br />
<br />
到你的用户文件 .xinitrc.<br />
<br />
注意:这个稳定版已经有些年头了,如果需要最新的fvwm版本,可以安装unstable repo里的fvwm-devel 包.<br />
<br />
===四、优化和收尾===<br />
====HAL====<br />
如果你已经安装了一个桌面环境,但是又觉得用起来不是很方便,那么现在就是个安装HAL的好时机了。HAL使得你的手机、iPod、移动硬盘等等可以即插即用。它会挂载设备并在你的桌面或/和'My Computer'目录中创建相应的图标,使得你可以在插入设备后就能访问到它,无需每次都对每个新设备来手动配置/etc/fstab文件或者udev规则。<br />
<br />
KDE、GNOME和XFCE都使用到HAL。<br />
<br />
安装过程描述可以在[[HAL (简体中文)|HAL]]一文中找到。其它一些信息可以在[http://en.wikipedia.org/wiki/HAL_(software) Wikipedia]上找到。<br />
<br />
====启动时让守护进程在后台执行====<br />
<br />
要加速系统的启动过程,可以在/etc/rc.conf中给守护进程前加上'@'符号使之在后台执行,例如:<br />
<br />
DAEMONS=(@syslog-ng @network crond @alsa @hal @fam @kdm)<br />
这使得守护进程在后台被加载,无需等待它们加载结束。<br />
<br />
在守护进程前加上(!)可以禁止系统启动时加载它,例如:<br />
<br />
DAEMONS=(@syslog-ng @network !crond @alsa @hal @fam @kdm)<br />
<br />
另一种方式是直接将不需要的守护进程删除。<br />
<br />
====美化LCD下的字体====<br />
See [[Fonts]]<br />
<br />
====让所有的鼠标按键生效====<br />
看这个 [[Get All Mouse Buttons Working]]<br />
<br />
====笔记本电脑可能遇到的问题====<br />
(1) 触摸板问题<br />
参看http://wiki.archlinux.org/index.php/Touchpad_Synaptics<br />
<br />
(2) 摄像头问题<br />
参看http://wiki.archlinux.org/index.php/Webcam_Setup<br />
<br />
(3) 无线上网问题<br />
参看http://wiki.archlinux.org/index.php/Wireless<br />
<br />
(4) 快捷键问题<br />
参看http://wiki.archlinux.org/index.php/Extra_Keyboard_Keys<br />
<br />
====配置CPU频率====<br />
现在的处理器能够降低频率和电压,以降温和降低电源消耗。降温能使系统更稳定,笔记本用户肯定是想这样做的,但是即使是台式机也会对系统有利。<br />
<br />
安装CPU频率工具用:<br />
pacman -S cpufrequtils<br />
<br />
把CPU频率在/etc/rc.conf里加入到启动进程(daemons)中。编辑配置文件/etc/conf.d/cpufreq改<br />
governor="conservative"<br />
<br />
这使得在需要的情况下可以动态地增减CPU频率(这是对于台式机来说也是一个安全的选择)。改变最小频率(min_freq)和最大频率(max_freq)以匹配你的CPU的情况。如果你不知道频率,在载入频率测量模块后运行“cpufreq-info”。你也可以将min_freq和max_freq注释掉或删除,这样就能自动进行。加入频率测量模块到/etc/rc.conf的模块行。<br />
几乎所有的笔记本和台式机都可以简单地使用''acpi-cpufreq''驱动,但是也有其它的选择,如:''p4-clockmod, powernow-k6, powernow-k7, powernow-k8, and speedstep-centrino''。 <br />
<br />
通过下面这个命令载入这个模块:<br />
modprobe <modulname> <br />
通过下面命令行开启cpufreq:<br />
/etc/rc.d/cpufreq start<br />
更多细节,请看 [[Cpufrequtils]]<br />
<br />
==第五部分:常用的应用程序==<br />
更多信息,请看[[ArchLinux常用的应用程序(简体中文)]].<br />
<br />
==附录==<br />
新手指南附录[[ArchLinux新手指南附录 (简体中文)]]<br />
<br />
想得到更多的信息和支持,你可以去[http://www.archlinux.org/ homepage], [[Special:Search|search the wiki]],[http://bbs.archlinux.org/ forums],[[ArchChannel|IRC channel]],以及[http://www.archlinux.org/mailman/listinfo/ mailing lists]。<br />
=====问题答疑=====<br />
See [[Arch FAQs for newbies]]<br />
还有这里[http://bbs.archlinux.org/viewtopic.php?t=29055 Arch forum thread] 也是面向初学者的。<br />
<br />
=====术语=====<br />
更多信息关于Arch术语,查阅[[Arch Terminology/Jargon for newbies|this article]].<br />
<br />
=====接下来还有什么?=====<br />
<br />
你还可以阅读:<br />
<br />
[[Arch 官方安装指南 (简体中文)|Arch 官方安装指南]]<br />
<br />
[[Arch AUR (简体中文)|ArchLinux社区用户软件仓库 (AUR)]]<br />
<br />
[[Get All Mouse Buttons Working]]<br />
<br />
[[改善Pacman性能 (简体中文)|改善Pacman性能]]<br />
<br />
[[Kernel Compilation]]<br />
<br />
[[Pm-utils 电源管理 (简体中文)|Pm-utils 电源管理]]<br />
<br />
[[CPU 频率调节 (简体中文)|CPU 频率调节]]<br />
<br />
[[:Category:美化|美化]]</div>
Flydragon
https://wiki.archlinux.org/index.php?title=ArchLinux_%E6%96%B0%E6%89%8B%E6%8C%87%E5%8D%97_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=90850
ArchLinux 新手指南 (简体中文)
2010-01-04T09:43:51Z
<p>Flydragon: /* 模拟信号调制解调器 */</p>
<hr />
<div>[[Category:简体中文]]<br />
[[Category:获取并安装Arch (简体中文)]]<br />
[[Category:关于Arch_(简体中文)]]<br />
[[Category:HOWTOs (简体中文)]]<br />
<br />
{{Article summary start}}<br />
{{Article summary text|本文针对新手,提供了极其详尽的Archlinux的安装过程向导,和相关的简要说明。}}<br />
{{Article summary heading|已有的语言版本}}<br />
{{Article summary heading|Available Languages}}<br />
{{i18n_entry|Česky|Průvodce začátečníka (Česky)}}<br />
{{i18n_entry|简体中文|Arch 新手安装指南 (简体中文)}}<br />
{{i18n_entry|正體中文|Beginner's Guide 新手指南}}<br />
{{i18n_entry|Dansk|Dansk_Begynderguide}}<br />
{{i18n_entry|Deutsch|Beginners Guide (Deutsch)}}<br />
{{i18n_entry|English|Beginners Guide}}<br />
{{i18n_entry|Español|Guía para Principiantes (Español)}}<br />
{{i18n_entry|Français|Manuel_du_Débutant_(Français)}}<br />
{{i18n_entry|Italiano|Beginners Guide (Italiano)}}<br />
{{i18n_entry|Indonesia|Beginners_Guide_(Indonesia)}}<br />
{{i18n_entry|Lietuviškai|Pradedančiųjų gidas (Lietuviškai)}}<br />
{{i18n_entry|Nederlands|Beginners_Guide_(Nederlands)}}<br />
{{i18n_entry|Português Brasil|Guia do Iniciante(Português do Brasil)}}<br />
{{i18n_entry|Português|Guia para Principiantes(Português)}}<br />
{{i18n_entry|Русский|Руководство_для_новичков}}<br />
{{i18n_entry|Türkçe|Başlangıç Rehberi (Türkçe)}}<br />
{{i18n_entry|हिन्दी|नौसिखिया गाइड(हिन्दी)}}<br />
{{Article summary heading|相关文章}}<br />
{{Article summary wiki|Arch 官方安装指南 (简体中文)}}(更通用的安装方式)<br />
{{Article summary wiki|ArchLinux新手指南附录 (简体中文)}}<br />
{{Article summary wiki|ArchLinux安装完后的小技巧 (简体中文)}}<br />
{{Article summary wiki|ArchLinux常用的应用程序(简体中文)}}<br />
{{Article summary wiki|Work and Play with Arch (Chinese)}}<br />
{{Article summary end}}<br />
<br />
==前言==<br />
<br />
=====所有你一直想知道的关于安装Arch的事=====<br />
这篇文档将会指导你安装和配置[[ArchLinux (简体中文)|Arch Linux]] ── 一个简洁、轻量级的GNU/Linux发行版,一个类<code>UNIX</code>的操作系统。本文是面向Arch新用户,因此尽力为所有人提供强大的参考资料和信息。本指南讲述该如何获得一个基本配置好的Arch Linux系统(拥有一个图形桌面环境),但显然是不可能涵盖(甚至是预见)所有的信息。因此本指南会专注于某些关键性的步骤,想要进一步深入了解你可以查看[[Main Page (简体中文)|Arch Linux Wiki]]或者[http://bbs.archlinux.org/ Arch Linux论坛]。同时有兴趣的话你还可以了解一下[[Arch 之道 (简体中文)|Arch 之道]],它概述了Arch Linux发行版背后的哲学思想。<br />
<br />
'''Arch Linux的相关特性:'''<br />
* '''[[The Arch Way | Simple]]''' design and philosophy<br />
* Community distro targeted at competent GNU/Linux users<br />
* All packages compiled for '''i686/x86-64'''<br />
* 从底层开始就可以让用户高度定制<br />
* '''[[The Arch boot process | BSD-style init]]''' scripts, featuring one centralized configuration file<br />
* '''滚动升级''' <br />
* '''[[Pacman]]''' package manager is fast, written in '''C''', lightweight and agile, with a very modest memory footprint<br />
* '''[[ABS]]''': The '''A'''rch '''B'''uild '''S'''ystem, a ports-like package building system makes it simple to create your own easily installable Arch packages from source, to use and/or share with the community on the [[AUR]]<br />
* '''[[AUR]]''': The Arch User Repository, offering many thousands of build scripts for Arch user-provided software packages<br />
<br />
=====别怕(DON'T PANIC)!=====<br />
要知道Arch Linux的安装方法和过程也许会和你所使用过的其它GNU/Linux发行版非常不同,特别你是个新手的话将更能体会到这点。通常,GNU/Linux发行版会在一张或者一堆CD(甚至是DVD)上捆绑了大量的软件,包含了缺省桌面环境、缺省的应用程序和设置、硬件自动检测和图形化的安装程序,一切都是替你选择好了的。相反的,Arch Linux系统是让'''用户自己'''只是用一个bash shell和基本系统工具,从ncurses installer和基础系统上建造起来的。这就是[[Arch 之道 (简体中文)|Arch 之道]]。不象其它大型发行版,它没有强加于用户的缺省环境或者配置。你可以在命令行使用[[pacman (简体中文)|pacman]]通过互联网连接从Arch软件仓库安装软件包,直到你的系统配置成你希望的样子。这给予了用户最大的弹性、选择性和对系统资源的控制。因为是'''你'''建造了它,所以你肯定能了解系统里具体细节,知道底层都有些什么。<br />
<br />
Arch Linux系统是通过编辑文本文件进行配置的,没有提供图形界面的工具,所以需要对系统和linux相对熟悉。<br />
Arch Linux针对的是有能力的GNU/Linux用户以及希望花费时间学习系统知识的用户。 <br />
<br />
''Arch是一个可以被用户塑造的工具。''<br />
<br />
=====授权协议=====<br />
<br />
Arch Linux, pacman, documentation, and scripts are copyright<br />
©2002-2007 by Judd Vinet, ©2007-2008 by Aaron Griffin and are licensed under the GNU General Public License Version 2.<br />
<br />
=====[[Arch 之道 (简体中文)|Arch 之道]]=====<br />
<br />
''Arch的设计思想是"保持简洁"(keeping it simple)。'' <br />
<br />
这里的‘简洁’并不是单指‘简单’或者‘用户友好’,而是‘没有不必要的增加、修改或者复杂性’。简而言之,即优雅、极简之法。<br />
<br />
<br />
''"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 crap." -Aaron Griffin''<br />
<br />
<br />
''"The extraordinary part of [my method] lies in its simplicity..I have always believed that the simple way is the right way."'' - Bruce Lee<br />
“(我的方法中)最超凡的部分是它的简单性,我一直相信简单的就是对的。” 李小龙(Bruce Lee)<br />
<br />
Occam's razor: ''Entia non sunt multiplicanda praeter necessitatem'' or "Entities should not be multiplied unnecessarily." The term razor refers to the act of shaving away unnecessary assumptions and complications to get to the simplest explanation, method or theory.<br />
<br />
{{Box Note |'''仔细遵循本指南是成功安装一个配置正常的Arch Linux系统的基本要点,因此''请''认真仔细的阅读本文'''}}<br />
* 你也可以将本指南打印出来,作为一个较为有用的Arch Linux用户手册。<br />
*''如果你想在这个wiki里增加内容,请适当描述清楚“为什么会这样”以及“该怎么办”。最佳的文档应该能教会我们如何做和为什么这么做!''<br />
* Arch的wiki是项优秀的资源,可以[http://wiki.archlinux.org/index.php/Main_Page 第一时间]用来解决日常问题; 如果找不到答案也可以求助IRC和[http://bbs.archlinux.org/ 论坛]。<br />
----<br />
----<br />
欢迎使用Arch!现在,让我们开始吧。<br />
<br />
本文按照安装过程分四大部分:<br />
<br />
'''[[#第一部分:安装基本系统|第一部分:安装基本系统]]'''<br />
<br />
'''[[#第二部分:完成基本系统并升级|第二部分:完成基本系统并升级]]'''<br />
<br />
'''[[#第三部分:安装X并配置ALSA|第三部分:安装X并配置ALSA]]'''<br />
<br />
'''[[#第四部分:安装并配置桌面环境|第四部分:安装并配置桌面环境]]'''<br />
<br />
==第一部分:安装基本系统==<br />
===一、获取最新的系统安装包===<br />
<br />
你可以从[http://archlinux.org/download/ 这里]获取Arch最新的官方系统安装包。最新版本是2009.08<br />
<br />
*不论是Core还是Netinstall系统安装包,都只是包含了安装'''Arch Linux基本系统'''所需的软件包. ''注意,基本系统是不包含GUI图形界面的。它主要包含了GNU的系列工具(编译器、汇编程序、链接、库、脚本,还有其它的一些有用的工具),Linux的内核,还有一些额外的库和模块。<br />
*Core映像文件可以较方便的通过CD或者网络进行安装。<br />
*Netinstall映像文件较小巧,本身没有提供软件包,整个系统都是通过internet来获取的。<br />
*isolinux映像文件是给那些使用grub版本时发生问题的用户的。两者没有其它区别。<br />
*Arch64问答( http://wiki.archlinux.org/index.php/Arch64_问答_(简体中文) )可以帮助你在32位版本和64位版本之间作出选择。<br />
<br />
====CD 系统安装包====<br />
把下载的.iso映像文件刻录到CD上。开机时用CD启动,出现界面,跳到[[#二、启动Arch Linux系统安装程序| 二、启动Arch Linux系统安装程序]]<br />
{{Box Note| 通常为了刻录的稳定可靠(速率越低刻录质量越有保证),推荐刻录的最大速度不超过16倍速。有些用户推荐'''''速度为 4x 或者 2x.''''' 如果所刻录的CD有问题,可以尝试使用你系统所支持的最小速度方式刻录。 }}<br />
<br />
<br />
====USB安装方式====<br />
{{Warning|这样做会把USB盘里面原有的数据格式化。}}<br />
<br />
'''<code>UNIX</code> 方式:'''<br />
<br />
插入USB盘,找到其路径,用<code>/bin/dd</code>命令把.img映像文件写入USB(Linux下):<br />
<br />
dd if=archlinux-2009.08-''{core|netinstall}''-''{i686|x86_64}''.img of=/dev/sd''x''<br />
<br />
if= 后面是.img镜像文件的路径,of= 是你的USB路径. 要使用/dev/sd''x''而不是/dev/sd''x1''.(就是要使用整个分区而不是第一分区)<br />
<br />
'''检查镜像的完整性md5sum (可选):'''<br />
<br />
记下读入和写出的记录区数目,然后执行以下命令进行检查:<br />
dd if=/dev/sd''x'' count=''记录区数目'' status=noxfer | md5sum<br />
<br />
md5sum命令返回的值(这是你检查U盘上文件得到的)要与你下载的archlinux镜像文件的md5sum校验值相同;它们都应该和镜像站点的md5sum文件列表里相应的值相同。<br />
<br />
'''Windows方式:'''<br />
<br />
从https://launchpad.net/win32-image-writer/+download 下载Disk Imager。插入U盘,启动Disk Imager并选择映像文件,再选择U盘相应的磁盘驱动号,点击"write"即可。<br />
<br />
===二、启动Arch Linux系统安装程序===<br />
Usually, the first item is the preferred selection. However, choose Boot Archlive or Boot Archlive [legacy IDE] if you have trouble with libata/PATA, or have no SATA (Serial ATA) drives.<br />
<br />
Also, to change boot options, press '''e''' for editing the boot lines. Many users may wish to change the resolution of the framebuffer, for more readable console output. Append:<br />
插入刻录好的光盘CD或者USB盘,然后用它启动电脑。可能需要在BIOS里(通常是启动后在加电自检过程中按DEL、F1、F2、F11或者F12)改变一下启动顺序使得CD或者USB先被启动。<br />
<br />
{{Note|内存需求:<br />
* Core : 160 MB RAM x86_64/i686 (选择所有软件包,开启交换分区)<br />
* Netinstall : 160 MB RAM x86_64/i686 (选择所有软件包,开启交换分区)}}<br />
<br />
启动了Arch Linux光盘后,用上下箭头高亮菜单,按下回车键进行选择。<br />
<br />
通常,推荐选择第一项菜单。不过如果使用libata/PATA出现问题或者没有SATA (Serial ATA)驱动器,你也可以选择Boot Archlive或者Boot Archlive [legacy IDE] 。<br />
<br />
如果你需要改变启动参数,可以按‘e ’键来编辑启动行内容。 含多用户可能希望改变framebuffer分辨率以得到更好的终端显示。将<br />
vga=773<br />
加到kernel一行的后面,然后按<ENTER>,就可以得到1024x768的framebuffer。设置完毕后按'''b'''则使用相应的选择项进行启动。<br />
<br />
系统将会启动并提示登录,这时可以用'root'进行登录(不要加上单引号)。<br />
<br />
如果你的机器从live CD启动时发生错误或者一些其它'''硬件hardware'''错误,请参看[[Installation Troubleshooting]]。<br />
<br />
<br />
====登录并根据需要更换键盘映射表====<br />
如果你使用non-US键盘布局,可以用命令选择相应的键盘映射表。<br />
# km<br />
或者是是用loadkeys命令<br />
# loadkeys ''layout''<br />
(把''layout''替换成你需要的,比如 &quot;<code>fr</code>&quot; 或者 &quot;<code>be-latin1</code>&quot;)<br />
<br />
====边安装边查看安装指南====<br />
在刻录的livecd里面,已经包含了官方安装指南,在安装的时候可以边安装边查看,按组合键<ALT>+F2 切换到控制台vc/2(alt+f3,alt+f4……分别可以切换到对应的控制台vc/3,vc/4……以此类推),然后输入:<br />
<br />
# less /arch/docs/official_installation_guide_en<br />
<br />
按组合键<ALT>+F1回到控制台vc/1,继续安装系统。安装过程中可以随时切换回vc/2来查看安装指南。<br />
<code>less</code> 是个文本查看程序,位于<code>/usr/bin/less</code><br />
{{tip|请注意,官方指南仅涵盖基本系统的安装和配置过程。一旦安装完毕,强烈建议回到本wiki浏览更多安装后续已经相关问题。}}<br />
<br />
===三、开始安装===<br />
键入<br />
/arch/setup <br />
开始安装。<br />
<br />
====1、选择安装来源====<br />
接着会出现一个选择安装来源的提示。如果你用core ISO的话请选择CD,如果使用FTP ISO的话则选择FTP。<br />
* 如果选择 CORE installer,可以直接看下面的硬盘分区配置。<br />
* FTP/HTTP only: 选择这个需要预先加载网络驱动以便联网安装. 使用Udev来加载这些模块非常有效.<br />
按组合键ALT+F3切换到控制台vc/3,确认一下看其是否生效 invoking ifconfig -a . (Select OK to continue.) ——把后面的网络配置提前看<br />
<br />
====2、设置时间====<br />
有两个选择:<br />
* UTC - 如果使用unix系统包括Linux, Freebsd等, 建议使用UTC<br />
* local - 如果和Windows共享多引导系统, 建议使用local<br />
<br />
====3、硬盘分区配置====<br />
选择第一个菜单项"Prepare Hard Drive"。请注意,"Auto-Prepare"(自动分区)并不是最佳的选择,因为它只分配了最基本的三个区( /,/home,swap)<br />
在这里我们用手工进行硬盘分区。选择"2. Partition Hard Drives",接着选要分区的硬盘(比如:/dev/sdx),然后按你需要编辑分区表。<br />
<br />
''Arch Linux安装程序使用cfdisk公用程序来对硬盘进行分区。''<br />
<br />
''接下来,熟悉GNU/Linux的用户可以跳过这段内容直接到下面'''[[#选择软件包|选择软件包]]'''。''<br />
<br />
=====分区信息=====<br />
<br />
对磁盘进行分区是指在磁盘上定义若干区域(分区),每个都象是一个独立的磁盘,可以在其上创建(格式化)一个文件系统。 分区的类型分为主分区(Primary)、扩展分区(Extended)和逻辑分区(Logical)三类。 <br />
<br />
主分区可以被启动,一个物理磁盘最多能有4个主分区。要使用超过4个的话,只能使用一个包含了逻辑分区的扩展分区。<br />
(译者注:为避免误解,较易懂的解释应该是:一个磁盘不算逻辑分区最多只能有4个分区,这4个要么全是主分区,要么就是3个主分区+1个扩展分区,当然你将整个磁盘划为1个主分区也是没问题的,只要不超过4个分区即可)<br />
<br />
扩展分区通常不会被直接使用,它是作为逻辑分区的“容器”存在。一个硬盘只能有一个扩展分区,可以在里面继续再划分逻辑分区。<br />
<br />
当对一个磁盘进行分区时,是按这种数字顺序命名:主分区为sda1-3,跟着是扩展分区sda4(译者注:在/dev和fdisk -l里是看不到这个sda4的),在扩展分区中划分出来的逻辑分区分别是sda5、sda6,如此类推。<br />
<br />
=====交换分区swap=====<br />
交换分区Swap是虚拟内存在硬盘上驻留的地方,内核可以用它来储存在物理内存中放不下的数据。<br />
<br />
过去,常用的规则是将交换分区大小设置为物理内存的两倍。但是随着时间推移,现在的计算机已经有更大的内存容量,这条规则已经不适用了。通常,512MB内存的计算机,两倍(1G)的还是够用的。而1G内存的计算机,一倍的也够用了。如果你有更大的内存(比如超过1GB),也许可以完全把交换分区忘了,不推荐这样做!<br />
* ''如果你打算使用休眠到磁盘的电源方案,你必须要有不小于内存容量大小的交换分区,有些用户甚至会推荐大于物理内存容量15%的大小。''<br />
<br />
=====规划分区=====<br />
磁盘分区的规划是十分个人的设置。每位用户的决策都会根据自己计算机的情况和需求而不同。至少需要有一个包含了根[http://en.wikipedia.org/wiki/File_system 文件系统] ( / )的主分区和一个交换分区。你还可以选择给/boot(主要用来存放内核文件)、/usr、/var和/home(用来存放用户个人数据)划出独立分区。一个较好的做法是给 / 和 /home都划分独立分区。这样的话,当你因为某些原因重装Arch Linux(或者其它发行版),你还可以保留你的个人数据例如音乐、图片、桌面环境配置等。<br />
<br />
在本案例中,我们划分一个分区给 /,一个给/home,另外还有一个交换分区。<br />
<br />
=====开始创建分区cfdisk=====<br />
让我们开始创建一个包含'''root'''(/)文件系统的主分区。 <br />
<br />
选择'''N'''ew -> Primary,然后输入你希望的分区大小(对一个完整的Linux系统,4到8G是个不错的选择)。分区要位于磁盘的开头部分。选择刚新建的分区,接着选择'''B'''ootable将它置为可启动。<br />
<br />
同时选择分区文件系统类型'''T'''ype,指定为'83 Linux'.。<br />
<br />
给你的/home目录创建另一个分区。选择另外一个主分区设成你想要的容量大小,这取决于你的用户会在他们的home目录里储存多少文件,其大小可能从几百M办公文档到上百G音频视频,所以这里我无法给出一个建议。如果你要使用磁盘所有的剩余空间,记得保给交换分区留一部分(例如1GB或1024MB)。<br />
<br />
同样的,选择'''T'''ype为'83 Linux'。 <br />
<br />
最后,我们给交换分区创建一个分区。选择一个介于512MB到1GB之间的大小并将'''T'''ype改为82 (Linux swap / Solaris)。<br />
<br />
现在的分区规划看起来应该象这样(基于你的选择大小也许会有所不同):<br />
<br />
Name Flags Part Type FS Type [Label] Size (MB)<br />
-------------------------------------------------------------------------<br />
sda1 Boot Primary Linux (4096 - 8192)<br />
sda2 Primary Linux (> 100)<br />
sda3 Primary Linux swap / Solaris (512 - 1024)<br />
<br />
选择'''W'''rite并输入''''yes''''。要注意如果你删除了分区的话,这个操作会破坏你磁盘上的数据。选择'''Q'''uit退出分区程序。<br />
选择Done离开此菜单,接着选择"Set Filesystem Mountpoints"。<br />
<br />
=====IDE设备,为什么看起来它们和SCSI设备一样?=====<br />
最新开发的Linux内核里包含了libata和PATA模块,所有的IDE、SATA和SCSI都采用sd''x''这种命名方式。这十分正常,无需担心。<br />
<br />
=====设置文件系统挂载点=====<br />
<br />
''' ”文件系统格式(filesystems)“和”文件系统结构(file systems)“的区别:'''<br />
<br />
从技术层面确切的说,'''文件系统格式(filesystems)'''是一种数据'''格式''',涉及信息吞吐,比如ext2;而”文件系统结构(file systems)“则是特定操作系统中文件和目录的布局,比如/home/username/games。因此,当你被问及是否创建'''文件系统格式(filesystems)'''时,是在问你是否要'''格式化'''该分区…但是当程序向你问及挂载点时,你应该给出的则是该分区应该出现在你的Arch Linux ”文件系统结构“中的位置。<br />
<br />
'''文件系统类型:'''<br />
<br />
'''强烈建议:'''创建一个交换分区(SWAP)。选择一个合适的分区(本例中使用的是sda3). 安装程序就会询问你是否要创建swap 文件系统; 选择 yes. 接下来, 选择根分区的挂载点(本例中就是 sda1). 然后安装程序就会询问你需要哪一种文件系统。<br />
<br />
{{Box Note| 采用何种文件系统的类型取决于实际应用需要,没有十全十美的文件系统,选择任何一个文件系统,都需要在数据安全和性能要求方面作出适当倾斜,下面只是简单的介绍各种Arch linux支持的文件系统 }}<br />
<br />
1. '''ext2''' - 古老、 可靠的 GNU/Linux 文件系统。非常的稳定,不过 ''不支持日志记录功能''。磁盘检测速度较慢,因而有些不便. ''ext2可以容易地转换成ext3''。一般认为/boot分区采用此系统最合适,因为/boot里的东西就开机的时候读取一次,而且很少有变动,不需要日志文件系统,如果采用日志文件系统,日志的体积很可能远远大于内核的大小。<br />
<br />
2. '''ext3''' - 基于ext2系统, 并添加了日志记录功能。 一般认为他比其他文件系统要 ''稍微的'' 慢一点, 不过 ''非常的'' 稳定并且使用最为广泛,由 GNU/Linux FS 负责维护和开发。<br />
<br />
'''高性能文件系统:'''<br />
<br />
3. '''ext4''' - 最近加入支持的文件系统,是ext2和ext3的后续发展版本,Ext4增加了48位块地址,最大支持1EB文件系统,和单个16TB的文件,增加子目录限制到64,000。新增了很多功能,提供在线碎片处理,速度比ext3快,系统开销比ext3小。<br />
{{Box Note| 由于此系统较新,目前仍存在一些问题,暂时建议/home分区不采用此文件系统,以保证个人数据安全。}}<br />
<br />
4. '''ReiserFS''' - Hans Reiser 主持编写的高性能的日志文件系统,使用一种非常独特有趣的数据存储检索方法。ReiserFS 效率非常高, 特别在处理很多小文件的时候更是如此。ReiserFS在挂载的时候相对比较慢. 性能稳定。 ReiserFS 现在的开发并不活跃(最新的版本是Reiser4).<br />
<br />
5. '''JFS''' - IBM提供的日志文件系统( '''J'''ournaled '''F'''ile'''S'''ystem首字母缩写). JFS 效率非常高并且CPU资源占用率比其他任何一个文件系统都要低。并且在挂载和磁盘检测的时候都非常快,在各方面的表现都非常突出,尤其是 conjunction with the deadline scheduler. (参见 [[JFS]].) 但是并不像ext或者ReiserFS那样应用广泛。<br />
<br />
6. '''XFS''' - 非常高效的日志文件系统,特别适合处理大文件。在处理小文件的时候稍慢。在挂载的时候也很快。由于 /var 需要处理很多的小文件,所以可能不太适合作为/var 分区的文件系统。 GNU/Linux 文件系统中,最先实现可用的在线碎片处理。应用不及ext和ReiserFS那么广泛。<br />
* JFS 和 XFS 不能被磁盘工具压缩(比如gparted 或者 parted magic)<br />
<br />
'''未来文件系统'''<br />
<br />
7、btrfs - 此文件系统尚未被Arch纳入正式支持。是Oracle提供的copy-on-write档案系统。目标在取代的ext3,提高ext3单一档案的大小,总档案系统大小或档案检查,加入目前ext3未支援的功能,比如:writable snapshots,snapshots of snapshots,内建磁盘阵列(RAID)支援,and subvolumes。<br />
<br />
最主要的差别在于[http://en.wikipedia.org/wiki/Journaling_file_system 日志系统] (一种类似的在数据库环境中记录着日志变更的东西). 除ext2之外,其他文件系统都支持日志记录功能. ext3 完全兼容 ext2,因此哪怕你可以用一个非常古老的CD来挂载他,也没问题。 根分区目前最安全的选择就是使用ext3文件系统。ReiserFS,XFS,和JFS也可以使用,因为GRUB (启动引导管理器,稍候在安装部分将会介绍到) 都可以从这些文件系统中启动。你可以通过选择‘’‘yes’‘’来创建文件系统(并格式化分区),接着你就会被提示添加附加分区。 在我们的例子中, 只有sda2了。 选择一个文件系统类型,并且把这个分区挂在到/home. 再次说明,创建文件系统并且选择Done。然后回到主菜单。<br />
<br />
====4、选择软件包====<br />
现在我们要选择安装哪些软件包到系统中。选择CD作为来源,如果你不止一个光驱的话还需要选择使用哪个的光驱。<br />
<br />
软件包选择分为两个阶段。首先要选择软件包分类,然后出现所选分类中软件包的详细列表供你微调。使用空格键进行选择和取消。<br />
<br />
''*BASE:包含最小的软件包集合,仅够构建一个可运行的系统骨架。''<br />
''*SUPPORT:供网络和文件系统用的额外软件包,例如gpm、fuse、dnsutils、无线驱动、ndiswrapper、ntfs-3g诸如此类。''<br />
''*DEVEL:软件创建工具,如GCC、autoconf、automake和make等等。''<br />
''*LIB:大量的库文件,如gmp、lebelf、libevent等等。''<br />
*''' 2008.06 版'''的软件包选择,只有一个: BASE ,选择之后进入其详细列表. <br />
<br />
在这里,我们对'Select all packages by default'选择'yes'。<br />
<br />
接下来屏幕将显示你所选的软件包。对于新手,较安全的做法是不修改它,而有经验的用户可能希望裁减掉一些不需要的软件包。(例如,不需要的文件系统类型公用程序,不需要的驱动等等。)<br />
<br />
====5、安装软件包====<br />
接着,选择'Install Packages'。你会被询问是否希望保留pacman缓冲里的软件包。如果你选'yes',日后你还可以选择对某些软件包进行降级,因此推荐保留(日后你还是可以清除这些缓存的)。安装脚本跟着就会安装所选软件包到你的系统中。这些软件包是二进制的、针对i686优化的,总共仅100MB,因此安装是相当便捷的。<br />
<br />
====6、配置系统====<br />
系统接着会询问你是否要选择[[Hwdetect|hwdetect]]来收集配置所需信息。新手应该选择是('yes')。<br />
<br />
如果是相当熟悉自己的硬件、所需模块,有能力从零开始手动配置/etc/mkinitcpio和/etc/fstab 的高级用户,可以选择否'no'。(当然,此选项是非常复杂的,已经超过本指南的范围,这里就不详细解释了。)<br />
<br />
接下来,系统会询问你是否需要支持从USB设备、FireWire设备、PCMCIA设备、NFS共享、软RAID阵列、LVM2卷和加密卷上启动。如果需要则选'yes',在本案例中以上都不选。<br />
<br />
新手还应该选择让/etc/mkinitcpio/kernel26-fallback.conf使用[[Hwdetect|hwdetect]]的结果,这将确保你的硬盘控制器相容次序。<br />
<br />
现在系统会询问你使用哪个文本编辑器;如果你不熟悉[http://en.wikipedia.org/wiki/Vim_%28text_editor%29 vi/vim]的话可以选择[http://en.wikipedia.org/wiki/Nano_%28text_editor%29 nano]。然后就会出现一个包含系统中大部分重要配置文件的菜单。如果你打算查找/etc/rc.conf中可用的选项,只需按Alt+F2切换到另外一个虚拟控制台进行查找,然后用Alt+F1切换回安装程序。<br />
<br />
======系统配置主文件'''/etc/rc.conf'''======<br />
Arch Linux继承FreeBSD的传统,使用'''/etc/rc.conf'''作为系统配置的主要文件。这个文件包含了广泛的配置信息,主要用于系统的启动。正如名字中所包含的意思,它还包含了供/etc/rc*文件使用的配置。/etc/rc.conf提供了一个Arch用户可以轻易访问到的,简洁而又范围广泛的精简系统资源配置方案。<br />
* '''LOCALIZATION'''部分<br />
** '''LOCALE'''=: 系统场所(locale)设置,被所有国际化(i18n-aware)的应用程序使用 。从命令行上运行locale可以列出可用的locale设置。此设置缺省是适合英文(US English)用户使用的en_US.utf8。(此处locale的设置必须与/etc/locale.gen一致,'''[[#/etc/locale.gen|详见下文]]'''。)中文一般是zh_CN.UTF-8,如果使用之后乱码,先换回en_US.utf8,等进图形界面后再换回来。<br />
** '''HARDWARECLOCK'''=: 指示开关机时进行同步的硬件时钟,是'''UTC'''时间(协调世界时(Universal Time Coordinated), 过去曾用格林威治平均时(GMT)来表示)还是'''localtime'''(本地时间)。通常UTC较为好,因为它大大简化了时区和日光节约时间(中国过去称为夏时制)的变更。而当你同时还有其它操作系统如windows进行双启动,就必须使用localtime(本地时间),它只把本地时间保存到硬件时钟里。<br />
** '''TIMEZONE'''=: 时区(TIMEZONE)。(所有可用的时区可在/usr/share/zoneinfo/里找到。)<br />
** '''KEYMAP'''=: 可用的键盘映射表可在/usr/share/kbd/keymaps里找到。请注意此设定仅在TTY中有效,在所有图形窗口管理器或者X中都不使用此设置!<br />
** '''CONSOLEFONT'''=: 如果你一定要修改此设置,可在/usr/share/kbd/consolefonts/中找到可用的字体。<br />
** '''CONSOLEMAP'''=: 定义了启动时setfont程序加载的控制台映射表。有需要的话,可在/usr/share/kbd/consoletrans里找到可用的映射表。<br />
** '''USECOLOR'''=: 如果你使用彩色显示器的话请选"yes"。<br />
<br />
LOCALE="zh_CN.UTF-8"<br />
HARDWARECLOCK="localtime"<br />
TIMEZONE="Asia/Shanghai"<br />
KEYMAP="us"<br />
CONSOLEFONT=<br />
CONSOLEMAP=<br />
USECOLOR="yes"<br />
* '''HARDWARE'''部分<br />
** '''MOD_AUTOLOAD'''=: 如果你使用'''udev'''在启动时探测硬件并加载相应模块。请设置为"yes",(适合缺省模块化的内核)。设置为"no"就得靠用户自己指定所需的有关信息。<br />
** '''MOD_BLACKLIST'''=: 模块黑名单。在下面的例子中,IPv6模块和pcspeaker都被列入黑名单而不被加载。<br />
** '''MODULES'''=: 指示了其它模块,如果你知道缺少哪个重要的模块可以加在里面。('''hwdetect'''应该已经填写了最重要的模块):<br />
# Scan hardware and load required modules at bootup<br />
MOD_AUTOLOAD="yes"<br />
# Module Blacklist - modules in this list will never be loaded by '''udev'''<br />
MOD_BLACKLIST=(net-pf-10 pcspkr)<br />
#<br />
MODULES=(e100 eepro100 mii slhc snd-ac97-codec snd-intel8x0 soundcore)<br />
* '''NETWORKING'''部分<br />
** '''HOSTNAME'''=:设置为你喜欢的主机名(HOSTNAME)。<br />
** '''lo'''=: 不修改此行。<br />
** '''eth0'''=: 如果使用'''静态IP'''的话请调整网络接口的IP地址、掩码和广播地址。如果使用'''DHCP'''的话则设为eth0="dhcp"。<br />
** '''INTERFACES'''=: 指定使用哪些网络接口。如果你不使用DHCP来配置设备,而是通过命令行用ifconfig手动配置设备的话,这里的变量值(名字必须等于打算进行配置的设备名一样)必须和ifconfig里加入的内容一样。<br />
** '''gateway'''=: 如果你使用'''静态IP''',将网关(gateway)地址设为路由器的IP。如果使用DHCP,则将此行用'#'注释掉。<br />
** '''ROUTES'''=: 如果你使用'''静态IP''',则将'gateway'前面的'!'去掉。如果使用'''DHCP'''的话则不需要修改此行。<br />
<br />
<br />
例如,当使用'''DHCP''':<br />
HOSTNAME="arch"<br />
lo="lo 127.0.0.1"<br />
#eth0="eth0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255" <br />
eth0="dhcp"<br />
INTERFACES=(lo eth0)<br />
#gateway="default gw 192.168.0.1"<br />
ROUTES=(!gateway)<br />
* '''DAEMONS'''部分<br />
这个序列罗列了位于/etc/rc.d/里需要在启动过程中启动的脚本名字。<br />
<br />
*如果脚本名字前有惊叹号(!),表示它不被执行。<br />
*如果脚本名字前有符号(@),则表示它会在后台被执行,启动序列不会等待此脚本成功执行完毕,而是继续执行下一个守护进程脚本。<br />
<br />
这种'BSD风格'的初始化就是Arch的处理办法,而其它发行版则是在一个init.d目录里使用一大堆符号链接(一个简单的文件 vs 一整个目录)。<br />
<br />
======关于守护进程======<br />
虽然此时你不需修改[[daemons]]行,不过还是有必要解释一下什么是守护进程,因为过一会儿在指南里我们会需要它。<br />
<br />
和Windows服务(service)类似,守护进程(daemon)是一个运行于后台的程序,等待事件发生并提供服务。一个较好的例子是webserver等待请求以发送页面,还有SSH服务等待用户登录。这些都是全功能的程序,还有些守护进程工作起来并不是那么明显的。例如向日志文件里写信息的守护进程(如syslog、metalog),当系统空闲时降低CPU频率的守护进程(如cpufreq),以及提供图形化登录的守护进程(如gdm、kdm)。所有这些程序都可以被加入到daemons行中,在系统启动时被执行。本指南会对一些较有用的守护进程进行介绍。<br />
按Ctrl+X退出nano编辑器。<br />
<br />
======磁盘和分区配置文件:/etc/fstab======<br />
'''fstab''' ('''f'''ile '''s'''ystems '''tab'''le的缩写) 是系统配置的一部分,该文件列出所有可用的磁盘和分区,并指明它们初始化的方式或整合至全局文件系统的方式。'''/etc/fstab'''文件一般被'''mount'''命令读取,以决定某一特定设备被挂载时所采用的选项。<br />
<br />
这是一个'''/etc/fstab'''的例子:<br />
<br />
#<br />
# /etc/fstab: static file system information<br />
#<br />
# <file system> <dir> <type> <options> <dump> <pass><br />
none /dev/pts devpts defaults 0 0<br />
none /dev/shm tmpfs defaults 0 0<br />
#/dev/cdrom /mnt/cdrom iso9660 ro,user,noauto,unhide 0 0<br />
#/dev/dvd /mnt/dvd udf ro,user,noauto,unhide 0 0<br />
#/dev/fd0 /mnt/fd0 vfat user,noauto 0 0<br />
/dev/sda1 / jfs defaults,noatime,nodiratime 0 1 <br />
/dev/sda2 /home jfs defaults,noatime,nodiratime 0 2<br />
/dev/sda3 swap swap defaults 0 0<br />
Hwdetect应该已经有效地配置了一个可用的'''fstab''',但最好还是简要地检查一下。<br />
<br />
*如果你打算用'''hal'''来自动挂载DVD之类的媒体,为了给即将安装的'''hal'''做准备,你可能要注释掉cdrom和dvd条目。 <br />
<br />
''在笔记本电脑和桌面系统上,可以给 / 和 /home加上'noatime'和'nodiratime'选项来提高速度、性能,同时还能省电。无论你采用何种文件系统,这样做都应该是安全的。''<br />
<br />
更多信息请参照[[Fstab]]<br />
<br />
======'''mkinitcpio.conf、modprobe.conf和kernel26-fallback.conf'''======<br />
此时我们无须去修改这些配置文件。'''mkinitcpio.conf'''负责配置ramdisk(例如从RAID、加密卷启动), '''modprobe.conf'''可以用来设置内核模块的的某些配置选项,而'''kernel26-fallback.conf'''则是initramfs后备配置。<br />
<br />
======(对于静态IP)网络配置文件:/etc/resolv.conf ======<br />
*''如果你使用DHCP,完全可以忽略此文件,缺省情况下dhcpd守护进程会自动创建和销毁此文件。''<br />
<br />
如果你使用静态IP,则可在/etc/resolv.conf里设置你的DNS服务器。每行的格式为nameserver <ip地址>,如果有多个DNS服务器则可以填入多行。<br />
<br />
如果你使用路由器,也许会希望由你的路由器本身指定DNS服务器,而在'''resolv.conf'''里只是写入你的路由器的IP(同时也是'''/etc/rc.conf'''里的网关),例如:<br />
nameserver 192.168.1.1<br />
可选的,逐个加入你的DNS服务器,例如:<br />
nameserver 4.2.2.1<br />
nameserver 4.2.2.2<br />
<br />
如果使用'''DHCP''',你也可以在你的路由器里指定你的DNS服务器,或者如果你的ISP支持的话由ISP自动指定。<br />
<br />
======/etc/hosts======<br />
可以在此文件中加入你想要的''hostname'',必须和/etc/rc.conf里的设置一致,因此它应该象这样:<br />
127.0.0.1 localhost.localdomain localhost '''''yourhostname'''''<br />
''为了程序的兼容性,必须严格遵照这个格式,'''包括'localhost' 这项'''!错误的句法可能会导致网络性能低下和/或某些程序运行缓慢甚至无法运行。这对新手来说是十分普遍的错误。''<br />
<br />
对于大部分用户,只要把''yourhostname''加入到行末就就可以了,不过有些用户推荐以下句法:<br />
127.0.0.1 '''''yourhostname'''''.domain.org localhost.localdomain localhost '''''yourhostname'''''<br />
如果你使用静态IP,可以用这种句法加入新行:<static-ip> hostname.domainname.org hostname,例如:<br />
192.168.1.100 '''''yourhostname'''''.domain.org '''''yourhostname'''''<br />
<br />
======/etc/hosts.deny和/etc/hosts.allow======<br />
如果你打算使用[[SSH|ssh]]的话,请根据自己的需要修改此配置。缺省设置是拒绝所有进入的连接,而不只是ssh连接。编辑'''/etc/hosts.allow '''文件加入:<br />
<br />
* 允许所有进入的ssh连接。<br />
sshd:all <br />
<br />
* 允许特定IP地址进入ssh连接。<br />
sshd: 192.168.0.1<br />
<br />
* 允许你指定的网段 (地址从 192.168.0.0 到 192.168.0.255)<br />
sshd: 192.168.0.<br />
<br />
* 允许某个IP地址范围<br />
sshd: 10.0.0.0/255.255.255.0<br />
<br />
如果你不打算使用[[SSH|ssh]],为安全起见请保持此文件的缺省设置(为空)。<br />
<br />
======/etc/locale.gen======<br />
<br />
'''locale-gen''' 命令从 '''/etc/locale.gen'''读取信息设定系统的locales. 这些设置稍后会被'''glibc''' 和其他一些支持本地化的程序或者库用于自动翻译输出各种语言的"独特" 文本, 并且合适的显示地域、货币、时区以及日期格式, 字符排列方式和其他一些本地化的特殊标准。设置默认本地化的功能是类<code>UNIX</code>操作系统的一大特质<br />
<br />
默认情况下 /etc/locale.gen 是一个仅包含注释文档的空文件.编辑后,这个文件将不会get touched again. 每次'''glibc'''更新之后'''locale-gen'''就会运行一次, 以在/etc/locale.gen重新生成所有的本地化设置.<br />
<br />
选定你需要的本地化类型(移除前面的#即可), 比如:<br />
en_US ISO-8859-1<br />
en_US.UTF-8 <br />
('''你这里的设置必须和上文中提到的/etc/rc.conf 的设置一致哦.''')<br />
<br />
现在,安装程序将运行locale-gen 脚本, 以生成你设定的locales。你以后可以通过修改文件/etc/locale.gen变更你的locale, 然后使用根用户(root)运行'locale-gen'脚本使之生效。<br />
<br />
''Note 如果你选择并设置了locale, 他将提示你 "The current locale is invalid..." 错误。可能是因为大多数新Arch用户都会犯的普遍的错误,也是在论坛中问得最多的问题。''<br />
<br />
======Root密码======<br />
最后,设置一个root密码并确定你已牢记它。返回主菜单然后接着安装启动加载器。<br />
<br />
======Pacman镜像======<br />
为'''pacman'''选择一个软件仓库镜像站。记住主站 archlinux.org 是有流量限制的,下载速度限于50KB/s.。<br />
<br />
在列表中仔细查看, 一般 xxx.cn 是中国镜像, xxx.au 是澳大利亚, 等等...<br />
<br />
*''如果你不熟悉现有的镜像和它们所处的位置,那就随便选一个。稍后你可以编辑 "/etc/pacman.d/mirrorlist", 或运行本指南后面提到的'''rankmirrors'''脚本,它将自动配置最接近你的镜像。''<br />
<br />
返回主菜单。<br />
<br />
====7、安装启动加载器====<br />
因为本案例中没有第二个操作系统,因此我们需要安装一个启动加载器。推荐选择[http://www.gnu.org/software/grub/ GNU GRUB]作为启动加载器。另外一种选择是[http://lilo.go.dyndns.org/ LILO]。缺省的'''GRUB'''配置('''/boot/grub/menu.lst''')应该足够了。唯一你可能想修改的是控制台的分辨率。将vga=<number>加入到第一个kernel行。(menu.lst中已列出一张分辨率和数字的对应表格可供查找。)<br />
title Arch Linux (Main)<br />
root (hd0,0)<br />
kernel /boot/vmlinuz26 root=/dev/sda1 ro vga=773<br />
initrd /boot/kernel26.img<br />
参数"vga=773"表示1024x768分辨率、256色的framebuffer。<br />
<br />
将'''GRUB'''启动加载器安装到主引导区(本例中为sda)。<br />
<br />
====8、系统重启====<br />
退出安装程序。<br />
*建议:为了方便接下来更进一步的安装配置,可以把光盘里的新手指南复制一份到电脑里,这样后面的安装就能查看相应的向导了<br />
<br />
cp /arch/beginnersguide.txt /mnt/home/beginnersguide.txt<br />
<br />
系统重启之后,进入控制台,可以使用下面命令查看这新手指南<br />
less /home/beginnersguide.txt<br />
所有安装完毕之后,可以删了这指南<br />
rm /home/beginnersguide.txt<br />
<br />
输入命令下面命令,重启:<br />
<br />
reboot<br />
<br />
一个新Arch Linux系统就会启动并进入登录提示符(你可能需要在'''BIOS'''将启动顺序改为优先从硬盘启动)。<br />
<br />
'''祝贺你,一个崭新的Arch Linux基础系统闪亮登场了!'''<br />
<br />
==第二部分:完成基本系统并升级==<br />
你的新Arch Linux基础系统现在已是一个功能完整的GNU/Linux环境了,随时可以进行定制。从现在开始,你可以按自己的意图和需求改造它。由于arch是滚动发布的,所以安装包不一定是最新的系统,所以我们在安装完成之后,需要立即更新系统。<br />
<br />
让我们开始吧。<br />
-----<br />
登录入你的root账号。我们将以root身份配置pacman和更新系统,然后创建一个普通用户账号。<br />
<br />
===一、配置网络(如果有需要)===<br />
*''如果安装脚本的自动配置不适合你,本段内容将帮助你配置大部分类型的网络。''<br />
-----<br />
如果一切正常的话,你的网络应该可以正常使用了。先ping www.google.com验证一下:<br />
ping -c 3 www.google.com<br />
<br />
''如果你已经成功建立网络连接,则跳到下面阅读[[#使用pacman更新、同步、升级系统|使用pacman更新、同步、升级系统]]'''。''<br />
<br />
如果ping www.google.com后得到"unknown host"的错误,可以认为你的网络尚未正确配置。你需要重新检查以下内容的完整性和正确性:<br />
'''/etc/rc.conf''' # 特别留意HOSTNAME= 和 NETWORKING 部分有无输入错误。<br />
<br />
'''/etc/hosts''' # 复核一下格式。(看之前的内容。)<br />
<br />
'''/etc/resolv.conf''' # 当你使用静态IP时需要检查。如果你使用DHCP,缺省这个文件会被自动创建和销毁,不过也可以改为你需要的内容。(参见[[Network]]。)<br />
<br />
高级的网络配置方法可以在[[Network]]一文中找到。<br />
<br />
=====有线网络=====<br />
<br />
用以下命令检查网络<br />
ifconfig<br />
你应该看到eth0这一项。如果有需要,你可以这样设置一个新的静态IP:<br />
ifconfig eth0 <ip address> netmask <netmask> up <br />
并且这样设置缺省网关:<br />
route add default gw <ip address of the gateway><br />
查看一下/etc/resolv.conf是否包含你的DNS服务器,不过缺失了则补填进去。<br />
再次用ping www.google.cn检查一下网络。如果一切正常,将/etc/rc.conf调整为刚才新设置的静态IP。如果你的网络使用DHCP服务器/路由器的话,输入:<br />
dhcpcd eth0<br />
如果这样可行的话,则将/etc/rc.conf按之前所述方法调整为动态IP。<br />
<br />
=====无线网络=====<br />
详见安装指南:[[无线设置 (简体中文)|无线设置]]<br />
<br />
=====模拟信号调制解调器=====<br />
---编辑中---<br />
--[[User:Flydragon|flydragon]] 04:43, 4 January 2010 (EST)<br />
如果你想使用外接电话线调制解调器, 你至少要安装ppp包. 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.<br />
Tip: Read [[Dialup without a dialer HOWTO]].<br />
<br />
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 [http://www.linmodems.org/ LinModem] homepage.<br />
<br />
---编辑中---<br />
<br />
=====ISDN=====<br />
<br />
通过三步,完成 ISDN 的安装和配置:<br />
# 安装配置固件Install and configure hardware<br />
# 安装配置ISDN 管理工具<br />
# 添加ISP信息<br />
<br />
现在的 Arch stock kernels 已经包含了ISDN 所需要的modules, 所以不需要重新去编译内核,除非 you're about to use rather odd ISDN hardware. 把ISDN卡插入电脑或者插入USB ISDN-Box之后,you can try loading the modules with modprobe. 绝大部分的ISDN PCI 卡都能被module hisax处理,只需要两个参数:类型和协议。 如果使用的是1TR6标准,则协议设定为 '1' ,如果使用的是EuroISDN (EDSS1),协议设定为 '2', '3' if you're hooked to a so-called leased-line without D-channel, 如果使用的是US NI1,则设为'4'.<br />
<br />
所有配置细节都可以在kernel documentation, more specifically in the isdn subdirectory, and available online中获知。 类型的参数是根据电视卡来设定的,在README.HiSax kernel documentation中,有一个可能类型的列表。 用相应的参数加载moduleChoose,比如这个:<br />
<br />
modprobe hisax type=18 protocol=2<br />
<br />
这个将加载适用于电视卡类型为ELSA Quickstep 1000PCI,德国使用的EDSS1协议的模块hisax。可以在日志文件/var/log/everything.log中查看是否模块被预加载。额外的USB ISDN Adapter需要加载些USB模块才能正常工作。<br />
<br />
通过上述设定之后,如果电视卡能正常工作,那么把下面模块和参数加入/etc/modprobe.conf中:<br />
<br />
alias ippp0 hisax<br />
options hisax type=18 protocol=2<br />
<br />
这么做的好处是,这些模块在不使用时不会被加载。另外的方法是可以在这只加参数,把hisax加入/etc/rc.conf里面的MODULES,这样做的坏处就是不管这些模块是不是在使用,都加载了。 <br />
<br />
完成上述步骤之后,需要安装管理工具<br />
<br />
安装软件包isdn4k-utils,阅读关于isdnctrl的说明手册。在说明手册里,将有详细的说明:如何创建一个配置文件that can be parsed by isdnctrl,安装实例。 Please note that you have to add your SPID to your MSN setting separated by a colon if you use US NI1.<br />
<br />
使用isdnctrl utility配置ISDN卡之后,将可以拨号到你设定的PHONE_OUT参数的机器上,但提示用户名和密码错误。把用户名和密码加入到/etc/ppp/pap-secrets或者/etc/ppp/chap-secrets,这个主要根据的是你的ISP使用的协议授权方式,as if you were configuring a normal analogous PPP link。如果无法确定,可以两个文件都加。<br />
<br />
完成上述设定之后,用root帐号建立一个拨号连接:<br />
isdnctrl dial ippp0<br />
有啥问题,请检查日志文件!<br />
<br />
=====DSL (PPPoE)=====<br />
<br />
仅当需要你的计算机去主动拨号连接ISP的情况下才需参考本段内容。如果你使用独立的路由器来负责这类工作,你只需要设置一个缺省网关即可。<br />
<br />
在使用DSL连接前,你得先在计算机里安装一个连接到DSL-Modem的网卡。将你新装网卡加入到modules.conf/modprobe.conf或者MODULES列表之后,安装rp-pppoe软件包并运行pppoe-setup脚本来配置你的连接。当你输入完有关信息后,可以分别通过以下命令来进行连接和挂断:<br />
<br />
/etc/rc.d/adsl start<br />
<br />
和<br />
<br />
/etc/rc.d/adsl stop<br />
<br />
setup过程一般都是很容易、直观的,如果还有不懂可以阅读man手册。如果你想在启动时自动拨号,可以将adsl加入到DAEMONS列表中。<br />
<br />
<br />
===二、更新Pacman===<br />
<br />
====pacman是什么?====<br />
[[Pacman]]是Arch Linux的软件包管理器('''pac'''kage '''man'''ager)。Pacman是用C语言编写的,速度快,使用简便,功能强大。它可以管理整个软件包系统,负责软件包的安装、删除、降级(通过缓存),也支持自编译的软件包,自动分析依赖关系,可以搜索远程和本地软件仓库,还有大量其它功能。这里我们将用pacman来从远程软件仓库下载软件包并安装到系统中。<br />
<br />
对系统进行定制,pacman是Arch Linux最重要工具。<br />
<br />
====1、配置pacman====<br />
=====pacman总配置文件/etc/pacman.conf=====<br />
Arch通过pacman可以获得对下面 4软件仓库的管理:<br />
<br />
'''[core]'''<br />
<br />
[core](“核心”)仓库的简单原则是只提供一个基本的Arch Linux的基本工具:GNU系列工具,Linux内核,一个文字编辑器,一个命令行浏览器等(这里也有一些例外。比如说,vi和nano是同时提供的,允许用户选择一个或两个)。它包含所有使你的系统正常运转的“必须”安装的包,只有它们完美地工作,你的系统才能继续运行。这些是绝对“system-critical”(对系统来说至关重要)的包。由开发者负责维护。<br />
<br />
*''Core安装媒介(The Core installation media)简单地包含一个安装脚本,一个当前发布版本的核心仓库的快照(snapshot)。''<br />
<br />
'''[extra]'''<br />
<br />
[extra](“额外的”)仓库包含所有的对于一个基本的Arch系统不是必须,但是对于构建一个完整的系统环境有用的的Arch包。 比如'''X''', KDE和Apache,都可以在这里面找到。它也是由开发者维护的。<br />
<br />
'''[testing]'''<br />
<br />
[testing](“测试”)仓库包含的包是[core]和[extra]仓库的候选者。<br />
下面情况下,新的软件包将进入[testing]软件仓库:<br />
* 可能会导致系统出问题的升级,需要测试。<br />
* 需要重新打包其他软件包。这种情况下,所有需要重新打包的软件包将被放在[testing]仓库,直到所有重新打包完成,这些软件包才回归原有的软件仓库。 <br />
<br />
开发者维护。<br />
<br />
[testing]是唯一的一个在名义上与其它官方仓库有冲突的仓库。(that can have name collisions with any of the other official repositories. )<br />
<br />
<font color=&quot;blue&quot;>*如果开启, [testing]必须放在''pacman.conf''的软件仓库的第一个。</font><br />
<br />
<font color=&quot;red&quot;>'''警告''': '''''开启[testing]软件仓库,容易导致系统崩溃,因此只建议有经验的用户开启。'''''</font><br />
<br />
'''[community]'''<br />
<br />
[community](“社区”)仓库是由“信任用户”(''Trusted Users (TUs)'')维护的,是''Arch User Repository ([[AUR]])''(Arch用户仓库)的一部分。它包含的是二进制的包,在用户仓库中有足够的“票数”,并由''信任用戶''挑选出来的。像其它上面列出的仓库一样,[community] 可以用pacman获取。<br />
<br />
'''[[AUR]]''' 也包含'''unsupported''' 分支,这不能直接通过pacman获取。*. [unsupported] 包含多达海量PKGBUILD脚本,用来从源代码编译。这从其它仓库中是不能使用的。 <br />
<br />
<nowiki>*</nowiki> '''''[[AUR Helpers]]''''' 能帮助你无缝地使用AUR。<br />
<br />
'''/etc/pacman.conf'''<br />
<br />
每次调用pacman,它都会读取/etc/pacman.conf文件。这个配置文件分若干段,每一段定义了一个pacman用来搜索软件的仓库。唯一例外的是options段,它定义了全局选项。<br />
nano /etc/pacman.conf<br />
范例:<br />
#<br />
# /etc/pacman.conf<br />
#<br />
# See the pacman.conf(5) manpage for option and repository directives<br />
<br />
#<br />
# GENERAL OPTIONS<br />
#<br />
[options]<br />
# The following paths are commented out with their default values listed.<br />
# If you wish to use different paths, uncomment and update the paths.<br />
#RootDir = /<br />
#DBPath = /var/lib/pacman/<br />
#CacheDir = /var/cache/pacman/pkg/<br />
#LogFile = /var/log/pacman.log<br />
HoldPkg = pacman glibc<br />
# If upgrades are available for these packages they will be asked for first<br />
SyncFirst = pacman<br />
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u<br />
#XferCommand = /usr/bin/curl %u > %o<br />
<br />
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup<br />
#IgnorePkg =<br />
#IgnoreGroup =<br />
<br />
#NoUpgrade =<br />
#NoExtract =<br />
<br />
# Misc options (all disabled by default)<br />
#NoPassiveFtp<br />
#UseSyslog<br />
#ShowSize<br />
#UseDelta<br />
#TotalDownload<br />
#<br />
# REPOSITORIES<br />
# - can be defined here or included from another file<br />
# - pacman will search repositories in the order defined here<br />
# - local/custom mirrors can be added here or in separate files<br />
# - repositories listed first will take precedence when packages<br />
# have identical names, regardless of version number<br />
# - URLs will have $repo replaced by the name of the current repo<br />
#<br />
# Repository entries are of the format:<br />
# [repo-name]<br />
# Server = ServerName<br />
# Include = IncludePath<br />
#<br />
# The header [repo-name] is crucial - it must be present and<br />
# uncommented to enable the repo.<br />
# <br />
<br />
# Testing is disabled by default. To enable, uncomment the following<br />
# two lines. You can add preferred servers immediately after the header,<br />
# and they will be used before the default mirrors.<br />
#[testing]<br />
#Include = /etc/pacman.d/mirrorlist<br />
<br />
[core]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
[extra]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist <br />
<br />
[community]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
# An example of a custom package repository. See the pacman manpage for<br />
# tips on creating your own repositories.<br />
#[custom]<br />
#Server = file:///home/custompkgs<br />
要开启一个软件仓库,只需要将'Include ='和'[repository]'行前的注释符号(#)去除。<br />
<br />
*"Server ="行如果取消注释,将会强制此服务器被首先搜索,详细的仓库配置位于/etc/pacman.d/下。<br />
* 注意:选择仓库时,请确认将仓库名和'Include ='行都一同取消注释。没有这样做的话会导致你选择的仓库被忽略!这是个很普遍的错误。<br />
<br />
=====(如果有必要)配置镜像列表 /etc/pacman.d/mirrorlist=====<br />
更快的镜像能显著改善pacman的性能和你对Arch Linux的总体体验。<br />
<br />
*手动编辑/etc/pacman.d/mirrorlist:<br />
nano /etc/pacman.d/mirrorlist<br />
删除所有不在你所在洲或者太远的镜像。(在nano里你可以用CTRL-K删除每个不需要的行。)保存文件并退出。<br />
<br />
*'''rankmirrors'''脚本可以根据镜像的响应延迟对其自动排名。'''Rankmirrors'''是python脚本,需要安装python:<br />
<br />
pacman -S python<br />
<br />
然后,运行'''rankmirrors'''脚本按响应延迟顺序对镜像进行排名:<br />
rankmirrors -v /etc/pacman.d/mirrorlist<br />
输出会列出所有镜像和它们的响应延迟(ping),例如:<br />
<br />
# United States<br />
# http://mirrors.easynews.com/linux/archlinux/$repo/os/i686 ... 0.96<br />
# ftp://ftp.nethat.com/pub/linux/archlinux/$repo/os/i686 ... unreachable<br />
# ftp://locke.suu.edu/linux/dist/archlinux/$repo/os/i686 ... 2.43<br />
# ftp://mirrors.unixheads.org/archlinux/$repo/os/i686 ... 1.96<br />
<br />
脚本将从低到高的响应延迟顺序显示:<br />
Server = http://mirrors.easynews.com/linux/archlinux/$repo/os/i686<br />
Server = ftp://mirrors.unixheads.org/archlinux/$repo/os/i686<br />
Server = ftp://locke.suu.edu/linux/dist/archlinux/$repo/os/i686<br />
Server = ftp://ftp.nethat.com/pub/linux/archlinux/$repo/os/i686<br />
<br />
要注意的是这个结果对于镜像排列并非很精确,最接近你的镜像或者延迟最低的镜像并不一定是最佳选择。(反应迅速但是内容过时的镜像、或者低延迟但是窄带宽的镜像对你毫无用处)。<br />
<br />
编辑/etc/pacman.d/mirrorlist,将最佳的镜像置于在列表顶端。为了体验多个镜像你可能要不断修改此配置文件,请精明地选择。<br />
<br />
====常用的命令====<br />
<br />
与远程软件仓库同步和更新本地包数据库 (推荐在安装和更新包之前这样做):<br />
pacman -Sy<br />
<br />
'''升级'''系统中所有的包:<br />
pacman -Su<br />
<br />
一条同步、更新、'''升级''' 所有系统中的包的命令:<br />
pacman -Syu<br />
<br />
安装或者升级单个软件包或者一串包(包括其依赖包):<br />
pacman -S packageA packageB<br />
<br />
同步、更新数据库并安装软件包:<br />
pacman -Sy packageA packageB<br />
<br />
移除软件包, 但保留依赖的包:<br />
pacman -R package<br />
<br />
移除单个包,并且移除没有被别的软件依赖的依赖包:<br />
pacman -Rs package<br />
<br />
移除包所有不需要的依赖包并删除其配置文件:<br />
pacman -Rsn package<br />
<br />
通过给定关键词(列表)搜索远程软件仓库数据库(repo):<br />
pacman -Ss keyword<br />
<br />
列出系统中所有的包<br />
pacman -Q<br />
<br />
在本地包数据库搜索 (查询)指定软件包:<br />
pacman -Q package <br />
<br />
在本地包数据库搜索 (查询)指定软件包并列出相关信息:<br />
pacman -Qi package<br />
<br />
To defragment pacman的数据库缓存和速度优化选项:<br />
pacman-optimize<br />
<br />
统计当前系统中的包数量:<br />
pacman -Q | wc -l<br />
<br />
使用ABS和makepkg从源代码编译安装包:<br />
pacman -U packagename.pkg.tar.gz<br />
<br />
Note: pacman有很多很多的选项和功能组合。你可以试试man pacman或者查阅lt the [[pacman]]维基条目<br />
<br />
====软件包管理增强工具====<br />
* Yaourt 可查询aur的pacman增强工具<br />
* Tupac 快速查询的yaourt增强工具<br />
* Powerpill 多进程下载的pacman增强工具<br />
{{Box Note| 强烈建议更新系统完毕后,安装yaourt和powerpill,以便更充分享受Arch Linux的方便和强大。}}<br />
在/etc/pacman.conf文件里,最后添加两行(如果是i686的话,把x86_64换成i686即可):<br />
[archlinuxfr]<br />
Server = http://repo.archlinux.fr/x86_64<br />
然后使用pacman安装yaourt<br />
pacman -Sy yaourt<br />
<br />
以后就可以使用yaourt命令来查找并安装包括[[AUR]]里的软件了。比如bcm无线网卡,需要安装b43-firmware(此软件包在[[AUR]]仓库里,使用pacman无法查找到),使用yaourt命令查找并安装:<br />
yaourt b43-firmware<br />
找到之后,根据相应提示,一直到安装完成。<br />
<br />
====图形化管理工具====<br />
* qt界面的shaman:比较成熟的pacman 图形化管理工具<br />
* gtk界面的gtkpacman :目前BUG比较多,不稳定。<br />
<br />
====Pacman的更多信息====<br />
用此命令查看pacman手册:<br />
man pacman<br />
有空的话可以看看[[pacman (简体中文)]]维基条目。<br />
<br />
====2、更新Pacman自己====<br />
<br />
一开始,系统可能会提示你先更新pacman自身,这取决于Arch安装包的新旧程度:<br />
pacman -Sy pacman<br />
pacman开始查看是否需要更新,如果有提示需要更新,则按‘y’,开始pacman更新。<br />
<br />
'''''有时候,还需要用户主动修改某些配置;请仔细阅读升级过程中的输出获取相关信息。'''''<br />
<br />
===三、更新系统===<br />
====使用[[pacman (简体中文)|pacman]]====<br />
现在我们要用[[pacman (简体中文)|pacman]]来更新系统。要更新、同步并'''升级'''你的系统,可以使用命令:<br />
pacman -Syu<br />
pacman就会获取所有最新可用软件包信息并进行升级。(此时你可能会被提示先升级pacman自身。如果是这样,回答'yes',然后在完毕后再运行一次pacman -Syu命令。)<br />
<br />
===='''滚动发布'''之美====<br />
Arch是一个'''rolling release'''(滚动发布)的发行版。这意味着没有必要重新安装或执行完整的系统重建来升级到最新版本。只需要执行'''pacman -Syu''',就能保持你的系统更新到最新和bleeding edge(表示最新的、因而也并非完美的技术)。<br />
<br />
===四、增加一个用户并设置用户组===<br />
用root账号来处理日常工作是很危险的。Root是用来处理系统管理的任务。我们可以用以下命令增加一个普通用户账号:<br />
adduser<br />
大部分缺省选项都是没问题的,你可能还需要将storage、audio、video、optical和wheel加入到你的用户组中 ── 特别是在你打算使用一个完整功能的桌面环境的情况下。<br />
<br />
用户组和用户的关联定义在/etc/group文件中: <br />
<br />
它包含了:<br />
<br />
*'''audio''' - 关于声卡和相关软件的任务<br />
<br />
*'''wheel''' - 给sudo使用<br />
<br />
*'''storage''' - 负责存储设备<br />
<br />
*'''video''' - 视频任务和3D加速<br />
<br />
*'''optical''' - 和光驱有关的任务<br />
<br />
*'''floppy''' - 软驱访问<br />
<br />
*'''lp''' - 打印任务<br />
<br />
请参看[[Groups]]一文了解你应该属于哪些用户组。<br />
你还可能需要将你的用户账号加入到以下用户组(需要以root身份运行此命令):<br />
usermod -aG audio,video,floppy,lp,optical,network,storage,wheel,dbus,hal USERNAME<br />
详情可看usermod和gpasswd的man手册。<br />
<br />
===五、安装建立Sudo (可选)===<br />
安装Sudo:<br />
# pacman -S sudo<br />
以root身份,运行命令visudo,把用户加入sudo用户 (a &quot;sudoer&quot;).如果不知道怎么使用vi,你可以在用visudo前设置EDITOR环境变量为你喜欢的编辑器。例如:<br />
# EDITOR=nano visudo<br />
如果你对于用vi很适应,去掉EDITOR=nano这个变量就行:<br />
# visudo<br />
这命令将在一个特殊的vi会话中打开文件 /etc/sudoers 。visudo复制文件到一个可编辑的临时文件中,用一个编辑器编辑它(vi是默认的),接下来运行一个安全检查(“sanity check”)。如果通过,这个临时文件就有正确的权限将重写的原始文件。t<br />
<br />
<font color=&quot;red&quot;>'''注意:不要直接用编辑器编辑 /etc/sudoers ; 否则会出现这样的提示:Errors in syntax can cause annoyances (像root帐户不能使用的描述一样)。 必须使用 ''visudo'' 命令来编辑 /etc/sudoers.'''</font><br />
<br />
当用户输入以 &quot;sudo&quot;, 作为开始的命令行时,临时授予该用户root权限。加入下面一行:<br />
USER_NAME ALL=(ALL) ALL<br />
USER_NAME 就是单个用户名。<br />
<br />
更多信息,比如按<TAB> 自动命令补全,请见[[Sudo]]<br />
<br />
==第三部分:安装X并配置ALSA==<br />
一共有三步工作:<br />
*1、安装声卡驱动<br />
*2、安装x-window(包括显卡驱动)<br />
*3、配置X<br />
<br />
{{Box Note | '''在热插拔未配置正确的情况下,或者是/etc/rc.d/hal未启动的情况下,请不要启动开启X(包括重启使用gdm或者kdm登陆),否则可能导致鼠标键盘失去响应!!!'''}}<br />
<br />
===一、配置声卡:使用alsamixer===<br />
高级Linux声音架构(Advanced Linux Sound Architecture,简称ALSA)是一个Linux内核组件。它替换了原有的开放声音系统(OSS),为声卡提供了设备驱动。除了声音设备驱动以外,'''ALSA'''还给应用程序开发人员提供了一个用户空间库,可使更高级的API无需直接与内核驱动打交道就能使用驱动功能。<br />
<br />
{{Box Note| Alsa已经包含进最新的内核kernel,udev 将在系统启动时自动检测硬件,并自动根据声卡加载相应的内核模块。虽然声卡已经在工作,但电脑的声音默认是静音。}}<br />
{{Box Note| OSS4.1已经放出,相对于老的版本,这是一个显著的提升的版本,如果使用ALSA有问题, 或者是想尝试新的功能,可以使用 OSS4.1。 相关说明可见: [[OSS]]}} <br />
<br />
Alsa-utils软件包里的alsamixer让我们可以从命令行来配置声音设备。(你也可以稍后在'''X'''环境中使用alsamixer。)<br />
默认情况下,内核加载模块snd_pcsp,这是一个alsa pc speaker模块。 snd_pcsp通常先于&quot;你实际的&quot;声卡模块加载。大部分情况下,这模块最后加载更好,因为可以让alsamixer正确控制需要的声卡。<br />
<br />
在/etc/modprobe.conf中加入这行,可以使得snd_pcsp最后加载:<br />
options snd-pcsp index=2<br />
<br />
当然,如果你不想让snd_pcsp加载,可以把它放入黑名单,或者是在/etc/rc.conf的Modules里禁止它:<br />
MODULES=(... !snd_pcsp)<br />
<br />
{{Box Note | 想要生效,需要释放并重新加载所有声音模块,当然,系统重启就可以简单解决这问题。 }}<br />
<br />
* 安装alsa-utils软件包:<br />
pacman -S alsa-utils<br />
<br />
* 为了解决Alsa声卡独占问题,可以安装alsa-oss:<br />
# pacman -S alsa-oss <br />
<br />
* 把你的普通用户账号加入到audio用户组中:以root身份,运行<code>/usr/bin/gpasswd</code>程序:<br />
gpasswd -a yourusername audio<br />
*以普通用户身份运行: <br />
alsamixer<br />
用左右光标键移动到Master和PCM声道上,按'''M'''取消掉静音。用向上键增加音量。(70-90的音量是较合适的范围)按ESC键离开alsamixer。<br />
有'''Speaker'''的,需要同时取消静音并调整之. <br />
<br />
====测试声音====<br />
以普通用户身份,使用 <code>/usr/bin/aplay</code>程序来测试你的声音配置:<br />
aplay /usr/share/sounds/alsa/Front_Center.wav<br />
你应该会听到一个女性声音说:“Front,center。”<br />
<br />
====保存声音配置====<br />
以root身份运行<code>/usr/bin/alsactl</code> :<br />
alsactl store<br />
这将创建'/etc/asound.state'文件,用来保存alsamixer的设置。<br />
<br />
为了每次启动都可以自动恢复混音器设置,可将守护进程''alsa''加入到你的/etc/rc.conf中的DAEMONS列表。<br />
nano /etc/rc.conf<br />
DAEMONS=(syslog-ng network crond '''alsa''')<br />
''注意,alsa守护进程在启动过程中仅仅是恢复音量设置。它和alsa音频库(和内核级API)是完全不同的。''<br />
<br />
更多详情请参看[[ALSA 安装设置 (简体中文)|ALSA 安装设置]]。<br />
<br />
===二、安装X===<br />
'''X''' 窗口系统(一般叫'''X11'''或者更简单的叫'''X''') 是一个网络互动和显示服务,提供位图显示器窗口. 提供标准化工具包(toolkit)和协议,用于<code>UNIX</code>类操作系统,构建一个图形界面(GUIs) <br />
<br />
'''X''' 提供最基本、基础的框架,用于构建一个图形操作界面环境。包括:绘图、屏幕窗口移动,与鼠标或者键盘的交互。 '''X''' 并不负责用户交互界面的部分:有独立的客户端程序负责处理这部分。 比如gnome、kde。<br />
<br />
'''X''' 因为它先于'''W'''窗口系统,最初由斯坦福大学开发。 <br />
<br />
*''注意: 如果想使用一个'''开源''' 显卡驱动, 需要3d加速,强烈建议在安装Xorg之前安装库 libgl :''<br />
pacman -S libgl<br />
''(拥有专利的视频驱动提供它们自己的gl库安装(implementations).)''<br />
----- <br />
====1、安装X====<br />
构建一个GUI的第一步:用pacman来安装Xorg包.<br />
<br />
# pacman -S xorg<br />
对于新版的xorg,建议(可能大部分情况下是必须的)安装输入设备驱动evdev。它本来应该作为xorg-server的一个依赖被安装的,不过不知道为什么貌似缺失了:<br />
# pacman -S xf86-input-evdev<br />
3d的工具比如glxgears包含在包'''mesa''' 里(如果需要,也安装):<br />
# pacman -S mesa<br />
<br />
====2、安装显卡驱动====<br />
到这一步,已经有了运行'''X''' Server的基本软件包,接下来需要把显卡的驱动安装到电脑里(e.g. xf86-video-<name>). 最简单的X.org配置方法就是安装正确的驱动包,然后使用自动脚本对 /etc/X11/xorg.conf 进行初始化,比如使用 Xorg -configure(arch团队提供hwd工具,但据以前用户的反映,这个现在还老出问题,新手可以使用,以后有能力再配置其他).<br />
<br />
如果不知道显卡类型,输入下面命令:<br />
lspci | grep VGA<br />
<br />
输入下面命令,查看所有'''开源'''驱动: <br />
pacman -Ss xf86-video | less<br />
<br />
下面是一个'''开源'''的显卡列表和相关说明:<br />
*'''xf86-video-apm''' Alliance ProMotion video driver<br />
*'''xf86-video-ark''' ark video driver<br />
*'''xf86-video-ati''' ati video driver<br />
*'''xf86-video-chips''' Chips and Technologies video driver<br />
*'''xf86-video-cirrus''' Cirrus Logic video driver<br />
*'''xf86-video-dummy''' dummy video driver<br />
*'''xf86-video-fbdev''' framebuffer video driver<br />
*'''xf86-video-glint''' GLINT/Permedia video driver<br />
*'''xf86-video-i128''' Number 0 i128 video driver<br />
*'''xf86-video-i740''' Intel i740 video driver<br />
*'''xf86-video-i810''' Intel i810/i830/i9xx video drivers (deprecated - use -intel)<br />
*'''xf86-video-intel''' Newer Version of Intel i810/i830/i9xx video drivers<br />
*'''xf86-video-imstt''' Integrated Micro Solutions Twin Turbo vidoe driver<br />
*'''xf86-video-mach64''' mach64 video driver <br />
*'''xf86-video-mga''' mga video driver (Matrox Graphics Adapter) <br />
*'''xf86-video-neomagic''' neomagic video driver<br />
*'''xf86-video-nouveau''' Open Source 3D acceleration driver for nVidia cards (eperimental)<br />
*'''xf86-video-nv''' nvidia nv video driver<br />
*'''xf86-video-openchrome''' Openchrome drivers<br />
*'''xf86-video-r128''' ati Rage128 video driver<br />
*'''xf86-video-radeonhd''' Experimental Radeon HD video driver for r500 and r600 ATI cards<br />
*'''xf86-video-rendition''' Rendition video driver<br />
*'''xf86-video-s3''' S3 video driver<br />
*'''xf86-video-s3virge''' S3 Virge video driver<br />
*'''xf86-video-savage''' savage video driver<br />
*'''xf86-video-siliconmotion''' siliconmotion video driver<br />
*'''xf86-video-sis''' SiS video driver<br />
*'''xf86-video-sisusb''' SiS USB video driver<br />
*'''xf86-video-tdfx''' tdfx video driver<br />
*'''xf86-video-trident''' Trident video driver<br />
*'''xf86-video-tseng''' tseng video driver<br />
*'''xf86-video-unichrome''' Unichrome video drivers<br />
*'''xf86-video-v4l''' v4l video driver<br />
*'''xf86-video-vesa''' vesa video driver<br />
*'''xf86-video-vga''' VGA 16 color video driver<br />
*'''xf86-video-via''' via video driver<br />
*'''xf86-video-vmware''' vmware video driver<br />
*'''xf86-video-voodoo''' voodoo video driver<br />
<br />
* 说明:'''vesa'''驱动是最原汁原味的,适用于大部分的显卡。如果实在无法找到合适的显卡驱动,就选用vesa。(这是原话,好像夸张了点!If you cannot find a suitable driver for your video chipset, vesa '''should''' work.)<br />
<br />
用pacman来安装适合你显卡的驱动。例如:<br />
pacman -S xf86-video-savage<br />
(给Savage显卡的驱动。)<br />
<br />
* 如果实在不确定需要安装那个显卡驱动,可以安装所有显卡驱动包, 输入下面命令:<br />
pacman -S xorg-video-drivers<br />
<br />
*如果显卡是nVIDIA 或者ATI的,并'''想安装nVIDIA或者ATI官方提供的显卡驱动,请看下面。'''<br />
-----<br />
<br />
====nVIDIA图形显示卡====<br />
nVIDIA显示卡的驱动程序被许多人认为是非常好的质量,而且带有高级3D性能。<br />
<br />
在设置您的你nVIDIA显卡之前您先要选择您要使用的驱动程序。Arch现在有3种不一样的nVIDIA驱动程序,各自支持不同型号的显卡:<br />
<br />
'''1. nvidia-96xx''' ''直到Ge Force 4的较新显卡''<br />
<br />
'''2. nvidia-173xx''' ''Geforce FX系列显卡''<br />
<br />
'''3. nvidia''' ''在GF FX之后的最新GPU''<br />
<br />
{{Box Note| 一些特别老如TNT和TNT2之类的显卡所需的Nvidia-71xx系列闭源驱动,由于无法在Arch所用的新版Xorg下正常运行,并且nvidia也已不再继续支持它们,因此已被删除。你可以改用xf86-video-nv或者xf86-video-vesa驱动。}}<br />
<br />
到nVIDIA主页,看哪个适合你电脑.区别只是安装,配置过程是一样的.<br />
<br />
''根据你的显卡'',选择合适的nVIDIA驱动安装,比如: <br />
pacman -S nvidia-96xx<br />
<br />
nVIDIA软件包有个工具能自动升级你已有的nVIDIA驱动的配置文件/etc/X11/xorg.conf,输入下列命令即可实现:<br />
nvidia-xconfig<br />
<br />
它也有一些选项,用于更深入和具体地配置xorg.conf文件的内容和选项,例如:<br />
<br />
<br />
nvidia-xconfig --composite --add-argb-glx-visuals<br />
<br />
更详细的信息,请参考:nvidia-xconfig(1).<br />
<br />
一些有用的妙法可用在“device“部分(你要清楚它们不一定都能对你的系统有用):<br />
Option "RenderAccel" "true"<br />
Option "NoLogo" "true"<br />
Option "AGPFastWrite" "true"<br />
Option "EnablePageFlip" "true"<br />
将所有的DRI注释掉:<br />
# Load "dri"<br />
<br />
多检查几次你的/etc/X11/xorg.conf以确定你的默认的depth(色深),horizontal sync(水平同步),垂直刷新率,以及分辨率是可以接受的。<br />
<br />
使用<code>/sbin/depmod</code>命令来更新内核模块依赖:<br />
depmod -a<br />
(也许需要重启。)<br />
{{Tip|nvidia配置的高级的说明参考文章[[NVIDIA]] 。}}<br />
<br />
现在你可以跳到'''[[#三、配置X:创建并修改/etc/X11/xorg.conf|配置X]]'''来进一步熟悉,或者跳到'''[[#3、测试 X|测试 X]]'''继续安装过程。<br />
<br />
====ATI图形显示卡====<br />
ATI用户的驱动可以有几种选择。<br />
* '''xf86-video-ati'''软件包提供的开源'''''radeon'''''驱动。<br />
** 原创的、完全支持Radeon芯片组到X1950(最新的R500芯片组)的逆向工程开源驱动。对9200系列以前的显卡完全支持,可以稳定的提供全2D和3D加速。从9500到X1950完全支持2D加速特性,良好的3D加速,不过缺乏某些闭源驱动的特性(例如能源节省特性仍处于测试阶段)。xf86-video-ati支持从HD2xxx (R6xx)到最新的显卡,不过目前仅提供2D支持。<br />
* '''xf86-video-radeonhd'''软件包提供了开源的'''''radeonhd'''''驱动。<br />
** 此驱动支持ATI R500(Radeon X1000系列)以及更新的芯片组。该驱动由AMD提供文档,Novell为之开发。它支持RandR 1.2,目前的开发工作非常活跃。因此所支持的不同系列显卡的功能可以不一致。(有些用户反映它性能优异,而有些则说它很糟)。它还支持带音频的HDMI。<br />
* AUR中的Catalyst软件包提供了闭源'''''fglrx'''''驱动。稍后将介绍闭源驱动。<br />
开源驱动通常可以满足大部分需求而且较少出问题。<br />
<br />
安装'''''radeon'''''ATI驱动:<br />
# pacman -S xf86-video-ati libgl ati-dri<br />
安装'''''radeonhd'''''ATI驱动:<br />
# pacman -S xf86-video-radeonhd libgl ati-dri<br />
<br />
Arch的<code>extra</code>官方仓库曾经提供过闭源ATI驱动'''Catalyst'''的预编译包,不过在2009年3月以后,由于对闭源驱动的质量和开发进度不满意,官方取消了对它的支持。目前catalyst驱动可以在[http://aur.archlinux.org/packages.php?ID=22899 AUR]中找到。Catalyst驱动的安装信息可以在[[ATI#Proprietary_ATI_Catalyst_driver|这里]]找到。<br />
<br />
{{Warning| 闭源ATI驱动仅支持R600和更新的显卡(即HD2xxx及以上系列),不支持旧系列(X1xxx系列及以下)。}}<br />
<br />
{{Tip|ATI配置的高级指引可以参看[[ATI | ATI wiki 文章]]。}}<br />
<br />
====3、安装输入设备驱动软件包====<br />
最新的X需要你为包括键盘和鼠标在内的输入设备安装驱动。查看可用输入设备驱动的完整列表:<br />
# pacman -Ss xf86-input | less<br />
<br />
对大部分用户,xf86-input-keyboard和xf86-input-mouse应该可以满足基本配置。使用pacman来为你的输入设备安装需要的驱动,例如:<br />
# pacman -S xf86-input-keyboard<br />
===三、配置X:创建并修改/etc/X11/xorg.conf===<br />
====xorg.conf文件====<br />
/etc/X11/xorg.conf 是你的 X-Window-System 的主要配置文件,你的 GUI('''G'''raphical '''U'''ser '''I'''nterface)的基础,它是一个普通的文本文件,里面由 “section” 和 “subsection” 来安排。重要的 section 有 ''Files, InputDevice, Module, Monitor, Modes, Screen, Device'' 和 ''ServerLayout''。各个section安排的前后次序没有关系,对同一种类型的设备也可以有多个section,比如你可能有多个显示器,或者你的本本既有鼠标又有触摸板。<br />
------<br />
从X11R7.2版开始Xserver引入了自动配置特性。在大多情况下,即使没有xorg.conf文件它也能很好地运作。如果''自动检测功能工作正常'',而且你又不需要开启如 aiglx、compositing 等功能的话,你甚至不需要创建这个配置文件。<br />
<br />
====1、创建 /etc/X11/xorg.conf====<br />
<br />
高级用户可以手动创建他们的xorg.conf文件。一般用户可以使用程序<code>/usr/bin/Xorg</code>附加参数-configure来生成一个基本的配置文件;以root身份输入下面命令:<br />
# Xorg -configure<br />
这里生成的文件是/root/xorg.conf.new <br />
<br />
把这文件复制到 <code>/etc/X11/</code>:<br />
# cp /root/xorg.xonf.new /etc/X11/xorg.conf<br />
<br />
====更多的创建/etc/X11/xorg.conf的办法====<br />
* 说明:如果你的电脑已经有一个配置好的xorg.conf文件,不管这个文件是在什么别的发行版下生成的,只要Xorg的版本一致,就可以把该文件复制到你的Arch系统的<code>/etc/X11/</code>目录下。<br />
* 可以使用程序<code>/usr/bin/hwd</code>生成xorg.conf。首先要安装这程序:<br />
# pacman -S hwd<br />
然后输入下面命令:<br />
# hwd -xa<br />
{{Box Note| 目前,hwd在生成的xorg.conf有一行失效。 使用完这程序后,需要手动删除或者是注释掉 Section &quot;Files&quot;下的RgbPath那一行。via nano /etc/X11/xorg.conf or your equivalent, as root/sudo.}}<br />
<br />
* 使用<code>/usr/bin/xorgcfg</code> 脚本生成xorg.conf:<br />
# xorgcfg <br />
* 使用<code>/usr/bin/xorgconfig</code>生成xorg.conf,这个程序以互动方式来创建该文件,输入下面命令运行:<br />
# xorgconfig<br />
<br />
====2、Input设备热插拔问题:请在测试X前阅读====<br />
<br />
xorg 1.5.x版本里已经开启热插拔Input设备。<br />
{{Box Note | 当热插拔开启后, X将清空xorg.conf里所有使用the kbd and mouse 驱动建立的设备。这将导致X被冻结,使得鼠标和键盘失去响应。下面是解决办法。'''方法只能二选一'''}}<br />
<br />
有两个办法可以修复这一问题:<br />
<br />
1) '''配置 input设备热插拔''':安装驱动 xf86-input-evdev,同时配置HAL使其能使用kbd/mouse驱动。<br />
<br />
安装xf86-input-evdev:<br />
# pacman -S xf86-input-evdev<br />
在X.org相关进程启动前,启动守护进程hal:<br />
# /etc/rc.d/hal start<br />
把hal加入/etc/rc.conf里的DAEMONS列表里,这样每次电脑启动,都会自动开启hal。详情请见[[Xorg input hotplugging]] 。<br />
<br />
说明: 开启hal必须首先有一个dbus用户和用户组,以root身份输入下面命令创建用户和用户组<br />
<br />
usr/sbin/groupadd -g 81 dbus<br />
usr/sbin/useradd -c 'System message bus' -u 81 -g dbus -d '/' -s /bin/false dbus<br />
<br />
2) '''关闭input设备热插拔''':在/etc/X11/xorg.conf的ServerFlags段,加入参数''Option &quot;AutoAddDevices&quot; &quot;False&quot;'' 这将忽略hal的硬件检测,并使用你xorg.conf的keyboard/mouse配置。步骤如下<br />
# nano /etc/X11/xorg.conf<br />
加入下面三行:<br />
Section &quot;ServerFlags&quot;<br />
Option &quot;AutoAddDevices&quot; &quot;False&quot;<br />
EndSection<br />
<br />
====3、测试 X====<br />
<br />
在所生成的xorg文件路径''path/to/xorg.conf''前,加入参数''-config'' ,运行 '''X'''脚本,可以测试脚本配置是否正确。<br />
比如要测试你上面生成的xorg是否配置正确,输入:<br />
X -config /root/xorg.conf.new<br />
'''X''' 将启动,在屏幕中央会有一个白色的 X ,鼠标或是触摸板可以移动它,按 CTRL-Alt-Backspace 可以退出 '''X'''<br />
<br />
====对xorg.conf除错====<br />
如果 X 出现错误不能运行,你需要手动检查你的配置文件:<br />
<br />
nano /root/xorg.conf.new<br />
<br />
* 确定 Xorg -configure 命令正确的识别了你的显卡,比如:<br />
Section &quot;Device&quot;<br />
<br />
...<br />
<br />
Driver &quot;savage&quot;<br />
<br />
...<br />
<br />
EndSection<br />
<br />
* 确定里面的 Section "Monitor" 设置了水平同步率和垂直刷新率,如果没有要把它加上:<br />
Section &quot;Monitor&quot;<br />
Identifier &quot;Monitor0&quot;<br />
VendorName &quot;Monitor Vendor&quot;<br />
ModelName &quot;Monitor Model&quot;<br />
HorizSync 30.0 - 130.0 # Safe for LCD's<br />
VertRefresh 50.0 - 100.0 # Safe for LCD's and most CRT's.<br />
EndSection<br />
如果你不知道这些刷新率到底是多少,你就得查一下你显示器的说明书。<br />
<br />
* 在section "Screen"配置默认色深(color depth):<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Card0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
(此处色深被设定为真彩24色。)<br />
<br />
<br />
* 在subsection &quot;Display&quot; 加入你需要的Modes, at least under the Depth 24 header, e.g.:<br />
SubSection &quot;Display&quot;<br />
Viewport 0 0<br />
Depth 24<br />
Modes &quot;1024x768&quot; &quot;800x600&quot; &quot;640x480&quot;<br />
* Add the following section, if you wish to enable eye candy which requires the composite extension: <br />
Section &quot;Extensions&quot;<br />
Option &quot;Composite&quot; &quot;Enable&quot;<br />
EndSection<br />
<br />
* 上述调整完成后,再测试你的配置:<br />
X -config /root/xorg.conf.new<br />
<br />
* 在确认 '''X''' session开启,没有错误之后,把测试好的配置文件移到 /etc/X11下,作为系统的xorg.conf配置文件:<br />
mv /root/xorg.conf.new /etc/X11/xorg.conf<br />
详细的介绍可见[[Xorg]] <br />
<br />
接下来可以简单作测试 '''[[#Simple baseline X test|Simple baseline X test]]'''<br />
<br />
====调整键盘布局====<br />
=====如果开启了input热插拔=====<br />
# cp /usr/share/hal/fdi/policy/10osvendor/10-keymap.fdi /etc/hal/fdi/policy/<br />
# nano /etc/hal/fdi/policy/10-keymap.fdi<br />
Edit the &quot;input.xkb.layout&quot; key and possibly the &quot;input.xkb.variant&quot; key in this file.<br />
Restart hal:<br />
# /etc/rc.d/hal restart<br />
<br />
=====如果关闭了input热插拔=====<br />
Add option lines in the &quot;InputDevice&quot; section of the /etc/X11/xorg.conf file specifying the keyboard layout and variant:<br />
Option &quot;XkbLayout&quot; &quot;be&quot;<br />
Option &quot;XkbVariant&quot; &quot;&quot;<br />
<br />
详情请见 [[Xorg input hotplugging]]。<br />
<br />
===简单的命令行界面X测试(如果需要)===<br />
<br />
在安装了xorg、合适的显卡驱动、创建了一个/etc/X11/xorg.conf文件之后,如果想在安装完整桌面环境之前,快速测试下你的配置,使用'''xterm'''可以实现! <br />
Xterm是个简单的终端模拟程序,作为base xorg软件包的一部分会被自动安装,运行在'''X '''Server环境里。通过配置~/.xinitrc,Xterm可以让我们快速测试显卡驱动和配置文件/etc/X11/xorg.conf是否被正确配置。(另外,如果在没有/etc/X11/xorg.conf的情况下,你想测试下'''X''' 自动检测是否满意,也可以使用这个)<br />
<br />
==== 准备工作:配置~/.xinitrc====<br />
<br />
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. <br />
{{Box Note | '''[[.xinitrc]]''' is a so-called 'dot' (.) file. 在UNIX文件系统下,文件名以 (.)开头的,是 '隐藏文件',,使用普通的命令'ls' 将不显示这些文件,使用加了参数命令'''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 &quot;Run Control&quot;.}}<br />
<br />
'''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. (说明: ''如果没有文件~/.xinitrc, /etc/X11/xinit/xinitrc 将被作为替代来使用,这是个使用TWM and Xterm的默认配置。'')<br />
<br />
切换到'''''普通, 非root'''''用户:<br />
# su - ''yourusername''<br />
* /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.<br />
* 如果没有~/.xinitrc这个文件,到该目录下创建一个,或者从/etc/skel/复制一个同样的文件到你的home目录:: <br />
<br />
$ cp /etc/skel/[[.xinitrc]] ~/<br />
<br />
* 编辑文件: <br />
$ nano ~/.xinitrc<br />
加入这行&quot;<code>exec xterm</code>&quot;像下面这样:<br />
<br />
#!/bin/sh<br />
#<br />
# ~/.xinitrc<br />
#<br />
# Executed by startx (run your window manager from here)<br />
#<br />
exec xterm<br />
# exec wmaker<br />
# exec startkde<br />
# exec icewm<br />
# exec blackbox<br />
# exec fluxbox<br />
<br />
{{Box Note | ''请确保~/.xinitrc''里,以'''exec'''开头的,只有'''一行'''的注释被去掉。}}<br />
<br />
====开始执行测试====<br />
<br />
* 以普通用户身份输入下面命令,开启'''X''',开始测试你的配置:<br />
<br />
$ startx<br />
或者是这命令<br />
$ xinit<br />
<br />
此时会打开一个'''xterm''' session,你可以在这里测试your keyboard and its layout<br />
<br />
* 按Ctrl+Alt+Backspace,或者输入"exit"可以退出'''X''' Server。<br />
* 如果开启'''X'''出现问题,在终端,查看日志文件/var/log/Xorg.0.log的错误信息。<br />
<br />
更多的Xorg configuration介绍可见[[Xorg]] .<br />
<br />
==第四部分:安装并配置桌面环境==<br />
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 icons, applets, windows, toolbars, folders, wallpapers, 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.<br />
<br />
* 如果你需要一个完整功能,类似于Windows和Mac OSX, 可以选择安装'''[[#KDE|KDE]]''' <br />
* If you want something slightly more minimalist, which follows the K.I.S.S. principle more closely, '''[[#GNOME|GNOME]]''' is a good choice<br />
* '''[[#Xfce|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.<br />
<br />
如果你的机器较老,或者是希望使用一个更轻量、更少GUI要求,可以选择只安装 '''Window Manager''', 或者 WM. A WM controls the placement and appearance of application windows in conjunction with the X Window System but does NOT provide such additions as panels, applets, icons, etc.<br />
* Lightweight floating WM's include: [[#Openbox|'''Openbox''']], [[#Fluxbox|'''Fluxbox''']], [[#fvwm2|'''fvwm2''']], '''Windowmaker, Pekwm, and TWM'''.<br />
* If you need something completely different, try '''Awesome, ion, wmii, dwm, or xmonad'''。<br />
<br />
===一、安装字体===<br />
在安装桌面环境/窗口管理器'''之前''',也许你会先安装些美观的字体。Dejavu和bitstream-vera都是不错的字体集。而对于网页,你还可能需要Microsoft字体。如下安装:<br />
pacman -S ttf-ms-fonts ttf-dejavu ttf-bitstream-vera<br />
对于中文字体,开源的文泉驿正黑矢量字体是不错的选择,它还内嵌了9pt-12pt的点阵宋体:<br />
pacman -S wqy-zenhei<br />
<br />
===二、选择默认启动的桌面环境 ~/.xinitrc===<br />
<br />
以普通用户身份编辑/home/username/.xinitrc,加入你要用的DE. This will allow you to use '''startx/xinit''' from the shell, in the future, to open your DE/WM of choice:<br />
<br />
nano ~/.xinitrc<br />
<br />
反注释或者加入相应的桌面环境/窗口管理器的''''exec''' ..'内容行。例如:使用Xfce4桌面环境:<br />
<br />
exec startxfce4 <br />
<br />
记住在~/.xinitrc中只反注释掉一行'''exec'''。这条命令将一直运行到你注销桌面登录。一般的,shell将等到kde完成加载之后,在运行下一条命令。在命令前加 &quot;exec&quot; ,是告诉the shell 这条命令最后执行, 这样shell就不用等待其他命令了,直接载入桌面。<br />
接下来安装你所选的桌面环境/窗口管理器。<br />
<br />
===三、选择安装一个桌面环境===<br />
====GNOME====<br />
=====关于GNOME=====<br />
GNOME是'''G'''NU '''N'''etwork '''O'''bject '''M'''odel '''E'''nvironment的缩写。GNOME项目有两大部分:GNOME桌面环境 ── 既直观又迷人的最终用户桌面,以及GNOME开发平台 ── 一个用来创建可与桌面集成的应用程序的庞大的框架。<br />
<br />
=====安装=====<br />
安装基本的GNOME环境:<br />
pacman -S gnome<br />
<br />
安装额外的GNOME环境:<br />
pacman -S gnome-extra<br />
然后选择提示的所有软件包。 <br />
<br />
=====对GNOME有用的守护进程=====<br />
如之前所述,守护进程(daemon)是运行在后台的程序,它等待事件发生并提供相应的服务。其中'''Hal'''守护进程可以自动挂载磁盘、光驱和U盘给GUI使用。'''Fam'''守护进程可以在GUI中实时反映文件的变动,如最近安装的程序、文件系统的变化等。'''Hal'''和'''fam'''使得GNOME的使用更为方便。Hal和fam软件包在安装GNOME时已一同安装,建议安装社区库的gamin来替代fam。<br />
<br />
{{Box Note|注意,fam是一个比较老的包,很容易造成较大的日志文件。}}<br />
<br />
{{Box Note|在当前的gnome环境中,你可以安装gamin来实现fam的功能。这时,你可以不用在DAEMONS中添加fam启动项了(不需要加入gamin,它会自动被启用)。}}<br />
<br />
* 你需要启动'''hal'''守护进程。<br />
<br />
启动hal:<br />
/etc/rc.d/hal start<br />
<br />
如果您想使用fam,同样需要启动:<br />
/etc/rc.d/fam start<br />
<br />
将hal加入到/etc/rc.conf的DAEMONS中以使得它们随系统启动而自动运行:<br />
nano /etc/rc.conf<br />
<br />
DAEMONS=(syslog-ng network crond alsa '''hal''')<br />
<br />
{{Box Note|注意,如果使用fam,那么把fam加入到hal后面。}}<br />
<br />
* 或许你还会希望安装一个图形界面的登录管理器。在GNOME下'''gdm'''守护进程是个不错的选择。<br />
以root身份运行:<br />
pacman -S gdm<br />
<br />
让gdm启用有两种方式,一种是直接加入到DAEMONS的末尾,通过rc.conf来启动;另外一种方式是用过配置inittab来加载gdm。<br />
<br />
* 通过inittab来加载gdm也很方便(推荐使用这种方式):<br />
nano /etc/inittab<br />
<br />
修改默认启动方式:<br />
<br />
将<br />
id:3:initdefault:<br />
改为<br />
id:5:initdefault:<br />
<br />
然后取消下面代码的注释:<br />
x:5:respawn:/usr/sbin/gdm -nodaemon<br />
<br />
{{Box Note|实际上,可以看到gdm/xdm/kdm/slim等,使用哪个取决于你的喜好,启用喜欢的那个,将其他的注释掉。当然,本章介绍的是gnome,所以推荐gdm,下章中将推荐kdm:)}}<br />
<br />
<br />
* 通过DAEMONS方式启动gdm也很方便:<br />
nano /etc/rc.conf<br />
<br />
DAEMONS=(syslog-ng network crond alsa hal gdm)<br />
<br />
{{Box Note|这是类似debian/ubuntu的做法,这种方式有一点不好:不管什么时候(非修复模式),系统总是会尝试进入gdm引导的X方式下。对于X已经配置得很好,并且不使用纯控制台的人可以使用这种方式。但是选择这种方式的话你将不能通过内核参数3或者5来区分进入纯字符控制台还是X11的gdm登录窗口。}}<br />
<br />
* 开启Gnome<br />
以普通用户身份启动X:<br />
startx<br />
或者这条命令也行:<br />
$ xinit<br />
如果你的 ~/.xinitrc一直没配置,那你将可以一直使用下面这条命令来开启Gnome:<br />
$ xinit /usr/bin/gnome-session<br />
<br />
关于安装和配置GNOME的高级指引可以参见[[GNOME (简体中文)|GNOME]]一文。接下来你可以浏览'''[[#优化和收尾|优化和收尾]]'''。或许你还会对[[ArchTips(简体中文)|Arch安装完后的小技巧]]一文感兴趣。<br />
<br />
=====美化=====<br />
如果不满足于缺省的GNOME主题和图标,那么可以安装一个不错的主题,比如murrine:<br />
pacman -S gtk-engine-murrine<br />
接着在System->Preferences->Theme里选择这个主题。<br />
<br />
Arch Linux也做了些不错的主题,根据你自己的审美观,选择满意的安装吧:<br />
<br />
# pacman -S gtk-engines gtk2-themes-collection gtk-aurora-engine gtk-candido-engine gtk-rezlooks-engine<br />
<br />
你还可以在[http://www.gnome-look.org Gnome Look]里找到更多的主题、图标和壁纸。<br />
<br />
====KDE====<br />
=====关于KDE=====<br />
KDE桌面环境('''K''' '''D'''esktop '''E'''nvironment)的缩写。 KDE是一种著名的运行于GNU/Linux 、 <code>UNIX</code> 工作站等的强大、自由图形工作环境。她拥有对系统内部各功能的强大整合能力、跨平台能力、易用性、优异的初始界面.<br />
<br />
=====安装=====<br />
Arch提供多个版本的kde: '''kde、kdebase 和 KDEmod'''. 选'''一个'''就行了,然后 '''[[#有用的KDE守护进程|有用的KDE守护进程]]''': <br />
<br />
'''1.)''' '''kde'''是完整的kde软件包,大概 ~300MB,适合主要使用kde软件的系统.<br />
pacman -S kde<br />
'''2.)''' '''kdebase'''是kde的基础软件包(里面没有kdm),大概 ~80MB,适合于只想把kde作为基础系统.<br />
pacman -S kdebase<br />
'''3.)''' '''KDEmod''' 是 Arch Linux独有的、社区驱动的项目,目标是把kde更加细致的模块化和达到其极致的运行效率。KDEmod项目的网站在http://chakra-project.org/ 。<br />
<br />
=====有用的KDE守护进程=====<br />
<br />
KDE 需要'''hal''' ('''H'''ardware '''A'''bstraction '''L'''ayer) 作为守护进程(daemons). '''kdm''' ( '''K''' '''D'''isplay '''M'''anager), 提供一个 '''图形化登录界面'''.<br />
{{Box Note|hal守护进程将自动开启dbus守护进程。kde4里已经不需要fam。kdm现在在kdebase-workstation这个包里,如果只安装kdebase,需要再安装此包才能使用kdm}}<br />
<br />
The hal daemon, among other things, will automate the mounting of disks, optical drives, and USB drives/thumbdrives for use in the GUI. <br />
<br />
-----<br />
启动hal进程:<br />
<br />
/etc/rc.d/hal start<br />
<br />
编辑/etc/rc.conf的 DAEMONS部分:<br />
nano /etc/rc.conf<br />
把 '''hal''' 加入 DAEMONS 部分,以便他们在系统启动时加载. 如果想要kde的图形化登录界面,把 '''kdm'''也加进去(或者不加,在/etc/inittab里面设置): <br />
DAEMONS=(syslog-ng network crond alsa '''hal kdm''')<br />
{{Box Note|如果你安装的是KDEmod3,则使用kdm3替换kdm}}<br />
<br />
*This method will start the system at runlevel 3, (/etc/inittab default, multiuser mode), and then start KDM as a daemon. <br />
<br />
*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 [[Adding a login manager (KDM, GDM, or XDM) to automatically boot on startup]] for more.<br />
<br />
*If you prefer to log into the '''console''' at runlevel 3, 手动启动 X, 则不加入kdm, 或者是加个前缀( ! )禁止它。<br />
<br />
* 现在可以试试效果了,用普通用户身份开启X Server:<br />
startx<br />
或者<br />
$ xinit<br />
更多关于安装和配置KDE的文章,请看[[KDE]].<br />
<br />
到此步,可以看 '''[[#优化和收尾]]'''这部分了. You may also be interested in the [[Post Installation Tips]] wiki article.<br />
<br />
====Xfce====<br />
=====关于Xfce=====<br />
和GNMOE、KDE一样,Xfce是一个桌面环境,其目标是快捷、轻量,同时又美观而易用。它还提供了一整套的应用程序如根窗口应用(root window app)、 窗口管理器、文件管理器、面板等等。 Xfce是用GTK2 toolkit编写的(类似GNOME),和其它大型桌面环境一样,它也有自己的开发环境(库文件、守护进程等)。但不象GNOME或者KDE,Xfce是轻量化的,其设计更接近于CDE而不是Windows或者Mac。它的开发周期比较慢,但是十分稳定、速度很快。在老硬件上Xfce可以运行得很好,而在新机器上更是运行如飞。<br />
<br />
=====安装=====<br />
安装完整的xfce环境以及主题和extras:<br />
pacman -S xfce4 xfce4-goodies gtk2-themes-collection <br />
<br />
如果你使用KDM或者GDM的话会显示一个xfce会话。另一种启动方式是:<br />
startxfce4<br />
<br />
关于安装和配置xfce的高级指引可以参见[[Xfce (简体中文)|Xfce]]一文。<br />
<br />
恭喜!欢迎来到Arch Linux系统的Xfce桌面环境!接下来你可以浏览'''[[#优化和收尾|优化和收尾]]''',或者下面的其它内容。或许你还会对[[ArchTips(简体中文)|Arch安装完后的小技巧]]一文感兴趣。<br />
<br />
====*box====<br />
=====Fluxbox=====<br />
Fluxbox © is yet another windowmanager for X.<br />
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).<br />
<br />
Install Fluxbox using <br />
pacman -S fluxbox fluxconf<br />
<br />
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:<br />
exec startfluxbox <br />
<br />
More information is available in the [[Fluxbox]] article.<br />
<br />
=====Openbox=====<br />
Openbox是一个标准的”温顺的“,快速的,轻量级的,可扩展的窗口管理器。<br />
<br />
Openbox与你的应用程序一起工作工作,并使你的的桌面便于管理。这是因为它的开发方式和通常的窗口管理器的方式是相悖的。 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.<br />
<br />
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. <br />
<br />
安装openbox<br />
pacman -S openbox obconf obmenu<br />
<br />
一旦openbox安装好,你将得到一个消息to move menu.xml & rc.xml to ~/.config/openbox/ in your home directory:<br />
<br />
mkdir -p ~/.config/openbox/<br />
cp /etc/xdg/openbox/rc.xml ~/.config/openbox/<br />
cp /etc/xdg/openbox/menu.xml ~/.config/openbox/<br />
<br />
In the file "rc.xml" you can change various settings for Openbox (or you can use OBconf). In "menu.xml" you can change your right-click menu.<br />
<br />
To be able to log into openbox you can either go via graphical login using KDM/GDM or startx, in which case you will need to edit your ~/.xinitrc (as user) and add the following:<br />
<br />
exec openbox<br />
<br />
For KDM there is nothing left to do; openbox is listed in the sessions menu in KDM.<br />
<br />
Useful programs for openbox are:<br />
* PyPanel or LXpanel if you want a panel<br />
* feh if you want to set the background<br />
* ROX if you want a simple file manager and desktop icons<br />
<br />
More information is available in the [[Openbox]] article.<br />
<br />
====fvwm2====<br />
FVWM是一个非常强大的面向X桌面系统的”ICCCM-compliant的多虚拟桌面的窗口管理器“(ICCCM-compliant multiple virtual desktop window manager)。开发活动很活跃,支持也是极好的。 <br />
<br />
输入下面命令安装 fvwm2 <br />
pacman -S fvwm <br />
<br />
fvwm会自动添加进 kdm/gdm会话列表. 如果没有的话,添加 <br />
exec fvwm <br />
<br />
到你的用户文件 .xinitrc.<br />
<br />
注意:这个稳定版已经有些年头了,如果需要最新的fvwm版本,可以安装unstable repo里的fvwm-devel 包.<br />
<br />
===四、优化和收尾===<br />
====HAL====<br />
如果你已经安装了一个桌面环境,但是又觉得用起来不是很方便,那么现在就是个安装HAL的好时机了。HAL使得你的手机、iPod、移动硬盘等等可以即插即用。它会挂载设备并在你的桌面或/和'My Computer'目录中创建相应的图标,使得你可以在插入设备后就能访问到它,无需每次都对每个新设备来手动配置/etc/fstab文件或者udev规则。<br />
<br />
KDE、GNOME和XFCE都使用到HAL。<br />
<br />
安装过程描述可以在[[HAL (简体中文)|HAL]]一文中找到。其它一些信息可以在[http://en.wikipedia.org/wiki/HAL_(software) Wikipedia]上找到。<br />
<br />
====启动时让守护进程在后台执行====<br />
<br />
要加速系统的启动过程,可以在/etc/rc.conf中给守护进程前加上'@'符号使之在后台执行,例如:<br />
<br />
DAEMONS=(@syslog-ng @network crond @alsa @hal @fam @kdm)<br />
这使得守护进程在后台被加载,无需等待它们加载结束。<br />
<br />
在守护进程前加上(!)可以禁止系统启动时加载它,例如:<br />
<br />
DAEMONS=(@syslog-ng @network !crond @alsa @hal @fam @kdm)<br />
<br />
另一种方式是直接将不需要的守护进程删除。<br />
<br />
====美化LCD下的字体====<br />
See [[Fonts]]<br />
<br />
====让所有的鼠标按键生效====<br />
看这个 [[Get All Mouse Buttons Working]]<br />
<br />
====笔记本电脑可能遇到的问题====<br />
(1) 触摸板问题<br />
参看http://wiki.archlinux.org/index.php/Touchpad_Synaptics<br />
<br />
(2) 摄像头问题<br />
参看http://wiki.archlinux.org/index.php/Webcam_Setup<br />
<br />
(3) 无线上网问题<br />
参看http://wiki.archlinux.org/index.php/Wireless<br />
<br />
(4) 快捷键问题<br />
参看http://wiki.archlinux.org/index.php/Extra_Keyboard_Keys<br />
<br />
====配置CPU频率====<br />
现在的处理器能够降低频率和电压,以降温和降低电源消耗。降温能使系统更稳定,笔记本用户肯定是想这样做的,但是即使是台式机也会对系统有利。<br />
<br />
安装CPU频率工具用:<br />
pacman -S cpufrequtils<br />
<br />
把CPU频率在/etc/rc.conf里加入到启动进程(daemons)中。编辑配置文件/etc/conf.d/cpufreq改<br />
governor="conservative"<br />
<br />
这使得在需要的情况下可以动态地增减CPU频率(这是对于台式机来说也是一个安全的选择)。改变最小频率(min_freq)和最大频率(max_freq)以匹配你的CPU的情况。如果你不知道频率,在载入频率测量模块后运行“cpufreq-info”。你也可以将min_freq和max_freq注释掉或删除,这样就能自动进行。加入频率测量模块到/etc/rc.conf的模块行。<br />
几乎所有的笔记本和台式机都可以简单地使用''acpi-cpufreq''驱动,但是也有其它的选择,如:''p4-clockmod, powernow-k6, powernow-k7, powernow-k8, and speedstep-centrino''。 <br />
<br />
通过下面这个命令载入这个模块:<br />
modprobe <modulname> <br />
通过下面命令行开启cpufreq:<br />
/etc/rc.d/cpufreq start<br />
更多细节,请看 [[Cpufrequtils]]<br />
<br />
==第五部分:常用的应用程序==<br />
更多信息,请看[[ArchLinux常用的应用程序(简体中文)]].<br />
<br />
==附录==<br />
新手指南附录[[ArchLinux新手指南附录 (简体中文)]]<br />
<br />
想得到更多的信息和支持,你可以去[http://www.archlinux.org/ homepage], [[Special:Search|search the wiki]],[http://bbs.archlinux.org/ forums],[[ArchChannel|IRC channel]],以及[http://www.archlinux.org/mailman/listinfo/ mailing lists]。<br />
=====问题答疑=====<br />
See [[Arch FAQs for newbies]]<br />
还有这里[http://bbs.archlinux.org/viewtopic.php?t=29055 Arch forum thread] 也是面向初学者的。<br />
<br />
=====术语=====<br />
更多信息关于Arch术语,查阅[[Arch Terminology/Jargon for newbies|this article]].<br />
<br />
=====接下来还有什么?=====<br />
<br />
你还可以阅读:<br />
<br />
[[Arch 官方安装指南 (简体中文)|Arch 官方安装指南]]<br />
<br />
[[Arch AUR (简体中文)|ArchLinux社区用户软件仓库 (AUR)]]<br />
<br />
[[Get All Mouse Buttons Working]]<br />
<br />
[[改善Pacman性能 (简体中文)|改善Pacman性能]]<br />
<br />
[[Kernel Compilation]]<br />
<br />
[[Pm-utils 电源管理 (简体中文)|Pm-utils 电源管理]]<br />
<br />
[[CPU 频率调节 (简体中文)|CPU 频率调节]]<br />
<br />
[[:Category:美化|美化]]</div>
Flydragon
https://wiki.archlinux.org/index.php?title=ArchLinux_%E6%96%B0%E6%89%8B%E6%8C%87%E5%8D%97_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=90849
ArchLinux 新手指南 (简体中文)
2010-01-04T09:43:32Z
<p>Flydragon: /* Analog Modem */</p>
<hr />
<div>[[Category:简体中文]]<br />
[[Category:获取并安装Arch (简体中文)]]<br />
[[Category:关于Arch_(简体中文)]]<br />
[[Category:HOWTOs (简体中文)]]<br />
<br />
{{Article summary start}}<br />
{{Article summary text|本文针对新手,提供了极其详尽的Archlinux的安装过程向导,和相关的简要说明。}}<br />
{{Article summary heading|已有的语言版本}}<br />
{{Article summary heading|Available Languages}}<br />
{{i18n_entry|Česky|Průvodce začátečníka (Česky)}}<br />
{{i18n_entry|简体中文|Arch 新手安装指南 (简体中文)}}<br />
{{i18n_entry|正體中文|Beginner's Guide 新手指南}}<br />
{{i18n_entry|Dansk|Dansk_Begynderguide}}<br />
{{i18n_entry|Deutsch|Beginners Guide (Deutsch)}}<br />
{{i18n_entry|English|Beginners Guide}}<br />
{{i18n_entry|Español|Guía para Principiantes (Español)}}<br />
{{i18n_entry|Français|Manuel_du_Débutant_(Français)}}<br />
{{i18n_entry|Italiano|Beginners Guide (Italiano)}}<br />
{{i18n_entry|Indonesia|Beginners_Guide_(Indonesia)}}<br />
{{i18n_entry|Lietuviškai|Pradedančiųjų gidas (Lietuviškai)}}<br />
{{i18n_entry|Nederlands|Beginners_Guide_(Nederlands)}}<br />
{{i18n_entry|Português Brasil|Guia do Iniciante(Português do Brasil)}}<br />
{{i18n_entry|Português|Guia para Principiantes(Português)}}<br />
{{i18n_entry|Русский|Руководство_для_новичков}}<br />
{{i18n_entry|Türkçe|Başlangıç Rehberi (Türkçe)}}<br />
{{i18n_entry|हिन्दी|नौसिखिया गाइड(हिन्दी)}}<br />
{{Article summary heading|相关文章}}<br />
{{Article summary wiki|Arch 官方安装指南 (简体中文)}}(更通用的安装方式)<br />
{{Article summary wiki|ArchLinux新手指南附录 (简体中文)}}<br />
{{Article summary wiki|ArchLinux安装完后的小技巧 (简体中文)}}<br />
{{Article summary wiki|ArchLinux常用的应用程序(简体中文)}}<br />
{{Article summary wiki|Work and Play with Arch (Chinese)}}<br />
{{Article summary end}}<br />
<br />
==前言==<br />
<br />
=====所有你一直想知道的关于安装Arch的事=====<br />
这篇文档将会指导你安装和配置[[ArchLinux (简体中文)|Arch Linux]] ── 一个简洁、轻量级的GNU/Linux发行版,一个类<code>UNIX</code>的操作系统。本文是面向Arch新用户,因此尽力为所有人提供强大的参考资料和信息。本指南讲述该如何获得一个基本配置好的Arch Linux系统(拥有一个图形桌面环境),但显然是不可能涵盖(甚至是预见)所有的信息。因此本指南会专注于某些关键性的步骤,想要进一步深入了解你可以查看[[Main Page (简体中文)|Arch Linux Wiki]]或者[http://bbs.archlinux.org/ Arch Linux论坛]。同时有兴趣的话你还可以了解一下[[Arch 之道 (简体中文)|Arch 之道]],它概述了Arch Linux发行版背后的哲学思想。<br />
<br />
'''Arch Linux的相关特性:'''<br />
* '''[[The Arch Way | Simple]]''' design and philosophy<br />
* Community distro targeted at competent GNU/Linux users<br />
* All packages compiled for '''i686/x86-64'''<br />
* 从底层开始就可以让用户高度定制<br />
* '''[[The Arch boot process | BSD-style init]]''' scripts, featuring one centralized configuration file<br />
* '''滚动升级''' <br />
* '''[[Pacman]]''' package manager is fast, written in '''C''', lightweight and agile, with a very modest memory footprint<br />
* '''[[ABS]]''': The '''A'''rch '''B'''uild '''S'''ystem, a ports-like package building system makes it simple to create your own easily installable Arch packages from source, to use and/or share with the community on the [[AUR]]<br />
* '''[[AUR]]''': The Arch User Repository, offering many thousands of build scripts for Arch user-provided software packages<br />
<br />
=====别怕(DON'T PANIC)!=====<br />
要知道Arch Linux的安装方法和过程也许会和你所使用过的其它GNU/Linux发行版非常不同,特别你是个新手的话将更能体会到这点。通常,GNU/Linux发行版会在一张或者一堆CD(甚至是DVD)上捆绑了大量的软件,包含了缺省桌面环境、缺省的应用程序和设置、硬件自动检测和图形化的安装程序,一切都是替你选择好了的。相反的,Arch Linux系统是让'''用户自己'''只是用一个bash shell和基本系统工具,从ncurses installer和基础系统上建造起来的。这就是[[Arch 之道 (简体中文)|Arch 之道]]。不象其它大型发行版,它没有强加于用户的缺省环境或者配置。你可以在命令行使用[[pacman (简体中文)|pacman]]通过互联网连接从Arch软件仓库安装软件包,直到你的系统配置成你希望的样子。这给予了用户最大的弹性、选择性和对系统资源的控制。因为是'''你'''建造了它,所以你肯定能了解系统里具体细节,知道底层都有些什么。<br />
<br />
Arch Linux系统是通过编辑文本文件进行配置的,没有提供图形界面的工具,所以需要对系统和linux相对熟悉。<br />
Arch Linux针对的是有能力的GNU/Linux用户以及希望花费时间学习系统知识的用户。 <br />
<br />
''Arch是一个可以被用户塑造的工具。''<br />
<br />
=====授权协议=====<br />
<br />
Arch Linux, pacman, documentation, and scripts are copyright<br />
©2002-2007 by Judd Vinet, ©2007-2008 by Aaron Griffin and are licensed under the GNU General Public License Version 2.<br />
<br />
=====[[Arch 之道 (简体中文)|Arch 之道]]=====<br />
<br />
''Arch的设计思想是"保持简洁"(keeping it simple)。'' <br />
<br />
这里的‘简洁’并不是单指‘简单’或者‘用户友好’,而是‘没有不必要的增加、修改或者复杂性’。简而言之,即优雅、极简之法。<br />
<br />
<br />
''"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 crap." -Aaron Griffin''<br />
<br />
<br />
''"The extraordinary part of [my method] lies in its simplicity..I have always believed that the simple way is the right way."'' - Bruce Lee<br />
“(我的方法中)最超凡的部分是它的简单性,我一直相信简单的就是对的。” 李小龙(Bruce Lee)<br />
<br />
Occam's razor: ''Entia non sunt multiplicanda praeter necessitatem'' or "Entities should not be multiplied unnecessarily." The term razor refers to the act of shaving away unnecessary assumptions and complications to get to the simplest explanation, method or theory.<br />
<br />
{{Box Note |'''仔细遵循本指南是成功安装一个配置正常的Arch Linux系统的基本要点,因此''请''认真仔细的阅读本文'''}}<br />
* 你也可以将本指南打印出来,作为一个较为有用的Arch Linux用户手册。<br />
*''如果你想在这个wiki里增加内容,请适当描述清楚“为什么会这样”以及“该怎么办”。最佳的文档应该能教会我们如何做和为什么这么做!''<br />
* Arch的wiki是项优秀的资源,可以[http://wiki.archlinux.org/index.php/Main_Page 第一时间]用来解决日常问题; 如果找不到答案也可以求助IRC和[http://bbs.archlinux.org/ 论坛]。<br />
----<br />
----<br />
欢迎使用Arch!现在,让我们开始吧。<br />
<br />
本文按照安装过程分四大部分:<br />
<br />
'''[[#第一部分:安装基本系统|第一部分:安装基本系统]]'''<br />
<br />
'''[[#第二部分:完成基本系统并升级|第二部分:完成基本系统并升级]]'''<br />
<br />
'''[[#第三部分:安装X并配置ALSA|第三部分:安装X并配置ALSA]]'''<br />
<br />
'''[[#第四部分:安装并配置桌面环境|第四部分:安装并配置桌面环境]]'''<br />
<br />
==第一部分:安装基本系统==<br />
===一、获取最新的系统安装包===<br />
<br />
你可以从[http://archlinux.org/download/ 这里]获取Arch最新的官方系统安装包。最新版本是2009.08<br />
<br />
*不论是Core还是Netinstall系统安装包,都只是包含了安装'''Arch Linux基本系统'''所需的软件包. ''注意,基本系统是不包含GUI图形界面的。它主要包含了GNU的系列工具(编译器、汇编程序、链接、库、脚本,还有其它的一些有用的工具),Linux的内核,还有一些额外的库和模块。<br />
*Core映像文件可以较方便的通过CD或者网络进行安装。<br />
*Netinstall映像文件较小巧,本身没有提供软件包,整个系统都是通过internet来获取的。<br />
*isolinux映像文件是给那些使用grub版本时发生问题的用户的。两者没有其它区别。<br />
*Arch64问答( http://wiki.archlinux.org/index.php/Arch64_问答_(简体中文) )可以帮助你在32位版本和64位版本之间作出选择。<br />
<br />
====CD 系统安装包====<br />
把下载的.iso映像文件刻录到CD上。开机时用CD启动,出现界面,跳到[[#二、启动Arch Linux系统安装程序| 二、启动Arch Linux系统安装程序]]<br />
{{Box Note| 通常为了刻录的稳定可靠(速率越低刻录质量越有保证),推荐刻录的最大速度不超过16倍速。有些用户推荐'''''速度为 4x 或者 2x.''''' 如果所刻录的CD有问题,可以尝试使用你系统所支持的最小速度方式刻录。 }}<br />
<br />
<br />
====USB安装方式====<br />
{{Warning|这样做会把USB盘里面原有的数据格式化。}}<br />
<br />
'''<code>UNIX</code> 方式:'''<br />
<br />
插入USB盘,找到其路径,用<code>/bin/dd</code>命令把.img映像文件写入USB(Linux下):<br />
<br />
dd if=archlinux-2009.08-''{core|netinstall}''-''{i686|x86_64}''.img of=/dev/sd''x''<br />
<br />
if= 后面是.img镜像文件的路径,of= 是你的USB路径. 要使用/dev/sd''x''而不是/dev/sd''x1''.(就是要使用整个分区而不是第一分区)<br />
<br />
'''检查镜像的完整性md5sum (可选):'''<br />
<br />
记下读入和写出的记录区数目,然后执行以下命令进行检查:<br />
dd if=/dev/sd''x'' count=''记录区数目'' status=noxfer | md5sum<br />
<br />
md5sum命令返回的值(这是你检查U盘上文件得到的)要与你下载的archlinux镜像文件的md5sum校验值相同;它们都应该和镜像站点的md5sum文件列表里相应的值相同。<br />
<br />
'''Windows方式:'''<br />
<br />
从https://launchpad.net/win32-image-writer/+download 下载Disk Imager。插入U盘,启动Disk Imager并选择映像文件,再选择U盘相应的磁盘驱动号,点击"write"即可。<br />
<br />
===二、启动Arch Linux系统安装程序===<br />
Usually, the first item is the preferred selection. However, choose Boot Archlive or Boot Archlive [legacy IDE] if you have trouble with libata/PATA, or have no SATA (Serial ATA) drives.<br />
<br />
Also, to change boot options, press '''e''' for editing the boot lines. Many users may wish to change the resolution of the framebuffer, for more readable console output. Append:<br />
插入刻录好的光盘CD或者USB盘,然后用它启动电脑。可能需要在BIOS里(通常是启动后在加电自检过程中按DEL、F1、F2、F11或者F12)改变一下启动顺序使得CD或者USB先被启动。<br />
<br />
{{Note|内存需求:<br />
* Core : 160 MB RAM x86_64/i686 (选择所有软件包,开启交换分区)<br />
* Netinstall : 160 MB RAM x86_64/i686 (选择所有软件包,开启交换分区)}}<br />
<br />
启动了Arch Linux光盘后,用上下箭头高亮菜单,按下回车键进行选择。<br />
<br />
通常,推荐选择第一项菜单。不过如果使用libata/PATA出现问题或者没有SATA (Serial ATA)驱动器,你也可以选择Boot Archlive或者Boot Archlive [legacy IDE] 。<br />
<br />
如果你需要改变启动参数,可以按‘e ’键来编辑启动行内容。 含多用户可能希望改变framebuffer分辨率以得到更好的终端显示。将<br />
vga=773<br />
加到kernel一行的后面,然后按<ENTER>,就可以得到1024x768的framebuffer。设置完毕后按'''b'''则使用相应的选择项进行启动。<br />
<br />
系统将会启动并提示登录,这时可以用'root'进行登录(不要加上单引号)。<br />
<br />
如果你的机器从live CD启动时发生错误或者一些其它'''硬件hardware'''错误,请参看[[Installation Troubleshooting]]。<br />
<br />
<br />
====登录并根据需要更换键盘映射表====<br />
如果你使用non-US键盘布局,可以用命令选择相应的键盘映射表。<br />
# km<br />
或者是是用loadkeys命令<br />
# loadkeys ''layout''<br />
(把''layout''替换成你需要的,比如 &quot;<code>fr</code>&quot; 或者 &quot;<code>be-latin1</code>&quot;)<br />
<br />
====边安装边查看安装指南====<br />
在刻录的livecd里面,已经包含了官方安装指南,在安装的时候可以边安装边查看,按组合键<ALT>+F2 切换到控制台vc/2(alt+f3,alt+f4……分别可以切换到对应的控制台vc/3,vc/4……以此类推),然后输入:<br />
<br />
# less /arch/docs/official_installation_guide_en<br />
<br />
按组合键<ALT>+F1回到控制台vc/1,继续安装系统。安装过程中可以随时切换回vc/2来查看安装指南。<br />
<code>less</code> 是个文本查看程序,位于<code>/usr/bin/less</code><br />
{{tip|请注意,官方指南仅涵盖基本系统的安装和配置过程。一旦安装完毕,强烈建议回到本wiki浏览更多安装后续已经相关问题。}}<br />
<br />
===三、开始安装===<br />
键入<br />
/arch/setup <br />
开始安装。<br />
<br />
====1、选择安装来源====<br />
接着会出现一个选择安装来源的提示。如果你用core ISO的话请选择CD,如果使用FTP ISO的话则选择FTP。<br />
* 如果选择 CORE installer,可以直接看下面的硬盘分区配置。<br />
* FTP/HTTP only: 选择这个需要预先加载网络驱动以便联网安装. 使用Udev来加载这些模块非常有效.<br />
按组合键ALT+F3切换到控制台vc/3,确认一下看其是否生效 invoking ifconfig -a . (Select OK to continue.) ——把后面的网络配置提前看<br />
<br />
====2、设置时间====<br />
有两个选择:<br />
* UTC - 如果使用unix系统包括Linux, Freebsd等, 建议使用UTC<br />
* local - 如果和Windows共享多引导系统, 建议使用local<br />
<br />
====3、硬盘分区配置====<br />
选择第一个菜单项"Prepare Hard Drive"。请注意,"Auto-Prepare"(自动分区)并不是最佳的选择,因为它只分配了最基本的三个区( /,/home,swap)<br />
在这里我们用手工进行硬盘分区。选择"2. Partition Hard Drives",接着选要分区的硬盘(比如:/dev/sdx),然后按你需要编辑分区表。<br />
<br />
''Arch Linux安装程序使用cfdisk公用程序来对硬盘进行分区。''<br />
<br />
''接下来,熟悉GNU/Linux的用户可以跳过这段内容直接到下面'''[[#选择软件包|选择软件包]]'''。''<br />
<br />
=====分区信息=====<br />
<br />
对磁盘进行分区是指在磁盘上定义若干区域(分区),每个都象是一个独立的磁盘,可以在其上创建(格式化)一个文件系统。 分区的类型分为主分区(Primary)、扩展分区(Extended)和逻辑分区(Logical)三类。 <br />
<br />
主分区可以被启动,一个物理磁盘最多能有4个主分区。要使用超过4个的话,只能使用一个包含了逻辑分区的扩展分区。<br />
(译者注:为避免误解,较易懂的解释应该是:一个磁盘不算逻辑分区最多只能有4个分区,这4个要么全是主分区,要么就是3个主分区+1个扩展分区,当然你将整个磁盘划为1个主分区也是没问题的,只要不超过4个分区即可)<br />
<br />
扩展分区通常不会被直接使用,它是作为逻辑分区的“容器”存在。一个硬盘只能有一个扩展分区,可以在里面继续再划分逻辑分区。<br />
<br />
当对一个磁盘进行分区时,是按这种数字顺序命名:主分区为sda1-3,跟着是扩展分区sda4(译者注:在/dev和fdisk -l里是看不到这个sda4的),在扩展分区中划分出来的逻辑分区分别是sda5、sda6,如此类推。<br />
<br />
=====交换分区swap=====<br />
交换分区Swap是虚拟内存在硬盘上驻留的地方,内核可以用它来储存在物理内存中放不下的数据。<br />
<br />
过去,常用的规则是将交换分区大小设置为物理内存的两倍。但是随着时间推移,现在的计算机已经有更大的内存容量,这条规则已经不适用了。通常,512MB内存的计算机,两倍(1G)的还是够用的。而1G内存的计算机,一倍的也够用了。如果你有更大的内存(比如超过1GB),也许可以完全把交换分区忘了,不推荐这样做!<br />
* ''如果你打算使用休眠到磁盘的电源方案,你必须要有不小于内存容量大小的交换分区,有些用户甚至会推荐大于物理内存容量15%的大小。''<br />
<br />
=====规划分区=====<br />
磁盘分区的规划是十分个人的设置。每位用户的决策都会根据自己计算机的情况和需求而不同。至少需要有一个包含了根[http://en.wikipedia.org/wiki/File_system 文件系统] ( / )的主分区和一个交换分区。你还可以选择给/boot(主要用来存放内核文件)、/usr、/var和/home(用来存放用户个人数据)划出独立分区。一个较好的做法是给 / 和 /home都划分独立分区。这样的话,当你因为某些原因重装Arch Linux(或者其它发行版),你还可以保留你的个人数据例如音乐、图片、桌面环境配置等。<br />
<br />
在本案例中,我们划分一个分区给 /,一个给/home,另外还有一个交换分区。<br />
<br />
=====开始创建分区cfdisk=====<br />
让我们开始创建一个包含'''root'''(/)文件系统的主分区。 <br />
<br />
选择'''N'''ew -> Primary,然后输入你希望的分区大小(对一个完整的Linux系统,4到8G是个不错的选择)。分区要位于磁盘的开头部分。选择刚新建的分区,接着选择'''B'''ootable将它置为可启动。<br />
<br />
同时选择分区文件系统类型'''T'''ype,指定为'83 Linux'.。<br />
<br />
给你的/home目录创建另一个分区。选择另外一个主分区设成你想要的容量大小,这取决于你的用户会在他们的home目录里储存多少文件,其大小可能从几百M办公文档到上百G音频视频,所以这里我无法给出一个建议。如果你要使用磁盘所有的剩余空间,记得保给交换分区留一部分(例如1GB或1024MB)。<br />
<br />
同样的,选择'''T'''ype为'83 Linux'。 <br />
<br />
最后,我们给交换分区创建一个分区。选择一个介于512MB到1GB之间的大小并将'''T'''ype改为82 (Linux swap / Solaris)。<br />
<br />
现在的分区规划看起来应该象这样(基于你的选择大小也许会有所不同):<br />
<br />
Name Flags Part Type FS Type [Label] Size (MB)<br />
-------------------------------------------------------------------------<br />
sda1 Boot Primary Linux (4096 - 8192)<br />
sda2 Primary Linux (> 100)<br />
sda3 Primary Linux swap / Solaris (512 - 1024)<br />
<br />
选择'''W'''rite并输入''''yes''''。要注意如果你删除了分区的话,这个操作会破坏你磁盘上的数据。选择'''Q'''uit退出分区程序。<br />
选择Done离开此菜单,接着选择"Set Filesystem Mountpoints"。<br />
<br />
=====IDE设备,为什么看起来它们和SCSI设备一样?=====<br />
最新开发的Linux内核里包含了libata和PATA模块,所有的IDE、SATA和SCSI都采用sd''x''这种命名方式。这十分正常,无需担心。<br />
<br />
=====设置文件系统挂载点=====<br />
<br />
''' ”文件系统格式(filesystems)“和”文件系统结构(file systems)“的区别:'''<br />
<br />
从技术层面确切的说,'''文件系统格式(filesystems)'''是一种数据'''格式''',涉及信息吞吐,比如ext2;而”文件系统结构(file systems)“则是特定操作系统中文件和目录的布局,比如/home/username/games。因此,当你被问及是否创建'''文件系统格式(filesystems)'''时,是在问你是否要'''格式化'''该分区…但是当程序向你问及挂载点时,你应该给出的则是该分区应该出现在你的Arch Linux ”文件系统结构“中的位置。<br />
<br />
'''文件系统类型:'''<br />
<br />
'''强烈建议:'''创建一个交换分区(SWAP)。选择一个合适的分区(本例中使用的是sda3). 安装程序就会询问你是否要创建swap 文件系统; 选择 yes. 接下来, 选择根分区的挂载点(本例中就是 sda1). 然后安装程序就会询问你需要哪一种文件系统。<br />
<br />
{{Box Note| 采用何种文件系统的类型取决于实际应用需要,没有十全十美的文件系统,选择任何一个文件系统,都需要在数据安全和性能要求方面作出适当倾斜,下面只是简单的介绍各种Arch linux支持的文件系统 }}<br />
<br />
1. '''ext2''' - 古老、 可靠的 GNU/Linux 文件系统。非常的稳定,不过 ''不支持日志记录功能''。磁盘检测速度较慢,因而有些不便. ''ext2可以容易地转换成ext3''。一般认为/boot分区采用此系统最合适,因为/boot里的东西就开机的时候读取一次,而且很少有变动,不需要日志文件系统,如果采用日志文件系统,日志的体积很可能远远大于内核的大小。<br />
<br />
2. '''ext3''' - 基于ext2系统, 并添加了日志记录功能。 一般认为他比其他文件系统要 ''稍微的'' 慢一点, 不过 ''非常的'' 稳定并且使用最为广泛,由 GNU/Linux FS 负责维护和开发。<br />
<br />
'''高性能文件系统:'''<br />
<br />
3. '''ext4''' - 最近加入支持的文件系统,是ext2和ext3的后续发展版本,Ext4增加了48位块地址,最大支持1EB文件系统,和单个16TB的文件,增加子目录限制到64,000。新增了很多功能,提供在线碎片处理,速度比ext3快,系统开销比ext3小。<br />
{{Box Note| 由于此系统较新,目前仍存在一些问题,暂时建议/home分区不采用此文件系统,以保证个人数据安全。}}<br />
<br />
4. '''ReiserFS''' - Hans Reiser 主持编写的高性能的日志文件系统,使用一种非常独特有趣的数据存储检索方法。ReiserFS 效率非常高, 特别在处理很多小文件的时候更是如此。ReiserFS在挂载的时候相对比较慢. 性能稳定。 ReiserFS 现在的开发并不活跃(最新的版本是Reiser4).<br />
<br />
5. '''JFS''' - IBM提供的日志文件系统( '''J'''ournaled '''F'''ile'''S'''ystem首字母缩写). JFS 效率非常高并且CPU资源占用率比其他任何一个文件系统都要低。并且在挂载和磁盘检测的时候都非常快,在各方面的表现都非常突出,尤其是 conjunction with the deadline scheduler. (参见 [[JFS]].) 但是并不像ext或者ReiserFS那样应用广泛。<br />
<br />
6. '''XFS''' - 非常高效的日志文件系统,特别适合处理大文件。在处理小文件的时候稍慢。在挂载的时候也很快。由于 /var 需要处理很多的小文件,所以可能不太适合作为/var 分区的文件系统。 GNU/Linux 文件系统中,最先实现可用的在线碎片处理。应用不及ext和ReiserFS那么广泛。<br />
* JFS 和 XFS 不能被磁盘工具压缩(比如gparted 或者 parted magic)<br />
<br />
'''未来文件系统'''<br />
<br />
7、btrfs - 此文件系统尚未被Arch纳入正式支持。是Oracle提供的copy-on-write档案系统。目标在取代的ext3,提高ext3单一档案的大小,总档案系统大小或档案检查,加入目前ext3未支援的功能,比如:writable snapshots,snapshots of snapshots,内建磁盘阵列(RAID)支援,and subvolumes。<br />
<br />
最主要的差别在于[http://en.wikipedia.org/wiki/Journaling_file_system 日志系统] (一种类似的在数据库环境中记录着日志变更的东西). 除ext2之外,其他文件系统都支持日志记录功能. ext3 完全兼容 ext2,因此哪怕你可以用一个非常古老的CD来挂载他,也没问题。 根分区目前最安全的选择就是使用ext3文件系统。ReiserFS,XFS,和JFS也可以使用,因为GRUB (启动引导管理器,稍候在安装部分将会介绍到) 都可以从这些文件系统中启动。你可以通过选择‘’‘yes’‘’来创建文件系统(并格式化分区),接着你就会被提示添加附加分区。 在我们的例子中, 只有sda2了。 选择一个文件系统类型,并且把这个分区挂在到/home. 再次说明,创建文件系统并且选择Done。然后回到主菜单。<br />
<br />
====4、选择软件包====<br />
现在我们要选择安装哪些软件包到系统中。选择CD作为来源,如果你不止一个光驱的话还需要选择使用哪个的光驱。<br />
<br />
软件包选择分为两个阶段。首先要选择软件包分类,然后出现所选分类中软件包的详细列表供你微调。使用空格键进行选择和取消。<br />
<br />
''*BASE:包含最小的软件包集合,仅够构建一个可运行的系统骨架。''<br />
''*SUPPORT:供网络和文件系统用的额外软件包,例如gpm、fuse、dnsutils、无线驱动、ndiswrapper、ntfs-3g诸如此类。''<br />
''*DEVEL:软件创建工具,如GCC、autoconf、automake和make等等。''<br />
''*LIB:大量的库文件,如gmp、lebelf、libevent等等。''<br />
*''' 2008.06 版'''的软件包选择,只有一个: BASE ,选择之后进入其详细列表. <br />
<br />
在这里,我们对'Select all packages by default'选择'yes'。<br />
<br />
接下来屏幕将显示你所选的软件包。对于新手,较安全的做法是不修改它,而有经验的用户可能希望裁减掉一些不需要的软件包。(例如,不需要的文件系统类型公用程序,不需要的驱动等等。)<br />
<br />
====5、安装软件包====<br />
接着,选择'Install Packages'。你会被询问是否希望保留pacman缓冲里的软件包。如果你选'yes',日后你还可以选择对某些软件包进行降级,因此推荐保留(日后你还是可以清除这些缓存的)。安装脚本跟着就会安装所选软件包到你的系统中。这些软件包是二进制的、针对i686优化的,总共仅100MB,因此安装是相当便捷的。<br />
<br />
====6、配置系统====<br />
系统接着会询问你是否要选择[[Hwdetect|hwdetect]]来收集配置所需信息。新手应该选择是('yes')。<br />
<br />
如果是相当熟悉自己的硬件、所需模块,有能力从零开始手动配置/etc/mkinitcpio和/etc/fstab 的高级用户,可以选择否'no'。(当然,此选项是非常复杂的,已经超过本指南的范围,这里就不详细解释了。)<br />
<br />
接下来,系统会询问你是否需要支持从USB设备、FireWire设备、PCMCIA设备、NFS共享、软RAID阵列、LVM2卷和加密卷上启动。如果需要则选'yes',在本案例中以上都不选。<br />
<br />
新手还应该选择让/etc/mkinitcpio/kernel26-fallback.conf使用[[Hwdetect|hwdetect]]的结果,这将确保你的硬盘控制器相容次序。<br />
<br />
现在系统会询问你使用哪个文本编辑器;如果你不熟悉[http://en.wikipedia.org/wiki/Vim_%28text_editor%29 vi/vim]的话可以选择[http://en.wikipedia.org/wiki/Nano_%28text_editor%29 nano]。然后就会出现一个包含系统中大部分重要配置文件的菜单。如果你打算查找/etc/rc.conf中可用的选项,只需按Alt+F2切换到另外一个虚拟控制台进行查找,然后用Alt+F1切换回安装程序。<br />
<br />
======系统配置主文件'''/etc/rc.conf'''======<br />
Arch Linux继承FreeBSD的传统,使用'''/etc/rc.conf'''作为系统配置的主要文件。这个文件包含了广泛的配置信息,主要用于系统的启动。正如名字中所包含的意思,它还包含了供/etc/rc*文件使用的配置。/etc/rc.conf提供了一个Arch用户可以轻易访问到的,简洁而又范围广泛的精简系统资源配置方案。<br />
* '''LOCALIZATION'''部分<br />
** '''LOCALE'''=: 系统场所(locale)设置,被所有国际化(i18n-aware)的应用程序使用 。从命令行上运行locale可以列出可用的locale设置。此设置缺省是适合英文(US English)用户使用的en_US.utf8。(此处locale的设置必须与/etc/locale.gen一致,'''[[#/etc/locale.gen|详见下文]]'''。)中文一般是zh_CN.UTF-8,如果使用之后乱码,先换回en_US.utf8,等进图形界面后再换回来。<br />
** '''HARDWARECLOCK'''=: 指示开关机时进行同步的硬件时钟,是'''UTC'''时间(协调世界时(Universal Time Coordinated), 过去曾用格林威治平均时(GMT)来表示)还是'''localtime'''(本地时间)。通常UTC较为好,因为它大大简化了时区和日光节约时间(中国过去称为夏时制)的变更。而当你同时还有其它操作系统如windows进行双启动,就必须使用localtime(本地时间),它只把本地时间保存到硬件时钟里。<br />
** '''TIMEZONE'''=: 时区(TIMEZONE)。(所有可用的时区可在/usr/share/zoneinfo/里找到。)<br />
** '''KEYMAP'''=: 可用的键盘映射表可在/usr/share/kbd/keymaps里找到。请注意此设定仅在TTY中有效,在所有图形窗口管理器或者X中都不使用此设置!<br />
** '''CONSOLEFONT'''=: 如果你一定要修改此设置,可在/usr/share/kbd/consolefonts/中找到可用的字体。<br />
** '''CONSOLEMAP'''=: 定义了启动时setfont程序加载的控制台映射表。有需要的话,可在/usr/share/kbd/consoletrans里找到可用的映射表。<br />
** '''USECOLOR'''=: 如果你使用彩色显示器的话请选"yes"。<br />
<br />
LOCALE="zh_CN.UTF-8"<br />
HARDWARECLOCK="localtime"<br />
TIMEZONE="Asia/Shanghai"<br />
KEYMAP="us"<br />
CONSOLEFONT=<br />
CONSOLEMAP=<br />
USECOLOR="yes"<br />
* '''HARDWARE'''部分<br />
** '''MOD_AUTOLOAD'''=: 如果你使用'''udev'''在启动时探测硬件并加载相应模块。请设置为"yes",(适合缺省模块化的内核)。设置为"no"就得靠用户自己指定所需的有关信息。<br />
** '''MOD_BLACKLIST'''=: 模块黑名单。在下面的例子中,IPv6模块和pcspeaker都被列入黑名单而不被加载。<br />
** '''MODULES'''=: 指示了其它模块,如果你知道缺少哪个重要的模块可以加在里面。('''hwdetect'''应该已经填写了最重要的模块):<br />
# Scan hardware and load required modules at bootup<br />
MOD_AUTOLOAD="yes"<br />
# Module Blacklist - modules in this list will never be loaded by '''udev'''<br />
MOD_BLACKLIST=(net-pf-10 pcspkr)<br />
#<br />
MODULES=(e100 eepro100 mii slhc snd-ac97-codec snd-intel8x0 soundcore)<br />
* '''NETWORKING'''部分<br />
** '''HOSTNAME'''=:设置为你喜欢的主机名(HOSTNAME)。<br />
** '''lo'''=: 不修改此行。<br />
** '''eth0'''=: 如果使用'''静态IP'''的话请调整网络接口的IP地址、掩码和广播地址。如果使用'''DHCP'''的话则设为eth0="dhcp"。<br />
** '''INTERFACES'''=: 指定使用哪些网络接口。如果你不使用DHCP来配置设备,而是通过命令行用ifconfig手动配置设备的话,这里的变量值(名字必须等于打算进行配置的设备名一样)必须和ifconfig里加入的内容一样。<br />
** '''gateway'''=: 如果你使用'''静态IP''',将网关(gateway)地址设为路由器的IP。如果使用DHCP,则将此行用'#'注释掉。<br />
** '''ROUTES'''=: 如果你使用'''静态IP''',则将'gateway'前面的'!'去掉。如果使用'''DHCP'''的话则不需要修改此行。<br />
<br />
<br />
例如,当使用'''DHCP''':<br />
HOSTNAME="arch"<br />
lo="lo 127.0.0.1"<br />
#eth0="eth0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255" <br />
eth0="dhcp"<br />
INTERFACES=(lo eth0)<br />
#gateway="default gw 192.168.0.1"<br />
ROUTES=(!gateway)<br />
* '''DAEMONS'''部分<br />
这个序列罗列了位于/etc/rc.d/里需要在启动过程中启动的脚本名字。<br />
<br />
*如果脚本名字前有惊叹号(!),表示它不被执行。<br />
*如果脚本名字前有符号(@),则表示它会在后台被执行,启动序列不会等待此脚本成功执行完毕,而是继续执行下一个守护进程脚本。<br />
<br />
这种'BSD风格'的初始化就是Arch的处理办法,而其它发行版则是在一个init.d目录里使用一大堆符号链接(一个简单的文件 vs 一整个目录)。<br />
<br />
======关于守护进程======<br />
虽然此时你不需修改[[daemons]]行,不过还是有必要解释一下什么是守护进程,因为过一会儿在指南里我们会需要它。<br />
<br />
和Windows服务(service)类似,守护进程(daemon)是一个运行于后台的程序,等待事件发生并提供服务。一个较好的例子是webserver等待请求以发送页面,还有SSH服务等待用户登录。这些都是全功能的程序,还有些守护进程工作起来并不是那么明显的。例如向日志文件里写信息的守护进程(如syslog、metalog),当系统空闲时降低CPU频率的守护进程(如cpufreq),以及提供图形化登录的守护进程(如gdm、kdm)。所有这些程序都可以被加入到daemons行中,在系统启动时被执行。本指南会对一些较有用的守护进程进行介绍。<br />
按Ctrl+X退出nano编辑器。<br />
<br />
======磁盘和分区配置文件:/etc/fstab======<br />
'''fstab''' ('''f'''ile '''s'''ystems '''tab'''le的缩写) 是系统配置的一部分,该文件列出所有可用的磁盘和分区,并指明它们初始化的方式或整合至全局文件系统的方式。'''/etc/fstab'''文件一般被'''mount'''命令读取,以决定某一特定设备被挂载时所采用的选项。<br />
<br />
这是一个'''/etc/fstab'''的例子:<br />
<br />
#<br />
# /etc/fstab: static file system information<br />
#<br />
# <file system> <dir> <type> <options> <dump> <pass><br />
none /dev/pts devpts defaults 0 0<br />
none /dev/shm tmpfs defaults 0 0<br />
#/dev/cdrom /mnt/cdrom iso9660 ro,user,noauto,unhide 0 0<br />
#/dev/dvd /mnt/dvd udf ro,user,noauto,unhide 0 0<br />
#/dev/fd0 /mnt/fd0 vfat user,noauto 0 0<br />
/dev/sda1 / jfs defaults,noatime,nodiratime 0 1 <br />
/dev/sda2 /home jfs defaults,noatime,nodiratime 0 2<br />
/dev/sda3 swap swap defaults 0 0<br />
Hwdetect应该已经有效地配置了一个可用的'''fstab''',但最好还是简要地检查一下。<br />
<br />
*如果你打算用'''hal'''来自动挂载DVD之类的媒体,为了给即将安装的'''hal'''做准备,你可能要注释掉cdrom和dvd条目。 <br />
<br />
''在笔记本电脑和桌面系统上,可以给 / 和 /home加上'noatime'和'nodiratime'选项来提高速度、性能,同时还能省电。无论你采用何种文件系统,这样做都应该是安全的。''<br />
<br />
更多信息请参照[[Fstab]]<br />
<br />
======'''mkinitcpio.conf、modprobe.conf和kernel26-fallback.conf'''======<br />
此时我们无须去修改这些配置文件。'''mkinitcpio.conf'''负责配置ramdisk(例如从RAID、加密卷启动), '''modprobe.conf'''可以用来设置内核模块的的某些配置选项,而'''kernel26-fallback.conf'''则是initramfs后备配置。<br />
<br />
======(对于静态IP)网络配置文件:/etc/resolv.conf ======<br />
*''如果你使用DHCP,完全可以忽略此文件,缺省情况下dhcpd守护进程会自动创建和销毁此文件。''<br />
<br />
如果你使用静态IP,则可在/etc/resolv.conf里设置你的DNS服务器。每行的格式为nameserver <ip地址>,如果有多个DNS服务器则可以填入多行。<br />
<br />
如果你使用路由器,也许会希望由你的路由器本身指定DNS服务器,而在'''resolv.conf'''里只是写入你的路由器的IP(同时也是'''/etc/rc.conf'''里的网关),例如:<br />
nameserver 192.168.1.1<br />
可选的,逐个加入你的DNS服务器,例如:<br />
nameserver 4.2.2.1<br />
nameserver 4.2.2.2<br />
<br />
如果使用'''DHCP''',你也可以在你的路由器里指定你的DNS服务器,或者如果你的ISP支持的话由ISP自动指定。<br />
<br />
======/etc/hosts======<br />
可以在此文件中加入你想要的''hostname'',必须和/etc/rc.conf里的设置一致,因此它应该象这样:<br />
127.0.0.1 localhost.localdomain localhost '''''yourhostname'''''<br />
''为了程序的兼容性,必须严格遵照这个格式,'''包括'localhost' 这项'''!错误的句法可能会导致网络性能低下和/或某些程序运行缓慢甚至无法运行。这对新手来说是十分普遍的错误。''<br />
<br />
对于大部分用户,只要把''yourhostname''加入到行末就就可以了,不过有些用户推荐以下句法:<br />
127.0.0.1 '''''yourhostname'''''.domain.org localhost.localdomain localhost '''''yourhostname'''''<br />
如果你使用静态IP,可以用这种句法加入新行:<static-ip> hostname.domainname.org hostname,例如:<br />
192.168.1.100 '''''yourhostname'''''.domain.org '''''yourhostname'''''<br />
<br />
======/etc/hosts.deny和/etc/hosts.allow======<br />
如果你打算使用[[SSH|ssh]]的话,请根据自己的需要修改此配置。缺省设置是拒绝所有进入的连接,而不只是ssh连接。编辑'''/etc/hosts.allow '''文件加入:<br />
<br />
* 允许所有进入的ssh连接。<br />
sshd:all <br />
<br />
* 允许特定IP地址进入ssh连接。<br />
sshd: 192.168.0.1<br />
<br />
* 允许你指定的网段 (地址从 192.168.0.0 到 192.168.0.255)<br />
sshd: 192.168.0.<br />
<br />
* 允许某个IP地址范围<br />
sshd: 10.0.0.0/255.255.255.0<br />
<br />
如果你不打算使用[[SSH|ssh]],为安全起见请保持此文件的缺省设置(为空)。<br />
<br />
======/etc/locale.gen======<br />
<br />
'''locale-gen''' 命令从 '''/etc/locale.gen'''读取信息设定系统的locales. 这些设置稍后会被'''glibc''' 和其他一些支持本地化的程序或者库用于自动翻译输出各种语言的"独特" 文本, 并且合适的显示地域、货币、时区以及日期格式, 字符排列方式和其他一些本地化的特殊标准。设置默认本地化的功能是类<code>UNIX</code>操作系统的一大特质<br />
<br />
默认情况下 /etc/locale.gen 是一个仅包含注释文档的空文件.编辑后,这个文件将不会get touched again. 每次'''glibc'''更新之后'''locale-gen'''就会运行一次, 以在/etc/locale.gen重新生成所有的本地化设置.<br />
<br />
选定你需要的本地化类型(移除前面的#即可), 比如:<br />
en_US ISO-8859-1<br />
en_US.UTF-8 <br />
('''你这里的设置必须和上文中提到的/etc/rc.conf 的设置一致哦.''')<br />
<br />
现在,安装程序将运行locale-gen 脚本, 以生成你设定的locales。你以后可以通过修改文件/etc/locale.gen变更你的locale, 然后使用根用户(root)运行'locale-gen'脚本使之生效。<br />
<br />
''Note 如果你选择并设置了locale, 他将提示你 "The current locale is invalid..." 错误。可能是因为大多数新Arch用户都会犯的普遍的错误,也是在论坛中问得最多的问题。''<br />
<br />
======Root密码======<br />
最后,设置一个root密码并确定你已牢记它。返回主菜单然后接着安装启动加载器。<br />
<br />
======Pacman镜像======<br />
为'''pacman'''选择一个软件仓库镜像站。记住主站 archlinux.org 是有流量限制的,下载速度限于50KB/s.。<br />
<br />
在列表中仔细查看, 一般 xxx.cn 是中国镜像, xxx.au 是澳大利亚, 等等...<br />
<br />
*''如果你不熟悉现有的镜像和它们所处的位置,那就随便选一个。稍后你可以编辑 "/etc/pacman.d/mirrorlist", 或运行本指南后面提到的'''rankmirrors'''脚本,它将自动配置最接近你的镜像。''<br />
<br />
返回主菜单。<br />
<br />
====7、安装启动加载器====<br />
因为本案例中没有第二个操作系统,因此我们需要安装一个启动加载器。推荐选择[http://www.gnu.org/software/grub/ GNU GRUB]作为启动加载器。另外一种选择是[http://lilo.go.dyndns.org/ LILO]。缺省的'''GRUB'''配置('''/boot/grub/menu.lst''')应该足够了。唯一你可能想修改的是控制台的分辨率。将vga=<number>加入到第一个kernel行。(menu.lst中已列出一张分辨率和数字的对应表格可供查找。)<br />
title Arch Linux (Main)<br />
root (hd0,0)<br />
kernel /boot/vmlinuz26 root=/dev/sda1 ro vga=773<br />
initrd /boot/kernel26.img<br />
参数"vga=773"表示1024x768分辨率、256色的framebuffer。<br />
<br />
将'''GRUB'''启动加载器安装到主引导区(本例中为sda)。<br />
<br />
====8、系统重启====<br />
退出安装程序。<br />
*建议:为了方便接下来更进一步的安装配置,可以把光盘里的新手指南复制一份到电脑里,这样后面的安装就能查看相应的向导了<br />
<br />
cp /arch/beginnersguide.txt /mnt/home/beginnersguide.txt<br />
<br />
系统重启之后,进入控制台,可以使用下面命令查看这新手指南<br />
less /home/beginnersguide.txt<br />
所有安装完毕之后,可以删了这指南<br />
rm /home/beginnersguide.txt<br />
<br />
输入命令下面命令,重启:<br />
<br />
reboot<br />
<br />
一个新Arch Linux系统就会启动并进入登录提示符(你可能需要在'''BIOS'''将启动顺序改为优先从硬盘启动)。<br />
<br />
'''祝贺你,一个崭新的Arch Linux基础系统闪亮登场了!'''<br />
<br />
==第二部分:完成基本系统并升级==<br />
你的新Arch Linux基础系统现在已是一个功能完整的GNU/Linux环境了,随时可以进行定制。从现在开始,你可以按自己的意图和需求改造它。由于arch是滚动发布的,所以安装包不一定是最新的系统,所以我们在安装完成之后,需要立即更新系统。<br />
<br />
让我们开始吧。<br />
-----<br />
登录入你的root账号。我们将以root身份配置pacman和更新系统,然后创建一个普通用户账号。<br />
<br />
===一、配置网络(如果有需要)===<br />
*''如果安装脚本的自动配置不适合你,本段内容将帮助你配置大部分类型的网络。''<br />
-----<br />
如果一切正常的话,你的网络应该可以正常使用了。先ping www.google.com验证一下:<br />
ping -c 3 www.google.com<br />
<br />
''如果你已经成功建立网络连接,则跳到下面阅读[[#使用pacman更新、同步、升级系统|使用pacman更新、同步、升级系统]]'''。''<br />
<br />
如果ping www.google.com后得到"unknown host"的错误,可以认为你的网络尚未正确配置。你需要重新检查以下内容的完整性和正确性:<br />
'''/etc/rc.conf''' # 特别留意HOSTNAME= 和 NETWORKING 部分有无输入错误。<br />
<br />
'''/etc/hosts''' # 复核一下格式。(看之前的内容。)<br />
<br />
'''/etc/resolv.conf''' # 当你使用静态IP时需要检查。如果你使用DHCP,缺省这个文件会被自动创建和销毁,不过也可以改为你需要的内容。(参见[[Network]]。)<br />
<br />
高级的网络配置方法可以在[[Network]]一文中找到。<br />
<br />
=====有线网络=====<br />
<br />
用以下命令检查网络<br />
ifconfig<br />
你应该看到eth0这一项。如果有需要,你可以这样设置一个新的静态IP:<br />
ifconfig eth0 <ip address> netmask <netmask> up <br />
并且这样设置缺省网关:<br />
route add default gw <ip address of the gateway><br />
查看一下/etc/resolv.conf是否包含你的DNS服务器,不过缺失了则补填进去。<br />
再次用ping www.google.cn检查一下网络。如果一切正常,将/etc/rc.conf调整为刚才新设置的静态IP。如果你的网络使用DHCP服务器/路由器的话,输入:<br />
dhcpcd eth0<br />
如果这样可行的话,则将/etc/rc.conf按之前所述方法调整为动态IP。<br />
<br />
=====无线网络=====<br />
详见安装指南:[[无线设置 (简体中文)|无线设置]]<br />
<br />
=====模拟信号调制解调器=====<br />
---编辑中---<br />
<br />
如果你想使用外接电话线调制解调器, 你至少要安装ppp包. 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.<br />
Tip: Read [[Dialup without a dialer HOWTO]].<br />
<br />
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 [http://www.linmodems.org/ LinModem] homepage.<br />
---编辑中---<br />
<br />
=====ISDN=====<br />
<br />
通过三步,完成 ISDN 的安装和配置:<br />
# 安装配置固件Install and configure hardware<br />
# 安装配置ISDN 管理工具<br />
# 添加ISP信息<br />
<br />
现在的 Arch stock kernels 已经包含了ISDN 所需要的modules, 所以不需要重新去编译内核,除非 you're about to use rather odd ISDN hardware. 把ISDN卡插入电脑或者插入USB ISDN-Box之后,you can try loading the modules with modprobe. 绝大部分的ISDN PCI 卡都能被module hisax处理,只需要两个参数:类型和协议。 如果使用的是1TR6标准,则协议设定为 '1' ,如果使用的是EuroISDN (EDSS1),协议设定为 '2', '3' if you're hooked to a so-called leased-line without D-channel, 如果使用的是US NI1,则设为'4'.<br />
<br />
所有配置细节都可以在kernel documentation, more specifically in the isdn subdirectory, and available online中获知。 类型的参数是根据电视卡来设定的,在README.HiSax kernel documentation中,有一个可能类型的列表。 用相应的参数加载moduleChoose,比如这个:<br />
<br />
modprobe hisax type=18 protocol=2<br />
<br />
这个将加载适用于电视卡类型为ELSA Quickstep 1000PCI,德国使用的EDSS1协议的模块hisax。可以在日志文件/var/log/everything.log中查看是否模块被预加载。额外的USB ISDN Adapter需要加载些USB模块才能正常工作。<br />
<br />
通过上述设定之后,如果电视卡能正常工作,那么把下面模块和参数加入/etc/modprobe.conf中:<br />
<br />
alias ippp0 hisax<br />
options hisax type=18 protocol=2<br />
<br />
这么做的好处是,这些模块在不使用时不会被加载。另外的方法是可以在这只加参数,把hisax加入/etc/rc.conf里面的MODULES,这样做的坏处就是不管这些模块是不是在使用,都加载了。 <br />
<br />
完成上述步骤之后,需要安装管理工具<br />
<br />
安装软件包isdn4k-utils,阅读关于isdnctrl的说明手册。在说明手册里,将有详细的说明:如何创建一个配置文件that can be parsed by isdnctrl,安装实例。 Please note that you have to add your SPID to your MSN setting separated by a colon if you use US NI1.<br />
<br />
使用isdnctrl utility配置ISDN卡之后,将可以拨号到你设定的PHONE_OUT参数的机器上,但提示用户名和密码错误。把用户名和密码加入到/etc/ppp/pap-secrets或者/etc/ppp/chap-secrets,这个主要根据的是你的ISP使用的协议授权方式,as if you were configuring a normal analogous PPP link。如果无法确定,可以两个文件都加。<br />
<br />
完成上述设定之后,用root帐号建立一个拨号连接:<br />
isdnctrl dial ippp0<br />
有啥问题,请检查日志文件!<br />
<br />
=====DSL (PPPoE)=====<br />
<br />
仅当需要你的计算机去主动拨号连接ISP的情况下才需参考本段内容。如果你使用独立的路由器来负责这类工作,你只需要设置一个缺省网关即可。<br />
<br />
在使用DSL连接前,你得先在计算机里安装一个连接到DSL-Modem的网卡。将你新装网卡加入到modules.conf/modprobe.conf或者MODULES列表之后,安装rp-pppoe软件包并运行pppoe-setup脚本来配置你的连接。当你输入完有关信息后,可以分别通过以下命令来进行连接和挂断:<br />
<br />
/etc/rc.d/adsl start<br />
<br />
和<br />
<br />
/etc/rc.d/adsl stop<br />
<br />
setup过程一般都是很容易、直观的,如果还有不懂可以阅读man手册。如果你想在启动时自动拨号,可以将adsl加入到DAEMONS列表中。<br />
<br />
<br />
===二、更新Pacman===<br />
<br />
====pacman是什么?====<br />
[[Pacman]]是Arch Linux的软件包管理器('''pac'''kage '''man'''ager)。Pacman是用C语言编写的,速度快,使用简便,功能强大。它可以管理整个软件包系统,负责软件包的安装、删除、降级(通过缓存),也支持自编译的软件包,自动分析依赖关系,可以搜索远程和本地软件仓库,还有大量其它功能。这里我们将用pacman来从远程软件仓库下载软件包并安装到系统中。<br />
<br />
对系统进行定制,pacman是Arch Linux最重要工具。<br />
<br />
====1、配置pacman====<br />
=====pacman总配置文件/etc/pacman.conf=====<br />
Arch通过pacman可以获得对下面 4软件仓库的管理:<br />
<br />
'''[core]'''<br />
<br />
[core](“核心”)仓库的简单原则是只提供一个基本的Arch Linux的基本工具:GNU系列工具,Linux内核,一个文字编辑器,一个命令行浏览器等(这里也有一些例外。比如说,vi和nano是同时提供的,允许用户选择一个或两个)。它包含所有使你的系统正常运转的“必须”安装的包,只有它们完美地工作,你的系统才能继续运行。这些是绝对“system-critical”(对系统来说至关重要)的包。由开发者负责维护。<br />
<br />
*''Core安装媒介(The Core installation media)简单地包含一个安装脚本,一个当前发布版本的核心仓库的快照(snapshot)。''<br />
<br />
'''[extra]'''<br />
<br />
[extra](“额外的”)仓库包含所有的对于一个基本的Arch系统不是必须,但是对于构建一个完整的系统环境有用的的Arch包。 比如'''X''', KDE和Apache,都可以在这里面找到。它也是由开发者维护的。<br />
<br />
'''[testing]'''<br />
<br />
[testing](“测试”)仓库包含的包是[core]和[extra]仓库的候选者。<br />
下面情况下,新的软件包将进入[testing]软件仓库:<br />
* 可能会导致系统出问题的升级,需要测试。<br />
* 需要重新打包其他软件包。这种情况下,所有需要重新打包的软件包将被放在[testing]仓库,直到所有重新打包完成,这些软件包才回归原有的软件仓库。 <br />
<br />
开发者维护。<br />
<br />
[testing]是唯一的一个在名义上与其它官方仓库有冲突的仓库。(that can have name collisions with any of the other official repositories. )<br />
<br />
<font color=&quot;blue&quot;>*如果开启, [testing]必须放在''pacman.conf''的软件仓库的第一个。</font><br />
<br />
<font color=&quot;red&quot;>'''警告''': '''''开启[testing]软件仓库,容易导致系统崩溃,因此只建议有经验的用户开启。'''''</font><br />
<br />
'''[community]'''<br />
<br />
[community](“社区”)仓库是由“信任用户”(''Trusted Users (TUs)'')维护的,是''Arch User Repository ([[AUR]])''(Arch用户仓库)的一部分。它包含的是二进制的包,在用户仓库中有足够的“票数”,并由''信任用戶''挑选出来的。像其它上面列出的仓库一样,[community] 可以用pacman获取。<br />
<br />
'''[[AUR]]''' 也包含'''unsupported''' 分支,这不能直接通过pacman获取。*. [unsupported] 包含多达海量PKGBUILD脚本,用来从源代码编译。这从其它仓库中是不能使用的。 <br />
<br />
<nowiki>*</nowiki> '''''[[AUR Helpers]]''''' 能帮助你无缝地使用AUR。<br />
<br />
'''/etc/pacman.conf'''<br />
<br />
每次调用pacman,它都会读取/etc/pacman.conf文件。这个配置文件分若干段,每一段定义了一个pacman用来搜索软件的仓库。唯一例外的是options段,它定义了全局选项。<br />
nano /etc/pacman.conf<br />
范例:<br />
#<br />
# /etc/pacman.conf<br />
#<br />
# See the pacman.conf(5) manpage for option and repository directives<br />
<br />
#<br />
# GENERAL OPTIONS<br />
#<br />
[options]<br />
# The following paths are commented out with their default values listed.<br />
# If you wish to use different paths, uncomment and update the paths.<br />
#RootDir = /<br />
#DBPath = /var/lib/pacman/<br />
#CacheDir = /var/cache/pacman/pkg/<br />
#LogFile = /var/log/pacman.log<br />
HoldPkg = pacman glibc<br />
# If upgrades are available for these packages they will be asked for first<br />
SyncFirst = pacman<br />
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u<br />
#XferCommand = /usr/bin/curl %u > %o<br />
<br />
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup<br />
#IgnorePkg =<br />
#IgnoreGroup =<br />
<br />
#NoUpgrade =<br />
#NoExtract =<br />
<br />
# Misc options (all disabled by default)<br />
#NoPassiveFtp<br />
#UseSyslog<br />
#ShowSize<br />
#UseDelta<br />
#TotalDownload<br />
#<br />
# REPOSITORIES<br />
# - can be defined here or included from another file<br />
# - pacman will search repositories in the order defined here<br />
# - local/custom mirrors can be added here or in separate files<br />
# - repositories listed first will take precedence when packages<br />
# have identical names, regardless of version number<br />
# - URLs will have $repo replaced by the name of the current repo<br />
#<br />
# Repository entries are of the format:<br />
# [repo-name]<br />
# Server = ServerName<br />
# Include = IncludePath<br />
#<br />
# The header [repo-name] is crucial - it must be present and<br />
# uncommented to enable the repo.<br />
# <br />
<br />
# Testing is disabled by default. To enable, uncomment the following<br />
# two lines. You can add preferred servers immediately after the header,<br />
# and they will be used before the default mirrors.<br />
#[testing]<br />
#Include = /etc/pacman.d/mirrorlist<br />
<br />
[core]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
[extra]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist <br />
<br />
[community]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
# An example of a custom package repository. See the pacman manpage for<br />
# tips on creating your own repositories.<br />
#[custom]<br />
#Server = file:///home/custompkgs<br />
要开启一个软件仓库,只需要将'Include ='和'[repository]'行前的注释符号(#)去除。<br />
<br />
*"Server ="行如果取消注释,将会强制此服务器被首先搜索,详细的仓库配置位于/etc/pacman.d/下。<br />
* 注意:选择仓库时,请确认将仓库名和'Include ='行都一同取消注释。没有这样做的话会导致你选择的仓库被忽略!这是个很普遍的错误。<br />
<br />
=====(如果有必要)配置镜像列表 /etc/pacman.d/mirrorlist=====<br />
更快的镜像能显著改善pacman的性能和你对Arch Linux的总体体验。<br />
<br />
*手动编辑/etc/pacman.d/mirrorlist:<br />
nano /etc/pacman.d/mirrorlist<br />
删除所有不在你所在洲或者太远的镜像。(在nano里你可以用CTRL-K删除每个不需要的行。)保存文件并退出。<br />
<br />
*'''rankmirrors'''脚本可以根据镜像的响应延迟对其自动排名。'''Rankmirrors'''是python脚本,需要安装python:<br />
<br />
pacman -S python<br />
<br />
然后,运行'''rankmirrors'''脚本按响应延迟顺序对镜像进行排名:<br />
rankmirrors -v /etc/pacman.d/mirrorlist<br />
输出会列出所有镜像和它们的响应延迟(ping),例如:<br />
<br />
# United States<br />
# http://mirrors.easynews.com/linux/archlinux/$repo/os/i686 ... 0.96<br />
# ftp://ftp.nethat.com/pub/linux/archlinux/$repo/os/i686 ... unreachable<br />
# ftp://locke.suu.edu/linux/dist/archlinux/$repo/os/i686 ... 2.43<br />
# ftp://mirrors.unixheads.org/archlinux/$repo/os/i686 ... 1.96<br />
<br />
脚本将从低到高的响应延迟顺序显示:<br />
Server = http://mirrors.easynews.com/linux/archlinux/$repo/os/i686<br />
Server = ftp://mirrors.unixheads.org/archlinux/$repo/os/i686<br />
Server = ftp://locke.suu.edu/linux/dist/archlinux/$repo/os/i686<br />
Server = ftp://ftp.nethat.com/pub/linux/archlinux/$repo/os/i686<br />
<br />
要注意的是这个结果对于镜像排列并非很精确,最接近你的镜像或者延迟最低的镜像并不一定是最佳选择。(反应迅速但是内容过时的镜像、或者低延迟但是窄带宽的镜像对你毫无用处)。<br />
<br />
编辑/etc/pacman.d/mirrorlist,将最佳的镜像置于在列表顶端。为了体验多个镜像你可能要不断修改此配置文件,请精明地选择。<br />
<br />
====常用的命令====<br />
<br />
与远程软件仓库同步和更新本地包数据库 (推荐在安装和更新包之前这样做):<br />
pacman -Sy<br />
<br />
'''升级'''系统中所有的包:<br />
pacman -Su<br />
<br />
一条同步、更新、'''升级''' 所有系统中的包的命令:<br />
pacman -Syu<br />
<br />
安装或者升级单个软件包或者一串包(包括其依赖包):<br />
pacman -S packageA packageB<br />
<br />
同步、更新数据库并安装软件包:<br />
pacman -Sy packageA packageB<br />
<br />
移除软件包, 但保留依赖的包:<br />
pacman -R package<br />
<br />
移除单个包,并且移除没有被别的软件依赖的依赖包:<br />
pacman -Rs package<br />
<br />
移除包所有不需要的依赖包并删除其配置文件:<br />
pacman -Rsn package<br />
<br />
通过给定关键词(列表)搜索远程软件仓库数据库(repo):<br />
pacman -Ss keyword<br />
<br />
列出系统中所有的包<br />
pacman -Q<br />
<br />
在本地包数据库搜索 (查询)指定软件包:<br />
pacman -Q package <br />
<br />
在本地包数据库搜索 (查询)指定软件包并列出相关信息:<br />
pacman -Qi package<br />
<br />
To defragment pacman的数据库缓存和速度优化选项:<br />
pacman-optimize<br />
<br />
统计当前系统中的包数量:<br />
pacman -Q | wc -l<br />
<br />
使用ABS和makepkg从源代码编译安装包:<br />
pacman -U packagename.pkg.tar.gz<br />
<br />
Note: pacman有很多很多的选项和功能组合。你可以试试man pacman或者查阅lt the [[pacman]]维基条目<br />
<br />
====软件包管理增强工具====<br />
* Yaourt 可查询aur的pacman增强工具<br />
* Tupac 快速查询的yaourt增强工具<br />
* Powerpill 多进程下载的pacman增强工具<br />
{{Box Note| 强烈建议更新系统完毕后,安装yaourt和powerpill,以便更充分享受Arch Linux的方便和强大。}}<br />
在/etc/pacman.conf文件里,最后添加两行(如果是i686的话,把x86_64换成i686即可):<br />
[archlinuxfr]<br />
Server = http://repo.archlinux.fr/x86_64<br />
然后使用pacman安装yaourt<br />
pacman -Sy yaourt<br />
<br />
以后就可以使用yaourt命令来查找并安装包括[[AUR]]里的软件了。比如bcm无线网卡,需要安装b43-firmware(此软件包在[[AUR]]仓库里,使用pacman无法查找到),使用yaourt命令查找并安装:<br />
yaourt b43-firmware<br />
找到之后,根据相应提示,一直到安装完成。<br />
<br />
====图形化管理工具====<br />
* qt界面的shaman:比较成熟的pacman 图形化管理工具<br />
* gtk界面的gtkpacman :目前BUG比较多,不稳定。<br />
<br />
====Pacman的更多信息====<br />
用此命令查看pacman手册:<br />
man pacman<br />
有空的话可以看看[[pacman (简体中文)]]维基条目。<br />
<br />
====2、更新Pacman自己====<br />
<br />
一开始,系统可能会提示你先更新pacman自身,这取决于Arch安装包的新旧程度:<br />
pacman -Sy pacman<br />
pacman开始查看是否需要更新,如果有提示需要更新,则按‘y’,开始pacman更新。<br />
<br />
'''''有时候,还需要用户主动修改某些配置;请仔细阅读升级过程中的输出获取相关信息。'''''<br />
<br />
===三、更新系统===<br />
====使用[[pacman (简体中文)|pacman]]====<br />
现在我们要用[[pacman (简体中文)|pacman]]来更新系统。要更新、同步并'''升级'''你的系统,可以使用命令:<br />
pacman -Syu<br />
pacman就会获取所有最新可用软件包信息并进行升级。(此时你可能会被提示先升级pacman自身。如果是这样,回答'yes',然后在完毕后再运行一次pacman -Syu命令。)<br />
<br />
===='''滚动发布'''之美====<br />
Arch是一个'''rolling release'''(滚动发布)的发行版。这意味着没有必要重新安装或执行完整的系统重建来升级到最新版本。只需要执行'''pacman -Syu''',就能保持你的系统更新到最新和bleeding edge(表示最新的、因而也并非完美的技术)。<br />
<br />
===四、增加一个用户并设置用户组===<br />
用root账号来处理日常工作是很危险的。Root是用来处理系统管理的任务。我们可以用以下命令增加一个普通用户账号:<br />
adduser<br />
大部分缺省选项都是没问题的,你可能还需要将storage、audio、video、optical和wheel加入到你的用户组中 ── 特别是在你打算使用一个完整功能的桌面环境的情况下。<br />
<br />
用户组和用户的关联定义在/etc/group文件中: <br />
<br />
它包含了:<br />
<br />
*'''audio''' - 关于声卡和相关软件的任务<br />
<br />
*'''wheel''' - 给sudo使用<br />
<br />
*'''storage''' - 负责存储设备<br />
<br />
*'''video''' - 视频任务和3D加速<br />
<br />
*'''optical''' - 和光驱有关的任务<br />
<br />
*'''floppy''' - 软驱访问<br />
<br />
*'''lp''' - 打印任务<br />
<br />
请参看[[Groups]]一文了解你应该属于哪些用户组。<br />
你还可能需要将你的用户账号加入到以下用户组(需要以root身份运行此命令):<br />
usermod -aG audio,video,floppy,lp,optical,network,storage,wheel,dbus,hal USERNAME<br />
详情可看usermod和gpasswd的man手册。<br />
<br />
===五、安装建立Sudo (可选)===<br />
安装Sudo:<br />
# pacman -S sudo<br />
以root身份,运行命令visudo,把用户加入sudo用户 (a &quot;sudoer&quot;).如果不知道怎么使用vi,你可以在用visudo前设置EDITOR环境变量为你喜欢的编辑器。例如:<br />
# EDITOR=nano visudo<br />
如果你对于用vi很适应,去掉EDITOR=nano这个变量就行:<br />
# visudo<br />
这命令将在一个特殊的vi会话中打开文件 /etc/sudoers 。visudo复制文件到一个可编辑的临时文件中,用一个编辑器编辑它(vi是默认的),接下来运行一个安全检查(“sanity check”)。如果通过,这个临时文件就有正确的权限将重写的原始文件。t<br />
<br />
<font color=&quot;red&quot;>'''注意:不要直接用编辑器编辑 /etc/sudoers ; 否则会出现这样的提示:Errors in syntax can cause annoyances (像root帐户不能使用的描述一样)。 必须使用 ''visudo'' 命令来编辑 /etc/sudoers.'''</font><br />
<br />
当用户输入以 &quot;sudo&quot;, 作为开始的命令行时,临时授予该用户root权限。加入下面一行:<br />
USER_NAME ALL=(ALL) ALL<br />
USER_NAME 就是单个用户名。<br />
<br />
更多信息,比如按<TAB> 自动命令补全,请见[[Sudo]]<br />
<br />
==第三部分:安装X并配置ALSA==<br />
一共有三步工作:<br />
*1、安装声卡驱动<br />
*2、安装x-window(包括显卡驱动)<br />
*3、配置X<br />
<br />
{{Box Note | '''在热插拔未配置正确的情况下,或者是/etc/rc.d/hal未启动的情况下,请不要启动开启X(包括重启使用gdm或者kdm登陆),否则可能导致鼠标键盘失去响应!!!'''}}<br />
<br />
===一、配置声卡:使用alsamixer===<br />
高级Linux声音架构(Advanced Linux Sound Architecture,简称ALSA)是一个Linux内核组件。它替换了原有的开放声音系统(OSS),为声卡提供了设备驱动。除了声音设备驱动以外,'''ALSA'''还给应用程序开发人员提供了一个用户空间库,可使更高级的API无需直接与内核驱动打交道就能使用驱动功能。<br />
<br />
{{Box Note| Alsa已经包含进最新的内核kernel,udev 将在系统启动时自动检测硬件,并自动根据声卡加载相应的内核模块。虽然声卡已经在工作,但电脑的声音默认是静音。}}<br />
{{Box Note| OSS4.1已经放出,相对于老的版本,这是一个显著的提升的版本,如果使用ALSA有问题, 或者是想尝试新的功能,可以使用 OSS4.1。 相关说明可见: [[OSS]]}} <br />
<br />
Alsa-utils软件包里的alsamixer让我们可以从命令行来配置声音设备。(你也可以稍后在'''X'''环境中使用alsamixer。)<br />
默认情况下,内核加载模块snd_pcsp,这是一个alsa pc speaker模块。 snd_pcsp通常先于&quot;你实际的&quot;声卡模块加载。大部分情况下,这模块最后加载更好,因为可以让alsamixer正确控制需要的声卡。<br />
<br />
在/etc/modprobe.conf中加入这行,可以使得snd_pcsp最后加载:<br />
options snd-pcsp index=2<br />
<br />
当然,如果你不想让snd_pcsp加载,可以把它放入黑名单,或者是在/etc/rc.conf的Modules里禁止它:<br />
MODULES=(... !snd_pcsp)<br />
<br />
{{Box Note | 想要生效,需要释放并重新加载所有声音模块,当然,系统重启就可以简单解决这问题。 }}<br />
<br />
* 安装alsa-utils软件包:<br />
pacman -S alsa-utils<br />
<br />
* 为了解决Alsa声卡独占问题,可以安装alsa-oss:<br />
# pacman -S alsa-oss <br />
<br />
* 把你的普通用户账号加入到audio用户组中:以root身份,运行<code>/usr/bin/gpasswd</code>程序:<br />
gpasswd -a yourusername audio<br />
*以普通用户身份运行: <br />
alsamixer<br />
用左右光标键移动到Master和PCM声道上,按'''M'''取消掉静音。用向上键增加音量。(70-90的音量是较合适的范围)按ESC键离开alsamixer。<br />
有'''Speaker'''的,需要同时取消静音并调整之. <br />
<br />
====测试声音====<br />
以普通用户身份,使用 <code>/usr/bin/aplay</code>程序来测试你的声音配置:<br />
aplay /usr/share/sounds/alsa/Front_Center.wav<br />
你应该会听到一个女性声音说:“Front,center。”<br />
<br />
====保存声音配置====<br />
以root身份运行<code>/usr/bin/alsactl</code> :<br />
alsactl store<br />
这将创建'/etc/asound.state'文件,用来保存alsamixer的设置。<br />
<br />
为了每次启动都可以自动恢复混音器设置,可将守护进程''alsa''加入到你的/etc/rc.conf中的DAEMONS列表。<br />
nano /etc/rc.conf<br />
DAEMONS=(syslog-ng network crond '''alsa''')<br />
''注意,alsa守护进程在启动过程中仅仅是恢复音量设置。它和alsa音频库(和内核级API)是完全不同的。''<br />
<br />
更多详情请参看[[ALSA 安装设置 (简体中文)|ALSA 安装设置]]。<br />
<br />
===二、安装X===<br />
'''X''' 窗口系统(一般叫'''X11'''或者更简单的叫'''X''') 是一个网络互动和显示服务,提供位图显示器窗口. 提供标准化工具包(toolkit)和协议,用于<code>UNIX</code>类操作系统,构建一个图形界面(GUIs) <br />
<br />
'''X''' 提供最基本、基础的框架,用于构建一个图形操作界面环境。包括:绘图、屏幕窗口移动,与鼠标或者键盘的交互。 '''X''' 并不负责用户交互界面的部分:有独立的客户端程序负责处理这部分。 比如gnome、kde。<br />
<br />
'''X''' 因为它先于'''W'''窗口系统,最初由斯坦福大学开发。 <br />
<br />
*''注意: 如果想使用一个'''开源''' 显卡驱动, 需要3d加速,强烈建议在安装Xorg之前安装库 libgl :''<br />
pacman -S libgl<br />
''(拥有专利的视频驱动提供它们自己的gl库安装(implementations).)''<br />
----- <br />
====1、安装X====<br />
构建一个GUI的第一步:用pacman来安装Xorg包.<br />
<br />
# pacman -S xorg<br />
对于新版的xorg,建议(可能大部分情况下是必须的)安装输入设备驱动evdev。它本来应该作为xorg-server的一个依赖被安装的,不过不知道为什么貌似缺失了:<br />
# pacman -S xf86-input-evdev<br />
3d的工具比如glxgears包含在包'''mesa''' 里(如果需要,也安装):<br />
# pacman -S mesa<br />
<br />
====2、安装显卡驱动====<br />
到这一步,已经有了运行'''X''' Server的基本软件包,接下来需要把显卡的驱动安装到电脑里(e.g. xf86-video-<name>). 最简单的X.org配置方法就是安装正确的驱动包,然后使用自动脚本对 /etc/X11/xorg.conf 进行初始化,比如使用 Xorg -configure(arch团队提供hwd工具,但据以前用户的反映,这个现在还老出问题,新手可以使用,以后有能力再配置其他).<br />
<br />
如果不知道显卡类型,输入下面命令:<br />
lspci | grep VGA<br />
<br />
输入下面命令,查看所有'''开源'''驱动: <br />
pacman -Ss xf86-video | less<br />
<br />
下面是一个'''开源'''的显卡列表和相关说明:<br />
*'''xf86-video-apm''' Alliance ProMotion video driver<br />
*'''xf86-video-ark''' ark video driver<br />
*'''xf86-video-ati''' ati video driver<br />
*'''xf86-video-chips''' Chips and Technologies video driver<br />
*'''xf86-video-cirrus''' Cirrus Logic video driver<br />
*'''xf86-video-dummy''' dummy video driver<br />
*'''xf86-video-fbdev''' framebuffer video driver<br />
*'''xf86-video-glint''' GLINT/Permedia video driver<br />
*'''xf86-video-i128''' Number 0 i128 video driver<br />
*'''xf86-video-i740''' Intel i740 video driver<br />
*'''xf86-video-i810''' Intel i810/i830/i9xx video drivers (deprecated - use -intel)<br />
*'''xf86-video-intel''' Newer Version of Intel i810/i830/i9xx video drivers<br />
*'''xf86-video-imstt''' Integrated Micro Solutions Twin Turbo vidoe driver<br />
*'''xf86-video-mach64''' mach64 video driver <br />
*'''xf86-video-mga''' mga video driver (Matrox Graphics Adapter) <br />
*'''xf86-video-neomagic''' neomagic video driver<br />
*'''xf86-video-nouveau''' Open Source 3D acceleration driver for nVidia cards (eperimental)<br />
*'''xf86-video-nv''' nvidia nv video driver<br />
*'''xf86-video-openchrome''' Openchrome drivers<br />
*'''xf86-video-r128''' ati Rage128 video driver<br />
*'''xf86-video-radeonhd''' Experimental Radeon HD video driver for r500 and r600 ATI cards<br />
*'''xf86-video-rendition''' Rendition video driver<br />
*'''xf86-video-s3''' S3 video driver<br />
*'''xf86-video-s3virge''' S3 Virge video driver<br />
*'''xf86-video-savage''' savage video driver<br />
*'''xf86-video-siliconmotion''' siliconmotion video driver<br />
*'''xf86-video-sis''' SiS video driver<br />
*'''xf86-video-sisusb''' SiS USB video driver<br />
*'''xf86-video-tdfx''' tdfx video driver<br />
*'''xf86-video-trident''' Trident video driver<br />
*'''xf86-video-tseng''' tseng video driver<br />
*'''xf86-video-unichrome''' Unichrome video drivers<br />
*'''xf86-video-v4l''' v4l video driver<br />
*'''xf86-video-vesa''' vesa video driver<br />
*'''xf86-video-vga''' VGA 16 color video driver<br />
*'''xf86-video-via''' via video driver<br />
*'''xf86-video-vmware''' vmware video driver<br />
*'''xf86-video-voodoo''' voodoo video driver<br />
<br />
* 说明:'''vesa'''驱动是最原汁原味的,适用于大部分的显卡。如果实在无法找到合适的显卡驱动,就选用vesa。(这是原话,好像夸张了点!If you cannot find a suitable driver for your video chipset, vesa '''should''' work.)<br />
<br />
用pacman来安装适合你显卡的驱动。例如:<br />
pacman -S xf86-video-savage<br />
(给Savage显卡的驱动。)<br />
<br />
* 如果实在不确定需要安装那个显卡驱动,可以安装所有显卡驱动包, 输入下面命令:<br />
pacman -S xorg-video-drivers<br />
<br />
*如果显卡是nVIDIA 或者ATI的,并'''想安装nVIDIA或者ATI官方提供的显卡驱动,请看下面。'''<br />
-----<br />
<br />
====nVIDIA图形显示卡====<br />
nVIDIA显示卡的驱动程序被许多人认为是非常好的质量,而且带有高级3D性能。<br />
<br />
在设置您的你nVIDIA显卡之前您先要选择您要使用的驱动程序。Arch现在有3种不一样的nVIDIA驱动程序,各自支持不同型号的显卡:<br />
<br />
'''1. nvidia-96xx''' ''直到Ge Force 4的较新显卡''<br />
<br />
'''2. nvidia-173xx''' ''Geforce FX系列显卡''<br />
<br />
'''3. nvidia''' ''在GF FX之后的最新GPU''<br />
<br />
{{Box Note| 一些特别老如TNT和TNT2之类的显卡所需的Nvidia-71xx系列闭源驱动,由于无法在Arch所用的新版Xorg下正常运行,并且nvidia也已不再继续支持它们,因此已被删除。你可以改用xf86-video-nv或者xf86-video-vesa驱动。}}<br />
<br />
到nVIDIA主页,看哪个适合你电脑.区别只是安装,配置过程是一样的.<br />
<br />
''根据你的显卡'',选择合适的nVIDIA驱动安装,比如: <br />
pacman -S nvidia-96xx<br />
<br />
nVIDIA软件包有个工具能自动升级你已有的nVIDIA驱动的配置文件/etc/X11/xorg.conf,输入下列命令即可实现:<br />
nvidia-xconfig<br />
<br />
它也有一些选项,用于更深入和具体地配置xorg.conf文件的内容和选项,例如:<br />
<br />
<br />
nvidia-xconfig --composite --add-argb-glx-visuals<br />
<br />
更详细的信息,请参考:nvidia-xconfig(1).<br />
<br />
一些有用的妙法可用在“device“部分(你要清楚它们不一定都能对你的系统有用):<br />
Option "RenderAccel" "true"<br />
Option "NoLogo" "true"<br />
Option "AGPFastWrite" "true"<br />
Option "EnablePageFlip" "true"<br />
将所有的DRI注释掉:<br />
# Load "dri"<br />
<br />
多检查几次你的/etc/X11/xorg.conf以确定你的默认的depth(色深),horizontal sync(水平同步),垂直刷新率,以及分辨率是可以接受的。<br />
<br />
使用<code>/sbin/depmod</code>命令来更新内核模块依赖:<br />
depmod -a<br />
(也许需要重启。)<br />
{{Tip|nvidia配置的高级的说明参考文章[[NVIDIA]] 。}}<br />
<br />
现在你可以跳到'''[[#三、配置X:创建并修改/etc/X11/xorg.conf|配置X]]'''来进一步熟悉,或者跳到'''[[#3、测试 X|测试 X]]'''继续安装过程。<br />
<br />
====ATI图形显示卡====<br />
ATI用户的驱动可以有几种选择。<br />
* '''xf86-video-ati'''软件包提供的开源'''''radeon'''''驱动。<br />
** 原创的、完全支持Radeon芯片组到X1950(最新的R500芯片组)的逆向工程开源驱动。对9200系列以前的显卡完全支持,可以稳定的提供全2D和3D加速。从9500到X1950完全支持2D加速特性,良好的3D加速,不过缺乏某些闭源驱动的特性(例如能源节省特性仍处于测试阶段)。xf86-video-ati支持从HD2xxx (R6xx)到最新的显卡,不过目前仅提供2D支持。<br />
* '''xf86-video-radeonhd'''软件包提供了开源的'''''radeonhd'''''驱动。<br />
** 此驱动支持ATI R500(Radeon X1000系列)以及更新的芯片组。该驱动由AMD提供文档,Novell为之开发。它支持RandR 1.2,目前的开发工作非常活跃。因此所支持的不同系列显卡的功能可以不一致。(有些用户反映它性能优异,而有些则说它很糟)。它还支持带音频的HDMI。<br />
* AUR中的Catalyst软件包提供了闭源'''''fglrx'''''驱动。稍后将介绍闭源驱动。<br />
开源驱动通常可以满足大部分需求而且较少出问题。<br />
<br />
安装'''''radeon'''''ATI驱动:<br />
# pacman -S xf86-video-ati libgl ati-dri<br />
安装'''''radeonhd'''''ATI驱动:<br />
# pacman -S xf86-video-radeonhd libgl ati-dri<br />
<br />
Arch的<code>extra</code>官方仓库曾经提供过闭源ATI驱动'''Catalyst'''的预编译包,不过在2009年3月以后,由于对闭源驱动的质量和开发进度不满意,官方取消了对它的支持。目前catalyst驱动可以在[http://aur.archlinux.org/packages.php?ID=22899 AUR]中找到。Catalyst驱动的安装信息可以在[[ATI#Proprietary_ATI_Catalyst_driver|这里]]找到。<br />
<br />
{{Warning| 闭源ATI驱动仅支持R600和更新的显卡(即HD2xxx及以上系列),不支持旧系列(X1xxx系列及以下)。}}<br />
<br />
{{Tip|ATI配置的高级指引可以参看[[ATI | ATI wiki 文章]]。}}<br />
<br />
====3、安装输入设备驱动软件包====<br />
最新的X需要你为包括键盘和鼠标在内的输入设备安装驱动。查看可用输入设备驱动的完整列表:<br />
# pacman -Ss xf86-input | less<br />
<br />
对大部分用户,xf86-input-keyboard和xf86-input-mouse应该可以满足基本配置。使用pacman来为你的输入设备安装需要的驱动,例如:<br />
# pacman -S xf86-input-keyboard<br />
===三、配置X:创建并修改/etc/X11/xorg.conf===<br />
====xorg.conf文件====<br />
/etc/X11/xorg.conf 是你的 X-Window-System 的主要配置文件,你的 GUI('''G'''raphical '''U'''ser '''I'''nterface)的基础,它是一个普通的文本文件,里面由 “section” 和 “subsection” 来安排。重要的 section 有 ''Files, InputDevice, Module, Monitor, Modes, Screen, Device'' 和 ''ServerLayout''。各个section安排的前后次序没有关系,对同一种类型的设备也可以有多个section,比如你可能有多个显示器,或者你的本本既有鼠标又有触摸板。<br />
------<br />
从X11R7.2版开始Xserver引入了自动配置特性。在大多情况下,即使没有xorg.conf文件它也能很好地运作。如果''自动检测功能工作正常'',而且你又不需要开启如 aiglx、compositing 等功能的话,你甚至不需要创建这个配置文件。<br />
<br />
====1、创建 /etc/X11/xorg.conf====<br />
<br />
高级用户可以手动创建他们的xorg.conf文件。一般用户可以使用程序<code>/usr/bin/Xorg</code>附加参数-configure来生成一个基本的配置文件;以root身份输入下面命令:<br />
# Xorg -configure<br />
这里生成的文件是/root/xorg.conf.new <br />
<br />
把这文件复制到 <code>/etc/X11/</code>:<br />
# cp /root/xorg.xonf.new /etc/X11/xorg.conf<br />
<br />
====更多的创建/etc/X11/xorg.conf的办法====<br />
* 说明:如果你的电脑已经有一个配置好的xorg.conf文件,不管这个文件是在什么别的发行版下生成的,只要Xorg的版本一致,就可以把该文件复制到你的Arch系统的<code>/etc/X11/</code>目录下。<br />
* 可以使用程序<code>/usr/bin/hwd</code>生成xorg.conf。首先要安装这程序:<br />
# pacman -S hwd<br />
然后输入下面命令:<br />
# hwd -xa<br />
{{Box Note| 目前,hwd在生成的xorg.conf有一行失效。 使用完这程序后,需要手动删除或者是注释掉 Section &quot;Files&quot;下的RgbPath那一行。via nano /etc/X11/xorg.conf or your equivalent, as root/sudo.}}<br />
<br />
* 使用<code>/usr/bin/xorgcfg</code> 脚本生成xorg.conf:<br />
# xorgcfg <br />
* 使用<code>/usr/bin/xorgconfig</code>生成xorg.conf,这个程序以互动方式来创建该文件,输入下面命令运行:<br />
# xorgconfig<br />
<br />
====2、Input设备热插拔问题:请在测试X前阅读====<br />
<br />
xorg 1.5.x版本里已经开启热插拔Input设备。<br />
{{Box Note | 当热插拔开启后, X将清空xorg.conf里所有使用the kbd and mouse 驱动建立的设备。这将导致X被冻结,使得鼠标和键盘失去响应。下面是解决办法。'''方法只能二选一'''}}<br />
<br />
有两个办法可以修复这一问题:<br />
<br />
1) '''配置 input设备热插拔''':安装驱动 xf86-input-evdev,同时配置HAL使其能使用kbd/mouse驱动。<br />
<br />
安装xf86-input-evdev:<br />
# pacman -S xf86-input-evdev<br />
在X.org相关进程启动前,启动守护进程hal:<br />
# /etc/rc.d/hal start<br />
把hal加入/etc/rc.conf里的DAEMONS列表里,这样每次电脑启动,都会自动开启hal。详情请见[[Xorg input hotplugging]] 。<br />
<br />
说明: 开启hal必须首先有一个dbus用户和用户组,以root身份输入下面命令创建用户和用户组<br />
<br />
usr/sbin/groupadd -g 81 dbus<br />
usr/sbin/useradd -c 'System message bus' -u 81 -g dbus -d '/' -s /bin/false dbus<br />
<br />
2) '''关闭input设备热插拔''':在/etc/X11/xorg.conf的ServerFlags段,加入参数''Option &quot;AutoAddDevices&quot; &quot;False&quot;'' 这将忽略hal的硬件检测,并使用你xorg.conf的keyboard/mouse配置。步骤如下<br />
# nano /etc/X11/xorg.conf<br />
加入下面三行:<br />
Section &quot;ServerFlags&quot;<br />
Option &quot;AutoAddDevices&quot; &quot;False&quot;<br />
EndSection<br />
<br />
====3、测试 X====<br />
<br />
在所生成的xorg文件路径''path/to/xorg.conf''前,加入参数''-config'' ,运行 '''X'''脚本,可以测试脚本配置是否正确。<br />
比如要测试你上面生成的xorg是否配置正确,输入:<br />
X -config /root/xorg.conf.new<br />
'''X''' 将启动,在屏幕中央会有一个白色的 X ,鼠标或是触摸板可以移动它,按 CTRL-Alt-Backspace 可以退出 '''X'''<br />
<br />
====对xorg.conf除错====<br />
如果 X 出现错误不能运行,你需要手动检查你的配置文件:<br />
<br />
nano /root/xorg.conf.new<br />
<br />
* 确定 Xorg -configure 命令正确的识别了你的显卡,比如:<br />
Section &quot;Device&quot;<br />
<br />
...<br />
<br />
Driver &quot;savage&quot;<br />
<br />
...<br />
<br />
EndSection<br />
<br />
* 确定里面的 Section "Monitor" 设置了水平同步率和垂直刷新率,如果没有要把它加上:<br />
Section &quot;Monitor&quot;<br />
Identifier &quot;Monitor0&quot;<br />
VendorName &quot;Monitor Vendor&quot;<br />
ModelName &quot;Monitor Model&quot;<br />
HorizSync 30.0 - 130.0 # Safe for LCD's<br />
VertRefresh 50.0 - 100.0 # Safe for LCD's and most CRT's.<br />
EndSection<br />
如果你不知道这些刷新率到底是多少,你就得查一下你显示器的说明书。<br />
<br />
* 在section "Screen"配置默认色深(color depth):<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Card0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
(此处色深被设定为真彩24色。)<br />
<br />
<br />
* 在subsection &quot;Display&quot; 加入你需要的Modes, at least under the Depth 24 header, e.g.:<br />
SubSection &quot;Display&quot;<br />
Viewport 0 0<br />
Depth 24<br />
Modes &quot;1024x768&quot; &quot;800x600&quot; &quot;640x480&quot;<br />
* Add the following section, if you wish to enable eye candy which requires the composite extension: <br />
Section &quot;Extensions&quot;<br />
Option &quot;Composite&quot; &quot;Enable&quot;<br />
EndSection<br />
<br />
* 上述调整完成后,再测试你的配置:<br />
X -config /root/xorg.conf.new<br />
<br />
* 在确认 '''X''' session开启,没有错误之后,把测试好的配置文件移到 /etc/X11下,作为系统的xorg.conf配置文件:<br />
mv /root/xorg.conf.new /etc/X11/xorg.conf<br />
详细的介绍可见[[Xorg]] <br />
<br />
接下来可以简单作测试 '''[[#Simple baseline X test|Simple baseline X test]]'''<br />
<br />
====调整键盘布局====<br />
=====如果开启了input热插拔=====<br />
# cp /usr/share/hal/fdi/policy/10osvendor/10-keymap.fdi /etc/hal/fdi/policy/<br />
# nano /etc/hal/fdi/policy/10-keymap.fdi<br />
Edit the &quot;input.xkb.layout&quot; key and possibly the &quot;input.xkb.variant&quot; key in this file.<br />
Restart hal:<br />
# /etc/rc.d/hal restart<br />
<br />
=====如果关闭了input热插拔=====<br />
Add option lines in the &quot;InputDevice&quot; section of the /etc/X11/xorg.conf file specifying the keyboard layout and variant:<br />
Option &quot;XkbLayout&quot; &quot;be&quot;<br />
Option &quot;XkbVariant&quot; &quot;&quot;<br />
<br />
详情请见 [[Xorg input hotplugging]]。<br />
<br />
===简单的命令行界面X测试(如果需要)===<br />
<br />
在安装了xorg、合适的显卡驱动、创建了一个/etc/X11/xorg.conf文件之后,如果想在安装完整桌面环境之前,快速测试下你的配置,使用'''xterm'''可以实现! <br />
Xterm是个简单的终端模拟程序,作为base xorg软件包的一部分会被自动安装,运行在'''X '''Server环境里。通过配置~/.xinitrc,Xterm可以让我们快速测试显卡驱动和配置文件/etc/X11/xorg.conf是否被正确配置。(另外,如果在没有/etc/X11/xorg.conf的情况下,你想测试下'''X''' 自动检测是否满意,也可以使用这个)<br />
<br />
==== 准备工作:配置~/.xinitrc====<br />
<br />
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. <br />
{{Box Note | '''[[.xinitrc]]''' is a so-called 'dot' (.) file. 在UNIX文件系统下,文件名以 (.)开头的,是 '隐藏文件',,使用普通的命令'ls' 将不显示这些文件,使用加了参数命令'''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 &quot;Run Control&quot;.}}<br />
<br />
'''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. (说明: ''如果没有文件~/.xinitrc, /etc/X11/xinit/xinitrc 将被作为替代来使用,这是个使用TWM and Xterm的默认配置。'')<br />
<br />
切换到'''''普通, 非root'''''用户:<br />
# su - ''yourusername''<br />
* /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.<br />
* 如果没有~/.xinitrc这个文件,到该目录下创建一个,或者从/etc/skel/复制一个同样的文件到你的home目录:: <br />
<br />
$ cp /etc/skel/[[.xinitrc]] ~/<br />
<br />
* 编辑文件: <br />
$ nano ~/.xinitrc<br />
加入这行&quot;<code>exec xterm</code>&quot;像下面这样:<br />
<br />
#!/bin/sh<br />
#<br />
# ~/.xinitrc<br />
#<br />
# Executed by startx (run your window manager from here)<br />
#<br />
exec xterm<br />
# exec wmaker<br />
# exec startkde<br />
# exec icewm<br />
# exec blackbox<br />
# exec fluxbox<br />
<br />
{{Box Note | ''请确保~/.xinitrc''里,以'''exec'''开头的,只有'''一行'''的注释被去掉。}}<br />
<br />
====开始执行测试====<br />
<br />
* 以普通用户身份输入下面命令,开启'''X''',开始测试你的配置:<br />
<br />
$ startx<br />
或者是这命令<br />
$ xinit<br />
<br />
此时会打开一个'''xterm''' session,你可以在这里测试your keyboard and its layout<br />
<br />
* 按Ctrl+Alt+Backspace,或者输入"exit"可以退出'''X''' Server。<br />
* 如果开启'''X'''出现问题,在终端,查看日志文件/var/log/Xorg.0.log的错误信息。<br />
<br />
更多的Xorg configuration介绍可见[[Xorg]] .<br />
<br />
==第四部分:安装并配置桌面环境==<br />
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 icons, applets, windows, toolbars, folders, wallpapers, 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.<br />
<br />
* 如果你需要一个完整功能,类似于Windows和Mac OSX, 可以选择安装'''[[#KDE|KDE]]''' <br />
* If you want something slightly more minimalist, which follows the K.I.S.S. principle more closely, '''[[#GNOME|GNOME]]''' is a good choice<br />
* '''[[#Xfce|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.<br />
<br />
如果你的机器较老,或者是希望使用一个更轻量、更少GUI要求,可以选择只安装 '''Window Manager''', 或者 WM. A WM controls the placement and appearance of application windows in conjunction with the X Window System but does NOT provide such additions as panels, applets, icons, etc.<br />
* Lightweight floating WM's include: [[#Openbox|'''Openbox''']], [[#Fluxbox|'''Fluxbox''']], [[#fvwm2|'''fvwm2''']], '''Windowmaker, Pekwm, and TWM'''.<br />
* If you need something completely different, try '''Awesome, ion, wmii, dwm, or xmonad'''。<br />
<br />
===一、安装字体===<br />
在安装桌面环境/窗口管理器'''之前''',也许你会先安装些美观的字体。Dejavu和bitstream-vera都是不错的字体集。而对于网页,你还可能需要Microsoft字体。如下安装:<br />
pacman -S ttf-ms-fonts ttf-dejavu ttf-bitstream-vera<br />
对于中文字体,开源的文泉驿正黑矢量字体是不错的选择,它还内嵌了9pt-12pt的点阵宋体:<br />
pacman -S wqy-zenhei<br />
<br />
===二、选择默认启动的桌面环境 ~/.xinitrc===<br />
<br />
以普通用户身份编辑/home/username/.xinitrc,加入你要用的DE. This will allow you to use '''startx/xinit''' from the shell, in the future, to open your DE/WM of choice:<br />
<br />
nano ~/.xinitrc<br />
<br />
反注释或者加入相应的桌面环境/窗口管理器的''''exec''' ..'内容行。例如:使用Xfce4桌面环境:<br />
<br />
exec startxfce4 <br />
<br />
记住在~/.xinitrc中只反注释掉一行'''exec'''。这条命令将一直运行到你注销桌面登录。一般的,shell将等到kde完成加载之后,在运行下一条命令。在命令前加 &quot;exec&quot; ,是告诉the shell 这条命令最后执行, 这样shell就不用等待其他命令了,直接载入桌面。<br />
接下来安装你所选的桌面环境/窗口管理器。<br />
<br />
===三、选择安装一个桌面环境===<br />
====GNOME====<br />
=====关于GNOME=====<br />
GNOME是'''G'''NU '''N'''etwork '''O'''bject '''M'''odel '''E'''nvironment的缩写。GNOME项目有两大部分:GNOME桌面环境 ── 既直观又迷人的最终用户桌面,以及GNOME开发平台 ── 一个用来创建可与桌面集成的应用程序的庞大的框架。<br />
<br />
=====安装=====<br />
安装基本的GNOME环境:<br />
pacman -S gnome<br />
<br />
安装额外的GNOME环境:<br />
pacman -S gnome-extra<br />
然后选择提示的所有软件包。 <br />
<br />
=====对GNOME有用的守护进程=====<br />
如之前所述,守护进程(daemon)是运行在后台的程序,它等待事件发生并提供相应的服务。其中'''Hal'''守护进程可以自动挂载磁盘、光驱和U盘给GUI使用。'''Fam'''守护进程可以在GUI中实时反映文件的变动,如最近安装的程序、文件系统的变化等。'''Hal'''和'''fam'''使得GNOME的使用更为方便。Hal和fam软件包在安装GNOME时已一同安装,建议安装社区库的gamin来替代fam。<br />
<br />
{{Box Note|注意,fam是一个比较老的包,很容易造成较大的日志文件。}}<br />
<br />
{{Box Note|在当前的gnome环境中,你可以安装gamin来实现fam的功能。这时,你可以不用在DAEMONS中添加fam启动项了(不需要加入gamin,它会自动被启用)。}}<br />
<br />
* 你需要启动'''hal'''守护进程。<br />
<br />
启动hal:<br />
/etc/rc.d/hal start<br />
<br />
如果您想使用fam,同样需要启动:<br />
/etc/rc.d/fam start<br />
<br />
将hal加入到/etc/rc.conf的DAEMONS中以使得它们随系统启动而自动运行:<br />
nano /etc/rc.conf<br />
<br />
DAEMONS=(syslog-ng network crond alsa '''hal''')<br />
<br />
{{Box Note|注意,如果使用fam,那么把fam加入到hal后面。}}<br />
<br />
* 或许你还会希望安装一个图形界面的登录管理器。在GNOME下'''gdm'''守护进程是个不错的选择。<br />
以root身份运行:<br />
pacman -S gdm<br />
<br />
让gdm启用有两种方式,一种是直接加入到DAEMONS的末尾,通过rc.conf来启动;另外一种方式是用过配置inittab来加载gdm。<br />
<br />
* 通过inittab来加载gdm也很方便(推荐使用这种方式):<br />
nano /etc/inittab<br />
<br />
修改默认启动方式:<br />
<br />
将<br />
id:3:initdefault:<br />
改为<br />
id:5:initdefault:<br />
<br />
然后取消下面代码的注释:<br />
x:5:respawn:/usr/sbin/gdm -nodaemon<br />
<br />
{{Box Note|实际上,可以看到gdm/xdm/kdm/slim等,使用哪个取决于你的喜好,启用喜欢的那个,将其他的注释掉。当然,本章介绍的是gnome,所以推荐gdm,下章中将推荐kdm:)}}<br />
<br />
<br />
* 通过DAEMONS方式启动gdm也很方便:<br />
nano /etc/rc.conf<br />
<br />
DAEMONS=(syslog-ng network crond alsa hal gdm)<br />
<br />
{{Box Note|这是类似debian/ubuntu的做法,这种方式有一点不好:不管什么时候(非修复模式),系统总是会尝试进入gdm引导的X方式下。对于X已经配置得很好,并且不使用纯控制台的人可以使用这种方式。但是选择这种方式的话你将不能通过内核参数3或者5来区分进入纯字符控制台还是X11的gdm登录窗口。}}<br />
<br />
* 开启Gnome<br />
以普通用户身份启动X:<br />
startx<br />
或者这条命令也行:<br />
$ xinit<br />
如果你的 ~/.xinitrc一直没配置,那你将可以一直使用下面这条命令来开启Gnome:<br />
$ xinit /usr/bin/gnome-session<br />
<br />
关于安装和配置GNOME的高级指引可以参见[[GNOME (简体中文)|GNOME]]一文。接下来你可以浏览'''[[#优化和收尾|优化和收尾]]'''。或许你还会对[[ArchTips(简体中文)|Arch安装完后的小技巧]]一文感兴趣。<br />
<br />
=====美化=====<br />
如果不满足于缺省的GNOME主题和图标,那么可以安装一个不错的主题,比如murrine:<br />
pacman -S gtk-engine-murrine<br />
接着在System->Preferences->Theme里选择这个主题。<br />
<br />
Arch Linux也做了些不错的主题,根据你自己的审美观,选择满意的安装吧:<br />
<br />
# pacman -S gtk-engines gtk2-themes-collection gtk-aurora-engine gtk-candido-engine gtk-rezlooks-engine<br />
<br />
你还可以在[http://www.gnome-look.org Gnome Look]里找到更多的主题、图标和壁纸。<br />
<br />
====KDE====<br />
=====关于KDE=====<br />
KDE桌面环境('''K''' '''D'''esktop '''E'''nvironment)的缩写。 KDE是一种著名的运行于GNU/Linux 、 <code>UNIX</code> 工作站等的强大、自由图形工作环境。她拥有对系统内部各功能的强大整合能力、跨平台能力、易用性、优异的初始界面.<br />
<br />
=====安装=====<br />
Arch提供多个版本的kde: '''kde、kdebase 和 KDEmod'''. 选'''一个'''就行了,然后 '''[[#有用的KDE守护进程|有用的KDE守护进程]]''': <br />
<br />
'''1.)''' '''kde'''是完整的kde软件包,大概 ~300MB,适合主要使用kde软件的系统.<br />
pacman -S kde<br />
'''2.)''' '''kdebase'''是kde的基础软件包(里面没有kdm),大概 ~80MB,适合于只想把kde作为基础系统.<br />
pacman -S kdebase<br />
'''3.)''' '''KDEmod''' 是 Arch Linux独有的、社区驱动的项目,目标是把kde更加细致的模块化和达到其极致的运行效率。KDEmod项目的网站在http://chakra-project.org/ 。<br />
<br />
=====有用的KDE守护进程=====<br />
<br />
KDE 需要'''hal''' ('''H'''ardware '''A'''bstraction '''L'''ayer) 作为守护进程(daemons). '''kdm''' ( '''K''' '''D'''isplay '''M'''anager), 提供一个 '''图形化登录界面'''.<br />
{{Box Note|hal守护进程将自动开启dbus守护进程。kde4里已经不需要fam。kdm现在在kdebase-workstation这个包里,如果只安装kdebase,需要再安装此包才能使用kdm}}<br />
<br />
The hal daemon, among other things, will automate the mounting of disks, optical drives, and USB drives/thumbdrives for use in the GUI. <br />
<br />
-----<br />
启动hal进程:<br />
<br />
/etc/rc.d/hal start<br />
<br />
编辑/etc/rc.conf的 DAEMONS部分:<br />
nano /etc/rc.conf<br />
把 '''hal''' 加入 DAEMONS 部分,以便他们在系统启动时加载. 如果想要kde的图形化登录界面,把 '''kdm'''也加进去(或者不加,在/etc/inittab里面设置): <br />
DAEMONS=(syslog-ng network crond alsa '''hal kdm''')<br />
{{Box Note|如果你安装的是KDEmod3,则使用kdm3替换kdm}}<br />
<br />
*This method will start the system at runlevel 3, (/etc/inittab default, multiuser mode), and then start KDM as a daemon. <br />
<br />
*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 [[Adding a login manager (KDM, GDM, or XDM) to automatically boot on startup]] for more.<br />
<br />
*If you prefer to log into the '''console''' at runlevel 3, 手动启动 X, 则不加入kdm, 或者是加个前缀( ! )禁止它。<br />
<br />
* 现在可以试试效果了,用普通用户身份开启X Server:<br />
startx<br />
或者<br />
$ xinit<br />
更多关于安装和配置KDE的文章,请看[[KDE]].<br />
<br />
到此步,可以看 '''[[#优化和收尾]]'''这部分了. You may also be interested in the [[Post Installation Tips]] wiki article.<br />
<br />
====Xfce====<br />
=====关于Xfce=====<br />
和GNMOE、KDE一样,Xfce是一个桌面环境,其目标是快捷、轻量,同时又美观而易用。它还提供了一整套的应用程序如根窗口应用(root window app)、 窗口管理器、文件管理器、面板等等。 Xfce是用GTK2 toolkit编写的(类似GNOME),和其它大型桌面环境一样,它也有自己的开发环境(库文件、守护进程等)。但不象GNOME或者KDE,Xfce是轻量化的,其设计更接近于CDE而不是Windows或者Mac。它的开发周期比较慢,但是十分稳定、速度很快。在老硬件上Xfce可以运行得很好,而在新机器上更是运行如飞。<br />
<br />
=====安装=====<br />
安装完整的xfce环境以及主题和extras:<br />
pacman -S xfce4 xfce4-goodies gtk2-themes-collection <br />
<br />
如果你使用KDM或者GDM的话会显示一个xfce会话。另一种启动方式是:<br />
startxfce4<br />
<br />
关于安装和配置xfce的高级指引可以参见[[Xfce (简体中文)|Xfce]]一文。<br />
<br />
恭喜!欢迎来到Arch Linux系统的Xfce桌面环境!接下来你可以浏览'''[[#优化和收尾|优化和收尾]]''',或者下面的其它内容。或许你还会对[[ArchTips(简体中文)|Arch安装完后的小技巧]]一文感兴趣。<br />
<br />
====*box====<br />
=====Fluxbox=====<br />
Fluxbox © is yet another windowmanager for X.<br />
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).<br />
<br />
Install Fluxbox using <br />
pacman -S fluxbox fluxconf<br />
<br />
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:<br />
exec startfluxbox <br />
<br />
More information is available in the [[Fluxbox]] article.<br />
<br />
=====Openbox=====<br />
Openbox是一个标准的”温顺的“,快速的,轻量级的,可扩展的窗口管理器。<br />
<br />
Openbox与你的应用程序一起工作工作,并使你的的桌面便于管理。这是因为它的开发方式和通常的窗口管理器的方式是相悖的。 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.<br />
<br />
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. <br />
<br />
安装openbox<br />
pacman -S openbox obconf obmenu<br />
<br />
一旦openbox安装好,你将得到一个消息to move menu.xml & rc.xml to ~/.config/openbox/ in your home directory:<br />
<br />
mkdir -p ~/.config/openbox/<br />
cp /etc/xdg/openbox/rc.xml ~/.config/openbox/<br />
cp /etc/xdg/openbox/menu.xml ~/.config/openbox/<br />
<br />
In the file "rc.xml" you can change various settings for Openbox (or you can use OBconf). In "menu.xml" you can change your right-click menu.<br />
<br />
To be able to log into openbox you can either go via graphical login using KDM/GDM or startx, in which case you will need to edit your ~/.xinitrc (as user) and add the following:<br />
<br />
exec openbox<br />
<br />
For KDM there is nothing left to do; openbox is listed in the sessions menu in KDM.<br />
<br />
Useful programs for openbox are:<br />
* PyPanel or LXpanel if you want a panel<br />
* feh if you want to set the background<br />
* ROX if you want a simple file manager and desktop icons<br />
<br />
More information is available in the [[Openbox]] article.<br />
<br />
====fvwm2====<br />
FVWM是一个非常强大的面向X桌面系统的”ICCCM-compliant的多虚拟桌面的窗口管理器“(ICCCM-compliant multiple virtual desktop window manager)。开发活动很活跃,支持也是极好的。 <br />
<br />
输入下面命令安装 fvwm2 <br />
pacman -S fvwm <br />
<br />
fvwm会自动添加进 kdm/gdm会话列表. 如果没有的话,添加 <br />
exec fvwm <br />
<br />
到你的用户文件 .xinitrc.<br />
<br />
注意:这个稳定版已经有些年头了,如果需要最新的fvwm版本,可以安装unstable repo里的fvwm-devel 包.<br />
<br />
===四、优化和收尾===<br />
====HAL====<br />
如果你已经安装了一个桌面环境,但是又觉得用起来不是很方便,那么现在就是个安装HAL的好时机了。HAL使得你的手机、iPod、移动硬盘等等可以即插即用。它会挂载设备并在你的桌面或/和'My Computer'目录中创建相应的图标,使得你可以在插入设备后就能访问到它,无需每次都对每个新设备来手动配置/etc/fstab文件或者udev规则。<br />
<br />
KDE、GNOME和XFCE都使用到HAL。<br />
<br />
安装过程描述可以在[[HAL (简体中文)|HAL]]一文中找到。其它一些信息可以在[http://en.wikipedia.org/wiki/HAL_(software) Wikipedia]上找到。<br />
<br />
====启动时让守护进程在后台执行====<br />
<br />
要加速系统的启动过程,可以在/etc/rc.conf中给守护进程前加上'@'符号使之在后台执行,例如:<br />
<br />
DAEMONS=(@syslog-ng @network crond @alsa @hal @fam @kdm)<br />
这使得守护进程在后台被加载,无需等待它们加载结束。<br />
<br />
在守护进程前加上(!)可以禁止系统启动时加载它,例如:<br />
<br />
DAEMONS=(@syslog-ng @network !crond @alsa @hal @fam @kdm)<br />
<br />
另一种方式是直接将不需要的守护进程删除。<br />
<br />
====美化LCD下的字体====<br />
See [[Fonts]]<br />
<br />
====让所有的鼠标按键生效====<br />
看这个 [[Get All Mouse Buttons Working]]<br />
<br />
====笔记本电脑可能遇到的问题====<br />
(1) 触摸板问题<br />
参看http://wiki.archlinux.org/index.php/Touchpad_Synaptics<br />
<br />
(2) 摄像头问题<br />
参看http://wiki.archlinux.org/index.php/Webcam_Setup<br />
<br />
(3) 无线上网问题<br />
参看http://wiki.archlinux.org/index.php/Wireless<br />
<br />
(4) 快捷键问题<br />
参看http://wiki.archlinux.org/index.php/Extra_Keyboard_Keys<br />
<br />
====配置CPU频率====<br />
现在的处理器能够降低频率和电压,以降温和降低电源消耗。降温能使系统更稳定,笔记本用户肯定是想这样做的,但是即使是台式机也会对系统有利。<br />
<br />
安装CPU频率工具用:<br />
pacman -S cpufrequtils<br />
<br />
把CPU频率在/etc/rc.conf里加入到启动进程(daemons)中。编辑配置文件/etc/conf.d/cpufreq改<br />
governor="conservative"<br />
<br />
这使得在需要的情况下可以动态地增减CPU频率(这是对于台式机来说也是一个安全的选择)。改变最小频率(min_freq)和最大频率(max_freq)以匹配你的CPU的情况。如果你不知道频率,在载入频率测量模块后运行“cpufreq-info”。你也可以将min_freq和max_freq注释掉或删除,这样就能自动进行。加入频率测量模块到/etc/rc.conf的模块行。<br />
几乎所有的笔记本和台式机都可以简单地使用''acpi-cpufreq''驱动,但是也有其它的选择,如:''p4-clockmod, powernow-k6, powernow-k7, powernow-k8, and speedstep-centrino''。 <br />
<br />
通过下面这个命令载入这个模块:<br />
modprobe <modulname> <br />
通过下面命令行开启cpufreq:<br />
/etc/rc.d/cpufreq start<br />
更多细节,请看 [[Cpufrequtils]]<br />
<br />
==第五部分:常用的应用程序==<br />
更多信息,请看[[ArchLinux常用的应用程序(简体中文)]].<br />
<br />
==附录==<br />
新手指南附录[[ArchLinux新手指南附录 (简体中文)]]<br />
<br />
想得到更多的信息和支持,你可以去[http://www.archlinux.org/ homepage], [[Special:Search|search the wiki]],[http://bbs.archlinux.org/ forums],[[ArchChannel|IRC channel]],以及[http://www.archlinux.org/mailman/listinfo/ mailing lists]。<br />
=====问题答疑=====<br />
See [[Arch FAQs for newbies]]<br />
还有这里[http://bbs.archlinux.org/viewtopic.php?t=29055 Arch forum thread] 也是面向初学者的。<br />
<br />
=====术语=====<br />
更多信息关于Arch术语,查阅[[Arch Terminology/Jargon for newbies|this article]].<br />
<br />
=====接下来还有什么?=====<br />
<br />
你还可以阅读:<br />
<br />
[[Arch 官方安装指南 (简体中文)|Arch 官方安装指南]]<br />
<br />
[[Arch AUR (简体中文)|ArchLinux社区用户软件仓库 (AUR)]]<br />
<br />
[[Get All Mouse Buttons Working]]<br />
<br />
[[改善Pacman性能 (简体中文)|改善Pacman性能]]<br />
<br />
[[Kernel Compilation]]<br />
<br />
[[Pm-utils 电源管理 (简体中文)|Pm-utils 电源管理]]<br />
<br />
[[CPU 频率调节 (简体中文)|CPU 频率调节]]<br />
<br />
[[:Category:美化|美化]]</div>
Flydragon
https://wiki.archlinux.org/index.php?title=ArchLinux_%E6%96%B0%E6%89%8B%E6%8C%87%E5%8D%97_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=90847
ArchLinux 新手指南 (简体中文)
2010-01-04T09:38:53Z
<p>Flydragon: /* Pacman镜像 */</p>
<hr />
<div>[[Category:简体中文]]<br />
[[Category:获取并安装Arch (简体中文)]]<br />
[[Category:关于Arch_(简体中文)]]<br />
[[Category:HOWTOs (简体中文)]]<br />
<br />
{{Article summary start}}<br />
{{Article summary text|本文针对新手,提供了极其详尽的Archlinux的安装过程向导,和相关的简要说明。}}<br />
{{Article summary heading|已有的语言版本}}<br />
{{Article summary heading|Available Languages}}<br />
{{i18n_entry|Česky|Průvodce začátečníka (Česky)}}<br />
{{i18n_entry|简体中文|Arch 新手安装指南 (简体中文)}}<br />
{{i18n_entry|正體中文|Beginner's Guide 新手指南}}<br />
{{i18n_entry|Dansk|Dansk_Begynderguide}}<br />
{{i18n_entry|Deutsch|Beginners Guide (Deutsch)}}<br />
{{i18n_entry|English|Beginners Guide}}<br />
{{i18n_entry|Español|Guía para Principiantes (Español)}}<br />
{{i18n_entry|Français|Manuel_du_Débutant_(Français)}}<br />
{{i18n_entry|Italiano|Beginners Guide (Italiano)}}<br />
{{i18n_entry|Indonesia|Beginners_Guide_(Indonesia)}}<br />
{{i18n_entry|Lietuviškai|Pradedančiųjų gidas (Lietuviškai)}}<br />
{{i18n_entry|Nederlands|Beginners_Guide_(Nederlands)}}<br />
{{i18n_entry|Português Brasil|Guia do Iniciante(Português do Brasil)}}<br />
{{i18n_entry|Português|Guia para Principiantes(Português)}}<br />
{{i18n_entry|Русский|Руководство_для_новичков}}<br />
{{i18n_entry|Türkçe|Başlangıç Rehberi (Türkçe)}}<br />
{{i18n_entry|हिन्दी|नौसिखिया गाइड(हिन्दी)}}<br />
{{Article summary heading|相关文章}}<br />
{{Article summary wiki|Arch 官方安装指南 (简体中文)}}(更通用的安装方式)<br />
{{Article summary wiki|ArchLinux新手指南附录 (简体中文)}}<br />
{{Article summary wiki|ArchLinux安装完后的小技巧 (简体中文)}}<br />
{{Article summary wiki|ArchLinux常用的应用程序(简体中文)}}<br />
{{Article summary wiki|Work and Play with Arch (Chinese)}}<br />
{{Article summary end}}<br />
<br />
==前言==<br />
<br />
=====所有你一直想知道的关于安装Arch的事=====<br />
这篇文档将会指导你安装和配置[[ArchLinux (简体中文)|Arch Linux]] ── 一个简洁、轻量级的GNU/Linux发行版,一个类<code>UNIX</code>的操作系统。本文是面向Arch新用户,因此尽力为所有人提供强大的参考资料和信息。本指南讲述该如何获得一个基本配置好的Arch Linux系统(拥有一个图形桌面环境),但显然是不可能涵盖(甚至是预见)所有的信息。因此本指南会专注于某些关键性的步骤,想要进一步深入了解你可以查看[[Main Page (简体中文)|Arch Linux Wiki]]或者[http://bbs.archlinux.org/ Arch Linux论坛]。同时有兴趣的话你还可以了解一下[[Arch 之道 (简体中文)|Arch 之道]],它概述了Arch Linux发行版背后的哲学思想。<br />
<br />
'''Arch Linux的相关特性:'''<br />
* '''[[The Arch Way | Simple]]''' design and philosophy<br />
* Community distro targeted at competent GNU/Linux users<br />
* All packages compiled for '''i686/x86-64'''<br />
* 从底层开始就可以让用户高度定制<br />
* '''[[The Arch boot process | BSD-style init]]''' scripts, featuring one centralized configuration file<br />
* '''滚动升级''' <br />
* '''[[Pacman]]''' package manager is fast, written in '''C''', lightweight and agile, with a very modest memory footprint<br />
* '''[[ABS]]''': The '''A'''rch '''B'''uild '''S'''ystem, a ports-like package building system makes it simple to create your own easily installable Arch packages from source, to use and/or share with the community on the [[AUR]]<br />
* '''[[AUR]]''': The Arch User Repository, offering many thousands of build scripts for Arch user-provided software packages<br />
<br />
=====别怕(DON'T PANIC)!=====<br />
要知道Arch Linux的安装方法和过程也许会和你所使用过的其它GNU/Linux发行版非常不同,特别你是个新手的话将更能体会到这点。通常,GNU/Linux发行版会在一张或者一堆CD(甚至是DVD)上捆绑了大量的软件,包含了缺省桌面环境、缺省的应用程序和设置、硬件自动检测和图形化的安装程序,一切都是替你选择好了的。相反的,Arch Linux系统是让'''用户自己'''只是用一个bash shell和基本系统工具,从ncurses installer和基础系统上建造起来的。这就是[[Arch 之道 (简体中文)|Arch 之道]]。不象其它大型发行版,它没有强加于用户的缺省环境或者配置。你可以在命令行使用[[pacman (简体中文)|pacman]]通过互联网连接从Arch软件仓库安装软件包,直到你的系统配置成你希望的样子。这给予了用户最大的弹性、选择性和对系统资源的控制。因为是'''你'''建造了它,所以你肯定能了解系统里具体细节,知道底层都有些什么。<br />
<br />
Arch Linux系统是通过编辑文本文件进行配置的,没有提供图形界面的工具,所以需要对系统和linux相对熟悉。<br />
Arch Linux针对的是有能力的GNU/Linux用户以及希望花费时间学习系统知识的用户。 <br />
<br />
''Arch是一个可以被用户塑造的工具。''<br />
<br />
=====授权协议=====<br />
<br />
Arch Linux, pacman, documentation, and scripts are copyright<br />
©2002-2007 by Judd Vinet, ©2007-2008 by Aaron Griffin and are licensed under the GNU General Public License Version 2.<br />
<br />
=====[[Arch 之道 (简体中文)|Arch 之道]]=====<br />
<br />
''Arch的设计思想是"保持简洁"(keeping it simple)。'' <br />
<br />
这里的‘简洁’并不是单指‘简单’或者‘用户友好’,而是‘没有不必要的增加、修改或者复杂性’。简而言之,即优雅、极简之法。<br />
<br />
<br />
''"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 crap." -Aaron Griffin''<br />
<br />
<br />
''"The extraordinary part of [my method] lies in its simplicity..I have always believed that the simple way is the right way."'' - Bruce Lee<br />
“(我的方法中)最超凡的部分是它的简单性,我一直相信简单的就是对的。” 李小龙(Bruce Lee)<br />
<br />
Occam's razor: ''Entia non sunt multiplicanda praeter necessitatem'' or "Entities should not be multiplied unnecessarily." The term razor refers to the act of shaving away unnecessary assumptions and complications to get to the simplest explanation, method or theory.<br />
<br />
{{Box Note |'''仔细遵循本指南是成功安装一个配置正常的Arch Linux系统的基本要点,因此''请''认真仔细的阅读本文'''}}<br />
* 你也可以将本指南打印出来,作为一个较为有用的Arch Linux用户手册。<br />
*''如果你想在这个wiki里增加内容,请适当描述清楚“为什么会这样”以及“该怎么办”。最佳的文档应该能教会我们如何做和为什么这么做!''<br />
* Arch的wiki是项优秀的资源,可以[http://wiki.archlinux.org/index.php/Main_Page 第一时间]用来解决日常问题; 如果找不到答案也可以求助IRC和[http://bbs.archlinux.org/ 论坛]。<br />
----<br />
----<br />
欢迎使用Arch!现在,让我们开始吧。<br />
<br />
本文按照安装过程分四大部分:<br />
<br />
'''[[#第一部分:安装基本系统|第一部分:安装基本系统]]'''<br />
<br />
'''[[#第二部分:完成基本系统并升级|第二部分:完成基本系统并升级]]'''<br />
<br />
'''[[#第三部分:安装X并配置ALSA|第三部分:安装X并配置ALSA]]'''<br />
<br />
'''[[#第四部分:安装并配置桌面环境|第四部分:安装并配置桌面环境]]'''<br />
<br />
==第一部分:安装基本系统==<br />
===一、获取最新的系统安装包===<br />
<br />
你可以从[http://archlinux.org/download/ 这里]获取Arch最新的官方系统安装包。最新版本是2009.08<br />
<br />
*不论是Core还是Netinstall系统安装包,都只是包含了安装'''Arch Linux基本系统'''所需的软件包. ''注意,基本系统是不包含GUI图形界面的。它主要包含了GNU的系列工具(编译器、汇编程序、链接、库、脚本,还有其它的一些有用的工具),Linux的内核,还有一些额外的库和模块。<br />
*Core映像文件可以较方便的通过CD或者网络进行安装。<br />
*Netinstall映像文件较小巧,本身没有提供软件包,整个系统都是通过internet来获取的。<br />
*isolinux映像文件是给那些使用grub版本时发生问题的用户的。两者没有其它区别。<br />
*Arch64问答( http://wiki.archlinux.org/index.php/Arch64_问答_(简体中文) )可以帮助你在32位版本和64位版本之间作出选择。<br />
<br />
====CD 系统安装包====<br />
把下载的.iso映像文件刻录到CD上。开机时用CD启动,出现界面,跳到[[#二、启动Arch Linux系统安装程序| 二、启动Arch Linux系统安装程序]]<br />
{{Box Note| 通常为了刻录的稳定可靠(速率越低刻录质量越有保证),推荐刻录的最大速度不超过16倍速。有些用户推荐'''''速度为 4x 或者 2x.''''' 如果所刻录的CD有问题,可以尝试使用你系统所支持的最小速度方式刻录。 }}<br />
<br />
<br />
====USB安装方式====<br />
{{Warning|这样做会把USB盘里面原有的数据格式化。}}<br />
<br />
'''<code>UNIX</code> 方式:'''<br />
<br />
插入USB盘,找到其路径,用<code>/bin/dd</code>命令把.img映像文件写入USB(Linux下):<br />
<br />
dd if=archlinux-2009.08-''{core|netinstall}''-''{i686|x86_64}''.img of=/dev/sd''x''<br />
<br />
if= 后面是.img镜像文件的路径,of= 是你的USB路径. 要使用/dev/sd''x''而不是/dev/sd''x1''.(就是要使用整个分区而不是第一分区)<br />
<br />
'''检查镜像的完整性md5sum (可选):'''<br />
<br />
记下读入和写出的记录区数目,然后执行以下命令进行检查:<br />
dd if=/dev/sd''x'' count=''记录区数目'' status=noxfer | md5sum<br />
<br />
md5sum命令返回的值(这是你检查U盘上文件得到的)要与你下载的archlinux镜像文件的md5sum校验值相同;它们都应该和镜像站点的md5sum文件列表里相应的值相同。<br />
<br />
'''Windows方式:'''<br />
<br />
从https://launchpad.net/win32-image-writer/+download 下载Disk Imager。插入U盘,启动Disk Imager并选择映像文件,再选择U盘相应的磁盘驱动号,点击"write"即可。<br />
<br />
===二、启动Arch Linux系统安装程序===<br />
Usually, the first item is the preferred selection. However, choose Boot Archlive or Boot Archlive [legacy IDE] if you have trouble with libata/PATA, or have no SATA (Serial ATA) drives.<br />
<br />
Also, to change boot options, press '''e''' for editing the boot lines. Many users may wish to change the resolution of the framebuffer, for more readable console output. Append:<br />
插入刻录好的光盘CD或者USB盘,然后用它启动电脑。可能需要在BIOS里(通常是启动后在加电自检过程中按DEL、F1、F2、F11或者F12)改变一下启动顺序使得CD或者USB先被启动。<br />
<br />
{{Note|内存需求:<br />
* Core : 160 MB RAM x86_64/i686 (选择所有软件包,开启交换分区)<br />
* Netinstall : 160 MB RAM x86_64/i686 (选择所有软件包,开启交换分区)}}<br />
<br />
启动了Arch Linux光盘后,用上下箭头高亮菜单,按下回车键进行选择。<br />
<br />
通常,推荐选择第一项菜单。不过如果使用libata/PATA出现问题或者没有SATA (Serial ATA)驱动器,你也可以选择Boot Archlive或者Boot Archlive [legacy IDE] 。<br />
<br />
如果你需要改变启动参数,可以按‘e ’键来编辑启动行内容。 含多用户可能希望改变framebuffer分辨率以得到更好的终端显示。将<br />
vga=773<br />
加到kernel一行的后面,然后按<ENTER>,就可以得到1024x768的framebuffer。设置完毕后按'''b'''则使用相应的选择项进行启动。<br />
<br />
系统将会启动并提示登录,这时可以用'root'进行登录(不要加上单引号)。<br />
<br />
如果你的机器从live CD启动时发生错误或者一些其它'''硬件hardware'''错误,请参看[[Installation Troubleshooting]]。<br />
<br />
<br />
====登录并根据需要更换键盘映射表====<br />
如果你使用non-US键盘布局,可以用命令选择相应的键盘映射表。<br />
# km<br />
或者是是用loadkeys命令<br />
# loadkeys ''layout''<br />
(把''layout''替换成你需要的,比如 &quot;<code>fr</code>&quot; 或者 &quot;<code>be-latin1</code>&quot;)<br />
<br />
====边安装边查看安装指南====<br />
在刻录的livecd里面,已经包含了官方安装指南,在安装的时候可以边安装边查看,按组合键<ALT>+F2 切换到控制台vc/2(alt+f3,alt+f4……分别可以切换到对应的控制台vc/3,vc/4……以此类推),然后输入:<br />
<br />
# less /arch/docs/official_installation_guide_en<br />
<br />
按组合键<ALT>+F1回到控制台vc/1,继续安装系统。安装过程中可以随时切换回vc/2来查看安装指南。<br />
<code>less</code> 是个文本查看程序,位于<code>/usr/bin/less</code><br />
{{tip|请注意,官方指南仅涵盖基本系统的安装和配置过程。一旦安装完毕,强烈建议回到本wiki浏览更多安装后续已经相关问题。}}<br />
<br />
===三、开始安装===<br />
键入<br />
/arch/setup <br />
开始安装。<br />
<br />
====1、选择安装来源====<br />
接着会出现一个选择安装来源的提示。如果你用core ISO的话请选择CD,如果使用FTP ISO的话则选择FTP。<br />
* 如果选择 CORE installer,可以直接看下面的硬盘分区配置。<br />
* FTP/HTTP only: 选择这个需要预先加载网络驱动以便联网安装. 使用Udev来加载这些模块非常有效.<br />
按组合键ALT+F3切换到控制台vc/3,确认一下看其是否生效 invoking ifconfig -a . (Select OK to continue.) ——把后面的网络配置提前看<br />
<br />
====2、设置时间====<br />
有两个选择:<br />
* UTC - 如果使用unix系统包括Linux, Freebsd等, 建议使用UTC<br />
* local - 如果和Windows共享多引导系统, 建议使用local<br />
<br />
====3、硬盘分区配置====<br />
选择第一个菜单项"Prepare Hard Drive"。请注意,"Auto-Prepare"(自动分区)并不是最佳的选择,因为它只分配了最基本的三个区( /,/home,swap)<br />
在这里我们用手工进行硬盘分区。选择"2. Partition Hard Drives",接着选要分区的硬盘(比如:/dev/sdx),然后按你需要编辑分区表。<br />
<br />
''Arch Linux安装程序使用cfdisk公用程序来对硬盘进行分区。''<br />
<br />
''接下来,熟悉GNU/Linux的用户可以跳过这段内容直接到下面'''[[#选择软件包|选择软件包]]'''。''<br />
<br />
=====分区信息=====<br />
<br />
对磁盘进行分区是指在磁盘上定义若干区域(分区),每个都象是一个独立的磁盘,可以在其上创建(格式化)一个文件系统。 分区的类型分为主分区(Primary)、扩展分区(Extended)和逻辑分区(Logical)三类。 <br />
<br />
主分区可以被启动,一个物理磁盘最多能有4个主分区。要使用超过4个的话,只能使用一个包含了逻辑分区的扩展分区。<br />
(译者注:为避免误解,较易懂的解释应该是:一个磁盘不算逻辑分区最多只能有4个分区,这4个要么全是主分区,要么就是3个主分区+1个扩展分区,当然你将整个磁盘划为1个主分区也是没问题的,只要不超过4个分区即可)<br />
<br />
扩展分区通常不会被直接使用,它是作为逻辑分区的“容器”存在。一个硬盘只能有一个扩展分区,可以在里面继续再划分逻辑分区。<br />
<br />
当对一个磁盘进行分区时,是按这种数字顺序命名:主分区为sda1-3,跟着是扩展分区sda4(译者注:在/dev和fdisk -l里是看不到这个sda4的),在扩展分区中划分出来的逻辑分区分别是sda5、sda6,如此类推。<br />
<br />
=====交换分区swap=====<br />
交换分区Swap是虚拟内存在硬盘上驻留的地方,内核可以用它来储存在物理内存中放不下的数据。<br />
<br />
过去,常用的规则是将交换分区大小设置为物理内存的两倍。但是随着时间推移,现在的计算机已经有更大的内存容量,这条规则已经不适用了。通常,512MB内存的计算机,两倍(1G)的还是够用的。而1G内存的计算机,一倍的也够用了。如果你有更大的内存(比如超过1GB),也许可以完全把交换分区忘了,不推荐这样做!<br />
* ''如果你打算使用休眠到磁盘的电源方案,你必须要有不小于内存容量大小的交换分区,有些用户甚至会推荐大于物理内存容量15%的大小。''<br />
<br />
=====规划分区=====<br />
磁盘分区的规划是十分个人的设置。每位用户的决策都会根据自己计算机的情况和需求而不同。至少需要有一个包含了根[http://en.wikipedia.org/wiki/File_system 文件系统] ( / )的主分区和一个交换分区。你还可以选择给/boot(主要用来存放内核文件)、/usr、/var和/home(用来存放用户个人数据)划出独立分区。一个较好的做法是给 / 和 /home都划分独立分区。这样的话,当你因为某些原因重装Arch Linux(或者其它发行版),你还可以保留你的个人数据例如音乐、图片、桌面环境配置等。<br />
<br />
在本案例中,我们划分一个分区给 /,一个给/home,另外还有一个交换分区。<br />
<br />
=====开始创建分区cfdisk=====<br />
让我们开始创建一个包含'''root'''(/)文件系统的主分区。 <br />
<br />
选择'''N'''ew -> Primary,然后输入你希望的分区大小(对一个完整的Linux系统,4到8G是个不错的选择)。分区要位于磁盘的开头部分。选择刚新建的分区,接着选择'''B'''ootable将它置为可启动。<br />
<br />
同时选择分区文件系统类型'''T'''ype,指定为'83 Linux'.。<br />
<br />
给你的/home目录创建另一个分区。选择另外一个主分区设成你想要的容量大小,这取决于你的用户会在他们的home目录里储存多少文件,其大小可能从几百M办公文档到上百G音频视频,所以这里我无法给出一个建议。如果你要使用磁盘所有的剩余空间,记得保给交换分区留一部分(例如1GB或1024MB)。<br />
<br />
同样的,选择'''T'''ype为'83 Linux'。 <br />
<br />
最后,我们给交换分区创建一个分区。选择一个介于512MB到1GB之间的大小并将'''T'''ype改为82 (Linux swap / Solaris)。<br />
<br />
现在的分区规划看起来应该象这样(基于你的选择大小也许会有所不同):<br />
<br />
Name Flags Part Type FS Type [Label] Size (MB)<br />
-------------------------------------------------------------------------<br />
sda1 Boot Primary Linux (4096 - 8192)<br />
sda2 Primary Linux (> 100)<br />
sda3 Primary Linux swap / Solaris (512 - 1024)<br />
<br />
选择'''W'''rite并输入''''yes''''。要注意如果你删除了分区的话,这个操作会破坏你磁盘上的数据。选择'''Q'''uit退出分区程序。<br />
选择Done离开此菜单,接着选择"Set Filesystem Mountpoints"。<br />
<br />
=====IDE设备,为什么看起来它们和SCSI设备一样?=====<br />
最新开发的Linux内核里包含了libata和PATA模块,所有的IDE、SATA和SCSI都采用sd''x''这种命名方式。这十分正常,无需担心。<br />
<br />
=====设置文件系统挂载点=====<br />
<br />
''' ”文件系统格式(filesystems)“和”文件系统结构(file systems)“的区别:'''<br />
<br />
从技术层面确切的说,'''文件系统格式(filesystems)'''是一种数据'''格式''',涉及信息吞吐,比如ext2;而”文件系统结构(file systems)“则是特定操作系统中文件和目录的布局,比如/home/username/games。因此,当你被问及是否创建'''文件系统格式(filesystems)'''时,是在问你是否要'''格式化'''该分区…但是当程序向你问及挂载点时,你应该给出的则是该分区应该出现在你的Arch Linux ”文件系统结构“中的位置。<br />
<br />
'''文件系统类型:'''<br />
<br />
'''强烈建议:'''创建一个交换分区(SWAP)。选择一个合适的分区(本例中使用的是sda3). 安装程序就会询问你是否要创建swap 文件系统; 选择 yes. 接下来, 选择根分区的挂载点(本例中就是 sda1). 然后安装程序就会询问你需要哪一种文件系统。<br />
<br />
{{Box Note| 采用何种文件系统的类型取决于实际应用需要,没有十全十美的文件系统,选择任何一个文件系统,都需要在数据安全和性能要求方面作出适当倾斜,下面只是简单的介绍各种Arch linux支持的文件系统 }}<br />
<br />
1. '''ext2''' - 古老、 可靠的 GNU/Linux 文件系统。非常的稳定,不过 ''不支持日志记录功能''。磁盘检测速度较慢,因而有些不便. ''ext2可以容易地转换成ext3''。一般认为/boot分区采用此系统最合适,因为/boot里的东西就开机的时候读取一次,而且很少有变动,不需要日志文件系统,如果采用日志文件系统,日志的体积很可能远远大于内核的大小。<br />
<br />
2. '''ext3''' - 基于ext2系统, 并添加了日志记录功能。 一般认为他比其他文件系统要 ''稍微的'' 慢一点, 不过 ''非常的'' 稳定并且使用最为广泛,由 GNU/Linux FS 负责维护和开发。<br />
<br />
'''高性能文件系统:'''<br />
<br />
3. '''ext4''' - 最近加入支持的文件系统,是ext2和ext3的后续发展版本,Ext4增加了48位块地址,最大支持1EB文件系统,和单个16TB的文件,增加子目录限制到64,000。新增了很多功能,提供在线碎片处理,速度比ext3快,系统开销比ext3小。<br />
{{Box Note| 由于此系统较新,目前仍存在一些问题,暂时建议/home分区不采用此文件系统,以保证个人数据安全。}}<br />
<br />
4. '''ReiserFS''' - Hans Reiser 主持编写的高性能的日志文件系统,使用一种非常独特有趣的数据存储检索方法。ReiserFS 效率非常高, 特别在处理很多小文件的时候更是如此。ReiserFS在挂载的时候相对比较慢. 性能稳定。 ReiserFS 现在的开发并不活跃(最新的版本是Reiser4).<br />
<br />
5. '''JFS''' - IBM提供的日志文件系统( '''J'''ournaled '''F'''ile'''S'''ystem首字母缩写). JFS 效率非常高并且CPU资源占用率比其他任何一个文件系统都要低。并且在挂载和磁盘检测的时候都非常快,在各方面的表现都非常突出,尤其是 conjunction with the deadline scheduler. (参见 [[JFS]].) 但是并不像ext或者ReiserFS那样应用广泛。<br />
<br />
6. '''XFS''' - 非常高效的日志文件系统,特别适合处理大文件。在处理小文件的时候稍慢。在挂载的时候也很快。由于 /var 需要处理很多的小文件,所以可能不太适合作为/var 分区的文件系统。 GNU/Linux 文件系统中,最先实现可用的在线碎片处理。应用不及ext和ReiserFS那么广泛。<br />
* JFS 和 XFS 不能被磁盘工具压缩(比如gparted 或者 parted magic)<br />
<br />
'''未来文件系统'''<br />
<br />
7、btrfs - 此文件系统尚未被Arch纳入正式支持。是Oracle提供的copy-on-write档案系统。目标在取代的ext3,提高ext3单一档案的大小,总档案系统大小或档案检查,加入目前ext3未支援的功能,比如:writable snapshots,snapshots of snapshots,内建磁盘阵列(RAID)支援,and subvolumes。<br />
<br />
最主要的差别在于[http://en.wikipedia.org/wiki/Journaling_file_system 日志系统] (一种类似的在数据库环境中记录着日志变更的东西). 除ext2之外,其他文件系统都支持日志记录功能. ext3 完全兼容 ext2,因此哪怕你可以用一个非常古老的CD来挂载他,也没问题。 根分区目前最安全的选择就是使用ext3文件系统。ReiserFS,XFS,和JFS也可以使用,因为GRUB (启动引导管理器,稍候在安装部分将会介绍到) 都可以从这些文件系统中启动。你可以通过选择‘’‘yes’‘’来创建文件系统(并格式化分区),接着你就会被提示添加附加分区。 在我们的例子中, 只有sda2了。 选择一个文件系统类型,并且把这个分区挂在到/home. 再次说明,创建文件系统并且选择Done。然后回到主菜单。<br />
<br />
====4、选择软件包====<br />
现在我们要选择安装哪些软件包到系统中。选择CD作为来源,如果你不止一个光驱的话还需要选择使用哪个的光驱。<br />
<br />
软件包选择分为两个阶段。首先要选择软件包分类,然后出现所选分类中软件包的详细列表供你微调。使用空格键进行选择和取消。<br />
<br />
''*BASE:包含最小的软件包集合,仅够构建一个可运行的系统骨架。''<br />
''*SUPPORT:供网络和文件系统用的额外软件包,例如gpm、fuse、dnsutils、无线驱动、ndiswrapper、ntfs-3g诸如此类。''<br />
''*DEVEL:软件创建工具,如GCC、autoconf、automake和make等等。''<br />
''*LIB:大量的库文件,如gmp、lebelf、libevent等等。''<br />
*''' 2008.06 版'''的软件包选择,只有一个: BASE ,选择之后进入其详细列表. <br />
<br />
在这里,我们对'Select all packages by default'选择'yes'。<br />
<br />
接下来屏幕将显示你所选的软件包。对于新手,较安全的做法是不修改它,而有经验的用户可能希望裁减掉一些不需要的软件包。(例如,不需要的文件系统类型公用程序,不需要的驱动等等。)<br />
<br />
====5、安装软件包====<br />
接着,选择'Install Packages'。你会被询问是否希望保留pacman缓冲里的软件包。如果你选'yes',日后你还可以选择对某些软件包进行降级,因此推荐保留(日后你还是可以清除这些缓存的)。安装脚本跟着就会安装所选软件包到你的系统中。这些软件包是二进制的、针对i686优化的,总共仅100MB,因此安装是相当便捷的。<br />
<br />
====6、配置系统====<br />
系统接着会询问你是否要选择[[Hwdetect|hwdetect]]来收集配置所需信息。新手应该选择是('yes')。<br />
<br />
如果是相当熟悉自己的硬件、所需模块,有能力从零开始手动配置/etc/mkinitcpio和/etc/fstab 的高级用户,可以选择否'no'。(当然,此选项是非常复杂的,已经超过本指南的范围,这里就不详细解释了。)<br />
<br />
接下来,系统会询问你是否需要支持从USB设备、FireWire设备、PCMCIA设备、NFS共享、软RAID阵列、LVM2卷和加密卷上启动。如果需要则选'yes',在本案例中以上都不选。<br />
<br />
新手还应该选择让/etc/mkinitcpio/kernel26-fallback.conf使用[[Hwdetect|hwdetect]]的结果,这将确保你的硬盘控制器相容次序。<br />
<br />
现在系统会询问你使用哪个文本编辑器;如果你不熟悉[http://en.wikipedia.org/wiki/Vim_%28text_editor%29 vi/vim]的话可以选择[http://en.wikipedia.org/wiki/Nano_%28text_editor%29 nano]。然后就会出现一个包含系统中大部分重要配置文件的菜单。如果你打算查找/etc/rc.conf中可用的选项,只需按Alt+F2切换到另外一个虚拟控制台进行查找,然后用Alt+F1切换回安装程序。<br />
<br />
======系统配置主文件'''/etc/rc.conf'''======<br />
Arch Linux继承FreeBSD的传统,使用'''/etc/rc.conf'''作为系统配置的主要文件。这个文件包含了广泛的配置信息,主要用于系统的启动。正如名字中所包含的意思,它还包含了供/etc/rc*文件使用的配置。/etc/rc.conf提供了一个Arch用户可以轻易访问到的,简洁而又范围广泛的精简系统资源配置方案。<br />
* '''LOCALIZATION'''部分<br />
** '''LOCALE'''=: 系统场所(locale)设置,被所有国际化(i18n-aware)的应用程序使用 。从命令行上运行locale可以列出可用的locale设置。此设置缺省是适合英文(US English)用户使用的en_US.utf8。(此处locale的设置必须与/etc/locale.gen一致,'''[[#/etc/locale.gen|详见下文]]'''。)中文一般是zh_CN.UTF-8,如果使用之后乱码,先换回en_US.utf8,等进图形界面后再换回来。<br />
** '''HARDWARECLOCK'''=: 指示开关机时进行同步的硬件时钟,是'''UTC'''时间(协调世界时(Universal Time Coordinated), 过去曾用格林威治平均时(GMT)来表示)还是'''localtime'''(本地时间)。通常UTC较为好,因为它大大简化了时区和日光节约时间(中国过去称为夏时制)的变更。而当你同时还有其它操作系统如windows进行双启动,就必须使用localtime(本地时间),它只把本地时间保存到硬件时钟里。<br />
** '''TIMEZONE'''=: 时区(TIMEZONE)。(所有可用的时区可在/usr/share/zoneinfo/里找到。)<br />
** '''KEYMAP'''=: 可用的键盘映射表可在/usr/share/kbd/keymaps里找到。请注意此设定仅在TTY中有效,在所有图形窗口管理器或者X中都不使用此设置!<br />
** '''CONSOLEFONT'''=: 如果你一定要修改此设置,可在/usr/share/kbd/consolefonts/中找到可用的字体。<br />
** '''CONSOLEMAP'''=: 定义了启动时setfont程序加载的控制台映射表。有需要的话,可在/usr/share/kbd/consoletrans里找到可用的映射表。<br />
** '''USECOLOR'''=: 如果你使用彩色显示器的话请选"yes"。<br />
<br />
LOCALE="zh_CN.UTF-8"<br />
HARDWARECLOCK="localtime"<br />
TIMEZONE="Asia/Shanghai"<br />
KEYMAP="us"<br />
CONSOLEFONT=<br />
CONSOLEMAP=<br />
USECOLOR="yes"<br />
* '''HARDWARE'''部分<br />
** '''MOD_AUTOLOAD'''=: 如果你使用'''udev'''在启动时探测硬件并加载相应模块。请设置为"yes",(适合缺省模块化的内核)。设置为"no"就得靠用户自己指定所需的有关信息。<br />
** '''MOD_BLACKLIST'''=: 模块黑名单。在下面的例子中,IPv6模块和pcspeaker都被列入黑名单而不被加载。<br />
** '''MODULES'''=: 指示了其它模块,如果你知道缺少哪个重要的模块可以加在里面。('''hwdetect'''应该已经填写了最重要的模块):<br />
# Scan hardware and load required modules at bootup<br />
MOD_AUTOLOAD="yes"<br />
# Module Blacklist - modules in this list will never be loaded by '''udev'''<br />
MOD_BLACKLIST=(net-pf-10 pcspkr)<br />
#<br />
MODULES=(e100 eepro100 mii slhc snd-ac97-codec snd-intel8x0 soundcore)<br />
* '''NETWORKING'''部分<br />
** '''HOSTNAME'''=:设置为你喜欢的主机名(HOSTNAME)。<br />
** '''lo'''=: 不修改此行。<br />
** '''eth0'''=: 如果使用'''静态IP'''的话请调整网络接口的IP地址、掩码和广播地址。如果使用'''DHCP'''的话则设为eth0="dhcp"。<br />
** '''INTERFACES'''=: 指定使用哪些网络接口。如果你不使用DHCP来配置设备,而是通过命令行用ifconfig手动配置设备的话,这里的变量值(名字必须等于打算进行配置的设备名一样)必须和ifconfig里加入的内容一样。<br />
** '''gateway'''=: 如果你使用'''静态IP''',将网关(gateway)地址设为路由器的IP。如果使用DHCP,则将此行用'#'注释掉。<br />
** '''ROUTES'''=: 如果你使用'''静态IP''',则将'gateway'前面的'!'去掉。如果使用'''DHCP'''的话则不需要修改此行。<br />
<br />
<br />
例如,当使用'''DHCP''':<br />
HOSTNAME="arch"<br />
lo="lo 127.0.0.1"<br />
#eth0="eth0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255" <br />
eth0="dhcp"<br />
INTERFACES=(lo eth0)<br />
#gateway="default gw 192.168.0.1"<br />
ROUTES=(!gateway)<br />
* '''DAEMONS'''部分<br />
这个序列罗列了位于/etc/rc.d/里需要在启动过程中启动的脚本名字。<br />
<br />
*如果脚本名字前有惊叹号(!),表示它不被执行。<br />
*如果脚本名字前有符号(@),则表示它会在后台被执行,启动序列不会等待此脚本成功执行完毕,而是继续执行下一个守护进程脚本。<br />
<br />
这种'BSD风格'的初始化就是Arch的处理办法,而其它发行版则是在一个init.d目录里使用一大堆符号链接(一个简单的文件 vs 一整个目录)。<br />
<br />
======关于守护进程======<br />
虽然此时你不需修改[[daemons]]行,不过还是有必要解释一下什么是守护进程,因为过一会儿在指南里我们会需要它。<br />
<br />
和Windows服务(service)类似,守护进程(daemon)是一个运行于后台的程序,等待事件发生并提供服务。一个较好的例子是webserver等待请求以发送页面,还有SSH服务等待用户登录。这些都是全功能的程序,还有些守护进程工作起来并不是那么明显的。例如向日志文件里写信息的守护进程(如syslog、metalog),当系统空闲时降低CPU频率的守护进程(如cpufreq),以及提供图形化登录的守护进程(如gdm、kdm)。所有这些程序都可以被加入到daemons行中,在系统启动时被执行。本指南会对一些较有用的守护进程进行介绍。<br />
按Ctrl+X退出nano编辑器。<br />
<br />
======磁盘和分区配置文件:/etc/fstab======<br />
'''fstab''' ('''f'''ile '''s'''ystems '''tab'''le的缩写) 是系统配置的一部分,该文件列出所有可用的磁盘和分区,并指明它们初始化的方式或整合至全局文件系统的方式。'''/etc/fstab'''文件一般被'''mount'''命令读取,以决定某一特定设备被挂载时所采用的选项。<br />
<br />
这是一个'''/etc/fstab'''的例子:<br />
<br />
#<br />
# /etc/fstab: static file system information<br />
#<br />
# <file system> <dir> <type> <options> <dump> <pass><br />
none /dev/pts devpts defaults 0 0<br />
none /dev/shm tmpfs defaults 0 0<br />
#/dev/cdrom /mnt/cdrom iso9660 ro,user,noauto,unhide 0 0<br />
#/dev/dvd /mnt/dvd udf ro,user,noauto,unhide 0 0<br />
#/dev/fd0 /mnt/fd0 vfat user,noauto 0 0<br />
/dev/sda1 / jfs defaults,noatime,nodiratime 0 1 <br />
/dev/sda2 /home jfs defaults,noatime,nodiratime 0 2<br />
/dev/sda3 swap swap defaults 0 0<br />
Hwdetect应该已经有效地配置了一个可用的'''fstab''',但最好还是简要地检查一下。<br />
<br />
*如果你打算用'''hal'''来自动挂载DVD之类的媒体,为了给即将安装的'''hal'''做准备,你可能要注释掉cdrom和dvd条目。 <br />
<br />
''在笔记本电脑和桌面系统上,可以给 / 和 /home加上'noatime'和'nodiratime'选项来提高速度、性能,同时还能省电。无论你采用何种文件系统,这样做都应该是安全的。''<br />
<br />
更多信息请参照[[Fstab]]<br />
<br />
======'''mkinitcpio.conf、modprobe.conf和kernel26-fallback.conf'''======<br />
此时我们无须去修改这些配置文件。'''mkinitcpio.conf'''负责配置ramdisk(例如从RAID、加密卷启动), '''modprobe.conf'''可以用来设置内核模块的的某些配置选项,而'''kernel26-fallback.conf'''则是initramfs后备配置。<br />
<br />
======(对于静态IP)网络配置文件:/etc/resolv.conf ======<br />
*''如果你使用DHCP,完全可以忽略此文件,缺省情况下dhcpd守护进程会自动创建和销毁此文件。''<br />
<br />
如果你使用静态IP,则可在/etc/resolv.conf里设置你的DNS服务器。每行的格式为nameserver <ip地址>,如果有多个DNS服务器则可以填入多行。<br />
<br />
如果你使用路由器,也许会希望由你的路由器本身指定DNS服务器,而在'''resolv.conf'''里只是写入你的路由器的IP(同时也是'''/etc/rc.conf'''里的网关),例如:<br />
nameserver 192.168.1.1<br />
可选的,逐个加入你的DNS服务器,例如:<br />
nameserver 4.2.2.1<br />
nameserver 4.2.2.2<br />
<br />
如果使用'''DHCP''',你也可以在你的路由器里指定你的DNS服务器,或者如果你的ISP支持的话由ISP自动指定。<br />
<br />
======/etc/hosts======<br />
可以在此文件中加入你想要的''hostname'',必须和/etc/rc.conf里的设置一致,因此它应该象这样:<br />
127.0.0.1 localhost.localdomain localhost '''''yourhostname'''''<br />
''为了程序的兼容性,必须严格遵照这个格式,'''包括'localhost' 这项'''!错误的句法可能会导致网络性能低下和/或某些程序运行缓慢甚至无法运行。这对新手来说是十分普遍的错误。''<br />
<br />
对于大部分用户,只要把''yourhostname''加入到行末就就可以了,不过有些用户推荐以下句法:<br />
127.0.0.1 '''''yourhostname'''''.domain.org localhost.localdomain localhost '''''yourhostname'''''<br />
如果你使用静态IP,可以用这种句法加入新行:<static-ip> hostname.domainname.org hostname,例如:<br />
192.168.1.100 '''''yourhostname'''''.domain.org '''''yourhostname'''''<br />
<br />
======/etc/hosts.deny和/etc/hosts.allow======<br />
如果你打算使用[[SSH|ssh]]的话,请根据自己的需要修改此配置。缺省设置是拒绝所有进入的连接,而不只是ssh连接。编辑'''/etc/hosts.allow '''文件加入:<br />
<br />
* 允许所有进入的ssh连接。<br />
sshd:all <br />
<br />
* 允许特定IP地址进入ssh连接。<br />
sshd: 192.168.0.1<br />
<br />
* 允许你指定的网段 (地址从 192.168.0.0 到 192.168.0.255)<br />
sshd: 192.168.0.<br />
<br />
* 允许某个IP地址范围<br />
sshd: 10.0.0.0/255.255.255.0<br />
<br />
如果你不打算使用[[SSH|ssh]],为安全起见请保持此文件的缺省设置(为空)。<br />
<br />
======/etc/locale.gen======<br />
<br />
'''locale-gen''' 命令从 '''/etc/locale.gen'''读取信息设定系统的locales. 这些设置稍后会被'''glibc''' 和其他一些支持本地化的程序或者库用于自动翻译输出各种语言的"独特" 文本, 并且合适的显示地域、货币、时区以及日期格式, 字符排列方式和其他一些本地化的特殊标准。设置默认本地化的功能是类<code>UNIX</code>操作系统的一大特质<br />
<br />
默认情况下 /etc/locale.gen 是一个仅包含注释文档的空文件.编辑后,这个文件将不会get touched again. 每次'''glibc'''更新之后'''locale-gen'''就会运行一次, 以在/etc/locale.gen重新生成所有的本地化设置.<br />
<br />
选定你需要的本地化类型(移除前面的#即可), 比如:<br />
en_US ISO-8859-1<br />
en_US.UTF-8 <br />
('''你这里的设置必须和上文中提到的/etc/rc.conf 的设置一致哦.''')<br />
<br />
现在,安装程序将运行locale-gen 脚本, 以生成你设定的locales。你以后可以通过修改文件/etc/locale.gen变更你的locale, 然后使用根用户(root)运行'locale-gen'脚本使之生效。<br />
<br />
''Note 如果你选择并设置了locale, 他将提示你 "The current locale is invalid..." 错误。可能是因为大多数新Arch用户都会犯的普遍的错误,也是在论坛中问得最多的问题。''<br />
<br />
======Root密码======<br />
最后,设置一个root密码并确定你已牢记它。返回主菜单然后接着安装启动加载器。<br />
<br />
======Pacman镜像======<br />
为'''pacman'''选择一个软件仓库镜像站。记住主站 archlinux.org 是有流量限制的,下载速度限于50KB/s.。<br />
<br />
在列表中仔细查看, 一般 xxx.cn 是中国镜像, xxx.au 是澳大利亚, 等等...<br />
<br />
*''如果你不熟悉现有的镜像和它们所处的位置,那就随便选一个。稍后你可以编辑 "/etc/pacman.d/mirrorlist", 或运行本指南后面提到的'''rankmirrors'''脚本,它将自动配置最接近你的镜像。''<br />
<br />
返回主菜单。<br />
<br />
====7、安装启动加载器====<br />
因为本案例中没有第二个操作系统,因此我们需要安装一个启动加载器。推荐选择[http://www.gnu.org/software/grub/ GNU GRUB]作为启动加载器。另外一种选择是[http://lilo.go.dyndns.org/ LILO]。缺省的'''GRUB'''配置('''/boot/grub/menu.lst''')应该足够了。唯一你可能想修改的是控制台的分辨率。将vga=<number>加入到第一个kernel行。(menu.lst中已列出一张分辨率和数字的对应表格可供查找。)<br />
title Arch Linux (Main)<br />
root (hd0,0)<br />
kernel /boot/vmlinuz26 root=/dev/sda1 ro vga=773<br />
initrd /boot/kernel26.img<br />
参数"vga=773"表示1024x768分辨率、256色的framebuffer。<br />
<br />
将'''GRUB'''启动加载器安装到主引导区(本例中为sda)。<br />
<br />
====8、系统重启====<br />
退出安装程序。<br />
*建议:为了方便接下来更进一步的安装配置,可以把光盘里的新手指南复制一份到电脑里,这样后面的安装就能查看相应的向导了<br />
<br />
cp /arch/beginnersguide.txt /mnt/home/beginnersguide.txt<br />
<br />
系统重启之后,进入控制台,可以使用下面命令查看这新手指南<br />
less /home/beginnersguide.txt<br />
所有安装完毕之后,可以删了这指南<br />
rm /home/beginnersguide.txt<br />
<br />
输入命令下面命令,重启:<br />
<br />
reboot<br />
<br />
一个新Arch Linux系统就会启动并进入登录提示符(你可能需要在'''BIOS'''将启动顺序改为优先从硬盘启动)。<br />
<br />
'''祝贺你,一个崭新的Arch Linux基础系统闪亮登场了!'''<br />
<br />
==第二部分:完成基本系统并升级==<br />
你的新Arch Linux基础系统现在已是一个功能完整的GNU/Linux环境了,随时可以进行定制。从现在开始,你可以按自己的意图和需求改造它。由于arch是滚动发布的,所以安装包不一定是最新的系统,所以我们在安装完成之后,需要立即更新系统。<br />
<br />
让我们开始吧。<br />
-----<br />
登录入你的root账号。我们将以root身份配置pacman和更新系统,然后创建一个普通用户账号。<br />
<br />
===一、配置网络(如果有需要)===<br />
*''如果安装脚本的自动配置不适合你,本段内容将帮助你配置大部分类型的网络。''<br />
-----<br />
如果一切正常的话,你的网络应该可以正常使用了。先ping www.google.com验证一下:<br />
ping -c 3 www.google.com<br />
<br />
''如果你已经成功建立网络连接,则跳到下面阅读[[#使用pacman更新、同步、升级系统|使用pacman更新、同步、升级系统]]'''。''<br />
<br />
如果ping www.google.com后得到"unknown host"的错误,可以认为你的网络尚未正确配置。你需要重新检查以下内容的完整性和正确性:<br />
'''/etc/rc.conf''' # 特别留意HOSTNAME= 和 NETWORKING 部分有无输入错误。<br />
<br />
'''/etc/hosts''' # 复核一下格式。(看之前的内容。)<br />
<br />
'''/etc/resolv.conf''' # 当你使用静态IP时需要检查。如果你使用DHCP,缺省这个文件会被自动创建和销毁,不过也可以改为你需要的内容。(参见[[Network]]。)<br />
<br />
高级的网络配置方法可以在[[Network]]一文中找到。<br />
<br />
=====有线网络=====<br />
<br />
用以下命令检查网络<br />
ifconfig<br />
你应该看到eth0这一项。如果有需要,你可以这样设置一个新的静态IP:<br />
ifconfig eth0 <ip address> netmask <netmask> up <br />
并且这样设置缺省网关:<br />
route add default gw <ip address of the gateway><br />
查看一下/etc/resolv.conf是否包含你的DNS服务器,不过缺失了则补填进去。<br />
再次用ping www.google.cn检查一下网络。如果一切正常,将/etc/rc.conf调整为刚才新设置的静态IP。如果你的网络使用DHCP服务器/路由器的话,输入:<br />
dhcpcd eth0<br />
如果这样可行的话,则将/etc/rc.conf按之前所述方法调整为动态IP。<br />
<br />
=====无线网络=====<br />
详见安装指南:[[无线设置 (简体中文)|无线设置]]<br />
<br />
=====Analog Modem=====<br />
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.<br />
Tip: Read [[Dialup without a dialer HOWTO]].<br />
<br />
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 [http://www.linmodems.org/ LinModem] homepage.<br />
<br />
=====ISDN=====<br />
<br />
通过三步,完成 ISDN 的安装和配置:<br />
# 安装配置固件Install and configure hardware<br />
# 安装配置ISDN 管理工具<br />
# 添加ISP信息<br />
<br />
现在的 Arch stock kernels 已经包含了ISDN 所需要的modules, 所以不需要重新去编译内核,除非 you're about to use rather odd ISDN hardware. 把ISDN卡插入电脑或者插入USB ISDN-Box之后,you can try loading the modules with modprobe. 绝大部分的ISDN PCI 卡都能被module hisax处理,只需要两个参数:类型和协议。 如果使用的是1TR6标准,则协议设定为 '1' ,如果使用的是EuroISDN (EDSS1),协议设定为 '2', '3' if you're hooked to a so-called leased-line without D-channel, 如果使用的是US NI1,则设为'4'.<br />
<br />
所有配置细节都可以在kernel documentation, more specifically in the isdn subdirectory, and available online中获知。 类型的参数是根据电视卡来设定的,在README.HiSax kernel documentation中,有一个可能类型的列表。 用相应的参数加载moduleChoose,比如这个:<br />
<br />
modprobe hisax type=18 protocol=2<br />
<br />
这个将加载适用于电视卡类型为ELSA Quickstep 1000PCI,德国使用的EDSS1协议的模块hisax。可以在日志文件/var/log/everything.log中查看是否模块被预加载。额外的USB ISDN Adapter需要加载些USB模块才能正常工作。<br />
<br />
通过上述设定之后,如果电视卡能正常工作,那么把下面模块和参数加入/etc/modprobe.conf中:<br />
<br />
alias ippp0 hisax<br />
options hisax type=18 protocol=2<br />
<br />
这么做的好处是,这些模块在不使用时不会被加载。另外的方法是可以在这只加参数,把hisax加入/etc/rc.conf里面的MODULES,这样做的坏处就是不管这些模块是不是在使用,都加载了。 <br />
<br />
完成上述步骤之后,需要安装管理工具<br />
<br />
安装软件包isdn4k-utils,阅读关于isdnctrl的说明手册。在说明手册里,将有详细的说明:如何创建一个配置文件that can be parsed by isdnctrl,安装实例。 Please note that you have to add your SPID to your MSN setting separated by a colon if you use US NI1.<br />
<br />
使用isdnctrl utility配置ISDN卡之后,将可以拨号到你设定的PHONE_OUT参数的机器上,但提示用户名和密码错误。把用户名和密码加入到/etc/ppp/pap-secrets或者/etc/ppp/chap-secrets,这个主要根据的是你的ISP使用的协议授权方式,as if you were configuring a normal analogous PPP link。如果无法确定,可以两个文件都加。<br />
<br />
完成上述设定之后,用root帐号建立一个拨号连接:<br />
isdnctrl dial ippp0<br />
有啥问题,请检查日志文件!<br />
<br />
=====DSL (PPPoE)=====<br />
<br />
仅当需要你的计算机去主动拨号连接ISP的情况下才需参考本段内容。如果你使用独立的路由器来负责这类工作,你只需要设置一个缺省网关即可。<br />
<br />
在使用DSL连接前,你得先在计算机里安装一个连接到DSL-Modem的网卡。将你新装网卡加入到modules.conf/modprobe.conf或者MODULES列表之后,安装rp-pppoe软件包并运行pppoe-setup脚本来配置你的连接。当你输入完有关信息后,可以分别通过以下命令来进行连接和挂断:<br />
<br />
/etc/rc.d/adsl start<br />
<br />
和<br />
<br />
/etc/rc.d/adsl stop<br />
<br />
setup过程一般都是很容易、直观的,如果还有不懂可以阅读man手册。如果你想在启动时自动拨号,可以将adsl加入到DAEMONS列表中。<br />
<br />
<br />
===二、更新Pacman===<br />
<br />
====pacman是什么?====<br />
[[Pacman]]是Arch Linux的软件包管理器('''pac'''kage '''man'''ager)。Pacman是用C语言编写的,速度快,使用简便,功能强大。它可以管理整个软件包系统,负责软件包的安装、删除、降级(通过缓存),也支持自编译的软件包,自动分析依赖关系,可以搜索远程和本地软件仓库,还有大量其它功能。这里我们将用pacman来从远程软件仓库下载软件包并安装到系统中。<br />
<br />
对系统进行定制,pacman是Arch Linux最重要工具。<br />
<br />
====1、配置pacman====<br />
=====pacman总配置文件/etc/pacman.conf=====<br />
Arch通过pacman可以获得对下面 4软件仓库的管理:<br />
<br />
'''[core]'''<br />
<br />
[core](“核心”)仓库的简单原则是只提供一个基本的Arch Linux的基本工具:GNU系列工具,Linux内核,一个文字编辑器,一个命令行浏览器等(这里也有一些例外。比如说,vi和nano是同时提供的,允许用户选择一个或两个)。它包含所有使你的系统正常运转的“必须”安装的包,只有它们完美地工作,你的系统才能继续运行。这些是绝对“system-critical”(对系统来说至关重要)的包。由开发者负责维护。<br />
<br />
*''Core安装媒介(The Core installation media)简单地包含一个安装脚本,一个当前发布版本的核心仓库的快照(snapshot)。''<br />
<br />
'''[extra]'''<br />
<br />
[extra](“额外的”)仓库包含所有的对于一个基本的Arch系统不是必须,但是对于构建一个完整的系统环境有用的的Arch包。 比如'''X''', KDE和Apache,都可以在这里面找到。它也是由开发者维护的。<br />
<br />
'''[testing]'''<br />
<br />
[testing](“测试”)仓库包含的包是[core]和[extra]仓库的候选者。<br />
下面情况下,新的软件包将进入[testing]软件仓库:<br />
* 可能会导致系统出问题的升级,需要测试。<br />
* 需要重新打包其他软件包。这种情况下,所有需要重新打包的软件包将被放在[testing]仓库,直到所有重新打包完成,这些软件包才回归原有的软件仓库。 <br />
<br />
开发者维护。<br />
<br />
[testing]是唯一的一个在名义上与其它官方仓库有冲突的仓库。(that can have name collisions with any of the other official repositories. )<br />
<br />
<font color=&quot;blue&quot;>*如果开启, [testing]必须放在''pacman.conf''的软件仓库的第一个。</font><br />
<br />
<font color=&quot;red&quot;>'''警告''': '''''开启[testing]软件仓库,容易导致系统崩溃,因此只建议有经验的用户开启。'''''</font><br />
<br />
'''[community]'''<br />
<br />
[community](“社区”)仓库是由“信任用户”(''Trusted Users (TUs)'')维护的,是''Arch User Repository ([[AUR]])''(Arch用户仓库)的一部分。它包含的是二进制的包,在用户仓库中有足够的“票数”,并由''信任用戶''挑选出来的。像其它上面列出的仓库一样,[community] 可以用pacman获取。<br />
<br />
'''[[AUR]]''' 也包含'''unsupported''' 分支,这不能直接通过pacman获取。*. [unsupported] 包含多达海量PKGBUILD脚本,用来从源代码编译。这从其它仓库中是不能使用的。 <br />
<br />
<nowiki>*</nowiki> '''''[[AUR Helpers]]''''' 能帮助你无缝地使用AUR。<br />
<br />
'''/etc/pacman.conf'''<br />
<br />
每次调用pacman,它都会读取/etc/pacman.conf文件。这个配置文件分若干段,每一段定义了一个pacman用来搜索软件的仓库。唯一例外的是options段,它定义了全局选项。<br />
nano /etc/pacman.conf<br />
范例:<br />
#<br />
# /etc/pacman.conf<br />
#<br />
# See the pacman.conf(5) manpage for option and repository directives<br />
<br />
#<br />
# GENERAL OPTIONS<br />
#<br />
[options]<br />
# The following paths are commented out with their default values listed.<br />
# If you wish to use different paths, uncomment and update the paths.<br />
#RootDir = /<br />
#DBPath = /var/lib/pacman/<br />
#CacheDir = /var/cache/pacman/pkg/<br />
#LogFile = /var/log/pacman.log<br />
HoldPkg = pacman glibc<br />
# If upgrades are available for these packages they will be asked for first<br />
SyncFirst = pacman<br />
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u<br />
#XferCommand = /usr/bin/curl %u > %o<br />
<br />
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup<br />
#IgnorePkg =<br />
#IgnoreGroup =<br />
<br />
#NoUpgrade =<br />
#NoExtract =<br />
<br />
# Misc options (all disabled by default)<br />
#NoPassiveFtp<br />
#UseSyslog<br />
#ShowSize<br />
#UseDelta<br />
#TotalDownload<br />
#<br />
# REPOSITORIES<br />
# - can be defined here or included from another file<br />
# - pacman will search repositories in the order defined here<br />
# - local/custom mirrors can be added here or in separate files<br />
# - repositories listed first will take precedence when packages<br />
# have identical names, regardless of version number<br />
# - URLs will have $repo replaced by the name of the current repo<br />
#<br />
# Repository entries are of the format:<br />
# [repo-name]<br />
# Server = ServerName<br />
# Include = IncludePath<br />
#<br />
# The header [repo-name] is crucial - it must be present and<br />
# uncommented to enable the repo.<br />
# <br />
<br />
# Testing is disabled by default. To enable, uncomment the following<br />
# two lines. You can add preferred servers immediately after the header,<br />
# and they will be used before the default mirrors.<br />
#[testing]<br />
#Include = /etc/pacman.d/mirrorlist<br />
<br />
[core]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
[extra]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist <br />
<br />
[community]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
# An example of a custom package repository. See the pacman manpage for<br />
# tips on creating your own repositories.<br />
#[custom]<br />
#Server = file:///home/custompkgs<br />
要开启一个软件仓库,只需要将'Include ='和'[repository]'行前的注释符号(#)去除。<br />
<br />
*"Server ="行如果取消注释,将会强制此服务器被首先搜索,详细的仓库配置位于/etc/pacman.d/下。<br />
* 注意:选择仓库时,请确认将仓库名和'Include ='行都一同取消注释。没有这样做的话会导致你选择的仓库被忽略!这是个很普遍的错误。<br />
<br />
=====(如果有必要)配置镜像列表 /etc/pacman.d/mirrorlist=====<br />
更快的镜像能显著改善pacman的性能和你对Arch Linux的总体体验。<br />
<br />
*手动编辑/etc/pacman.d/mirrorlist:<br />
nano /etc/pacman.d/mirrorlist<br />
删除所有不在你所在洲或者太远的镜像。(在nano里你可以用CTRL-K删除每个不需要的行。)保存文件并退出。<br />
<br />
*'''rankmirrors'''脚本可以根据镜像的响应延迟对其自动排名。'''Rankmirrors'''是python脚本,需要安装python:<br />
<br />
pacman -S python<br />
<br />
然后,运行'''rankmirrors'''脚本按响应延迟顺序对镜像进行排名:<br />
rankmirrors -v /etc/pacman.d/mirrorlist<br />
输出会列出所有镜像和它们的响应延迟(ping),例如:<br />
<br />
# United States<br />
# http://mirrors.easynews.com/linux/archlinux/$repo/os/i686 ... 0.96<br />
# ftp://ftp.nethat.com/pub/linux/archlinux/$repo/os/i686 ... unreachable<br />
# ftp://locke.suu.edu/linux/dist/archlinux/$repo/os/i686 ... 2.43<br />
# ftp://mirrors.unixheads.org/archlinux/$repo/os/i686 ... 1.96<br />
<br />
脚本将从低到高的响应延迟顺序显示:<br />
Server = http://mirrors.easynews.com/linux/archlinux/$repo/os/i686<br />
Server = ftp://mirrors.unixheads.org/archlinux/$repo/os/i686<br />
Server = ftp://locke.suu.edu/linux/dist/archlinux/$repo/os/i686<br />
Server = ftp://ftp.nethat.com/pub/linux/archlinux/$repo/os/i686<br />
<br />
要注意的是这个结果对于镜像排列并非很精确,最接近你的镜像或者延迟最低的镜像并不一定是最佳选择。(反应迅速但是内容过时的镜像、或者低延迟但是窄带宽的镜像对你毫无用处)。<br />
<br />
编辑/etc/pacman.d/mirrorlist,将最佳的镜像置于在列表顶端。为了体验多个镜像你可能要不断修改此配置文件,请精明地选择。<br />
<br />
====常用的命令====<br />
<br />
与远程软件仓库同步和更新本地包数据库 (推荐在安装和更新包之前这样做):<br />
pacman -Sy<br />
<br />
'''升级'''系统中所有的包:<br />
pacman -Su<br />
<br />
一条同步、更新、'''升级''' 所有系统中的包的命令:<br />
pacman -Syu<br />
<br />
安装或者升级单个软件包或者一串包(包括其依赖包):<br />
pacman -S packageA packageB<br />
<br />
同步、更新数据库并安装软件包:<br />
pacman -Sy packageA packageB<br />
<br />
移除软件包, 但保留依赖的包:<br />
pacman -R package<br />
<br />
移除单个包,并且移除没有被别的软件依赖的依赖包:<br />
pacman -Rs package<br />
<br />
移除包所有不需要的依赖包并删除其配置文件:<br />
pacman -Rsn package<br />
<br />
通过给定关键词(列表)搜索远程软件仓库数据库(repo):<br />
pacman -Ss keyword<br />
<br />
列出系统中所有的包<br />
pacman -Q<br />
<br />
在本地包数据库搜索 (查询)指定软件包:<br />
pacman -Q package <br />
<br />
在本地包数据库搜索 (查询)指定软件包并列出相关信息:<br />
pacman -Qi package<br />
<br />
To defragment pacman的数据库缓存和速度优化选项:<br />
pacman-optimize<br />
<br />
统计当前系统中的包数量:<br />
pacman -Q | wc -l<br />
<br />
使用ABS和makepkg从源代码编译安装包:<br />
pacman -U packagename.pkg.tar.gz<br />
<br />
Note: pacman有很多很多的选项和功能组合。你可以试试man pacman或者查阅lt the [[pacman]]维基条目<br />
<br />
====软件包管理增强工具====<br />
* Yaourt 可查询aur的pacman增强工具<br />
* Tupac 快速查询的yaourt增强工具<br />
* Powerpill 多进程下载的pacman增强工具<br />
{{Box Note| 强烈建议更新系统完毕后,安装yaourt和powerpill,以便更充分享受Arch Linux的方便和强大。}}<br />
在/etc/pacman.conf文件里,最后添加两行(如果是i686的话,把x86_64换成i686即可):<br />
[archlinuxfr]<br />
Server = http://repo.archlinux.fr/x86_64<br />
然后使用pacman安装yaourt<br />
pacman -Sy yaourt<br />
<br />
以后就可以使用yaourt命令来查找并安装包括[[AUR]]里的软件了。比如bcm无线网卡,需要安装b43-firmware(此软件包在[[AUR]]仓库里,使用pacman无法查找到),使用yaourt命令查找并安装:<br />
yaourt b43-firmware<br />
找到之后,根据相应提示,一直到安装完成。<br />
<br />
====图形化管理工具====<br />
* qt界面的shaman:比较成熟的pacman 图形化管理工具<br />
* gtk界面的gtkpacman :目前BUG比较多,不稳定。<br />
<br />
====Pacman的更多信息====<br />
用此命令查看pacman手册:<br />
man pacman<br />
有空的话可以看看[[pacman (简体中文)]]维基条目。<br />
<br />
====2、更新Pacman自己====<br />
<br />
一开始,系统可能会提示你先更新pacman自身,这取决于Arch安装包的新旧程度:<br />
pacman -Sy pacman<br />
pacman开始查看是否需要更新,如果有提示需要更新,则按‘y’,开始pacman更新。<br />
<br />
'''''有时候,还需要用户主动修改某些配置;请仔细阅读升级过程中的输出获取相关信息。'''''<br />
<br />
===三、更新系统===<br />
====使用[[pacman (简体中文)|pacman]]====<br />
现在我们要用[[pacman (简体中文)|pacman]]来更新系统。要更新、同步并'''升级'''你的系统,可以使用命令:<br />
pacman -Syu<br />
pacman就会获取所有最新可用软件包信息并进行升级。(此时你可能会被提示先升级pacman自身。如果是这样,回答'yes',然后在完毕后再运行一次pacman -Syu命令。)<br />
<br />
===='''滚动发布'''之美====<br />
Arch是一个'''rolling release'''(滚动发布)的发行版。这意味着没有必要重新安装或执行完整的系统重建来升级到最新版本。只需要执行'''pacman -Syu''',就能保持你的系统更新到最新和bleeding edge(表示最新的、因而也并非完美的技术)。<br />
<br />
===四、增加一个用户并设置用户组===<br />
用root账号来处理日常工作是很危险的。Root是用来处理系统管理的任务。我们可以用以下命令增加一个普通用户账号:<br />
adduser<br />
大部分缺省选项都是没问题的,你可能还需要将storage、audio、video、optical和wheel加入到你的用户组中 ── 特别是在你打算使用一个完整功能的桌面环境的情况下。<br />
<br />
用户组和用户的关联定义在/etc/group文件中: <br />
<br />
它包含了:<br />
<br />
*'''audio''' - 关于声卡和相关软件的任务<br />
<br />
*'''wheel''' - 给sudo使用<br />
<br />
*'''storage''' - 负责存储设备<br />
<br />
*'''video''' - 视频任务和3D加速<br />
<br />
*'''optical''' - 和光驱有关的任务<br />
<br />
*'''floppy''' - 软驱访问<br />
<br />
*'''lp''' - 打印任务<br />
<br />
请参看[[Groups]]一文了解你应该属于哪些用户组。<br />
你还可能需要将你的用户账号加入到以下用户组(需要以root身份运行此命令):<br />
usermod -aG audio,video,floppy,lp,optical,network,storage,wheel,dbus,hal USERNAME<br />
详情可看usermod和gpasswd的man手册。<br />
<br />
===五、安装建立Sudo (可选)===<br />
安装Sudo:<br />
# pacman -S sudo<br />
以root身份,运行命令visudo,把用户加入sudo用户 (a &quot;sudoer&quot;).如果不知道怎么使用vi,你可以在用visudo前设置EDITOR环境变量为你喜欢的编辑器。例如:<br />
# EDITOR=nano visudo<br />
如果你对于用vi很适应,去掉EDITOR=nano这个变量就行:<br />
# visudo<br />
这命令将在一个特殊的vi会话中打开文件 /etc/sudoers 。visudo复制文件到一个可编辑的临时文件中,用一个编辑器编辑它(vi是默认的),接下来运行一个安全检查(“sanity check”)。如果通过,这个临时文件就有正确的权限将重写的原始文件。t<br />
<br />
<font color=&quot;red&quot;>'''注意:不要直接用编辑器编辑 /etc/sudoers ; 否则会出现这样的提示:Errors in syntax can cause annoyances (像root帐户不能使用的描述一样)。 必须使用 ''visudo'' 命令来编辑 /etc/sudoers.'''</font><br />
<br />
当用户输入以 &quot;sudo&quot;, 作为开始的命令行时,临时授予该用户root权限。加入下面一行:<br />
USER_NAME ALL=(ALL) ALL<br />
USER_NAME 就是单个用户名。<br />
<br />
更多信息,比如按<TAB> 自动命令补全,请见[[Sudo]]<br />
<br />
==第三部分:安装X并配置ALSA==<br />
一共有三步工作:<br />
*1、安装声卡驱动<br />
*2、安装x-window(包括显卡驱动)<br />
*3、配置X<br />
<br />
{{Box Note | '''在热插拔未配置正确的情况下,或者是/etc/rc.d/hal未启动的情况下,请不要启动开启X(包括重启使用gdm或者kdm登陆),否则可能导致鼠标键盘失去响应!!!'''}}<br />
<br />
===一、配置声卡:使用alsamixer===<br />
高级Linux声音架构(Advanced Linux Sound Architecture,简称ALSA)是一个Linux内核组件。它替换了原有的开放声音系统(OSS),为声卡提供了设备驱动。除了声音设备驱动以外,'''ALSA'''还给应用程序开发人员提供了一个用户空间库,可使更高级的API无需直接与内核驱动打交道就能使用驱动功能。<br />
<br />
{{Box Note| Alsa已经包含进最新的内核kernel,udev 将在系统启动时自动检测硬件,并自动根据声卡加载相应的内核模块。虽然声卡已经在工作,但电脑的声音默认是静音。}}<br />
{{Box Note| OSS4.1已经放出,相对于老的版本,这是一个显著的提升的版本,如果使用ALSA有问题, 或者是想尝试新的功能,可以使用 OSS4.1。 相关说明可见: [[OSS]]}} <br />
<br />
Alsa-utils软件包里的alsamixer让我们可以从命令行来配置声音设备。(你也可以稍后在'''X'''环境中使用alsamixer。)<br />
默认情况下,内核加载模块snd_pcsp,这是一个alsa pc speaker模块。 snd_pcsp通常先于&quot;你实际的&quot;声卡模块加载。大部分情况下,这模块最后加载更好,因为可以让alsamixer正确控制需要的声卡。<br />
<br />
在/etc/modprobe.conf中加入这行,可以使得snd_pcsp最后加载:<br />
options snd-pcsp index=2<br />
<br />
当然,如果你不想让snd_pcsp加载,可以把它放入黑名单,或者是在/etc/rc.conf的Modules里禁止它:<br />
MODULES=(... !snd_pcsp)<br />
<br />
{{Box Note | 想要生效,需要释放并重新加载所有声音模块,当然,系统重启就可以简单解决这问题。 }}<br />
<br />
* 安装alsa-utils软件包:<br />
pacman -S alsa-utils<br />
<br />
* 为了解决Alsa声卡独占问题,可以安装alsa-oss:<br />
# pacman -S alsa-oss <br />
<br />
* 把你的普通用户账号加入到audio用户组中:以root身份,运行<code>/usr/bin/gpasswd</code>程序:<br />
gpasswd -a yourusername audio<br />
*以普通用户身份运行: <br />
alsamixer<br />
用左右光标键移动到Master和PCM声道上,按'''M'''取消掉静音。用向上键增加音量。(70-90的音量是较合适的范围)按ESC键离开alsamixer。<br />
有'''Speaker'''的,需要同时取消静音并调整之. <br />
<br />
====测试声音====<br />
以普通用户身份,使用 <code>/usr/bin/aplay</code>程序来测试你的声音配置:<br />
aplay /usr/share/sounds/alsa/Front_Center.wav<br />
你应该会听到一个女性声音说:“Front,center。”<br />
<br />
====保存声音配置====<br />
以root身份运行<code>/usr/bin/alsactl</code> :<br />
alsactl store<br />
这将创建'/etc/asound.state'文件,用来保存alsamixer的设置。<br />
<br />
为了每次启动都可以自动恢复混音器设置,可将守护进程''alsa''加入到你的/etc/rc.conf中的DAEMONS列表。<br />
nano /etc/rc.conf<br />
DAEMONS=(syslog-ng network crond '''alsa''')<br />
''注意,alsa守护进程在启动过程中仅仅是恢复音量设置。它和alsa音频库(和内核级API)是完全不同的。''<br />
<br />
更多详情请参看[[ALSA 安装设置 (简体中文)|ALSA 安装设置]]。<br />
<br />
===二、安装X===<br />
'''X''' 窗口系统(一般叫'''X11'''或者更简单的叫'''X''') 是一个网络互动和显示服务,提供位图显示器窗口. 提供标准化工具包(toolkit)和协议,用于<code>UNIX</code>类操作系统,构建一个图形界面(GUIs) <br />
<br />
'''X''' 提供最基本、基础的框架,用于构建一个图形操作界面环境。包括:绘图、屏幕窗口移动,与鼠标或者键盘的交互。 '''X''' 并不负责用户交互界面的部分:有独立的客户端程序负责处理这部分。 比如gnome、kde。<br />
<br />
'''X''' 因为它先于'''W'''窗口系统,最初由斯坦福大学开发。 <br />
<br />
*''注意: 如果想使用一个'''开源''' 显卡驱动, 需要3d加速,强烈建议在安装Xorg之前安装库 libgl :''<br />
pacman -S libgl<br />
''(拥有专利的视频驱动提供它们自己的gl库安装(implementations).)''<br />
----- <br />
====1、安装X====<br />
构建一个GUI的第一步:用pacman来安装Xorg包.<br />
<br />
# pacman -S xorg<br />
对于新版的xorg,建议(可能大部分情况下是必须的)安装输入设备驱动evdev。它本来应该作为xorg-server的一个依赖被安装的,不过不知道为什么貌似缺失了:<br />
# pacman -S xf86-input-evdev<br />
3d的工具比如glxgears包含在包'''mesa''' 里(如果需要,也安装):<br />
# pacman -S mesa<br />
<br />
====2、安装显卡驱动====<br />
到这一步,已经有了运行'''X''' Server的基本软件包,接下来需要把显卡的驱动安装到电脑里(e.g. xf86-video-<name>). 最简单的X.org配置方法就是安装正确的驱动包,然后使用自动脚本对 /etc/X11/xorg.conf 进行初始化,比如使用 Xorg -configure(arch团队提供hwd工具,但据以前用户的反映,这个现在还老出问题,新手可以使用,以后有能力再配置其他).<br />
<br />
如果不知道显卡类型,输入下面命令:<br />
lspci | grep VGA<br />
<br />
输入下面命令,查看所有'''开源'''驱动: <br />
pacman -Ss xf86-video | less<br />
<br />
下面是一个'''开源'''的显卡列表和相关说明:<br />
*'''xf86-video-apm''' Alliance ProMotion video driver<br />
*'''xf86-video-ark''' ark video driver<br />
*'''xf86-video-ati''' ati video driver<br />
*'''xf86-video-chips''' Chips and Technologies video driver<br />
*'''xf86-video-cirrus''' Cirrus Logic video driver<br />
*'''xf86-video-dummy''' dummy video driver<br />
*'''xf86-video-fbdev''' framebuffer video driver<br />
*'''xf86-video-glint''' GLINT/Permedia video driver<br />
*'''xf86-video-i128''' Number 0 i128 video driver<br />
*'''xf86-video-i740''' Intel i740 video driver<br />
*'''xf86-video-i810''' Intel i810/i830/i9xx video drivers (deprecated - use -intel)<br />
*'''xf86-video-intel''' Newer Version of Intel i810/i830/i9xx video drivers<br />
*'''xf86-video-imstt''' Integrated Micro Solutions Twin Turbo vidoe driver<br />
*'''xf86-video-mach64''' mach64 video driver <br />
*'''xf86-video-mga''' mga video driver (Matrox Graphics Adapter) <br />
*'''xf86-video-neomagic''' neomagic video driver<br />
*'''xf86-video-nouveau''' Open Source 3D acceleration driver for nVidia cards (eperimental)<br />
*'''xf86-video-nv''' nvidia nv video driver<br />
*'''xf86-video-openchrome''' Openchrome drivers<br />
*'''xf86-video-r128''' ati Rage128 video driver<br />
*'''xf86-video-radeonhd''' Experimental Radeon HD video driver for r500 and r600 ATI cards<br />
*'''xf86-video-rendition''' Rendition video driver<br />
*'''xf86-video-s3''' S3 video driver<br />
*'''xf86-video-s3virge''' S3 Virge video driver<br />
*'''xf86-video-savage''' savage video driver<br />
*'''xf86-video-siliconmotion''' siliconmotion video driver<br />
*'''xf86-video-sis''' SiS video driver<br />
*'''xf86-video-sisusb''' SiS USB video driver<br />
*'''xf86-video-tdfx''' tdfx video driver<br />
*'''xf86-video-trident''' Trident video driver<br />
*'''xf86-video-tseng''' tseng video driver<br />
*'''xf86-video-unichrome''' Unichrome video drivers<br />
*'''xf86-video-v4l''' v4l video driver<br />
*'''xf86-video-vesa''' vesa video driver<br />
*'''xf86-video-vga''' VGA 16 color video driver<br />
*'''xf86-video-via''' via video driver<br />
*'''xf86-video-vmware''' vmware video driver<br />
*'''xf86-video-voodoo''' voodoo video driver<br />
<br />
* 说明:'''vesa'''驱动是最原汁原味的,适用于大部分的显卡。如果实在无法找到合适的显卡驱动,就选用vesa。(这是原话,好像夸张了点!If you cannot find a suitable driver for your video chipset, vesa '''should''' work.)<br />
<br />
用pacman来安装适合你显卡的驱动。例如:<br />
pacman -S xf86-video-savage<br />
(给Savage显卡的驱动。)<br />
<br />
* 如果实在不确定需要安装那个显卡驱动,可以安装所有显卡驱动包, 输入下面命令:<br />
pacman -S xorg-video-drivers<br />
<br />
*如果显卡是nVIDIA 或者ATI的,并'''想安装nVIDIA或者ATI官方提供的显卡驱动,请看下面。'''<br />
-----<br />
<br />
====nVIDIA图形显示卡====<br />
nVIDIA显示卡的驱动程序被许多人认为是非常好的质量,而且带有高级3D性能。<br />
<br />
在设置您的你nVIDIA显卡之前您先要选择您要使用的驱动程序。Arch现在有3种不一样的nVIDIA驱动程序,各自支持不同型号的显卡:<br />
<br />
'''1. nvidia-96xx''' ''直到Ge Force 4的较新显卡''<br />
<br />
'''2. nvidia-173xx''' ''Geforce FX系列显卡''<br />
<br />
'''3. nvidia''' ''在GF FX之后的最新GPU''<br />
<br />
{{Box Note| 一些特别老如TNT和TNT2之类的显卡所需的Nvidia-71xx系列闭源驱动,由于无法在Arch所用的新版Xorg下正常运行,并且nvidia也已不再继续支持它们,因此已被删除。你可以改用xf86-video-nv或者xf86-video-vesa驱动。}}<br />
<br />
到nVIDIA主页,看哪个适合你电脑.区别只是安装,配置过程是一样的.<br />
<br />
''根据你的显卡'',选择合适的nVIDIA驱动安装,比如: <br />
pacman -S nvidia-96xx<br />
<br />
nVIDIA软件包有个工具能自动升级你已有的nVIDIA驱动的配置文件/etc/X11/xorg.conf,输入下列命令即可实现:<br />
nvidia-xconfig<br />
<br />
它也有一些选项,用于更深入和具体地配置xorg.conf文件的内容和选项,例如:<br />
<br />
<br />
nvidia-xconfig --composite --add-argb-glx-visuals<br />
<br />
更详细的信息,请参考:nvidia-xconfig(1).<br />
<br />
一些有用的妙法可用在“device“部分(你要清楚它们不一定都能对你的系统有用):<br />
Option "RenderAccel" "true"<br />
Option "NoLogo" "true"<br />
Option "AGPFastWrite" "true"<br />
Option "EnablePageFlip" "true"<br />
将所有的DRI注释掉:<br />
# Load "dri"<br />
<br />
多检查几次你的/etc/X11/xorg.conf以确定你的默认的depth(色深),horizontal sync(水平同步),垂直刷新率,以及分辨率是可以接受的。<br />
<br />
使用<code>/sbin/depmod</code>命令来更新内核模块依赖:<br />
depmod -a<br />
(也许需要重启。)<br />
{{Tip|nvidia配置的高级的说明参考文章[[NVIDIA]] 。}}<br />
<br />
现在你可以跳到'''[[#三、配置X:创建并修改/etc/X11/xorg.conf|配置X]]'''来进一步熟悉,或者跳到'''[[#3、测试 X|测试 X]]'''继续安装过程。<br />
<br />
====ATI图形显示卡====<br />
ATI用户的驱动可以有几种选择。<br />
* '''xf86-video-ati'''软件包提供的开源'''''radeon'''''驱动。<br />
** 原创的、完全支持Radeon芯片组到X1950(最新的R500芯片组)的逆向工程开源驱动。对9200系列以前的显卡完全支持,可以稳定的提供全2D和3D加速。从9500到X1950完全支持2D加速特性,良好的3D加速,不过缺乏某些闭源驱动的特性(例如能源节省特性仍处于测试阶段)。xf86-video-ati支持从HD2xxx (R6xx)到最新的显卡,不过目前仅提供2D支持。<br />
* '''xf86-video-radeonhd'''软件包提供了开源的'''''radeonhd'''''驱动。<br />
** 此驱动支持ATI R500(Radeon X1000系列)以及更新的芯片组。该驱动由AMD提供文档,Novell为之开发。它支持RandR 1.2,目前的开发工作非常活跃。因此所支持的不同系列显卡的功能可以不一致。(有些用户反映它性能优异,而有些则说它很糟)。它还支持带音频的HDMI。<br />
* AUR中的Catalyst软件包提供了闭源'''''fglrx'''''驱动。稍后将介绍闭源驱动。<br />
开源驱动通常可以满足大部分需求而且较少出问题。<br />
<br />
安装'''''radeon'''''ATI驱动:<br />
# pacman -S xf86-video-ati libgl ati-dri<br />
安装'''''radeonhd'''''ATI驱动:<br />
# pacman -S xf86-video-radeonhd libgl ati-dri<br />
<br />
Arch的<code>extra</code>官方仓库曾经提供过闭源ATI驱动'''Catalyst'''的预编译包,不过在2009年3月以后,由于对闭源驱动的质量和开发进度不满意,官方取消了对它的支持。目前catalyst驱动可以在[http://aur.archlinux.org/packages.php?ID=22899 AUR]中找到。Catalyst驱动的安装信息可以在[[ATI#Proprietary_ATI_Catalyst_driver|这里]]找到。<br />
<br />
{{Warning| 闭源ATI驱动仅支持R600和更新的显卡(即HD2xxx及以上系列),不支持旧系列(X1xxx系列及以下)。}}<br />
<br />
{{Tip|ATI配置的高级指引可以参看[[ATI | ATI wiki 文章]]。}}<br />
<br />
====3、安装输入设备驱动软件包====<br />
最新的X需要你为包括键盘和鼠标在内的输入设备安装驱动。查看可用输入设备驱动的完整列表:<br />
# pacman -Ss xf86-input | less<br />
<br />
对大部分用户,xf86-input-keyboard和xf86-input-mouse应该可以满足基本配置。使用pacman来为你的输入设备安装需要的驱动,例如:<br />
# pacman -S xf86-input-keyboard<br />
===三、配置X:创建并修改/etc/X11/xorg.conf===<br />
====xorg.conf文件====<br />
/etc/X11/xorg.conf 是你的 X-Window-System 的主要配置文件,你的 GUI('''G'''raphical '''U'''ser '''I'''nterface)的基础,它是一个普通的文本文件,里面由 “section” 和 “subsection” 来安排。重要的 section 有 ''Files, InputDevice, Module, Monitor, Modes, Screen, Device'' 和 ''ServerLayout''。各个section安排的前后次序没有关系,对同一种类型的设备也可以有多个section,比如你可能有多个显示器,或者你的本本既有鼠标又有触摸板。<br />
------<br />
从X11R7.2版开始Xserver引入了自动配置特性。在大多情况下,即使没有xorg.conf文件它也能很好地运作。如果''自动检测功能工作正常'',而且你又不需要开启如 aiglx、compositing 等功能的话,你甚至不需要创建这个配置文件。<br />
<br />
====1、创建 /etc/X11/xorg.conf====<br />
<br />
高级用户可以手动创建他们的xorg.conf文件。一般用户可以使用程序<code>/usr/bin/Xorg</code>附加参数-configure来生成一个基本的配置文件;以root身份输入下面命令:<br />
# Xorg -configure<br />
这里生成的文件是/root/xorg.conf.new <br />
<br />
把这文件复制到 <code>/etc/X11/</code>:<br />
# cp /root/xorg.xonf.new /etc/X11/xorg.conf<br />
<br />
====更多的创建/etc/X11/xorg.conf的办法====<br />
* 说明:如果你的电脑已经有一个配置好的xorg.conf文件,不管这个文件是在什么别的发行版下生成的,只要Xorg的版本一致,就可以把该文件复制到你的Arch系统的<code>/etc/X11/</code>目录下。<br />
* 可以使用程序<code>/usr/bin/hwd</code>生成xorg.conf。首先要安装这程序:<br />
# pacman -S hwd<br />
然后输入下面命令:<br />
# hwd -xa<br />
{{Box Note| 目前,hwd在生成的xorg.conf有一行失效。 使用完这程序后,需要手动删除或者是注释掉 Section &quot;Files&quot;下的RgbPath那一行。via nano /etc/X11/xorg.conf or your equivalent, as root/sudo.}}<br />
<br />
* 使用<code>/usr/bin/xorgcfg</code> 脚本生成xorg.conf:<br />
# xorgcfg <br />
* 使用<code>/usr/bin/xorgconfig</code>生成xorg.conf,这个程序以互动方式来创建该文件,输入下面命令运行:<br />
# xorgconfig<br />
<br />
====2、Input设备热插拔问题:请在测试X前阅读====<br />
<br />
xorg 1.5.x版本里已经开启热插拔Input设备。<br />
{{Box Note | 当热插拔开启后, X将清空xorg.conf里所有使用the kbd and mouse 驱动建立的设备。这将导致X被冻结,使得鼠标和键盘失去响应。下面是解决办法。'''方法只能二选一'''}}<br />
<br />
有两个办法可以修复这一问题:<br />
<br />
1) '''配置 input设备热插拔''':安装驱动 xf86-input-evdev,同时配置HAL使其能使用kbd/mouse驱动。<br />
<br />
安装xf86-input-evdev:<br />
# pacman -S xf86-input-evdev<br />
在X.org相关进程启动前,启动守护进程hal:<br />
# /etc/rc.d/hal start<br />
把hal加入/etc/rc.conf里的DAEMONS列表里,这样每次电脑启动,都会自动开启hal。详情请见[[Xorg input hotplugging]] 。<br />
<br />
说明: 开启hal必须首先有一个dbus用户和用户组,以root身份输入下面命令创建用户和用户组<br />
<br />
usr/sbin/groupadd -g 81 dbus<br />
usr/sbin/useradd -c 'System message bus' -u 81 -g dbus -d '/' -s /bin/false dbus<br />
<br />
2) '''关闭input设备热插拔''':在/etc/X11/xorg.conf的ServerFlags段,加入参数''Option &quot;AutoAddDevices&quot; &quot;False&quot;'' 这将忽略hal的硬件检测,并使用你xorg.conf的keyboard/mouse配置。步骤如下<br />
# nano /etc/X11/xorg.conf<br />
加入下面三行:<br />
Section &quot;ServerFlags&quot;<br />
Option &quot;AutoAddDevices&quot; &quot;False&quot;<br />
EndSection<br />
<br />
====3、测试 X====<br />
<br />
在所生成的xorg文件路径''path/to/xorg.conf''前,加入参数''-config'' ,运行 '''X'''脚本,可以测试脚本配置是否正确。<br />
比如要测试你上面生成的xorg是否配置正确,输入:<br />
X -config /root/xorg.conf.new<br />
'''X''' 将启动,在屏幕中央会有一个白色的 X ,鼠标或是触摸板可以移动它,按 CTRL-Alt-Backspace 可以退出 '''X'''<br />
<br />
====对xorg.conf除错====<br />
如果 X 出现错误不能运行,你需要手动检查你的配置文件:<br />
<br />
nano /root/xorg.conf.new<br />
<br />
* 确定 Xorg -configure 命令正确的识别了你的显卡,比如:<br />
Section &quot;Device&quot;<br />
<br />
...<br />
<br />
Driver &quot;savage&quot;<br />
<br />
...<br />
<br />
EndSection<br />
<br />
* 确定里面的 Section "Monitor" 设置了水平同步率和垂直刷新率,如果没有要把它加上:<br />
Section &quot;Monitor&quot;<br />
Identifier &quot;Monitor0&quot;<br />
VendorName &quot;Monitor Vendor&quot;<br />
ModelName &quot;Monitor Model&quot;<br />
HorizSync 30.0 - 130.0 # Safe for LCD's<br />
VertRefresh 50.0 - 100.0 # Safe for LCD's and most CRT's.<br />
EndSection<br />
如果你不知道这些刷新率到底是多少,你就得查一下你显示器的说明书。<br />
<br />
* 在section "Screen"配置默认色深(color depth):<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Card0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
(此处色深被设定为真彩24色。)<br />
<br />
<br />
* 在subsection &quot;Display&quot; 加入你需要的Modes, at least under the Depth 24 header, e.g.:<br />
SubSection &quot;Display&quot;<br />
Viewport 0 0<br />
Depth 24<br />
Modes &quot;1024x768&quot; &quot;800x600&quot; &quot;640x480&quot;<br />
* Add the following section, if you wish to enable eye candy which requires the composite extension: <br />
Section &quot;Extensions&quot;<br />
Option &quot;Composite&quot; &quot;Enable&quot;<br />
EndSection<br />
<br />
* 上述调整完成后,再测试你的配置:<br />
X -config /root/xorg.conf.new<br />
<br />
* 在确认 '''X''' session开启,没有错误之后,把测试好的配置文件移到 /etc/X11下,作为系统的xorg.conf配置文件:<br />
mv /root/xorg.conf.new /etc/X11/xorg.conf<br />
详细的介绍可见[[Xorg]] <br />
<br />
接下来可以简单作测试 '''[[#Simple baseline X test|Simple baseline X test]]'''<br />
<br />
====调整键盘布局====<br />
=====如果开启了input热插拔=====<br />
# cp /usr/share/hal/fdi/policy/10osvendor/10-keymap.fdi /etc/hal/fdi/policy/<br />
# nano /etc/hal/fdi/policy/10-keymap.fdi<br />
Edit the &quot;input.xkb.layout&quot; key and possibly the &quot;input.xkb.variant&quot; key in this file.<br />
Restart hal:<br />
# /etc/rc.d/hal restart<br />
<br />
=====如果关闭了input热插拔=====<br />
Add option lines in the &quot;InputDevice&quot; section of the /etc/X11/xorg.conf file specifying the keyboard layout and variant:<br />
Option &quot;XkbLayout&quot; &quot;be&quot;<br />
Option &quot;XkbVariant&quot; &quot;&quot;<br />
<br />
详情请见 [[Xorg input hotplugging]]。<br />
<br />
===简单的命令行界面X测试(如果需要)===<br />
<br />
在安装了xorg、合适的显卡驱动、创建了一个/etc/X11/xorg.conf文件之后,如果想在安装完整桌面环境之前,快速测试下你的配置,使用'''xterm'''可以实现! <br />
Xterm是个简单的终端模拟程序,作为base xorg软件包的一部分会被自动安装,运行在'''X '''Server环境里。通过配置~/.xinitrc,Xterm可以让我们快速测试显卡驱动和配置文件/etc/X11/xorg.conf是否被正确配置。(另外,如果在没有/etc/X11/xorg.conf的情况下,你想测试下'''X''' 自动检测是否满意,也可以使用这个)<br />
<br />
==== 准备工作:配置~/.xinitrc====<br />
<br />
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. <br />
{{Box Note | '''[[.xinitrc]]''' is a so-called 'dot' (.) file. 在UNIX文件系统下,文件名以 (.)开头的,是 '隐藏文件',,使用普通的命令'ls' 将不显示这些文件,使用加了参数命令'''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 &quot;Run Control&quot;.}}<br />
<br />
'''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. (说明: ''如果没有文件~/.xinitrc, /etc/X11/xinit/xinitrc 将被作为替代来使用,这是个使用TWM and Xterm的默认配置。'')<br />
<br />
切换到'''''普通, 非root'''''用户:<br />
# su - ''yourusername''<br />
* /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.<br />
* 如果没有~/.xinitrc这个文件,到该目录下创建一个,或者从/etc/skel/复制一个同样的文件到你的home目录:: <br />
<br />
$ cp /etc/skel/[[.xinitrc]] ~/<br />
<br />
* 编辑文件: <br />
$ nano ~/.xinitrc<br />
加入这行&quot;<code>exec xterm</code>&quot;像下面这样:<br />
<br />
#!/bin/sh<br />
#<br />
# ~/.xinitrc<br />
#<br />
# Executed by startx (run your window manager from here)<br />
#<br />
exec xterm<br />
# exec wmaker<br />
# exec startkde<br />
# exec icewm<br />
# exec blackbox<br />
# exec fluxbox<br />
<br />
{{Box Note | ''请确保~/.xinitrc''里,以'''exec'''开头的,只有'''一行'''的注释被去掉。}}<br />
<br />
====开始执行测试====<br />
<br />
* 以普通用户身份输入下面命令,开启'''X''',开始测试你的配置:<br />
<br />
$ startx<br />
或者是这命令<br />
$ xinit<br />
<br />
此时会打开一个'''xterm''' session,你可以在这里测试your keyboard and its layout<br />
<br />
* 按Ctrl+Alt+Backspace,或者输入"exit"可以退出'''X''' Server。<br />
* 如果开启'''X'''出现问题,在终端,查看日志文件/var/log/Xorg.0.log的错误信息。<br />
<br />
更多的Xorg configuration介绍可见[[Xorg]] .<br />
<br />
==第四部分:安装并配置桌面环境==<br />
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 icons, applets, windows, toolbars, folders, wallpapers, 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.<br />
<br />
* 如果你需要一个完整功能,类似于Windows和Mac OSX, 可以选择安装'''[[#KDE|KDE]]''' <br />
* If you want something slightly more minimalist, which follows the K.I.S.S. principle more closely, '''[[#GNOME|GNOME]]''' is a good choice<br />
* '''[[#Xfce|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.<br />
<br />
如果你的机器较老,或者是希望使用一个更轻量、更少GUI要求,可以选择只安装 '''Window Manager''', 或者 WM. A WM controls the placement and appearance of application windows in conjunction with the X Window System but does NOT provide such additions as panels, applets, icons, etc.<br />
* Lightweight floating WM's include: [[#Openbox|'''Openbox''']], [[#Fluxbox|'''Fluxbox''']], [[#fvwm2|'''fvwm2''']], '''Windowmaker, Pekwm, and TWM'''.<br />
* If you need something completely different, try '''Awesome, ion, wmii, dwm, or xmonad'''。<br />
<br />
===一、安装字体===<br />
在安装桌面环境/窗口管理器'''之前''',也许你会先安装些美观的字体。Dejavu和bitstream-vera都是不错的字体集。而对于网页,你还可能需要Microsoft字体。如下安装:<br />
pacman -S ttf-ms-fonts ttf-dejavu ttf-bitstream-vera<br />
对于中文字体,开源的文泉驿正黑矢量字体是不错的选择,它还内嵌了9pt-12pt的点阵宋体:<br />
pacman -S wqy-zenhei<br />
<br />
===二、选择默认启动的桌面环境 ~/.xinitrc===<br />
<br />
以普通用户身份编辑/home/username/.xinitrc,加入你要用的DE. This will allow you to use '''startx/xinit''' from the shell, in the future, to open your DE/WM of choice:<br />
<br />
nano ~/.xinitrc<br />
<br />
反注释或者加入相应的桌面环境/窗口管理器的''''exec''' ..'内容行。例如:使用Xfce4桌面环境:<br />
<br />
exec startxfce4 <br />
<br />
记住在~/.xinitrc中只反注释掉一行'''exec'''。这条命令将一直运行到你注销桌面登录。一般的,shell将等到kde完成加载之后,在运行下一条命令。在命令前加 &quot;exec&quot; ,是告诉the shell 这条命令最后执行, 这样shell就不用等待其他命令了,直接载入桌面。<br />
接下来安装你所选的桌面环境/窗口管理器。<br />
<br />
===三、选择安装一个桌面环境===<br />
====GNOME====<br />
=====关于GNOME=====<br />
GNOME是'''G'''NU '''N'''etwork '''O'''bject '''M'''odel '''E'''nvironment的缩写。GNOME项目有两大部分:GNOME桌面环境 ── 既直观又迷人的最终用户桌面,以及GNOME开发平台 ── 一个用来创建可与桌面集成的应用程序的庞大的框架。<br />
<br />
=====安装=====<br />
安装基本的GNOME环境:<br />
pacman -S gnome<br />
<br />
安装额外的GNOME环境:<br />
pacman -S gnome-extra<br />
然后选择提示的所有软件包。 <br />
<br />
=====对GNOME有用的守护进程=====<br />
如之前所述,守护进程(daemon)是运行在后台的程序,它等待事件发生并提供相应的服务。其中'''Hal'''守护进程可以自动挂载磁盘、光驱和U盘给GUI使用。'''Fam'''守护进程可以在GUI中实时反映文件的变动,如最近安装的程序、文件系统的变化等。'''Hal'''和'''fam'''使得GNOME的使用更为方便。Hal和fam软件包在安装GNOME时已一同安装,建议安装社区库的gamin来替代fam。<br />
<br />
{{Box Note|注意,fam是一个比较老的包,很容易造成较大的日志文件。}}<br />
<br />
{{Box Note|在当前的gnome环境中,你可以安装gamin来实现fam的功能。这时,你可以不用在DAEMONS中添加fam启动项了(不需要加入gamin,它会自动被启用)。}}<br />
<br />
* 你需要启动'''hal'''守护进程。<br />
<br />
启动hal:<br />
/etc/rc.d/hal start<br />
<br />
如果您想使用fam,同样需要启动:<br />
/etc/rc.d/fam start<br />
<br />
将hal加入到/etc/rc.conf的DAEMONS中以使得它们随系统启动而自动运行:<br />
nano /etc/rc.conf<br />
<br />
DAEMONS=(syslog-ng network crond alsa '''hal''')<br />
<br />
{{Box Note|注意,如果使用fam,那么把fam加入到hal后面。}}<br />
<br />
* 或许你还会希望安装一个图形界面的登录管理器。在GNOME下'''gdm'''守护进程是个不错的选择。<br />
以root身份运行:<br />
pacman -S gdm<br />
<br />
让gdm启用有两种方式,一种是直接加入到DAEMONS的末尾,通过rc.conf来启动;另外一种方式是用过配置inittab来加载gdm。<br />
<br />
* 通过inittab来加载gdm也很方便(推荐使用这种方式):<br />
nano /etc/inittab<br />
<br />
修改默认启动方式:<br />
<br />
将<br />
id:3:initdefault:<br />
改为<br />
id:5:initdefault:<br />
<br />
然后取消下面代码的注释:<br />
x:5:respawn:/usr/sbin/gdm -nodaemon<br />
<br />
{{Box Note|实际上,可以看到gdm/xdm/kdm/slim等,使用哪个取决于你的喜好,启用喜欢的那个,将其他的注释掉。当然,本章介绍的是gnome,所以推荐gdm,下章中将推荐kdm:)}}<br />
<br />
<br />
* 通过DAEMONS方式启动gdm也很方便:<br />
nano /etc/rc.conf<br />
<br />
DAEMONS=(syslog-ng network crond alsa hal gdm)<br />
<br />
{{Box Note|这是类似debian/ubuntu的做法,这种方式有一点不好:不管什么时候(非修复模式),系统总是会尝试进入gdm引导的X方式下。对于X已经配置得很好,并且不使用纯控制台的人可以使用这种方式。但是选择这种方式的话你将不能通过内核参数3或者5来区分进入纯字符控制台还是X11的gdm登录窗口。}}<br />
<br />
* 开启Gnome<br />
以普通用户身份启动X:<br />
startx<br />
或者这条命令也行:<br />
$ xinit<br />
如果你的 ~/.xinitrc一直没配置,那你将可以一直使用下面这条命令来开启Gnome:<br />
$ xinit /usr/bin/gnome-session<br />
<br />
关于安装和配置GNOME的高级指引可以参见[[GNOME (简体中文)|GNOME]]一文。接下来你可以浏览'''[[#优化和收尾|优化和收尾]]'''。或许你还会对[[ArchTips(简体中文)|Arch安装完后的小技巧]]一文感兴趣。<br />
<br />
=====美化=====<br />
如果不满足于缺省的GNOME主题和图标,那么可以安装一个不错的主题,比如murrine:<br />
pacman -S gtk-engine-murrine<br />
接着在System->Preferences->Theme里选择这个主题。<br />
<br />
Arch Linux也做了些不错的主题,根据你自己的审美观,选择满意的安装吧:<br />
<br />
# pacman -S gtk-engines gtk2-themes-collection gtk-aurora-engine gtk-candido-engine gtk-rezlooks-engine<br />
<br />
你还可以在[http://www.gnome-look.org Gnome Look]里找到更多的主题、图标和壁纸。<br />
<br />
====KDE====<br />
=====关于KDE=====<br />
KDE桌面环境('''K''' '''D'''esktop '''E'''nvironment)的缩写。 KDE是一种著名的运行于GNU/Linux 、 <code>UNIX</code> 工作站等的强大、自由图形工作环境。她拥有对系统内部各功能的强大整合能力、跨平台能力、易用性、优异的初始界面.<br />
<br />
=====安装=====<br />
Arch提供多个版本的kde: '''kde、kdebase 和 KDEmod'''. 选'''一个'''就行了,然后 '''[[#有用的KDE守护进程|有用的KDE守护进程]]''': <br />
<br />
'''1.)''' '''kde'''是完整的kde软件包,大概 ~300MB,适合主要使用kde软件的系统.<br />
pacman -S kde<br />
'''2.)''' '''kdebase'''是kde的基础软件包(里面没有kdm),大概 ~80MB,适合于只想把kde作为基础系统.<br />
pacman -S kdebase<br />
'''3.)''' '''KDEmod''' 是 Arch Linux独有的、社区驱动的项目,目标是把kde更加细致的模块化和达到其极致的运行效率。KDEmod项目的网站在http://chakra-project.org/ 。<br />
<br />
=====有用的KDE守护进程=====<br />
<br />
KDE 需要'''hal''' ('''H'''ardware '''A'''bstraction '''L'''ayer) 作为守护进程(daemons). '''kdm''' ( '''K''' '''D'''isplay '''M'''anager), 提供一个 '''图形化登录界面'''.<br />
{{Box Note|hal守护进程将自动开启dbus守护进程。kde4里已经不需要fam。kdm现在在kdebase-workstation这个包里,如果只安装kdebase,需要再安装此包才能使用kdm}}<br />
<br />
The hal daemon, among other things, will automate the mounting of disks, optical drives, and USB drives/thumbdrives for use in the GUI. <br />
<br />
-----<br />
启动hal进程:<br />
<br />
/etc/rc.d/hal start<br />
<br />
编辑/etc/rc.conf的 DAEMONS部分:<br />
nano /etc/rc.conf<br />
把 '''hal''' 加入 DAEMONS 部分,以便他们在系统启动时加载. 如果想要kde的图形化登录界面,把 '''kdm'''也加进去(或者不加,在/etc/inittab里面设置): <br />
DAEMONS=(syslog-ng network crond alsa '''hal kdm''')<br />
{{Box Note|如果你安装的是KDEmod3,则使用kdm3替换kdm}}<br />
<br />
*This method will start the system at runlevel 3, (/etc/inittab default, multiuser mode), and then start KDM as a daemon. <br />
<br />
*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 [[Adding a login manager (KDM, GDM, or XDM) to automatically boot on startup]] for more.<br />
<br />
*If you prefer to log into the '''console''' at runlevel 3, 手动启动 X, 则不加入kdm, 或者是加个前缀( ! )禁止它。<br />
<br />
* 现在可以试试效果了,用普通用户身份开启X Server:<br />
startx<br />
或者<br />
$ xinit<br />
更多关于安装和配置KDE的文章,请看[[KDE]].<br />
<br />
到此步,可以看 '''[[#优化和收尾]]'''这部分了. You may also be interested in the [[Post Installation Tips]] wiki article.<br />
<br />
====Xfce====<br />
=====关于Xfce=====<br />
和GNMOE、KDE一样,Xfce是一个桌面环境,其目标是快捷、轻量,同时又美观而易用。它还提供了一整套的应用程序如根窗口应用(root window app)、 窗口管理器、文件管理器、面板等等。 Xfce是用GTK2 toolkit编写的(类似GNOME),和其它大型桌面环境一样,它也有自己的开发环境(库文件、守护进程等)。但不象GNOME或者KDE,Xfce是轻量化的,其设计更接近于CDE而不是Windows或者Mac。它的开发周期比较慢,但是十分稳定、速度很快。在老硬件上Xfce可以运行得很好,而在新机器上更是运行如飞。<br />
<br />
=====安装=====<br />
安装完整的xfce环境以及主题和extras:<br />
pacman -S xfce4 xfce4-goodies gtk2-themes-collection <br />
<br />
如果你使用KDM或者GDM的话会显示一个xfce会话。另一种启动方式是:<br />
startxfce4<br />
<br />
关于安装和配置xfce的高级指引可以参见[[Xfce (简体中文)|Xfce]]一文。<br />
<br />
恭喜!欢迎来到Arch Linux系统的Xfce桌面环境!接下来你可以浏览'''[[#优化和收尾|优化和收尾]]''',或者下面的其它内容。或许你还会对[[ArchTips(简体中文)|Arch安装完后的小技巧]]一文感兴趣。<br />
<br />
====*box====<br />
=====Fluxbox=====<br />
Fluxbox © is yet another windowmanager for X.<br />
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).<br />
<br />
Install Fluxbox using <br />
pacman -S fluxbox fluxconf<br />
<br />
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:<br />
exec startfluxbox <br />
<br />
More information is available in the [[Fluxbox]] article.<br />
<br />
=====Openbox=====<br />
Openbox是一个标准的”温顺的“,快速的,轻量级的,可扩展的窗口管理器。<br />
<br />
Openbox与你的应用程序一起工作工作,并使你的的桌面便于管理。这是因为它的开发方式和通常的窗口管理器的方式是相悖的。 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.<br />
<br />
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. <br />
<br />
安装openbox<br />
pacman -S openbox obconf obmenu<br />
<br />
一旦openbox安装好,你将得到一个消息to move menu.xml & rc.xml to ~/.config/openbox/ in your home directory:<br />
<br />
mkdir -p ~/.config/openbox/<br />
cp /etc/xdg/openbox/rc.xml ~/.config/openbox/<br />
cp /etc/xdg/openbox/menu.xml ~/.config/openbox/<br />
<br />
In the file "rc.xml" you can change various settings for Openbox (or you can use OBconf). In "menu.xml" you can change your right-click menu.<br />
<br />
To be able to log into openbox you can either go via graphical login using KDM/GDM or startx, in which case you will need to edit your ~/.xinitrc (as user) and add the following:<br />
<br />
exec openbox<br />
<br />
For KDM there is nothing left to do; openbox is listed in the sessions menu in KDM.<br />
<br />
Useful programs for openbox are:<br />
* PyPanel or LXpanel if you want a panel<br />
* feh if you want to set the background<br />
* ROX if you want a simple file manager and desktop icons<br />
<br />
More information is available in the [[Openbox]] article.<br />
<br />
====fvwm2====<br />
FVWM是一个非常强大的面向X桌面系统的”ICCCM-compliant的多虚拟桌面的窗口管理器“(ICCCM-compliant multiple virtual desktop window manager)。开发活动很活跃,支持也是极好的。 <br />
<br />
输入下面命令安装 fvwm2 <br />
pacman -S fvwm <br />
<br />
fvwm会自动添加进 kdm/gdm会话列表. 如果没有的话,添加 <br />
exec fvwm <br />
<br />
到你的用户文件 .xinitrc.<br />
<br />
注意:这个稳定版已经有些年头了,如果需要最新的fvwm版本,可以安装unstable repo里的fvwm-devel 包.<br />
<br />
===四、优化和收尾===<br />
====HAL====<br />
如果你已经安装了一个桌面环境,但是又觉得用起来不是很方便,那么现在就是个安装HAL的好时机了。HAL使得你的手机、iPod、移动硬盘等等可以即插即用。它会挂载设备并在你的桌面或/和'My Computer'目录中创建相应的图标,使得你可以在插入设备后就能访问到它,无需每次都对每个新设备来手动配置/etc/fstab文件或者udev规则。<br />
<br />
KDE、GNOME和XFCE都使用到HAL。<br />
<br />
安装过程描述可以在[[HAL (简体中文)|HAL]]一文中找到。其它一些信息可以在[http://en.wikipedia.org/wiki/HAL_(software) Wikipedia]上找到。<br />
<br />
====启动时让守护进程在后台执行====<br />
<br />
要加速系统的启动过程,可以在/etc/rc.conf中给守护进程前加上'@'符号使之在后台执行,例如:<br />
<br />
DAEMONS=(@syslog-ng @network crond @alsa @hal @fam @kdm)<br />
这使得守护进程在后台被加载,无需等待它们加载结束。<br />
<br />
在守护进程前加上(!)可以禁止系统启动时加载它,例如:<br />
<br />
DAEMONS=(@syslog-ng @network !crond @alsa @hal @fam @kdm)<br />
<br />
另一种方式是直接将不需要的守护进程删除。<br />
<br />
====美化LCD下的字体====<br />
See [[Fonts]]<br />
<br />
====让所有的鼠标按键生效====<br />
看这个 [[Get All Mouse Buttons Working]]<br />
<br />
====笔记本电脑可能遇到的问题====<br />
(1) 触摸板问题<br />
参看http://wiki.archlinux.org/index.php/Touchpad_Synaptics<br />
<br />
(2) 摄像头问题<br />
参看http://wiki.archlinux.org/index.php/Webcam_Setup<br />
<br />
(3) 无线上网问题<br />
参看http://wiki.archlinux.org/index.php/Wireless<br />
<br />
(4) 快捷键问题<br />
参看http://wiki.archlinux.org/index.php/Extra_Keyboard_Keys<br />
<br />
====配置CPU频率====<br />
现在的处理器能够降低频率和电压,以降温和降低电源消耗。降温能使系统更稳定,笔记本用户肯定是想这样做的,但是即使是台式机也会对系统有利。<br />
<br />
安装CPU频率工具用:<br />
pacman -S cpufrequtils<br />
<br />
把CPU频率在/etc/rc.conf里加入到启动进程(daemons)中。编辑配置文件/etc/conf.d/cpufreq改<br />
governor="conservative"<br />
<br />
这使得在需要的情况下可以动态地增减CPU频率(这是对于台式机来说也是一个安全的选择)。改变最小频率(min_freq)和最大频率(max_freq)以匹配你的CPU的情况。如果你不知道频率,在载入频率测量模块后运行“cpufreq-info”。你也可以将min_freq和max_freq注释掉或删除,这样就能自动进行。加入频率测量模块到/etc/rc.conf的模块行。<br />
几乎所有的笔记本和台式机都可以简单地使用''acpi-cpufreq''驱动,但是也有其它的选择,如:''p4-clockmod, powernow-k6, powernow-k7, powernow-k8, and speedstep-centrino''。 <br />
<br />
通过下面这个命令载入这个模块:<br />
modprobe <modulname> <br />
通过下面命令行开启cpufreq:<br />
/etc/rc.d/cpufreq start<br />
更多细节,请看 [[Cpufrequtils]]<br />
<br />
==第五部分:常用的应用程序==<br />
更多信息,请看[[ArchLinux常用的应用程序(简体中文)]].<br />
<br />
==附录==<br />
新手指南附录[[ArchLinux新手指南附录 (简体中文)]]<br />
<br />
想得到更多的信息和支持,你可以去[http://www.archlinux.org/ homepage], [[Special:Search|search the wiki]],[http://bbs.archlinux.org/ forums],[[ArchChannel|IRC channel]],以及[http://www.archlinux.org/mailman/listinfo/ mailing lists]。<br />
=====问题答疑=====<br />
See [[Arch FAQs for newbies]]<br />
还有这里[http://bbs.archlinux.org/viewtopic.php?t=29055 Arch forum thread] 也是面向初学者的。<br />
<br />
=====术语=====<br />
更多信息关于Arch术语,查阅[[Arch Terminology/Jargon for newbies|this article]].<br />
<br />
=====接下来还有什么?=====<br />
<br />
你还可以阅读:<br />
<br />
[[Arch 官方安装指南 (简体中文)|Arch 官方安装指南]]<br />
<br />
[[Arch AUR (简体中文)|ArchLinux社区用户软件仓库 (AUR)]]<br />
<br />
[[Get All Mouse Buttons Working]]<br />
<br />
[[改善Pacman性能 (简体中文)|改善Pacman性能]]<br />
<br />
[[Kernel Compilation]]<br />
<br />
[[Pm-utils 电源管理 (简体中文)|Pm-utils 电源管理]]<br />
<br />
[[CPU 频率调节 (简体中文)|CPU 频率调节]]<br />
<br />
[[:Category:美化|美化]]</div>
Flydragon
https://wiki.archlinux.org/index.php?title=ArchLinux_%E6%96%B0%E6%89%8B%E6%8C%87%E5%8D%97_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=90846
ArchLinux 新手指南 (简体中文)
2010-01-04T09:35:00Z
<p>Flydragon: /* Pacman镜像 */</p>
<hr />
<div>[[Category:简体中文]]<br />
[[Category:获取并安装Arch (简体中文)]]<br />
[[Category:关于Arch_(简体中文)]]<br />
[[Category:HOWTOs (简体中文)]]<br />
<br />
{{Article summary start}}<br />
{{Article summary text|本文针对新手,提供了极其详尽的Archlinux的安装过程向导,和相关的简要说明。}}<br />
{{Article summary heading|已有的语言版本}}<br />
{{Article summary heading|Available Languages}}<br />
{{i18n_entry|Česky|Průvodce začátečníka (Česky)}}<br />
{{i18n_entry|简体中文|Arch 新手安装指南 (简体中文)}}<br />
{{i18n_entry|正體中文|Beginner's Guide 新手指南}}<br />
{{i18n_entry|Dansk|Dansk_Begynderguide}}<br />
{{i18n_entry|Deutsch|Beginners Guide (Deutsch)}}<br />
{{i18n_entry|English|Beginners Guide}}<br />
{{i18n_entry|Español|Guía para Principiantes (Español)}}<br />
{{i18n_entry|Français|Manuel_du_Débutant_(Français)}}<br />
{{i18n_entry|Italiano|Beginners Guide (Italiano)}}<br />
{{i18n_entry|Indonesia|Beginners_Guide_(Indonesia)}}<br />
{{i18n_entry|Lietuviškai|Pradedančiųjų gidas (Lietuviškai)}}<br />
{{i18n_entry|Nederlands|Beginners_Guide_(Nederlands)}}<br />
{{i18n_entry|Português Brasil|Guia do Iniciante(Português do Brasil)}}<br />
{{i18n_entry|Português|Guia para Principiantes(Português)}}<br />
{{i18n_entry|Русский|Руководство_для_новичков}}<br />
{{i18n_entry|Türkçe|Başlangıç Rehberi (Türkçe)}}<br />
{{i18n_entry|हिन्दी|नौसिखिया गाइड(हिन्दी)}}<br />
{{Article summary heading|相关文章}}<br />
{{Article summary wiki|Arch 官方安装指南 (简体中文)}}(更通用的安装方式)<br />
{{Article summary wiki|ArchLinux新手指南附录 (简体中文)}}<br />
{{Article summary wiki|ArchLinux安装完后的小技巧 (简体中文)}}<br />
{{Article summary wiki|ArchLinux常用的应用程序(简体中文)}}<br />
{{Article summary wiki|Work and Play with Arch (Chinese)}}<br />
{{Article summary end}}<br />
<br />
==前言==<br />
<br />
=====所有你一直想知道的关于安装Arch的事=====<br />
这篇文档将会指导你安装和配置[[ArchLinux (简体中文)|Arch Linux]] ── 一个简洁、轻量级的GNU/Linux发行版,一个类<code>UNIX</code>的操作系统。本文是面向Arch新用户,因此尽力为所有人提供强大的参考资料和信息。本指南讲述该如何获得一个基本配置好的Arch Linux系统(拥有一个图形桌面环境),但显然是不可能涵盖(甚至是预见)所有的信息。因此本指南会专注于某些关键性的步骤,想要进一步深入了解你可以查看[[Main Page (简体中文)|Arch Linux Wiki]]或者[http://bbs.archlinux.org/ Arch Linux论坛]。同时有兴趣的话你还可以了解一下[[Arch 之道 (简体中文)|Arch 之道]],它概述了Arch Linux发行版背后的哲学思想。<br />
<br />
'''Arch Linux的相关特性:'''<br />
* '''[[The Arch Way | Simple]]''' design and philosophy<br />
* Community distro targeted at competent GNU/Linux users<br />
* All packages compiled for '''i686/x86-64'''<br />
* 从底层开始就可以让用户高度定制<br />
* '''[[The Arch boot process | BSD-style init]]''' scripts, featuring one centralized configuration file<br />
* '''滚动升级''' <br />
* '''[[Pacman]]''' package manager is fast, written in '''C''', lightweight and agile, with a very modest memory footprint<br />
* '''[[ABS]]''': The '''A'''rch '''B'''uild '''S'''ystem, a ports-like package building system makes it simple to create your own easily installable Arch packages from source, to use and/or share with the community on the [[AUR]]<br />
* '''[[AUR]]''': The Arch User Repository, offering many thousands of build scripts for Arch user-provided software packages<br />
<br />
=====别怕(DON'T PANIC)!=====<br />
要知道Arch Linux的安装方法和过程也许会和你所使用过的其它GNU/Linux发行版非常不同,特别你是个新手的话将更能体会到这点。通常,GNU/Linux发行版会在一张或者一堆CD(甚至是DVD)上捆绑了大量的软件,包含了缺省桌面环境、缺省的应用程序和设置、硬件自动检测和图形化的安装程序,一切都是替你选择好了的。相反的,Arch Linux系统是让'''用户自己'''只是用一个bash shell和基本系统工具,从ncurses installer和基础系统上建造起来的。这就是[[Arch 之道 (简体中文)|Arch 之道]]。不象其它大型发行版,它没有强加于用户的缺省环境或者配置。你可以在命令行使用[[pacman (简体中文)|pacman]]通过互联网连接从Arch软件仓库安装软件包,直到你的系统配置成你希望的样子。这给予了用户最大的弹性、选择性和对系统资源的控制。因为是'''你'''建造了它,所以你肯定能了解系统里具体细节,知道底层都有些什么。<br />
<br />
Arch Linux系统是通过编辑文本文件进行配置的,没有提供图形界面的工具,所以需要对系统和linux相对熟悉。<br />
Arch Linux针对的是有能力的GNU/Linux用户以及希望花费时间学习系统知识的用户。 <br />
<br />
''Arch是一个可以被用户塑造的工具。''<br />
<br />
=====授权协议=====<br />
<br />
Arch Linux, pacman, documentation, and scripts are copyright<br />
©2002-2007 by Judd Vinet, ©2007-2008 by Aaron Griffin and are licensed under the GNU General Public License Version 2.<br />
<br />
=====[[Arch 之道 (简体中文)|Arch 之道]]=====<br />
<br />
''Arch的设计思想是"保持简洁"(keeping it simple)。'' <br />
<br />
这里的‘简洁’并不是单指‘简单’或者‘用户友好’,而是‘没有不必要的增加、修改或者复杂性’。简而言之,即优雅、极简之法。<br />
<br />
<br />
''"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 crap." -Aaron Griffin''<br />
<br />
<br />
''"The extraordinary part of [my method] lies in its simplicity..I have always believed that the simple way is the right way."'' - Bruce Lee<br />
“(我的方法中)最超凡的部分是它的简单性,我一直相信简单的就是对的。” 李小龙(Bruce Lee)<br />
<br />
Occam's razor: ''Entia non sunt multiplicanda praeter necessitatem'' or "Entities should not be multiplied unnecessarily." The term razor refers to the act of shaving away unnecessary assumptions and complications to get to the simplest explanation, method or theory.<br />
<br />
{{Box Note |'''仔细遵循本指南是成功安装一个配置正常的Arch Linux系统的基本要点,因此''请''认真仔细的阅读本文'''}}<br />
* 你也可以将本指南打印出来,作为一个较为有用的Arch Linux用户手册。<br />
*''如果你想在这个wiki里增加内容,请适当描述清楚“为什么会这样”以及“该怎么办”。最佳的文档应该能教会我们如何做和为什么这么做!''<br />
* Arch的wiki是项优秀的资源,可以[http://wiki.archlinux.org/index.php/Main_Page 第一时间]用来解决日常问题; 如果找不到答案也可以求助IRC和[http://bbs.archlinux.org/ 论坛]。<br />
----<br />
----<br />
欢迎使用Arch!现在,让我们开始吧。<br />
<br />
本文按照安装过程分四大部分:<br />
<br />
'''[[#第一部分:安装基本系统|第一部分:安装基本系统]]'''<br />
<br />
'''[[#第二部分:完成基本系统并升级|第二部分:完成基本系统并升级]]'''<br />
<br />
'''[[#第三部分:安装X并配置ALSA|第三部分:安装X并配置ALSA]]'''<br />
<br />
'''[[#第四部分:安装并配置桌面环境|第四部分:安装并配置桌面环境]]'''<br />
<br />
==第一部分:安装基本系统==<br />
===一、获取最新的系统安装包===<br />
<br />
你可以从[http://archlinux.org/download/ 这里]获取Arch最新的官方系统安装包。最新版本是2009.08<br />
<br />
*不论是Core还是Netinstall系统安装包,都只是包含了安装'''Arch Linux基本系统'''所需的软件包. ''注意,基本系统是不包含GUI图形界面的。它主要包含了GNU的系列工具(编译器、汇编程序、链接、库、脚本,还有其它的一些有用的工具),Linux的内核,还有一些额外的库和模块。<br />
*Core映像文件可以较方便的通过CD或者网络进行安装。<br />
*Netinstall映像文件较小巧,本身没有提供软件包,整个系统都是通过internet来获取的。<br />
*isolinux映像文件是给那些使用grub版本时发生问题的用户的。两者没有其它区别。<br />
*Arch64问答( http://wiki.archlinux.org/index.php/Arch64_问答_(简体中文) )可以帮助你在32位版本和64位版本之间作出选择。<br />
<br />
====CD 系统安装包====<br />
把下载的.iso映像文件刻录到CD上。开机时用CD启动,出现界面,跳到[[#二、启动Arch Linux系统安装程序| 二、启动Arch Linux系统安装程序]]<br />
{{Box Note| 通常为了刻录的稳定可靠(速率越低刻录质量越有保证),推荐刻录的最大速度不超过16倍速。有些用户推荐'''''速度为 4x 或者 2x.''''' 如果所刻录的CD有问题,可以尝试使用你系统所支持的最小速度方式刻录。 }}<br />
<br />
<br />
====USB安装方式====<br />
{{Warning|这样做会把USB盘里面原有的数据格式化。}}<br />
<br />
'''<code>UNIX</code> 方式:'''<br />
<br />
插入USB盘,找到其路径,用<code>/bin/dd</code>命令把.img映像文件写入USB(Linux下):<br />
<br />
dd if=archlinux-2009.08-''{core|netinstall}''-''{i686|x86_64}''.img of=/dev/sd''x''<br />
<br />
if= 后面是.img镜像文件的路径,of= 是你的USB路径. 要使用/dev/sd''x''而不是/dev/sd''x1''.(就是要使用整个分区而不是第一分区)<br />
<br />
'''检查镜像的完整性md5sum (可选):'''<br />
<br />
记下读入和写出的记录区数目,然后执行以下命令进行检查:<br />
dd if=/dev/sd''x'' count=''记录区数目'' status=noxfer | md5sum<br />
<br />
md5sum命令返回的值(这是你检查U盘上文件得到的)要与你下载的archlinux镜像文件的md5sum校验值相同;它们都应该和镜像站点的md5sum文件列表里相应的值相同。<br />
<br />
'''Windows方式:'''<br />
<br />
从https://launchpad.net/win32-image-writer/+download 下载Disk Imager。插入U盘,启动Disk Imager并选择映像文件,再选择U盘相应的磁盘驱动号,点击"write"即可。<br />
<br />
===二、启动Arch Linux系统安装程序===<br />
Usually, the first item is the preferred selection. However, choose Boot Archlive or Boot Archlive [legacy IDE] if you have trouble with libata/PATA, or have no SATA (Serial ATA) drives.<br />
<br />
Also, to change boot options, press '''e''' for editing the boot lines. Many users may wish to change the resolution of the framebuffer, for more readable console output. Append:<br />
插入刻录好的光盘CD或者USB盘,然后用它启动电脑。可能需要在BIOS里(通常是启动后在加电自检过程中按DEL、F1、F2、F11或者F12)改变一下启动顺序使得CD或者USB先被启动。<br />
<br />
{{Note|内存需求:<br />
* Core : 160 MB RAM x86_64/i686 (选择所有软件包,开启交换分区)<br />
* Netinstall : 160 MB RAM x86_64/i686 (选择所有软件包,开启交换分区)}}<br />
<br />
启动了Arch Linux光盘后,用上下箭头高亮菜单,按下回车键进行选择。<br />
<br />
通常,推荐选择第一项菜单。不过如果使用libata/PATA出现问题或者没有SATA (Serial ATA)驱动器,你也可以选择Boot Archlive或者Boot Archlive [legacy IDE] 。<br />
<br />
如果你需要改变启动参数,可以按‘e ’键来编辑启动行内容。 含多用户可能希望改变framebuffer分辨率以得到更好的终端显示。将<br />
vga=773<br />
加到kernel一行的后面,然后按<ENTER>,就可以得到1024x768的framebuffer。设置完毕后按'''b'''则使用相应的选择项进行启动。<br />
<br />
系统将会启动并提示登录,这时可以用'root'进行登录(不要加上单引号)。<br />
<br />
如果你的机器从live CD启动时发生错误或者一些其它'''硬件hardware'''错误,请参看[[Installation Troubleshooting]]。<br />
<br />
<br />
====登录并根据需要更换键盘映射表====<br />
如果你使用non-US键盘布局,可以用命令选择相应的键盘映射表。<br />
# km<br />
或者是是用loadkeys命令<br />
# loadkeys ''layout''<br />
(把''layout''替换成你需要的,比如 &quot;<code>fr</code>&quot; 或者 &quot;<code>be-latin1</code>&quot;)<br />
<br />
====边安装边查看安装指南====<br />
在刻录的livecd里面,已经包含了官方安装指南,在安装的时候可以边安装边查看,按组合键<ALT>+F2 切换到控制台vc/2(alt+f3,alt+f4……分别可以切换到对应的控制台vc/3,vc/4……以此类推),然后输入:<br />
<br />
# less /arch/docs/official_installation_guide_en<br />
<br />
按组合键<ALT>+F1回到控制台vc/1,继续安装系统。安装过程中可以随时切换回vc/2来查看安装指南。<br />
<code>less</code> 是个文本查看程序,位于<code>/usr/bin/less</code><br />
{{tip|请注意,官方指南仅涵盖基本系统的安装和配置过程。一旦安装完毕,强烈建议回到本wiki浏览更多安装后续已经相关问题。}}<br />
<br />
===三、开始安装===<br />
键入<br />
/arch/setup <br />
开始安装。<br />
<br />
====1、选择安装来源====<br />
接着会出现一个选择安装来源的提示。如果你用core ISO的话请选择CD,如果使用FTP ISO的话则选择FTP。<br />
* 如果选择 CORE installer,可以直接看下面的硬盘分区配置。<br />
* FTP/HTTP only: 选择这个需要预先加载网络驱动以便联网安装. 使用Udev来加载这些模块非常有效.<br />
按组合键ALT+F3切换到控制台vc/3,确认一下看其是否生效 invoking ifconfig -a . (Select OK to continue.) ——把后面的网络配置提前看<br />
<br />
====2、设置时间====<br />
有两个选择:<br />
* UTC - 如果使用unix系统包括Linux, Freebsd等, 建议使用UTC<br />
* local - 如果和Windows共享多引导系统, 建议使用local<br />
<br />
====3、硬盘分区配置====<br />
选择第一个菜单项"Prepare Hard Drive"。请注意,"Auto-Prepare"(自动分区)并不是最佳的选择,因为它只分配了最基本的三个区( /,/home,swap)<br />
在这里我们用手工进行硬盘分区。选择"2. Partition Hard Drives",接着选要分区的硬盘(比如:/dev/sdx),然后按你需要编辑分区表。<br />
<br />
''Arch Linux安装程序使用cfdisk公用程序来对硬盘进行分区。''<br />
<br />
''接下来,熟悉GNU/Linux的用户可以跳过这段内容直接到下面'''[[#选择软件包|选择软件包]]'''。''<br />
<br />
=====分区信息=====<br />
<br />
对磁盘进行分区是指在磁盘上定义若干区域(分区),每个都象是一个独立的磁盘,可以在其上创建(格式化)一个文件系统。 分区的类型分为主分区(Primary)、扩展分区(Extended)和逻辑分区(Logical)三类。 <br />
<br />
主分区可以被启动,一个物理磁盘最多能有4个主分区。要使用超过4个的话,只能使用一个包含了逻辑分区的扩展分区。<br />
(译者注:为避免误解,较易懂的解释应该是:一个磁盘不算逻辑分区最多只能有4个分区,这4个要么全是主分区,要么就是3个主分区+1个扩展分区,当然你将整个磁盘划为1个主分区也是没问题的,只要不超过4个分区即可)<br />
<br />
扩展分区通常不会被直接使用,它是作为逻辑分区的“容器”存在。一个硬盘只能有一个扩展分区,可以在里面继续再划分逻辑分区。<br />
<br />
当对一个磁盘进行分区时,是按这种数字顺序命名:主分区为sda1-3,跟着是扩展分区sda4(译者注:在/dev和fdisk -l里是看不到这个sda4的),在扩展分区中划分出来的逻辑分区分别是sda5、sda6,如此类推。<br />
<br />
=====交换分区swap=====<br />
交换分区Swap是虚拟内存在硬盘上驻留的地方,内核可以用它来储存在物理内存中放不下的数据。<br />
<br />
过去,常用的规则是将交换分区大小设置为物理内存的两倍。但是随着时间推移,现在的计算机已经有更大的内存容量,这条规则已经不适用了。通常,512MB内存的计算机,两倍(1G)的还是够用的。而1G内存的计算机,一倍的也够用了。如果你有更大的内存(比如超过1GB),也许可以完全把交换分区忘了,不推荐这样做!<br />
* ''如果你打算使用休眠到磁盘的电源方案,你必须要有不小于内存容量大小的交换分区,有些用户甚至会推荐大于物理内存容量15%的大小。''<br />
<br />
=====规划分区=====<br />
磁盘分区的规划是十分个人的设置。每位用户的决策都会根据自己计算机的情况和需求而不同。至少需要有一个包含了根[http://en.wikipedia.org/wiki/File_system 文件系统] ( / )的主分区和一个交换分区。你还可以选择给/boot(主要用来存放内核文件)、/usr、/var和/home(用来存放用户个人数据)划出独立分区。一个较好的做法是给 / 和 /home都划分独立分区。这样的话,当你因为某些原因重装Arch Linux(或者其它发行版),你还可以保留你的个人数据例如音乐、图片、桌面环境配置等。<br />
<br />
在本案例中,我们划分一个分区给 /,一个给/home,另外还有一个交换分区。<br />
<br />
=====开始创建分区cfdisk=====<br />
让我们开始创建一个包含'''root'''(/)文件系统的主分区。 <br />
<br />
选择'''N'''ew -> Primary,然后输入你希望的分区大小(对一个完整的Linux系统,4到8G是个不错的选择)。分区要位于磁盘的开头部分。选择刚新建的分区,接着选择'''B'''ootable将它置为可启动。<br />
<br />
同时选择分区文件系统类型'''T'''ype,指定为'83 Linux'.。<br />
<br />
给你的/home目录创建另一个分区。选择另外一个主分区设成你想要的容量大小,这取决于你的用户会在他们的home目录里储存多少文件,其大小可能从几百M办公文档到上百G音频视频,所以这里我无法给出一个建议。如果你要使用磁盘所有的剩余空间,记得保给交换分区留一部分(例如1GB或1024MB)。<br />
<br />
同样的,选择'''T'''ype为'83 Linux'。 <br />
<br />
最后,我们给交换分区创建一个分区。选择一个介于512MB到1GB之间的大小并将'''T'''ype改为82 (Linux swap / Solaris)。<br />
<br />
现在的分区规划看起来应该象这样(基于你的选择大小也许会有所不同):<br />
<br />
Name Flags Part Type FS Type [Label] Size (MB)<br />
-------------------------------------------------------------------------<br />
sda1 Boot Primary Linux (4096 - 8192)<br />
sda2 Primary Linux (> 100)<br />
sda3 Primary Linux swap / Solaris (512 - 1024)<br />
<br />
选择'''W'''rite并输入''''yes''''。要注意如果你删除了分区的话,这个操作会破坏你磁盘上的数据。选择'''Q'''uit退出分区程序。<br />
选择Done离开此菜单,接着选择"Set Filesystem Mountpoints"。<br />
<br />
=====IDE设备,为什么看起来它们和SCSI设备一样?=====<br />
最新开发的Linux内核里包含了libata和PATA模块,所有的IDE、SATA和SCSI都采用sd''x''这种命名方式。这十分正常,无需担心。<br />
<br />
=====设置文件系统挂载点=====<br />
<br />
''' ”文件系统格式(filesystems)“和”文件系统结构(file systems)“的区别:'''<br />
<br />
从技术层面确切的说,'''文件系统格式(filesystems)'''是一种数据'''格式''',涉及信息吞吐,比如ext2;而”文件系统结构(file systems)“则是特定操作系统中文件和目录的布局,比如/home/username/games。因此,当你被问及是否创建'''文件系统格式(filesystems)'''时,是在问你是否要'''格式化'''该分区…但是当程序向你问及挂载点时,你应该给出的则是该分区应该出现在你的Arch Linux ”文件系统结构“中的位置。<br />
<br />
'''文件系统类型:'''<br />
<br />
'''强烈建议:'''创建一个交换分区(SWAP)。选择一个合适的分区(本例中使用的是sda3). 安装程序就会询问你是否要创建swap 文件系统; 选择 yes. 接下来, 选择根分区的挂载点(本例中就是 sda1). 然后安装程序就会询问你需要哪一种文件系统。<br />
<br />
{{Box Note| 采用何种文件系统的类型取决于实际应用需要,没有十全十美的文件系统,选择任何一个文件系统,都需要在数据安全和性能要求方面作出适当倾斜,下面只是简单的介绍各种Arch linux支持的文件系统 }}<br />
<br />
1. '''ext2''' - 古老、 可靠的 GNU/Linux 文件系统。非常的稳定,不过 ''不支持日志记录功能''。磁盘检测速度较慢,因而有些不便. ''ext2可以容易地转换成ext3''。一般认为/boot分区采用此系统最合适,因为/boot里的东西就开机的时候读取一次,而且很少有变动,不需要日志文件系统,如果采用日志文件系统,日志的体积很可能远远大于内核的大小。<br />
<br />
2. '''ext3''' - 基于ext2系统, 并添加了日志记录功能。 一般认为他比其他文件系统要 ''稍微的'' 慢一点, 不过 ''非常的'' 稳定并且使用最为广泛,由 GNU/Linux FS 负责维护和开发。<br />
<br />
'''高性能文件系统:'''<br />
<br />
3. '''ext4''' - 最近加入支持的文件系统,是ext2和ext3的后续发展版本,Ext4增加了48位块地址,最大支持1EB文件系统,和单个16TB的文件,增加子目录限制到64,000。新增了很多功能,提供在线碎片处理,速度比ext3快,系统开销比ext3小。<br />
{{Box Note| 由于此系统较新,目前仍存在一些问题,暂时建议/home分区不采用此文件系统,以保证个人数据安全。}}<br />
<br />
4. '''ReiserFS''' - Hans Reiser 主持编写的高性能的日志文件系统,使用一种非常独特有趣的数据存储检索方法。ReiserFS 效率非常高, 特别在处理很多小文件的时候更是如此。ReiserFS在挂载的时候相对比较慢. 性能稳定。 ReiserFS 现在的开发并不活跃(最新的版本是Reiser4).<br />
<br />
5. '''JFS''' - IBM提供的日志文件系统( '''J'''ournaled '''F'''ile'''S'''ystem首字母缩写). JFS 效率非常高并且CPU资源占用率比其他任何一个文件系统都要低。并且在挂载和磁盘检测的时候都非常快,在各方面的表现都非常突出,尤其是 conjunction with the deadline scheduler. (参见 [[JFS]].) 但是并不像ext或者ReiserFS那样应用广泛。<br />
<br />
6. '''XFS''' - 非常高效的日志文件系统,特别适合处理大文件。在处理小文件的时候稍慢。在挂载的时候也很快。由于 /var 需要处理很多的小文件,所以可能不太适合作为/var 分区的文件系统。 GNU/Linux 文件系统中,最先实现可用的在线碎片处理。应用不及ext和ReiserFS那么广泛。<br />
* JFS 和 XFS 不能被磁盘工具压缩(比如gparted 或者 parted magic)<br />
<br />
'''未来文件系统'''<br />
<br />
7、btrfs - 此文件系统尚未被Arch纳入正式支持。是Oracle提供的copy-on-write档案系统。目标在取代的ext3,提高ext3单一档案的大小,总档案系统大小或档案检查,加入目前ext3未支援的功能,比如:writable snapshots,snapshots of snapshots,内建磁盘阵列(RAID)支援,and subvolumes。<br />
<br />
最主要的差别在于[http://en.wikipedia.org/wiki/Journaling_file_system 日志系统] (一种类似的在数据库环境中记录着日志变更的东西). 除ext2之外,其他文件系统都支持日志记录功能. ext3 完全兼容 ext2,因此哪怕你可以用一个非常古老的CD来挂载他,也没问题。 根分区目前最安全的选择就是使用ext3文件系统。ReiserFS,XFS,和JFS也可以使用,因为GRUB (启动引导管理器,稍候在安装部分将会介绍到) 都可以从这些文件系统中启动。你可以通过选择‘’‘yes’‘’来创建文件系统(并格式化分区),接着你就会被提示添加附加分区。 在我们的例子中, 只有sda2了。 选择一个文件系统类型,并且把这个分区挂在到/home. 再次说明,创建文件系统并且选择Done。然后回到主菜单。<br />
<br />
====4、选择软件包====<br />
现在我们要选择安装哪些软件包到系统中。选择CD作为来源,如果你不止一个光驱的话还需要选择使用哪个的光驱。<br />
<br />
软件包选择分为两个阶段。首先要选择软件包分类,然后出现所选分类中软件包的详细列表供你微调。使用空格键进行选择和取消。<br />
<br />
''*BASE:包含最小的软件包集合,仅够构建一个可运行的系统骨架。''<br />
''*SUPPORT:供网络和文件系统用的额外软件包,例如gpm、fuse、dnsutils、无线驱动、ndiswrapper、ntfs-3g诸如此类。''<br />
''*DEVEL:软件创建工具,如GCC、autoconf、automake和make等等。''<br />
''*LIB:大量的库文件,如gmp、lebelf、libevent等等。''<br />
*''' 2008.06 版'''的软件包选择,只有一个: BASE ,选择之后进入其详细列表. <br />
<br />
在这里,我们对'Select all packages by default'选择'yes'。<br />
<br />
接下来屏幕将显示你所选的软件包。对于新手,较安全的做法是不修改它,而有经验的用户可能希望裁减掉一些不需要的软件包。(例如,不需要的文件系统类型公用程序,不需要的驱动等等。)<br />
<br />
====5、安装软件包====<br />
接着,选择'Install Packages'。你会被询问是否希望保留pacman缓冲里的软件包。如果你选'yes',日后你还可以选择对某些软件包进行降级,因此推荐保留(日后你还是可以清除这些缓存的)。安装脚本跟着就会安装所选软件包到你的系统中。这些软件包是二进制的、针对i686优化的,总共仅100MB,因此安装是相当便捷的。<br />
<br />
====6、配置系统====<br />
系统接着会询问你是否要选择[[Hwdetect|hwdetect]]来收集配置所需信息。新手应该选择是('yes')。<br />
<br />
如果是相当熟悉自己的硬件、所需模块,有能力从零开始手动配置/etc/mkinitcpio和/etc/fstab 的高级用户,可以选择否'no'。(当然,此选项是非常复杂的,已经超过本指南的范围,这里就不详细解释了。)<br />
<br />
接下来,系统会询问你是否需要支持从USB设备、FireWire设备、PCMCIA设备、NFS共享、软RAID阵列、LVM2卷和加密卷上启动。如果需要则选'yes',在本案例中以上都不选。<br />
<br />
新手还应该选择让/etc/mkinitcpio/kernel26-fallback.conf使用[[Hwdetect|hwdetect]]的结果,这将确保你的硬盘控制器相容次序。<br />
<br />
现在系统会询问你使用哪个文本编辑器;如果你不熟悉[http://en.wikipedia.org/wiki/Vim_%28text_editor%29 vi/vim]的话可以选择[http://en.wikipedia.org/wiki/Nano_%28text_editor%29 nano]。然后就会出现一个包含系统中大部分重要配置文件的菜单。如果你打算查找/etc/rc.conf中可用的选项,只需按Alt+F2切换到另外一个虚拟控制台进行查找,然后用Alt+F1切换回安装程序。<br />
<br />
======系统配置主文件'''/etc/rc.conf'''======<br />
Arch Linux继承FreeBSD的传统,使用'''/etc/rc.conf'''作为系统配置的主要文件。这个文件包含了广泛的配置信息,主要用于系统的启动。正如名字中所包含的意思,它还包含了供/etc/rc*文件使用的配置。/etc/rc.conf提供了一个Arch用户可以轻易访问到的,简洁而又范围广泛的精简系统资源配置方案。<br />
* '''LOCALIZATION'''部分<br />
** '''LOCALE'''=: 系统场所(locale)设置,被所有国际化(i18n-aware)的应用程序使用 。从命令行上运行locale可以列出可用的locale设置。此设置缺省是适合英文(US English)用户使用的en_US.utf8。(此处locale的设置必须与/etc/locale.gen一致,'''[[#/etc/locale.gen|详见下文]]'''。)中文一般是zh_CN.UTF-8,如果使用之后乱码,先换回en_US.utf8,等进图形界面后再换回来。<br />
** '''HARDWARECLOCK'''=: 指示开关机时进行同步的硬件时钟,是'''UTC'''时间(协调世界时(Universal Time Coordinated), 过去曾用格林威治平均时(GMT)来表示)还是'''localtime'''(本地时间)。通常UTC较为好,因为它大大简化了时区和日光节约时间(中国过去称为夏时制)的变更。而当你同时还有其它操作系统如windows进行双启动,就必须使用localtime(本地时间),它只把本地时间保存到硬件时钟里。<br />
** '''TIMEZONE'''=: 时区(TIMEZONE)。(所有可用的时区可在/usr/share/zoneinfo/里找到。)<br />
** '''KEYMAP'''=: 可用的键盘映射表可在/usr/share/kbd/keymaps里找到。请注意此设定仅在TTY中有效,在所有图形窗口管理器或者X中都不使用此设置!<br />
** '''CONSOLEFONT'''=: 如果你一定要修改此设置,可在/usr/share/kbd/consolefonts/中找到可用的字体。<br />
** '''CONSOLEMAP'''=: 定义了启动时setfont程序加载的控制台映射表。有需要的话,可在/usr/share/kbd/consoletrans里找到可用的映射表。<br />
** '''USECOLOR'''=: 如果你使用彩色显示器的话请选"yes"。<br />
<br />
LOCALE="zh_CN.UTF-8"<br />
HARDWARECLOCK="localtime"<br />
TIMEZONE="Asia/Shanghai"<br />
KEYMAP="us"<br />
CONSOLEFONT=<br />
CONSOLEMAP=<br />
USECOLOR="yes"<br />
* '''HARDWARE'''部分<br />
** '''MOD_AUTOLOAD'''=: 如果你使用'''udev'''在启动时探测硬件并加载相应模块。请设置为"yes",(适合缺省模块化的内核)。设置为"no"就得靠用户自己指定所需的有关信息。<br />
** '''MOD_BLACKLIST'''=: 模块黑名单。在下面的例子中,IPv6模块和pcspeaker都被列入黑名单而不被加载。<br />
** '''MODULES'''=: 指示了其它模块,如果你知道缺少哪个重要的模块可以加在里面。('''hwdetect'''应该已经填写了最重要的模块):<br />
# Scan hardware and load required modules at bootup<br />
MOD_AUTOLOAD="yes"<br />
# Module Blacklist - modules in this list will never be loaded by '''udev'''<br />
MOD_BLACKLIST=(net-pf-10 pcspkr)<br />
#<br />
MODULES=(e100 eepro100 mii slhc snd-ac97-codec snd-intel8x0 soundcore)<br />
* '''NETWORKING'''部分<br />
** '''HOSTNAME'''=:设置为你喜欢的主机名(HOSTNAME)。<br />
** '''lo'''=: 不修改此行。<br />
** '''eth0'''=: 如果使用'''静态IP'''的话请调整网络接口的IP地址、掩码和广播地址。如果使用'''DHCP'''的话则设为eth0="dhcp"。<br />
** '''INTERFACES'''=: 指定使用哪些网络接口。如果你不使用DHCP来配置设备,而是通过命令行用ifconfig手动配置设备的话,这里的变量值(名字必须等于打算进行配置的设备名一样)必须和ifconfig里加入的内容一样。<br />
** '''gateway'''=: 如果你使用'''静态IP''',将网关(gateway)地址设为路由器的IP。如果使用DHCP,则将此行用'#'注释掉。<br />
** '''ROUTES'''=: 如果你使用'''静态IP''',则将'gateway'前面的'!'去掉。如果使用'''DHCP'''的话则不需要修改此行。<br />
<br />
<br />
例如,当使用'''DHCP''':<br />
HOSTNAME="arch"<br />
lo="lo 127.0.0.1"<br />
#eth0="eth0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255" <br />
eth0="dhcp"<br />
INTERFACES=(lo eth0)<br />
#gateway="default gw 192.168.0.1"<br />
ROUTES=(!gateway)<br />
* '''DAEMONS'''部分<br />
这个序列罗列了位于/etc/rc.d/里需要在启动过程中启动的脚本名字。<br />
<br />
*如果脚本名字前有惊叹号(!),表示它不被执行。<br />
*如果脚本名字前有符号(@),则表示它会在后台被执行,启动序列不会等待此脚本成功执行完毕,而是继续执行下一个守护进程脚本。<br />
<br />
这种'BSD风格'的初始化就是Arch的处理办法,而其它发行版则是在一个init.d目录里使用一大堆符号链接(一个简单的文件 vs 一整个目录)。<br />
<br />
======关于守护进程======<br />
虽然此时你不需修改[[daemons]]行,不过还是有必要解释一下什么是守护进程,因为过一会儿在指南里我们会需要它。<br />
<br />
和Windows服务(service)类似,守护进程(daemon)是一个运行于后台的程序,等待事件发生并提供服务。一个较好的例子是webserver等待请求以发送页面,还有SSH服务等待用户登录。这些都是全功能的程序,还有些守护进程工作起来并不是那么明显的。例如向日志文件里写信息的守护进程(如syslog、metalog),当系统空闲时降低CPU频率的守护进程(如cpufreq),以及提供图形化登录的守护进程(如gdm、kdm)。所有这些程序都可以被加入到daemons行中,在系统启动时被执行。本指南会对一些较有用的守护进程进行介绍。<br />
按Ctrl+X退出nano编辑器。<br />
<br />
======磁盘和分区配置文件:/etc/fstab======<br />
'''fstab''' ('''f'''ile '''s'''ystems '''tab'''le的缩写) 是系统配置的一部分,该文件列出所有可用的磁盘和分区,并指明它们初始化的方式或整合至全局文件系统的方式。'''/etc/fstab'''文件一般被'''mount'''命令读取,以决定某一特定设备被挂载时所采用的选项。<br />
<br />
这是一个'''/etc/fstab'''的例子:<br />
<br />
#<br />
# /etc/fstab: static file system information<br />
#<br />
# <file system> <dir> <type> <options> <dump> <pass><br />
none /dev/pts devpts defaults 0 0<br />
none /dev/shm tmpfs defaults 0 0<br />
#/dev/cdrom /mnt/cdrom iso9660 ro,user,noauto,unhide 0 0<br />
#/dev/dvd /mnt/dvd udf ro,user,noauto,unhide 0 0<br />
#/dev/fd0 /mnt/fd0 vfat user,noauto 0 0<br />
/dev/sda1 / jfs defaults,noatime,nodiratime 0 1 <br />
/dev/sda2 /home jfs defaults,noatime,nodiratime 0 2<br />
/dev/sda3 swap swap defaults 0 0<br />
Hwdetect应该已经有效地配置了一个可用的'''fstab''',但最好还是简要地检查一下。<br />
<br />
*如果你打算用'''hal'''来自动挂载DVD之类的媒体,为了给即将安装的'''hal'''做准备,你可能要注释掉cdrom和dvd条目。 <br />
<br />
''在笔记本电脑和桌面系统上,可以给 / 和 /home加上'noatime'和'nodiratime'选项来提高速度、性能,同时还能省电。无论你采用何种文件系统,这样做都应该是安全的。''<br />
<br />
更多信息请参照[[Fstab]]<br />
<br />
======'''mkinitcpio.conf、modprobe.conf和kernel26-fallback.conf'''======<br />
此时我们无须去修改这些配置文件。'''mkinitcpio.conf'''负责配置ramdisk(例如从RAID、加密卷启动), '''modprobe.conf'''可以用来设置内核模块的的某些配置选项,而'''kernel26-fallback.conf'''则是initramfs后备配置。<br />
<br />
======(对于静态IP)网络配置文件:/etc/resolv.conf ======<br />
*''如果你使用DHCP,完全可以忽略此文件,缺省情况下dhcpd守护进程会自动创建和销毁此文件。''<br />
<br />
如果你使用静态IP,则可在/etc/resolv.conf里设置你的DNS服务器。每行的格式为nameserver <ip地址>,如果有多个DNS服务器则可以填入多行。<br />
<br />
如果你使用路由器,也许会希望由你的路由器本身指定DNS服务器,而在'''resolv.conf'''里只是写入你的路由器的IP(同时也是'''/etc/rc.conf'''里的网关),例如:<br />
nameserver 192.168.1.1<br />
可选的,逐个加入你的DNS服务器,例如:<br />
nameserver 4.2.2.1<br />
nameserver 4.2.2.2<br />
<br />
如果使用'''DHCP''',你也可以在你的路由器里指定你的DNS服务器,或者如果你的ISP支持的话由ISP自动指定。<br />
<br />
======/etc/hosts======<br />
可以在此文件中加入你想要的''hostname'',必须和/etc/rc.conf里的设置一致,因此它应该象这样:<br />
127.0.0.1 localhost.localdomain localhost '''''yourhostname'''''<br />
''为了程序的兼容性,必须严格遵照这个格式,'''包括'localhost' 这项'''!错误的句法可能会导致网络性能低下和/或某些程序运行缓慢甚至无法运行。这对新手来说是十分普遍的错误。''<br />
<br />
对于大部分用户,只要把''yourhostname''加入到行末就就可以了,不过有些用户推荐以下句法:<br />
127.0.0.1 '''''yourhostname'''''.domain.org localhost.localdomain localhost '''''yourhostname'''''<br />
如果你使用静态IP,可以用这种句法加入新行:<static-ip> hostname.domainname.org hostname,例如:<br />
192.168.1.100 '''''yourhostname'''''.domain.org '''''yourhostname'''''<br />
<br />
======/etc/hosts.deny和/etc/hosts.allow======<br />
如果你打算使用[[SSH|ssh]]的话,请根据自己的需要修改此配置。缺省设置是拒绝所有进入的连接,而不只是ssh连接。编辑'''/etc/hosts.allow '''文件加入:<br />
<br />
* 允许所有进入的ssh连接。<br />
sshd:all <br />
<br />
* 允许特定IP地址进入ssh连接。<br />
sshd: 192.168.0.1<br />
<br />
* 允许你指定的网段 (地址从 192.168.0.0 到 192.168.0.255)<br />
sshd: 192.168.0.<br />
<br />
* 允许某个IP地址范围<br />
sshd: 10.0.0.0/255.255.255.0<br />
<br />
如果你不打算使用[[SSH|ssh]],为安全起见请保持此文件的缺省设置(为空)。<br />
<br />
======/etc/locale.gen======<br />
<br />
'''locale-gen''' 命令从 '''/etc/locale.gen'''读取信息设定系统的locales. 这些设置稍后会被'''glibc''' 和其他一些支持本地化的程序或者库用于自动翻译输出各种语言的"独特" 文本, 并且合适的显示地域、货币、时区以及日期格式, 字符排列方式和其他一些本地化的特殊标准。设置默认本地化的功能是类<code>UNIX</code>操作系统的一大特质<br />
<br />
默认情况下 /etc/locale.gen 是一个仅包含注释文档的空文件.编辑后,这个文件将不会get touched again. 每次'''glibc'''更新之后'''locale-gen'''就会运行一次, 以在/etc/locale.gen重新生成所有的本地化设置.<br />
<br />
选定你需要的本地化类型(移除前面的#即可), 比如:<br />
en_US ISO-8859-1<br />
en_US.UTF-8 <br />
('''你这里的设置必须和上文中提到的/etc/rc.conf 的设置一致哦.''')<br />
<br />
现在,安装程序将运行locale-gen 脚本, 以生成你设定的locales。你以后可以通过修改文件/etc/locale.gen变更你的locale, 然后使用根用户(root)运行'locale-gen'脚本使之生效。<br />
<br />
''Note 如果你选择并设置了locale, 他将提示你 "The current locale is invalid..." 错误。可能是因为大多数新Arch用户都会犯的普遍的错误,也是在论坛中问得最多的问题。''<br />
<br />
======Root密码======<br />
最后,设置一个root密码并确定你已牢记它。返回主菜单然后接着安装启动加载器。<br />
<br />
======Pacman镜像======<br />
为'''pacman'''选择一个镜像软件仓库。记住主站 archlinux.org 是有流量限制的,下载速度限于50KB/s.。<br />
<br />
*''如果你不熟悉现有的镜像和它们所处的位置,那就随便选一个。稍后你可以运行本指南后面提到的'''rankmirrors'''脚本,它将自动配置最接近你的镜像。''<br />
<br />
返回主菜单。<br />
<br />
====7、安装启动加载器====<br />
因为本案例中没有第二个操作系统,因此我们需要安装一个启动加载器。推荐选择[http://www.gnu.org/software/grub/ GNU GRUB]作为启动加载器。另外一种选择是[http://lilo.go.dyndns.org/ LILO]。缺省的'''GRUB'''配置('''/boot/grub/menu.lst''')应该足够了。唯一你可能想修改的是控制台的分辨率。将vga=<number>加入到第一个kernel行。(menu.lst中已列出一张分辨率和数字的对应表格可供查找。)<br />
title Arch Linux (Main)<br />
root (hd0,0)<br />
kernel /boot/vmlinuz26 root=/dev/sda1 ro vga=773<br />
initrd /boot/kernel26.img<br />
参数"vga=773"表示1024x768分辨率、256色的framebuffer。<br />
<br />
将'''GRUB'''启动加载器安装到主引导区(本例中为sda)。<br />
<br />
====8、系统重启====<br />
退出安装程序。<br />
*建议:为了方便接下来更进一步的安装配置,可以把光盘里的新手指南复制一份到电脑里,这样后面的安装就能查看相应的向导了<br />
<br />
cp /arch/beginnersguide.txt /mnt/home/beginnersguide.txt<br />
<br />
系统重启之后,进入控制台,可以使用下面命令查看这新手指南<br />
less /home/beginnersguide.txt<br />
所有安装完毕之后,可以删了这指南<br />
rm /home/beginnersguide.txt<br />
<br />
输入命令下面命令,重启:<br />
<br />
reboot<br />
<br />
一个新Arch Linux系统就会启动并进入登录提示符(你可能需要在'''BIOS'''将启动顺序改为优先从硬盘启动)。<br />
<br />
'''祝贺你,一个崭新的Arch Linux基础系统闪亮登场了!'''<br />
<br />
==第二部分:完成基本系统并升级==<br />
你的新Arch Linux基础系统现在已是一个功能完整的GNU/Linux环境了,随时可以进行定制。从现在开始,你可以按自己的意图和需求改造它。由于arch是滚动发布的,所以安装包不一定是最新的系统,所以我们在安装完成之后,需要立即更新系统。<br />
<br />
让我们开始吧。<br />
-----<br />
登录入你的root账号。我们将以root身份配置pacman和更新系统,然后创建一个普通用户账号。<br />
<br />
===一、配置网络(如果有需要)===<br />
*''如果安装脚本的自动配置不适合你,本段内容将帮助你配置大部分类型的网络。''<br />
-----<br />
如果一切正常的话,你的网络应该可以正常使用了。先ping www.google.com验证一下:<br />
ping -c 3 www.google.com<br />
<br />
''如果你已经成功建立网络连接,则跳到下面阅读[[#使用pacman更新、同步、升级系统|使用pacman更新、同步、升级系统]]'''。''<br />
<br />
如果ping www.google.com后得到"unknown host"的错误,可以认为你的网络尚未正确配置。你需要重新检查以下内容的完整性和正确性:<br />
'''/etc/rc.conf''' # 特别留意HOSTNAME= 和 NETWORKING 部分有无输入错误。<br />
<br />
'''/etc/hosts''' # 复核一下格式。(看之前的内容。)<br />
<br />
'''/etc/resolv.conf''' # 当你使用静态IP时需要检查。如果你使用DHCP,缺省这个文件会被自动创建和销毁,不过也可以改为你需要的内容。(参见[[Network]]。)<br />
<br />
高级的网络配置方法可以在[[Network]]一文中找到。<br />
<br />
=====有线网络=====<br />
<br />
用以下命令检查网络<br />
ifconfig<br />
你应该看到eth0这一项。如果有需要,你可以这样设置一个新的静态IP:<br />
ifconfig eth0 <ip address> netmask <netmask> up <br />
并且这样设置缺省网关:<br />
route add default gw <ip address of the gateway><br />
查看一下/etc/resolv.conf是否包含你的DNS服务器,不过缺失了则补填进去。<br />
再次用ping www.google.cn检查一下网络。如果一切正常,将/etc/rc.conf调整为刚才新设置的静态IP。如果你的网络使用DHCP服务器/路由器的话,输入:<br />
dhcpcd eth0<br />
如果这样可行的话,则将/etc/rc.conf按之前所述方法调整为动态IP。<br />
<br />
=====无线网络=====<br />
详见安装指南:[[无线设置 (简体中文)|无线设置]]<br />
<br />
=====Analog Modem=====<br />
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.<br />
Tip: Read [[Dialup without a dialer HOWTO]].<br />
<br />
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 [http://www.linmodems.org/ LinModem] homepage.<br />
<br />
=====ISDN=====<br />
<br />
通过三步,完成 ISDN 的安装和配置:<br />
# 安装配置固件Install and configure hardware<br />
# 安装配置ISDN 管理工具<br />
# 添加ISP信息<br />
<br />
现在的 Arch stock kernels 已经包含了ISDN 所需要的modules, 所以不需要重新去编译内核,除非 you're about to use rather odd ISDN hardware. 把ISDN卡插入电脑或者插入USB ISDN-Box之后,you can try loading the modules with modprobe. 绝大部分的ISDN PCI 卡都能被module hisax处理,只需要两个参数:类型和协议。 如果使用的是1TR6标准,则协议设定为 '1' ,如果使用的是EuroISDN (EDSS1),协议设定为 '2', '3' if you're hooked to a so-called leased-line without D-channel, 如果使用的是US NI1,则设为'4'.<br />
<br />
所有配置细节都可以在kernel documentation, more specifically in the isdn subdirectory, and available online中获知。 类型的参数是根据电视卡来设定的,在README.HiSax kernel documentation中,有一个可能类型的列表。 用相应的参数加载moduleChoose,比如这个:<br />
<br />
modprobe hisax type=18 protocol=2<br />
<br />
这个将加载适用于电视卡类型为ELSA Quickstep 1000PCI,德国使用的EDSS1协议的模块hisax。可以在日志文件/var/log/everything.log中查看是否模块被预加载。额外的USB ISDN Adapter需要加载些USB模块才能正常工作。<br />
<br />
通过上述设定之后,如果电视卡能正常工作,那么把下面模块和参数加入/etc/modprobe.conf中:<br />
<br />
alias ippp0 hisax<br />
options hisax type=18 protocol=2<br />
<br />
这么做的好处是,这些模块在不使用时不会被加载。另外的方法是可以在这只加参数,把hisax加入/etc/rc.conf里面的MODULES,这样做的坏处就是不管这些模块是不是在使用,都加载了。 <br />
<br />
完成上述步骤之后,需要安装管理工具<br />
<br />
安装软件包isdn4k-utils,阅读关于isdnctrl的说明手册。在说明手册里,将有详细的说明:如何创建一个配置文件that can be parsed by isdnctrl,安装实例。 Please note that you have to add your SPID to your MSN setting separated by a colon if you use US NI1.<br />
<br />
使用isdnctrl utility配置ISDN卡之后,将可以拨号到你设定的PHONE_OUT参数的机器上,但提示用户名和密码错误。把用户名和密码加入到/etc/ppp/pap-secrets或者/etc/ppp/chap-secrets,这个主要根据的是你的ISP使用的协议授权方式,as if you were configuring a normal analogous PPP link。如果无法确定,可以两个文件都加。<br />
<br />
完成上述设定之后,用root帐号建立一个拨号连接:<br />
isdnctrl dial ippp0<br />
有啥问题,请检查日志文件!<br />
<br />
=====DSL (PPPoE)=====<br />
<br />
仅当需要你的计算机去主动拨号连接ISP的情况下才需参考本段内容。如果你使用独立的路由器来负责这类工作,你只需要设置一个缺省网关即可。<br />
<br />
在使用DSL连接前,你得先在计算机里安装一个连接到DSL-Modem的网卡。将你新装网卡加入到modules.conf/modprobe.conf或者MODULES列表之后,安装rp-pppoe软件包并运行pppoe-setup脚本来配置你的连接。当你输入完有关信息后,可以分别通过以下命令来进行连接和挂断:<br />
<br />
/etc/rc.d/adsl start<br />
<br />
和<br />
<br />
/etc/rc.d/adsl stop<br />
<br />
setup过程一般都是很容易、直观的,如果还有不懂可以阅读man手册。如果你想在启动时自动拨号,可以将adsl加入到DAEMONS列表中。<br />
<br />
<br />
===二、更新Pacman===<br />
<br />
====pacman是什么?====<br />
[[Pacman]]是Arch Linux的软件包管理器('''pac'''kage '''man'''ager)。Pacman是用C语言编写的,速度快,使用简便,功能强大。它可以管理整个软件包系统,负责软件包的安装、删除、降级(通过缓存),也支持自编译的软件包,自动分析依赖关系,可以搜索远程和本地软件仓库,还有大量其它功能。这里我们将用pacman来从远程软件仓库下载软件包并安装到系统中。<br />
<br />
对系统进行定制,pacman是Arch Linux最重要工具。<br />
<br />
====1、配置pacman====<br />
=====pacman总配置文件/etc/pacman.conf=====<br />
Arch通过pacman可以获得对下面 4软件仓库的管理:<br />
<br />
'''[core]'''<br />
<br />
[core](“核心”)仓库的简单原则是只提供一个基本的Arch Linux的基本工具:GNU系列工具,Linux内核,一个文字编辑器,一个命令行浏览器等(这里也有一些例外。比如说,vi和nano是同时提供的,允许用户选择一个或两个)。它包含所有使你的系统正常运转的“必须”安装的包,只有它们完美地工作,你的系统才能继续运行。这些是绝对“system-critical”(对系统来说至关重要)的包。由开发者负责维护。<br />
<br />
*''Core安装媒介(The Core installation media)简单地包含一个安装脚本,一个当前发布版本的核心仓库的快照(snapshot)。''<br />
<br />
'''[extra]'''<br />
<br />
[extra](“额外的”)仓库包含所有的对于一个基本的Arch系统不是必须,但是对于构建一个完整的系统环境有用的的Arch包。 比如'''X''', KDE和Apache,都可以在这里面找到。它也是由开发者维护的。<br />
<br />
'''[testing]'''<br />
<br />
[testing](“测试”)仓库包含的包是[core]和[extra]仓库的候选者。<br />
下面情况下,新的软件包将进入[testing]软件仓库:<br />
* 可能会导致系统出问题的升级,需要测试。<br />
* 需要重新打包其他软件包。这种情况下,所有需要重新打包的软件包将被放在[testing]仓库,直到所有重新打包完成,这些软件包才回归原有的软件仓库。 <br />
<br />
开发者维护。<br />
<br />
[testing]是唯一的一个在名义上与其它官方仓库有冲突的仓库。(that can have name collisions with any of the other official repositories. )<br />
<br />
<font color=&quot;blue&quot;>*如果开启, [testing]必须放在''pacman.conf''的软件仓库的第一个。</font><br />
<br />
<font color=&quot;red&quot;>'''警告''': '''''开启[testing]软件仓库,容易导致系统崩溃,因此只建议有经验的用户开启。'''''</font><br />
<br />
'''[community]'''<br />
<br />
[community](“社区”)仓库是由“信任用户”(''Trusted Users (TUs)'')维护的,是''Arch User Repository ([[AUR]])''(Arch用户仓库)的一部分。它包含的是二进制的包,在用户仓库中有足够的“票数”,并由''信任用戶''挑选出来的。像其它上面列出的仓库一样,[community] 可以用pacman获取。<br />
<br />
'''[[AUR]]''' 也包含'''unsupported''' 分支,这不能直接通过pacman获取。*. [unsupported] 包含多达海量PKGBUILD脚本,用来从源代码编译。这从其它仓库中是不能使用的。 <br />
<br />
<nowiki>*</nowiki> '''''[[AUR Helpers]]''''' 能帮助你无缝地使用AUR。<br />
<br />
'''/etc/pacman.conf'''<br />
<br />
每次调用pacman,它都会读取/etc/pacman.conf文件。这个配置文件分若干段,每一段定义了一个pacman用来搜索软件的仓库。唯一例外的是options段,它定义了全局选项。<br />
nano /etc/pacman.conf<br />
范例:<br />
#<br />
# /etc/pacman.conf<br />
#<br />
# See the pacman.conf(5) manpage for option and repository directives<br />
<br />
#<br />
# GENERAL OPTIONS<br />
#<br />
[options]<br />
# The following paths are commented out with their default values listed.<br />
# If you wish to use different paths, uncomment and update the paths.<br />
#RootDir = /<br />
#DBPath = /var/lib/pacman/<br />
#CacheDir = /var/cache/pacman/pkg/<br />
#LogFile = /var/log/pacman.log<br />
HoldPkg = pacman glibc<br />
# If upgrades are available for these packages they will be asked for first<br />
SyncFirst = pacman<br />
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u<br />
#XferCommand = /usr/bin/curl %u > %o<br />
<br />
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup<br />
#IgnorePkg =<br />
#IgnoreGroup =<br />
<br />
#NoUpgrade =<br />
#NoExtract =<br />
<br />
# Misc options (all disabled by default)<br />
#NoPassiveFtp<br />
#UseSyslog<br />
#ShowSize<br />
#UseDelta<br />
#TotalDownload<br />
#<br />
# REPOSITORIES<br />
# - can be defined here or included from another file<br />
# - pacman will search repositories in the order defined here<br />
# - local/custom mirrors can be added here or in separate files<br />
# - repositories listed first will take precedence when packages<br />
# have identical names, regardless of version number<br />
# - URLs will have $repo replaced by the name of the current repo<br />
#<br />
# Repository entries are of the format:<br />
# [repo-name]<br />
# Server = ServerName<br />
# Include = IncludePath<br />
#<br />
# The header [repo-name] is crucial - it must be present and<br />
# uncommented to enable the repo.<br />
# <br />
<br />
# Testing is disabled by default. To enable, uncomment the following<br />
# two lines. You can add preferred servers immediately after the header,<br />
# and they will be used before the default mirrors.<br />
#[testing]<br />
#Include = /etc/pacman.d/mirrorlist<br />
<br />
[core]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
[extra]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist <br />
<br />
[community]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
# An example of a custom package repository. See the pacman manpage for<br />
# tips on creating your own repositories.<br />
#[custom]<br />
#Server = file:///home/custompkgs<br />
要开启一个软件仓库,只需要将'Include ='和'[repository]'行前的注释符号(#)去除。<br />
<br />
*"Server ="行如果取消注释,将会强制此服务器被首先搜索,详细的仓库配置位于/etc/pacman.d/下。<br />
* 注意:选择仓库时,请确认将仓库名和'Include ='行都一同取消注释。没有这样做的话会导致你选择的仓库被忽略!这是个很普遍的错误。<br />
<br />
=====(如果有必要)配置镜像列表 /etc/pacman.d/mirrorlist=====<br />
更快的镜像能显著改善pacman的性能和你对Arch Linux的总体体验。<br />
<br />
*手动编辑/etc/pacman.d/mirrorlist:<br />
nano /etc/pacman.d/mirrorlist<br />
删除所有不在你所在洲或者太远的镜像。(在nano里你可以用CTRL-K删除每个不需要的行。)保存文件并退出。<br />
<br />
*'''rankmirrors'''脚本可以根据镜像的响应延迟对其自动排名。'''Rankmirrors'''是python脚本,需要安装python:<br />
<br />
pacman -S python<br />
<br />
然后,运行'''rankmirrors'''脚本按响应延迟顺序对镜像进行排名:<br />
rankmirrors -v /etc/pacman.d/mirrorlist<br />
输出会列出所有镜像和它们的响应延迟(ping),例如:<br />
<br />
# United States<br />
# http://mirrors.easynews.com/linux/archlinux/$repo/os/i686 ... 0.96<br />
# ftp://ftp.nethat.com/pub/linux/archlinux/$repo/os/i686 ... unreachable<br />
# ftp://locke.suu.edu/linux/dist/archlinux/$repo/os/i686 ... 2.43<br />
# ftp://mirrors.unixheads.org/archlinux/$repo/os/i686 ... 1.96<br />
<br />
脚本将从低到高的响应延迟顺序显示:<br />
Server = http://mirrors.easynews.com/linux/archlinux/$repo/os/i686<br />
Server = ftp://mirrors.unixheads.org/archlinux/$repo/os/i686<br />
Server = ftp://locke.suu.edu/linux/dist/archlinux/$repo/os/i686<br />
Server = ftp://ftp.nethat.com/pub/linux/archlinux/$repo/os/i686<br />
<br />
要注意的是这个结果对于镜像排列并非很精确,最接近你的镜像或者延迟最低的镜像并不一定是最佳选择。(反应迅速但是内容过时的镜像、或者低延迟但是窄带宽的镜像对你毫无用处)。<br />
<br />
编辑/etc/pacman.d/mirrorlist,将最佳的镜像置于在列表顶端。为了体验多个镜像你可能要不断修改此配置文件,请精明地选择。<br />
<br />
====常用的命令====<br />
<br />
与远程软件仓库同步和更新本地包数据库 (推荐在安装和更新包之前这样做):<br />
pacman -Sy<br />
<br />
'''升级'''系统中所有的包:<br />
pacman -Su<br />
<br />
一条同步、更新、'''升级''' 所有系统中的包的命令:<br />
pacman -Syu<br />
<br />
安装或者升级单个软件包或者一串包(包括其依赖包):<br />
pacman -S packageA packageB<br />
<br />
同步、更新数据库并安装软件包:<br />
pacman -Sy packageA packageB<br />
<br />
移除软件包, 但保留依赖的包:<br />
pacman -R package<br />
<br />
移除单个包,并且移除没有被别的软件依赖的依赖包:<br />
pacman -Rs package<br />
<br />
移除包所有不需要的依赖包并删除其配置文件:<br />
pacman -Rsn package<br />
<br />
通过给定关键词(列表)搜索远程软件仓库数据库(repo):<br />
pacman -Ss keyword<br />
<br />
列出系统中所有的包<br />
pacman -Q<br />
<br />
在本地包数据库搜索 (查询)指定软件包:<br />
pacman -Q package <br />
<br />
在本地包数据库搜索 (查询)指定软件包并列出相关信息:<br />
pacman -Qi package<br />
<br />
To defragment pacman的数据库缓存和速度优化选项:<br />
pacman-optimize<br />
<br />
统计当前系统中的包数量:<br />
pacman -Q | wc -l<br />
<br />
使用ABS和makepkg从源代码编译安装包:<br />
pacman -U packagename.pkg.tar.gz<br />
<br />
Note: pacman有很多很多的选项和功能组合。你可以试试man pacman或者查阅lt the [[pacman]]维基条目<br />
<br />
====软件包管理增强工具====<br />
* Yaourt 可查询aur的pacman增强工具<br />
* Tupac 快速查询的yaourt增强工具<br />
* Powerpill 多进程下载的pacman增强工具<br />
{{Box Note| 强烈建议更新系统完毕后,安装yaourt和powerpill,以便更充分享受Arch Linux的方便和强大。}}<br />
在/etc/pacman.conf文件里,最后添加两行(如果是i686的话,把x86_64换成i686即可):<br />
[archlinuxfr]<br />
Server = http://repo.archlinux.fr/x86_64<br />
然后使用pacman安装yaourt<br />
pacman -Sy yaourt<br />
<br />
以后就可以使用yaourt命令来查找并安装包括[[AUR]]里的软件了。比如bcm无线网卡,需要安装b43-firmware(此软件包在[[AUR]]仓库里,使用pacman无法查找到),使用yaourt命令查找并安装:<br />
yaourt b43-firmware<br />
找到之后,根据相应提示,一直到安装完成。<br />
<br />
====图形化管理工具====<br />
* qt界面的shaman:比较成熟的pacman 图形化管理工具<br />
* gtk界面的gtkpacman :目前BUG比较多,不稳定。<br />
<br />
====Pacman的更多信息====<br />
用此命令查看pacman手册:<br />
man pacman<br />
有空的话可以看看[[pacman (简体中文)]]维基条目。<br />
<br />
====2、更新Pacman自己====<br />
<br />
一开始,系统可能会提示你先更新pacman自身,这取决于Arch安装包的新旧程度:<br />
pacman -Sy pacman<br />
pacman开始查看是否需要更新,如果有提示需要更新,则按‘y’,开始pacman更新。<br />
<br />
'''''有时候,还需要用户主动修改某些配置;请仔细阅读升级过程中的输出获取相关信息。'''''<br />
<br />
===三、更新系统===<br />
====使用[[pacman (简体中文)|pacman]]====<br />
现在我们要用[[pacman (简体中文)|pacman]]来更新系统。要更新、同步并'''升级'''你的系统,可以使用命令:<br />
pacman -Syu<br />
pacman就会获取所有最新可用软件包信息并进行升级。(此时你可能会被提示先升级pacman自身。如果是这样,回答'yes',然后在完毕后再运行一次pacman -Syu命令。)<br />
<br />
===='''滚动发布'''之美====<br />
Arch是一个'''rolling release'''(滚动发布)的发行版。这意味着没有必要重新安装或执行完整的系统重建来升级到最新版本。只需要执行'''pacman -Syu''',就能保持你的系统更新到最新和bleeding edge(表示最新的、因而也并非完美的技术)。<br />
<br />
===四、增加一个用户并设置用户组===<br />
用root账号来处理日常工作是很危险的。Root是用来处理系统管理的任务。我们可以用以下命令增加一个普通用户账号:<br />
adduser<br />
大部分缺省选项都是没问题的,你可能还需要将storage、audio、video、optical和wheel加入到你的用户组中 ── 特别是在你打算使用一个完整功能的桌面环境的情况下。<br />
<br />
用户组和用户的关联定义在/etc/group文件中: <br />
<br />
它包含了:<br />
<br />
*'''audio''' - 关于声卡和相关软件的任务<br />
<br />
*'''wheel''' - 给sudo使用<br />
<br />
*'''storage''' - 负责存储设备<br />
<br />
*'''video''' - 视频任务和3D加速<br />
<br />
*'''optical''' - 和光驱有关的任务<br />
<br />
*'''floppy''' - 软驱访问<br />
<br />
*'''lp''' - 打印任务<br />
<br />
请参看[[Groups]]一文了解你应该属于哪些用户组。<br />
你还可能需要将你的用户账号加入到以下用户组(需要以root身份运行此命令):<br />
usermod -aG audio,video,floppy,lp,optical,network,storage,wheel,dbus,hal USERNAME<br />
详情可看usermod和gpasswd的man手册。<br />
<br />
===五、安装建立Sudo (可选)===<br />
安装Sudo:<br />
# pacman -S sudo<br />
以root身份,运行命令visudo,把用户加入sudo用户 (a &quot;sudoer&quot;).如果不知道怎么使用vi,你可以在用visudo前设置EDITOR环境变量为你喜欢的编辑器。例如:<br />
# EDITOR=nano visudo<br />
如果你对于用vi很适应,去掉EDITOR=nano这个变量就行:<br />
# visudo<br />
这命令将在一个特殊的vi会话中打开文件 /etc/sudoers 。visudo复制文件到一个可编辑的临时文件中,用一个编辑器编辑它(vi是默认的),接下来运行一个安全检查(“sanity check”)。如果通过,这个临时文件就有正确的权限将重写的原始文件。t<br />
<br />
<font color=&quot;red&quot;>'''注意:不要直接用编辑器编辑 /etc/sudoers ; 否则会出现这样的提示:Errors in syntax can cause annoyances (像root帐户不能使用的描述一样)。 必须使用 ''visudo'' 命令来编辑 /etc/sudoers.'''</font><br />
<br />
当用户输入以 &quot;sudo&quot;, 作为开始的命令行时,临时授予该用户root权限。加入下面一行:<br />
USER_NAME ALL=(ALL) ALL<br />
USER_NAME 就是单个用户名。<br />
<br />
更多信息,比如按<TAB> 自动命令补全,请见[[Sudo]]<br />
<br />
==第三部分:安装X并配置ALSA==<br />
一共有三步工作:<br />
*1、安装声卡驱动<br />
*2、安装x-window(包括显卡驱动)<br />
*3、配置X<br />
<br />
{{Box Note | '''在热插拔未配置正确的情况下,或者是/etc/rc.d/hal未启动的情况下,请不要启动开启X(包括重启使用gdm或者kdm登陆),否则可能导致鼠标键盘失去响应!!!'''}}<br />
<br />
===一、配置声卡:使用alsamixer===<br />
高级Linux声音架构(Advanced Linux Sound Architecture,简称ALSA)是一个Linux内核组件。它替换了原有的开放声音系统(OSS),为声卡提供了设备驱动。除了声音设备驱动以外,'''ALSA'''还给应用程序开发人员提供了一个用户空间库,可使更高级的API无需直接与内核驱动打交道就能使用驱动功能。<br />
<br />
{{Box Note| Alsa已经包含进最新的内核kernel,udev 将在系统启动时自动检测硬件,并自动根据声卡加载相应的内核模块。虽然声卡已经在工作,但电脑的声音默认是静音。}}<br />
{{Box Note| OSS4.1已经放出,相对于老的版本,这是一个显著的提升的版本,如果使用ALSA有问题, 或者是想尝试新的功能,可以使用 OSS4.1。 相关说明可见: [[OSS]]}} <br />
<br />
Alsa-utils软件包里的alsamixer让我们可以从命令行来配置声音设备。(你也可以稍后在'''X'''环境中使用alsamixer。)<br />
默认情况下,内核加载模块snd_pcsp,这是一个alsa pc speaker模块。 snd_pcsp通常先于&quot;你实际的&quot;声卡模块加载。大部分情况下,这模块最后加载更好,因为可以让alsamixer正确控制需要的声卡。<br />
<br />
在/etc/modprobe.conf中加入这行,可以使得snd_pcsp最后加载:<br />
options snd-pcsp index=2<br />
<br />
当然,如果你不想让snd_pcsp加载,可以把它放入黑名单,或者是在/etc/rc.conf的Modules里禁止它:<br />
MODULES=(... !snd_pcsp)<br />
<br />
{{Box Note | 想要生效,需要释放并重新加载所有声音模块,当然,系统重启就可以简单解决这问题。 }}<br />
<br />
* 安装alsa-utils软件包:<br />
pacman -S alsa-utils<br />
<br />
* 为了解决Alsa声卡独占问题,可以安装alsa-oss:<br />
# pacman -S alsa-oss <br />
<br />
* 把你的普通用户账号加入到audio用户组中:以root身份,运行<code>/usr/bin/gpasswd</code>程序:<br />
gpasswd -a yourusername audio<br />
*以普通用户身份运行: <br />
alsamixer<br />
用左右光标键移动到Master和PCM声道上,按'''M'''取消掉静音。用向上键增加音量。(70-90的音量是较合适的范围)按ESC键离开alsamixer。<br />
有'''Speaker'''的,需要同时取消静音并调整之. <br />
<br />
====测试声音====<br />
以普通用户身份,使用 <code>/usr/bin/aplay</code>程序来测试你的声音配置:<br />
aplay /usr/share/sounds/alsa/Front_Center.wav<br />
你应该会听到一个女性声音说:“Front,center。”<br />
<br />
====保存声音配置====<br />
以root身份运行<code>/usr/bin/alsactl</code> :<br />
alsactl store<br />
这将创建'/etc/asound.state'文件,用来保存alsamixer的设置。<br />
<br />
为了每次启动都可以自动恢复混音器设置,可将守护进程''alsa''加入到你的/etc/rc.conf中的DAEMONS列表。<br />
nano /etc/rc.conf<br />
DAEMONS=(syslog-ng network crond '''alsa''')<br />
''注意,alsa守护进程在启动过程中仅仅是恢复音量设置。它和alsa音频库(和内核级API)是完全不同的。''<br />
<br />
更多详情请参看[[ALSA 安装设置 (简体中文)|ALSA 安装设置]]。<br />
<br />
===二、安装X===<br />
'''X''' 窗口系统(一般叫'''X11'''或者更简单的叫'''X''') 是一个网络互动和显示服务,提供位图显示器窗口. 提供标准化工具包(toolkit)和协议,用于<code>UNIX</code>类操作系统,构建一个图形界面(GUIs) <br />
<br />
'''X''' 提供最基本、基础的框架,用于构建一个图形操作界面环境。包括:绘图、屏幕窗口移动,与鼠标或者键盘的交互。 '''X''' 并不负责用户交互界面的部分:有独立的客户端程序负责处理这部分。 比如gnome、kde。<br />
<br />
'''X''' 因为它先于'''W'''窗口系统,最初由斯坦福大学开发。 <br />
<br />
*''注意: 如果想使用一个'''开源''' 显卡驱动, 需要3d加速,强烈建议在安装Xorg之前安装库 libgl :''<br />
pacman -S libgl<br />
''(拥有专利的视频驱动提供它们自己的gl库安装(implementations).)''<br />
----- <br />
====1、安装X====<br />
构建一个GUI的第一步:用pacman来安装Xorg包.<br />
<br />
# pacman -S xorg<br />
对于新版的xorg,建议(可能大部分情况下是必须的)安装输入设备驱动evdev。它本来应该作为xorg-server的一个依赖被安装的,不过不知道为什么貌似缺失了:<br />
# pacman -S xf86-input-evdev<br />
3d的工具比如glxgears包含在包'''mesa''' 里(如果需要,也安装):<br />
# pacman -S mesa<br />
<br />
====2、安装显卡驱动====<br />
到这一步,已经有了运行'''X''' Server的基本软件包,接下来需要把显卡的驱动安装到电脑里(e.g. xf86-video-<name>). 最简单的X.org配置方法就是安装正确的驱动包,然后使用自动脚本对 /etc/X11/xorg.conf 进行初始化,比如使用 Xorg -configure(arch团队提供hwd工具,但据以前用户的反映,这个现在还老出问题,新手可以使用,以后有能力再配置其他).<br />
<br />
如果不知道显卡类型,输入下面命令:<br />
lspci | grep VGA<br />
<br />
输入下面命令,查看所有'''开源'''驱动: <br />
pacman -Ss xf86-video | less<br />
<br />
下面是一个'''开源'''的显卡列表和相关说明:<br />
*'''xf86-video-apm''' Alliance ProMotion video driver<br />
*'''xf86-video-ark''' ark video driver<br />
*'''xf86-video-ati''' ati video driver<br />
*'''xf86-video-chips''' Chips and Technologies video driver<br />
*'''xf86-video-cirrus''' Cirrus Logic video driver<br />
*'''xf86-video-dummy''' dummy video driver<br />
*'''xf86-video-fbdev''' framebuffer video driver<br />
*'''xf86-video-glint''' GLINT/Permedia video driver<br />
*'''xf86-video-i128''' Number 0 i128 video driver<br />
*'''xf86-video-i740''' Intel i740 video driver<br />
*'''xf86-video-i810''' Intel i810/i830/i9xx video drivers (deprecated - use -intel)<br />
*'''xf86-video-intel''' Newer Version of Intel i810/i830/i9xx video drivers<br />
*'''xf86-video-imstt''' Integrated Micro Solutions Twin Turbo vidoe driver<br />
*'''xf86-video-mach64''' mach64 video driver <br />
*'''xf86-video-mga''' mga video driver (Matrox Graphics Adapter) <br />
*'''xf86-video-neomagic''' neomagic video driver<br />
*'''xf86-video-nouveau''' Open Source 3D acceleration driver for nVidia cards (eperimental)<br />
*'''xf86-video-nv''' nvidia nv video driver<br />
*'''xf86-video-openchrome''' Openchrome drivers<br />
*'''xf86-video-r128''' ati Rage128 video driver<br />
*'''xf86-video-radeonhd''' Experimental Radeon HD video driver for r500 and r600 ATI cards<br />
*'''xf86-video-rendition''' Rendition video driver<br />
*'''xf86-video-s3''' S3 video driver<br />
*'''xf86-video-s3virge''' S3 Virge video driver<br />
*'''xf86-video-savage''' savage video driver<br />
*'''xf86-video-siliconmotion''' siliconmotion video driver<br />
*'''xf86-video-sis''' SiS video driver<br />
*'''xf86-video-sisusb''' SiS USB video driver<br />
*'''xf86-video-tdfx''' tdfx video driver<br />
*'''xf86-video-trident''' Trident video driver<br />
*'''xf86-video-tseng''' tseng video driver<br />
*'''xf86-video-unichrome''' Unichrome video drivers<br />
*'''xf86-video-v4l''' v4l video driver<br />
*'''xf86-video-vesa''' vesa video driver<br />
*'''xf86-video-vga''' VGA 16 color video driver<br />
*'''xf86-video-via''' via video driver<br />
*'''xf86-video-vmware''' vmware video driver<br />
*'''xf86-video-voodoo''' voodoo video driver<br />
<br />
* 说明:'''vesa'''驱动是最原汁原味的,适用于大部分的显卡。如果实在无法找到合适的显卡驱动,就选用vesa。(这是原话,好像夸张了点!If you cannot find a suitable driver for your video chipset, vesa '''should''' work.)<br />
<br />
用pacman来安装适合你显卡的驱动。例如:<br />
pacman -S xf86-video-savage<br />
(给Savage显卡的驱动。)<br />
<br />
* 如果实在不确定需要安装那个显卡驱动,可以安装所有显卡驱动包, 输入下面命令:<br />
pacman -S xorg-video-drivers<br />
<br />
*如果显卡是nVIDIA 或者ATI的,并'''想安装nVIDIA或者ATI官方提供的显卡驱动,请看下面。'''<br />
-----<br />
<br />
====nVIDIA图形显示卡====<br />
nVIDIA显示卡的驱动程序被许多人认为是非常好的质量,而且带有高级3D性能。<br />
<br />
在设置您的你nVIDIA显卡之前您先要选择您要使用的驱动程序。Arch现在有3种不一样的nVIDIA驱动程序,各自支持不同型号的显卡:<br />
<br />
'''1. nvidia-96xx''' ''直到Ge Force 4的较新显卡''<br />
<br />
'''2. nvidia-173xx''' ''Geforce FX系列显卡''<br />
<br />
'''3. nvidia''' ''在GF FX之后的最新GPU''<br />
<br />
{{Box Note| 一些特别老如TNT和TNT2之类的显卡所需的Nvidia-71xx系列闭源驱动,由于无法在Arch所用的新版Xorg下正常运行,并且nvidia也已不再继续支持它们,因此已被删除。你可以改用xf86-video-nv或者xf86-video-vesa驱动。}}<br />
<br />
到nVIDIA主页,看哪个适合你电脑.区别只是安装,配置过程是一样的.<br />
<br />
''根据你的显卡'',选择合适的nVIDIA驱动安装,比如: <br />
pacman -S nvidia-96xx<br />
<br />
nVIDIA软件包有个工具能自动升级你已有的nVIDIA驱动的配置文件/etc/X11/xorg.conf,输入下列命令即可实现:<br />
nvidia-xconfig<br />
<br />
它也有一些选项,用于更深入和具体地配置xorg.conf文件的内容和选项,例如:<br />
<br />
<br />
nvidia-xconfig --composite --add-argb-glx-visuals<br />
<br />
更详细的信息,请参考:nvidia-xconfig(1).<br />
<br />
一些有用的妙法可用在“device“部分(你要清楚它们不一定都能对你的系统有用):<br />
Option "RenderAccel" "true"<br />
Option "NoLogo" "true"<br />
Option "AGPFastWrite" "true"<br />
Option "EnablePageFlip" "true"<br />
将所有的DRI注释掉:<br />
# Load "dri"<br />
<br />
多检查几次你的/etc/X11/xorg.conf以确定你的默认的depth(色深),horizontal sync(水平同步),垂直刷新率,以及分辨率是可以接受的。<br />
<br />
使用<code>/sbin/depmod</code>命令来更新内核模块依赖:<br />
depmod -a<br />
(也许需要重启。)<br />
{{Tip|nvidia配置的高级的说明参考文章[[NVIDIA]] 。}}<br />
<br />
现在你可以跳到'''[[#三、配置X:创建并修改/etc/X11/xorg.conf|配置X]]'''来进一步熟悉,或者跳到'''[[#3、测试 X|测试 X]]'''继续安装过程。<br />
<br />
====ATI图形显示卡====<br />
ATI用户的驱动可以有几种选择。<br />
* '''xf86-video-ati'''软件包提供的开源'''''radeon'''''驱动。<br />
** 原创的、完全支持Radeon芯片组到X1950(最新的R500芯片组)的逆向工程开源驱动。对9200系列以前的显卡完全支持,可以稳定的提供全2D和3D加速。从9500到X1950完全支持2D加速特性,良好的3D加速,不过缺乏某些闭源驱动的特性(例如能源节省特性仍处于测试阶段)。xf86-video-ati支持从HD2xxx (R6xx)到最新的显卡,不过目前仅提供2D支持。<br />
* '''xf86-video-radeonhd'''软件包提供了开源的'''''radeonhd'''''驱动。<br />
** 此驱动支持ATI R500(Radeon X1000系列)以及更新的芯片组。该驱动由AMD提供文档,Novell为之开发。它支持RandR 1.2,目前的开发工作非常活跃。因此所支持的不同系列显卡的功能可以不一致。(有些用户反映它性能优异,而有些则说它很糟)。它还支持带音频的HDMI。<br />
* AUR中的Catalyst软件包提供了闭源'''''fglrx'''''驱动。稍后将介绍闭源驱动。<br />
开源驱动通常可以满足大部分需求而且较少出问题。<br />
<br />
安装'''''radeon'''''ATI驱动:<br />
# pacman -S xf86-video-ati libgl ati-dri<br />
安装'''''radeonhd'''''ATI驱动:<br />
# pacman -S xf86-video-radeonhd libgl ati-dri<br />
<br />
Arch的<code>extra</code>官方仓库曾经提供过闭源ATI驱动'''Catalyst'''的预编译包,不过在2009年3月以后,由于对闭源驱动的质量和开发进度不满意,官方取消了对它的支持。目前catalyst驱动可以在[http://aur.archlinux.org/packages.php?ID=22899 AUR]中找到。Catalyst驱动的安装信息可以在[[ATI#Proprietary_ATI_Catalyst_driver|这里]]找到。<br />
<br />
{{Warning| 闭源ATI驱动仅支持R600和更新的显卡(即HD2xxx及以上系列),不支持旧系列(X1xxx系列及以下)。}}<br />
<br />
{{Tip|ATI配置的高级指引可以参看[[ATI | ATI wiki 文章]]。}}<br />
<br />
====3、安装输入设备驱动软件包====<br />
最新的X需要你为包括键盘和鼠标在内的输入设备安装驱动。查看可用输入设备驱动的完整列表:<br />
# pacman -Ss xf86-input | less<br />
<br />
对大部分用户,xf86-input-keyboard和xf86-input-mouse应该可以满足基本配置。使用pacman来为你的输入设备安装需要的驱动,例如:<br />
# pacman -S xf86-input-keyboard<br />
===三、配置X:创建并修改/etc/X11/xorg.conf===<br />
====xorg.conf文件====<br />
/etc/X11/xorg.conf 是你的 X-Window-System 的主要配置文件,你的 GUI('''G'''raphical '''U'''ser '''I'''nterface)的基础,它是一个普通的文本文件,里面由 “section” 和 “subsection” 来安排。重要的 section 有 ''Files, InputDevice, Module, Monitor, Modes, Screen, Device'' 和 ''ServerLayout''。各个section安排的前后次序没有关系,对同一种类型的设备也可以有多个section,比如你可能有多个显示器,或者你的本本既有鼠标又有触摸板。<br />
------<br />
从X11R7.2版开始Xserver引入了自动配置特性。在大多情况下,即使没有xorg.conf文件它也能很好地运作。如果''自动检测功能工作正常'',而且你又不需要开启如 aiglx、compositing 等功能的话,你甚至不需要创建这个配置文件。<br />
<br />
====1、创建 /etc/X11/xorg.conf====<br />
<br />
高级用户可以手动创建他们的xorg.conf文件。一般用户可以使用程序<code>/usr/bin/Xorg</code>附加参数-configure来生成一个基本的配置文件;以root身份输入下面命令:<br />
# Xorg -configure<br />
这里生成的文件是/root/xorg.conf.new <br />
<br />
把这文件复制到 <code>/etc/X11/</code>:<br />
# cp /root/xorg.xonf.new /etc/X11/xorg.conf<br />
<br />
====更多的创建/etc/X11/xorg.conf的办法====<br />
* 说明:如果你的电脑已经有一个配置好的xorg.conf文件,不管这个文件是在什么别的发行版下生成的,只要Xorg的版本一致,就可以把该文件复制到你的Arch系统的<code>/etc/X11/</code>目录下。<br />
* 可以使用程序<code>/usr/bin/hwd</code>生成xorg.conf。首先要安装这程序:<br />
# pacman -S hwd<br />
然后输入下面命令:<br />
# hwd -xa<br />
{{Box Note| 目前,hwd在生成的xorg.conf有一行失效。 使用完这程序后,需要手动删除或者是注释掉 Section &quot;Files&quot;下的RgbPath那一行。via nano /etc/X11/xorg.conf or your equivalent, as root/sudo.}}<br />
<br />
* 使用<code>/usr/bin/xorgcfg</code> 脚本生成xorg.conf:<br />
# xorgcfg <br />
* 使用<code>/usr/bin/xorgconfig</code>生成xorg.conf,这个程序以互动方式来创建该文件,输入下面命令运行:<br />
# xorgconfig<br />
<br />
====2、Input设备热插拔问题:请在测试X前阅读====<br />
<br />
xorg 1.5.x版本里已经开启热插拔Input设备。<br />
{{Box Note | 当热插拔开启后, X将清空xorg.conf里所有使用the kbd and mouse 驱动建立的设备。这将导致X被冻结,使得鼠标和键盘失去响应。下面是解决办法。'''方法只能二选一'''}}<br />
<br />
有两个办法可以修复这一问题:<br />
<br />
1) '''配置 input设备热插拔''':安装驱动 xf86-input-evdev,同时配置HAL使其能使用kbd/mouse驱动。<br />
<br />
安装xf86-input-evdev:<br />
# pacman -S xf86-input-evdev<br />
在X.org相关进程启动前,启动守护进程hal:<br />
# /etc/rc.d/hal start<br />
把hal加入/etc/rc.conf里的DAEMONS列表里,这样每次电脑启动,都会自动开启hal。详情请见[[Xorg input hotplugging]] 。<br />
<br />
说明: 开启hal必须首先有一个dbus用户和用户组,以root身份输入下面命令创建用户和用户组<br />
<br />
usr/sbin/groupadd -g 81 dbus<br />
usr/sbin/useradd -c 'System message bus' -u 81 -g dbus -d '/' -s /bin/false dbus<br />
<br />
2) '''关闭input设备热插拔''':在/etc/X11/xorg.conf的ServerFlags段,加入参数''Option &quot;AutoAddDevices&quot; &quot;False&quot;'' 这将忽略hal的硬件检测,并使用你xorg.conf的keyboard/mouse配置。步骤如下<br />
# nano /etc/X11/xorg.conf<br />
加入下面三行:<br />
Section &quot;ServerFlags&quot;<br />
Option &quot;AutoAddDevices&quot; &quot;False&quot;<br />
EndSection<br />
<br />
====3、测试 X====<br />
<br />
在所生成的xorg文件路径''path/to/xorg.conf''前,加入参数''-config'' ,运行 '''X'''脚本,可以测试脚本配置是否正确。<br />
比如要测试你上面生成的xorg是否配置正确,输入:<br />
X -config /root/xorg.conf.new<br />
'''X''' 将启动,在屏幕中央会有一个白色的 X ,鼠标或是触摸板可以移动它,按 CTRL-Alt-Backspace 可以退出 '''X'''<br />
<br />
====对xorg.conf除错====<br />
如果 X 出现错误不能运行,你需要手动检查你的配置文件:<br />
<br />
nano /root/xorg.conf.new<br />
<br />
* 确定 Xorg -configure 命令正确的识别了你的显卡,比如:<br />
Section &quot;Device&quot;<br />
<br />
...<br />
<br />
Driver &quot;savage&quot;<br />
<br />
...<br />
<br />
EndSection<br />
<br />
* 确定里面的 Section "Monitor" 设置了水平同步率和垂直刷新率,如果没有要把它加上:<br />
Section &quot;Monitor&quot;<br />
Identifier &quot;Monitor0&quot;<br />
VendorName &quot;Monitor Vendor&quot;<br />
ModelName &quot;Monitor Model&quot;<br />
HorizSync 30.0 - 130.0 # Safe for LCD's<br />
VertRefresh 50.0 - 100.0 # Safe for LCD's and most CRT's.<br />
EndSection<br />
如果你不知道这些刷新率到底是多少,你就得查一下你显示器的说明书。<br />
<br />
* 在section "Screen"配置默认色深(color depth):<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Card0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
(此处色深被设定为真彩24色。)<br />
<br />
<br />
* 在subsection &quot;Display&quot; 加入你需要的Modes, at least under the Depth 24 header, e.g.:<br />
SubSection &quot;Display&quot;<br />
Viewport 0 0<br />
Depth 24<br />
Modes &quot;1024x768&quot; &quot;800x600&quot; &quot;640x480&quot;<br />
* Add the following section, if you wish to enable eye candy which requires the composite extension: <br />
Section &quot;Extensions&quot;<br />
Option &quot;Composite&quot; &quot;Enable&quot;<br />
EndSection<br />
<br />
* 上述调整完成后,再测试你的配置:<br />
X -config /root/xorg.conf.new<br />
<br />
* 在确认 '''X''' session开启,没有错误之后,把测试好的配置文件移到 /etc/X11下,作为系统的xorg.conf配置文件:<br />
mv /root/xorg.conf.new /etc/X11/xorg.conf<br />
详细的介绍可见[[Xorg]] <br />
<br />
接下来可以简单作测试 '''[[#Simple baseline X test|Simple baseline X test]]'''<br />
<br />
====调整键盘布局====<br />
=====如果开启了input热插拔=====<br />
# cp /usr/share/hal/fdi/policy/10osvendor/10-keymap.fdi /etc/hal/fdi/policy/<br />
# nano /etc/hal/fdi/policy/10-keymap.fdi<br />
Edit the &quot;input.xkb.layout&quot; key and possibly the &quot;input.xkb.variant&quot; key in this file.<br />
Restart hal:<br />
# /etc/rc.d/hal restart<br />
<br />
=====如果关闭了input热插拔=====<br />
Add option lines in the &quot;InputDevice&quot; section of the /etc/X11/xorg.conf file specifying the keyboard layout and variant:<br />
Option &quot;XkbLayout&quot; &quot;be&quot;<br />
Option &quot;XkbVariant&quot; &quot;&quot;<br />
<br />
详情请见 [[Xorg input hotplugging]]。<br />
<br />
===简单的命令行界面X测试(如果需要)===<br />
<br />
在安装了xorg、合适的显卡驱动、创建了一个/etc/X11/xorg.conf文件之后,如果想在安装完整桌面环境之前,快速测试下你的配置,使用'''xterm'''可以实现! <br />
Xterm是个简单的终端模拟程序,作为base xorg软件包的一部分会被自动安装,运行在'''X '''Server环境里。通过配置~/.xinitrc,Xterm可以让我们快速测试显卡驱动和配置文件/etc/X11/xorg.conf是否被正确配置。(另外,如果在没有/etc/X11/xorg.conf的情况下,你想测试下'''X''' 自动检测是否满意,也可以使用这个)<br />
<br />
==== 准备工作:配置~/.xinitrc====<br />
<br />
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. <br />
{{Box Note | '''[[.xinitrc]]''' is a so-called 'dot' (.) file. 在UNIX文件系统下,文件名以 (.)开头的,是 '隐藏文件',,使用普通的命令'ls' 将不显示这些文件,使用加了参数命令'''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 &quot;Run Control&quot;.}}<br />
<br />
'''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. (说明: ''如果没有文件~/.xinitrc, /etc/X11/xinit/xinitrc 将被作为替代来使用,这是个使用TWM and Xterm的默认配置。'')<br />
<br />
切换到'''''普通, 非root'''''用户:<br />
# su - ''yourusername''<br />
* /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.<br />
* 如果没有~/.xinitrc这个文件,到该目录下创建一个,或者从/etc/skel/复制一个同样的文件到你的home目录:: <br />
<br />
$ cp /etc/skel/[[.xinitrc]] ~/<br />
<br />
* 编辑文件: <br />
$ nano ~/.xinitrc<br />
加入这行&quot;<code>exec xterm</code>&quot;像下面这样:<br />
<br />
#!/bin/sh<br />
#<br />
# ~/.xinitrc<br />
#<br />
# Executed by startx (run your window manager from here)<br />
#<br />
exec xterm<br />
# exec wmaker<br />
# exec startkde<br />
# exec icewm<br />
# exec blackbox<br />
# exec fluxbox<br />
<br />
{{Box Note | ''请确保~/.xinitrc''里,以'''exec'''开头的,只有'''一行'''的注释被去掉。}}<br />
<br />
====开始执行测试====<br />
<br />
* 以普通用户身份输入下面命令,开启'''X''',开始测试你的配置:<br />
<br />
$ startx<br />
或者是这命令<br />
$ xinit<br />
<br />
此时会打开一个'''xterm''' session,你可以在这里测试your keyboard and its layout<br />
<br />
* 按Ctrl+Alt+Backspace,或者输入"exit"可以退出'''X''' Server。<br />
* 如果开启'''X'''出现问题,在终端,查看日志文件/var/log/Xorg.0.log的错误信息。<br />
<br />
更多的Xorg configuration介绍可见[[Xorg]] .<br />
<br />
==第四部分:安装并配置桌面环境==<br />
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 icons, applets, windows, toolbars, folders, wallpapers, 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.<br />
<br />
* 如果你需要一个完整功能,类似于Windows和Mac OSX, 可以选择安装'''[[#KDE|KDE]]''' <br />
* If you want something slightly more minimalist, which follows the K.I.S.S. principle more closely, '''[[#GNOME|GNOME]]''' is a good choice<br />
* '''[[#Xfce|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.<br />
<br />
如果你的机器较老,或者是希望使用一个更轻量、更少GUI要求,可以选择只安装 '''Window Manager''', 或者 WM. A WM controls the placement and appearance of application windows in conjunction with the X Window System but does NOT provide such additions as panels, applets, icons, etc.<br />
* Lightweight floating WM's include: [[#Openbox|'''Openbox''']], [[#Fluxbox|'''Fluxbox''']], [[#fvwm2|'''fvwm2''']], '''Windowmaker, Pekwm, and TWM'''.<br />
* If you need something completely different, try '''Awesome, ion, wmii, dwm, or xmonad'''。<br />
<br />
===一、安装字体===<br />
在安装桌面环境/窗口管理器'''之前''',也许你会先安装些美观的字体。Dejavu和bitstream-vera都是不错的字体集。而对于网页,你还可能需要Microsoft字体。如下安装:<br />
pacman -S ttf-ms-fonts ttf-dejavu ttf-bitstream-vera<br />
对于中文字体,开源的文泉驿正黑矢量字体是不错的选择,它还内嵌了9pt-12pt的点阵宋体:<br />
pacman -S wqy-zenhei<br />
<br />
===二、选择默认启动的桌面环境 ~/.xinitrc===<br />
<br />
以普通用户身份编辑/home/username/.xinitrc,加入你要用的DE. This will allow you to use '''startx/xinit''' from the shell, in the future, to open your DE/WM of choice:<br />
<br />
nano ~/.xinitrc<br />
<br />
反注释或者加入相应的桌面环境/窗口管理器的''''exec''' ..'内容行。例如:使用Xfce4桌面环境:<br />
<br />
exec startxfce4 <br />
<br />
记住在~/.xinitrc中只反注释掉一行'''exec'''。这条命令将一直运行到你注销桌面登录。一般的,shell将等到kde完成加载之后,在运行下一条命令。在命令前加 &quot;exec&quot; ,是告诉the shell 这条命令最后执行, 这样shell就不用等待其他命令了,直接载入桌面。<br />
接下来安装你所选的桌面环境/窗口管理器。<br />
<br />
===三、选择安装一个桌面环境===<br />
====GNOME====<br />
=====关于GNOME=====<br />
GNOME是'''G'''NU '''N'''etwork '''O'''bject '''M'''odel '''E'''nvironment的缩写。GNOME项目有两大部分:GNOME桌面环境 ── 既直观又迷人的最终用户桌面,以及GNOME开发平台 ── 一个用来创建可与桌面集成的应用程序的庞大的框架。<br />
<br />
=====安装=====<br />
安装基本的GNOME环境:<br />
pacman -S gnome<br />
<br />
安装额外的GNOME环境:<br />
pacman -S gnome-extra<br />
然后选择提示的所有软件包。 <br />
<br />
=====对GNOME有用的守护进程=====<br />
如之前所述,守护进程(daemon)是运行在后台的程序,它等待事件发生并提供相应的服务。其中'''Hal'''守护进程可以自动挂载磁盘、光驱和U盘给GUI使用。'''Fam'''守护进程可以在GUI中实时反映文件的变动,如最近安装的程序、文件系统的变化等。'''Hal'''和'''fam'''使得GNOME的使用更为方便。Hal和fam软件包在安装GNOME时已一同安装,建议安装社区库的gamin来替代fam。<br />
<br />
{{Box Note|注意,fam是一个比较老的包,很容易造成较大的日志文件。}}<br />
<br />
{{Box Note|在当前的gnome环境中,你可以安装gamin来实现fam的功能。这时,你可以不用在DAEMONS中添加fam启动项了(不需要加入gamin,它会自动被启用)。}}<br />
<br />
* 你需要启动'''hal'''守护进程。<br />
<br />
启动hal:<br />
/etc/rc.d/hal start<br />
<br />
如果您想使用fam,同样需要启动:<br />
/etc/rc.d/fam start<br />
<br />
将hal加入到/etc/rc.conf的DAEMONS中以使得它们随系统启动而自动运行:<br />
nano /etc/rc.conf<br />
<br />
DAEMONS=(syslog-ng network crond alsa '''hal''')<br />
<br />
{{Box Note|注意,如果使用fam,那么把fam加入到hal后面。}}<br />
<br />
* 或许你还会希望安装一个图形界面的登录管理器。在GNOME下'''gdm'''守护进程是个不错的选择。<br />
以root身份运行:<br />
pacman -S gdm<br />
<br />
让gdm启用有两种方式,一种是直接加入到DAEMONS的末尾,通过rc.conf来启动;另外一种方式是用过配置inittab来加载gdm。<br />
<br />
* 通过inittab来加载gdm也很方便(推荐使用这种方式):<br />
nano /etc/inittab<br />
<br />
修改默认启动方式:<br />
<br />
将<br />
id:3:initdefault:<br />
改为<br />
id:5:initdefault:<br />
<br />
然后取消下面代码的注释:<br />
x:5:respawn:/usr/sbin/gdm -nodaemon<br />
<br />
{{Box Note|实际上,可以看到gdm/xdm/kdm/slim等,使用哪个取决于你的喜好,启用喜欢的那个,将其他的注释掉。当然,本章介绍的是gnome,所以推荐gdm,下章中将推荐kdm:)}}<br />
<br />
<br />
* 通过DAEMONS方式启动gdm也很方便:<br />
nano /etc/rc.conf<br />
<br />
DAEMONS=(syslog-ng network crond alsa hal gdm)<br />
<br />
{{Box Note|这是类似debian/ubuntu的做法,这种方式有一点不好:不管什么时候(非修复模式),系统总是会尝试进入gdm引导的X方式下。对于X已经配置得很好,并且不使用纯控制台的人可以使用这种方式。但是选择这种方式的话你将不能通过内核参数3或者5来区分进入纯字符控制台还是X11的gdm登录窗口。}}<br />
<br />
* 开启Gnome<br />
以普通用户身份启动X:<br />
startx<br />
或者这条命令也行:<br />
$ xinit<br />
如果你的 ~/.xinitrc一直没配置,那你将可以一直使用下面这条命令来开启Gnome:<br />
$ xinit /usr/bin/gnome-session<br />
<br />
关于安装和配置GNOME的高级指引可以参见[[GNOME (简体中文)|GNOME]]一文。接下来你可以浏览'''[[#优化和收尾|优化和收尾]]'''。或许你还会对[[ArchTips(简体中文)|Arch安装完后的小技巧]]一文感兴趣。<br />
<br />
=====美化=====<br />
如果不满足于缺省的GNOME主题和图标,那么可以安装一个不错的主题,比如murrine:<br />
pacman -S gtk-engine-murrine<br />
接着在System->Preferences->Theme里选择这个主题。<br />
<br />
Arch Linux也做了些不错的主题,根据你自己的审美观,选择满意的安装吧:<br />
<br />
# pacman -S gtk-engines gtk2-themes-collection gtk-aurora-engine gtk-candido-engine gtk-rezlooks-engine<br />
<br />
你还可以在[http://www.gnome-look.org Gnome Look]里找到更多的主题、图标和壁纸。<br />
<br />
====KDE====<br />
=====关于KDE=====<br />
KDE桌面环境('''K''' '''D'''esktop '''E'''nvironment)的缩写。 KDE是一种著名的运行于GNU/Linux 、 <code>UNIX</code> 工作站等的强大、自由图形工作环境。她拥有对系统内部各功能的强大整合能力、跨平台能力、易用性、优异的初始界面.<br />
<br />
=====安装=====<br />
Arch提供多个版本的kde: '''kde、kdebase 和 KDEmod'''. 选'''一个'''就行了,然后 '''[[#有用的KDE守护进程|有用的KDE守护进程]]''': <br />
<br />
'''1.)''' '''kde'''是完整的kde软件包,大概 ~300MB,适合主要使用kde软件的系统.<br />
pacman -S kde<br />
'''2.)''' '''kdebase'''是kde的基础软件包(里面没有kdm),大概 ~80MB,适合于只想把kde作为基础系统.<br />
pacman -S kdebase<br />
'''3.)''' '''KDEmod''' 是 Arch Linux独有的、社区驱动的项目,目标是把kde更加细致的模块化和达到其极致的运行效率。KDEmod项目的网站在http://chakra-project.org/ 。<br />
<br />
=====有用的KDE守护进程=====<br />
<br />
KDE 需要'''hal''' ('''H'''ardware '''A'''bstraction '''L'''ayer) 作为守护进程(daemons). '''kdm''' ( '''K''' '''D'''isplay '''M'''anager), 提供一个 '''图形化登录界面'''.<br />
{{Box Note|hal守护进程将自动开启dbus守护进程。kde4里已经不需要fam。kdm现在在kdebase-workstation这个包里,如果只安装kdebase,需要再安装此包才能使用kdm}}<br />
<br />
The hal daemon, among other things, will automate the mounting of disks, optical drives, and USB drives/thumbdrives for use in the GUI. <br />
<br />
-----<br />
启动hal进程:<br />
<br />
/etc/rc.d/hal start<br />
<br />
编辑/etc/rc.conf的 DAEMONS部分:<br />
nano /etc/rc.conf<br />
把 '''hal''' 加入 DAEMONS 部分,以便他们在系统启动时加载. 如果想要kde的图形化登录界面,把 '''kdm'''也加进去(或者不加,在/etc/inittab里面设置): <br />
DAEMONS=(syslog-ng network crond alsa '''hal kdm''')<br />
{{Box Note|如果你安装的是KDEmod3,则使用kdm3替换kdm}}<br />
<br />
*This method will start the system at runlevel 3, (/etc/inittab default, multiuser mode), and then start KDM as a daemon. <br />
<br />
*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 [[Adding a login manager (KDM, GDM, or XDM) to automatically boot on startup]] for more.<br />
<br />
*If you prefer to log into the '''console''' at runlevel 3, 手动启动 X, 则不加入kdm, 或者是加个前缀( ! )禁止它。<br />
<br />
* 现在可以试试效果了,用普通用户身份开启X Server:<br />
startx<br />
或者<br />
$ xinit<br />
更多关于安装和配置KDE的文章,请看[[KDE]].<br />
<br />
到此步,可以看 '''[[#优化和收尾]]'''这部分了. You may also be interested in the [[Post Installation Tips]] wiki article.<br />
<br />
====Xfce====<br />
=====关于Xfce=====<br />
和GNMOE、KDE一样,Xfce是一个桌面环境,其目标是快捷、轻量,同时又美观而易用。它还提供了一整套的应用程序如根窗口应用(root window app)、 窗口管理器、文件管理器、面板等等。 Xfce是用GTK2 toolkit编写的(类似GNOME),和其它大型桌面环境一样,它也有自己的开发环境(库文件、守护进程等)。但不象GNOME或者KDE,Xfce是轻量化的,其设计更接近于CDE而不是Windows或者Mac。它的开发周期比较慢,但是十分稳定、速度很快。在老硬件上Xfce可以运行得很好,而在新机器上更是运行如飞。<br />
<br />
=====安装=====<br />
安装完整的xfce环境以及主题和extras:<br />
pacman -S xfce4 xfce4-goodies gtk2-themes-collection <br />
<br />
如果你使用KDM或者GDM的话会显示一个xfce会话。另一种启动方式是:<br />
startxfce4<br />
<br />
关于安装和配置xfce的高级指引可以参见[[Xfce (简体中文)|Xfce]]一文。<br />
<br />
恭喜!欢迎来到Arch Linux系统的Xfce桌面环境!接下来你可以浏览'''[[#优化和收尾|优化和收尾]]''',或者下面的其它内容。或许你还会对[[ArchTips(简体中文)|Arch安装完后的小技巧]]一文感兴趣。<br />
<br />
====*box====<br />
=====Fluxbox=====<br />
Fluxbox © is yet another windowmanager for X.<br />
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).<br />
<br />
Install Fluxbox using <br />
pacman -S fluxbox fluxconf<br />
<br />
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:<br />
exec startfluxbox <br />
<br />
More information is available in the [[Fluxbox]] article.<br />
<br />
=====Openbox=====<br />
Openbox是一个标准的”温顺的“,快速的,轻量级的,可扩展的窗口管理器。<br />
<br />
Openbox与你的应用程序一起工作工作,并使你的的桌面便于管理。这是因为它的开发方式和通常的窗口管理器的方式是相悖的。 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.<br />
<br />
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. <br />
<br />
安装openbox<br />
pacman -S openbox obconf obmenu<br />
<br />
一旦openbox安装好,你将得到一个消息to move menu.xml & rc.xml to ~/.config/openbox/ in your home directory:<br />
<br />
mkdir -p ~/.config/openbox/<br />
cp /etc/xdg/openbox/rc.xml ~/.config/openbox/<br />
cp /etc/xdg/openbox/menu.xml ~/.config/openbox/<br />
<br />
In the file "rc.xml" you can change various settings for Openbox (or you can use OBconf). In "menu.xml" you can change your right-click menu.<br />
<br />
To be able to log into openbox you can either go via graphical login using KDM/GDM or startx, in which case you will need to edit your ~/.xinitrc (as user) and add the following:<br />
<br />
exec openbox<br />
<br />
For KDM there is nothing left to do; openbox is listed in the sessions menu in KDM.<br />
<br />
Useful programs for openbox are:<br />
* PyPanel or LXpanel if you want a panel<br />
* feh if you want to set the background<br />
* ROX if you want a simple file manager and desktop icons<br />
<br />
More information is available in the [[Openbox]] article.<br />
<br />
====fvwm2====<br />
FVWM是一个非常强大的面向X桌面系统的”ICCCM-compliant的多虚拟桌面的窗口管理器“(ICCCM-compliant multiple virtual desktop window manager)。开发活动很活跃,支持也是极好的。 <br />
<br />
输入下面命令安装 fvwm2 <br />
pacman -S fvwm <br />
<br />
fvwm会自动添加进 kdm/gdm会话列表. 如果没有的话,添加 <br />
exec fvwm <br />
<br />
到你的用户文件 .xinitrc.<br />
<br />
注意:这个稳定版已经有些年头了,如果需要最新的fvwm版本,可以安装unstable repo里的fvwm-devel 包.<br />
<br />
===四、优化和收尾===<br />
====HAL====<br />
如果你已经安装了一个桌面环境,但是又觉得用起来不是很方便,那么现在就是个安装HAL的好时机了。HAL使得你的手机、iPod、移动硬盘等等可以即插即用。它会挂载设备并在你的桌面或/和'My Computer'目录中创建相应的图标,使得你可以在插入设备后就能访问到它,无需每次都对每个新设备来手动配置/etc/fstab文件或者udev规则。<br />
<br />
KDE、GNOME和XFCE都使用到HAL。<br />
<br />
安装过程描述可以在[[HAL (简体中文)|HAL]]一文中找到。其它一些信息可以在[http://en.wikipedia.org/wiki/HAL_(software) Wikipedia]上找到。<br />
<br />
====启动时让守护进程在后台执行====<br />
<br />
要加速系统的启动过程,可以在/etc/rc.conf中给守护进程前加上'@'符号使之在后台执行,例如:<br />
<br />
DAEMONS=(@syslog-ng @network crond @alsa @hal @fam @kdm)<br />
这使得守护进程在后台被加载,无需等待它们加载结束。<br />
<br />
在守护进程前加上(!)可以禁止系统启动时加载它,例如:<br />
<br />
DAEMONS=(@syslog-ng @network !crond @alsa @hal @fam @kdm)<br />
<br />
另一种方式是直接将不需要的守护进程删除。<br />
<br />
====美化LCD下的字体====<br />
See [[Fonts]]<br />
<br />
====让所有的鼠标按键生效====<br />
看这个 [[Get All Mouse Buttons Working]]<br />
<br />
====笔记本电脑可能遇到的问题====<br />
(1) 触摸板问题<br />
参看http://wiki.archlinux.org/index.php/Touchpad_Synaptics<br />
<br />
(2) 摄像头问题<br />
参看http://wiki.archlinux.org/index.php/Webcam_Setup<br />
<br />
(3) 无线上网问题<br />
参看http://wiki.archlinux.org/index.php/Wireless<br />
<br />
(4) 快捷键问题<br />
参看http://wiki.archlinux.org/index.php/Extra_Keyboard_Keys<br />
<br />
====配置CPU频率====<br />
现在的处理器能够降低频率和电压,以降温和降低电源消耗。降温能使系统更稳定,笔记本用户肯定是想这样做的,但是即使是台式机也会对系统有利。<br />
<br />
安装CPU频率工具用:<br />
pacman -S cpufrequtils<br />
<br />
把CPU频率在/etc/rc.conf里加入到启动进程(daemons)中。编辑配置文件/etc/conf.d/cpufreq改<br />
governor="conservative"<br />
<br />
这使得在需要的情况下可以动态地增减CPU频率(这是对于台式机来说也是一个安全的选择)。改变最小频率(min_freq)和最大频率(max_freq)以匹配你的CPU的情况。如果你不知道频率,在载入频率测量模块后运行“cpufreq-info”。你也可以将min_freq和max_freq注释掉或删除,这样就能自动进行。加入频率测量模块到/etc/rc.conf的模块行。<br />
几乎所有的笔记本和台式机都可以简单地使用''acpi-cpufreq''驱动,但是也有其它的选择,如:''p4-clockmod, powernow-k6, powernow-k7, powernow-k8, and speedstep-centrino''。 <br />
<br />
通过下面这个命令载入这个模块:<br />
modprobe <modulname> <br />
通过下面命令行开启cpufreq:<br />
/etc/rc.d/cpufreq start<br />
更多细节,请看 [[Cpufrequtils]]<br />
<br />
==第五部分:常用的应用程序==<br />
更多信息,请看[[ArchLinux常用的应用程序(简体中文)]].<br />
<br />
==附录==<br />
新手指南附录[[ArchLinux新手指南附录 (简体中文)]]<br />
<br />
想得到更多的信息和支持,你可以去[http://www.archlinux.org/ homepage], [[Special:Search|search the wiki]],[http://bbs.archlinux.org/ forums],[[ArchChannel|IRC channel]],以及[http://www.archlinux.org/mailman/listinfo/ mailing lists]。<br />
=====问题答疑=====<br />
See [[Arch FAQs for newbies]]<br />
还有这里[http://bbs.archlinux.org/viewtopic.php?t=29055 Arch forum thread] 也是面向初学者的。<br />
<br />
=====术语=====<br />
更多信息关于Arch术语,查阅[[Arch Terminology/Jargon for newbies|this article]].<br />
<br />
=====接下来还有什么?=====<br />
<br />
你还可以阅读:<br />
<br />
[[Arch 官方安装指南 (简体中文)|Arch 官方安装指南]]<br />
<br />
[[Arch AUR (简体中文)|ArchLinux社区用户软件仓库 (AUR)]]<br />
<br />
[[Get All Mouse Buttons Working]]<br />
<br />
[[改善Pacman性能 (简体中文)|改善Pacman性能]]<br />
<br />
[[Kernel Compilation]]<br />
<br />
[[Pm-utils 电源管理 (简体中文)|Pm-utils 电源管理]]<br />
<br />
[[CPU 频率调节 (简体中文)|CPU 频率调节]]<br />
<br />
[[:Category:美化|美化]]</div>
Flydragon
https://wiki.archlinux.org/index.php?title=ArchLinux_%E6%96%B0%E6%89%8B%E6%8C%87%E5%8D%97_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=90845
ArchLinux 新手指南 (简体中文)
2010-01-04T09:32:21Z
<p>Flydragon: /* /etc/hosts.deny和/etc/hosts.allow */</p>
<hr />
<div>[[Category:简体中文]]<br />
[[Category:获取并安装Arch (简体中文)]]<br />
[[Category:关于Arch_(简体中文)]]<br />
[[Category:HOWTOs (简体中文)]]<br />
<br />
{{Article summary start}}<br />
{{Article summary text|本文针对新手,提供了极其详尽的Archlinux的安装过程向导,和相关的简要说明。}}<br />
{{Article summary heading|已有的语言版本}}<br />
{{Article summary heading|Available Languages}}<br />
{{i18n_entry|Česky|Průvodce začátečníka (Česky)}}<br />
{{i18n_entry|简体中文|Arch 新手安装指南 (简体中文)}}<br />
{{i18n_entry|正體中文|Beginner's Guide 新手指南}}<br />
{{i18n_entry|Dansk|Dansk_Begynderguide}}<br />
{{i18n_entry|Deutsch|Beginners Guide (Deutsch)}}<br />
{{i18n_entry|English|Beginners Guide}}<br />
{{i18n_entry|Español|Guía para Principiantes (Español)}}<br />
{{i18n_entry|Français|Manuel_du_Débutant_(Français)}}<br />
{{i18n_entry|Italiano|Beginners Guide (Italiano)}}<br />
{{i18n_entry|Indonesia|Beginners_Guide_(Indonesia)}}<br />
{{i18n_entry|Lietuviškai|Pradedančiųjų gidas (Lietuviškai)}}<br />
{{i18n_entry|Nederlands|Beginners_Guide_(Nederlands)}}<br />
{{i18n_entry|Português Brasil|Guia do Iniciante(Português do Brasil)}}<br />
{{i18n_entry|Português|Guia para Principiantes(Português)}}<br />
{{i18n_entry|Русский|Руководство_для_новичков}}<br />
{{i18n_entry|Türkçe|Başlangıç Rehberi (Türkçe)}}<br />
{{i18n_entry|हिन्दी|नौसिखिया गाइड(हिन्दी)}}<br />
{{Article summary heading|相关文章}}<br />
{{Article summary wiki|Arch 官方安装指南 (简体中文)}}(更通用的安装方式)<br />
{{Article summary wiki|ArchLinux新手指南附录 (简体中文)}}<br />
{{Article summary wiki|ArchLinux安装完后的小技巧 (简体中文)}}<br />
{{Article summary wiki|ArchLinux常用的应用程序(简体中文)}}<br />
{{Article summary wiki|Work and Play with Arch (Chinese)}}<br />
{{Article summary end}}<br />
<br />
==前言==<br />
<br />
=====所有你一直想知道的关于安装Arch的事=====<br />
这篇文档将会指导你安装和配置[[ArchLinux (简体中文)|Arch Linux]] ── 一个简洁、轻量级的GNU/Linux发行版,一个类<code>UNIX</code>的操作系统。本文是面向Arch新用户,因此尽力为所有人提供强大的参考资料和信息。本指南讲述该如何获得一个基本配置好的Arch Linux系统(拥有一个图形桌面环境),但显然是不可能涵盖(甚至是预见)所有的信息。因此本指南会专注于某些关键性的步骤,想要进一步深入了解你可以查看[[Main Page (简体中文)|Arch Linux Wiki]]或者[http://bbs.archlinux.org/ Arch Linux论坛]。同时有兴趣的话你还可以了解一下[[Arch 之道 (简体中文)|Arch 之道]],它概述了Arch Linux发行版背后的哲学思想。<br />
<br />
'''Arch Linux的相关特性:'''<br />
* '''[[The Arch Way | Simple]]''' design and philosophy<br />
* Community distro targeted at competent GNU/Linux users<br />
* All packages compiled for '''i686/x86-64'''<br />
* 从底层开始就可以让用户高度定制<br />
* '''[[The Arch boot process | BSD-style init]]''' scripts, featuring one centralized configuration file<br />
* '''滚动升级''' <br />
* '''[[Pacman]]''' package manager is fast, written in '''C''', lightweight and agile, with a very modest memory footprint<br />
* '''[[ABS]]''': The '''A'''rch '''B'''uild '''S'''ystem, a ports-like package building system makes it simple to create your own easily installable Arch packages from source, to use and/or share with the community on the [[AUR]]<br />
* '''[[AUR]]''': The Arch User Repository, offering many thousands of build scripts for Arch user-provided software packages<br />
<br />
=====别怕(DON'T PANIC)!=====<br />
要知道Arch Linux的安装方法和过程也许会和你所使用过的其它GNU/Linux发行版非常不同,特别你是个新手的话将更能体会到这点。通常,GNU/Linux发行版会在一张或者一堆CD(甚至是DVD)上捆绑了大量的软件,包含了缺省桌面环境、缺省的应用程序和设置、硬件自动检测和图形化的安装程序,一切都是替你选择好了的。相反的,Arch Linux系统是让'''用户自己'''只是用一个bash shell和基本系统工具,从ncurses installer和基础系统上建造起来的。这就是[[Arch 之道 (简体中文)|Arch 之道]]。不象其它大型发行版,它没有强加于用户的缺省环境或者配置。你可以在命令行使用[[pacman (简体中文)|pacman]]通过互联网连接从Arch软件仓库安装软件包,直到你的系统配置成你希望的样子。这给予了用户最大的弹性、选择性和对系统资源的控制。因为是'''你'''建造了它,所以你肯定能了解系统里具体细节,知道底层都有些什么。<br />
<br />
Arch Linux系统是通过编辑文本文件进行配置的,没有提供图形界面的工具,所以需要对系统和linux相对熟悉。<br />
Arch Linux针对的是有能力的GNU/Linux用户以及希望花费时间学习系统知识的用户。 <br />
<br />
''Arch是一个可以被用户塑造的工具。''<br />
<br />
=====授权协议=====<br />
<br />
Arch Linux, pacman, documentation, and scripts are copyright<br />
©2002-2007 by Judd Vinet, ©2007-2008 by Aaron Griffin and are licensed under the GNU General Public License Version 2.<br />
<br />
=====[[Arch 之道 (简体中文)|Arch 之道]]=====<br />
<br />
''Arch的设计思想是"保持简洁"(keeping it simple)。'' <br />
<br />
这里的‘简洁’并不是单指‘简单’或者‘用户友好’,而是‘没有不必要的增加、修改或者复杂性’。简而言之,即优雅、极简之法。<br />
<br />
<br />
''"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 crap." -Aaron Griffin''<br />
<br />
<br />
''"The extraordinary part of [my method] lies in its simplicity..I have always believed that the simple way is the right way."'' - Bruce Lee<br />
“(我的方法中)最超凡的部分是它的简单性,我一直相信简单的就是对的。” 李小龙(Bruce Lee)<br />
<br />
Occam's razor: ''Entia non sunt multiplicanda praeter necessitatem'' or "Entities should not be multiplied unnecessarily." The term razor refers to the act of shaving away unnecessary assumptions and complications to get to the simplest explanation, method or theory.<br />
<br />
{{Box Note |'''仔细遵循本指南是成功安装一个配置正常的Arch Linux系统的基本要点,因此''请''认真仔细的阅读本文'''}}<br />
* 你也可以将本指南打印出来,作为一个较为有用的Arch Linux用户手册。<br />
*''如果你想在这个wiki里增加内容,请适当描述清楚“为什么会这样”以及“该怎么办”。最佳的文档应该能教会我们如何做和为什么这么做!''<br />
* Arch的wiki是项优秀的资源,可以[http://wiki.archlinux.org/index.php/Main_Page 第一时间]用来解决日常问题; 如果找不到答案也可以求助IRC和[http://bbs.archlinux.org/ 论坛]。<br />
----<br />
----<br />
欢迎使用Arch!现在,让我们开始吧。<br />
<br />
本文按照安装过程分四大部分:<br />
<br />
'''[[#第一部分:安装基本系统|第一部分:安装基本系统]]'''<br />
<br />
'''[[#第二部分:完成基本系统并升级|第二部分:完成基本系统并升级]]'''<br />
<br />
'''[[#第三部分:安装X并配置ALSA|第三部分:安装X并配置ALSA]]'''<br />
<br />
'''[[#第四部分:安装并配置桌面环境|第四部分:安装并配置桌面环境]]'''<br />
<br />
==第一部分:安装基本系统==<br />
===一、获取最新的系统安装包===<br />
<br />
你可以从[http://archlinux.org/download/ 这里]获取Arch最新的官方系统安装包。最新版本是2009.08<br />
<br />
*不论是Core还是Netinstall系统安装包,都只是包含了安装'''Arch Linux基本系统'''所需的软件包. ''注意,基本系统是不包含GUI图形界面的。它主要包含了GNU的系列工具(编译器、汇编程序、链接、库、脚本,还有其它的一些有用的工具),Linux的内核,还有一些额外的库和模块。<br />
*Core映像文件可以较方便的通过CD或者网络进行安装。<br />
*Netinstall映像文件较小巧,本身没有提供软件包,整个系统都是通过internet来获取的。<br />
*isolinux映像文件是给那些使用grub版本时发生问题的用户的。两者没有其它区别。<br />
*Arch64问答( http://wiki.archlinux.org/index.php/Arch64_问答_(简体中文) )可以帮助你在32位版本和64位版本之间作出选择。<br />
<br />
====CD 系统安装包====<br />
把下载的.iso映像文件刻录到CD上。开机时用CD启动,出现界面,跳到[[#二、启动Arch Linux系统安装程序| 二、启动Arch Linux系统安装程序]]<br />
{{Box Note| 通常为了刻录的稳定可靠(速率越低刻录质量越有保证),推荐刻录的最大速度不超过16倍速。有些用户推荐'''''速度为 4x 或者 2x.''''' 如果所刻录的CD有问题,可以尝试使用你系统所支持的最小速度方式刻录。 }}<br />
<br />
<br />
====USB安装方式====<br />
{{Warning|这样做会把USB盘里面原有的数据格式化。}}<br />
<br />
'''<code>UNIX</code> 方式:'''<br />
<br />
插入USB盘,找到其路径,用<code>/bin/dd</code>命令把.img映像文件写入USB(Linux下):<br />
<br />
dd if=archlinux-2009.08-''{core|netinstall}''-''{i686|x86_64}''.img of=/dev/sd''x''<br />
<br />
if= 后面是.img镜像文件的路径,of= 是你的USB路径. 要使用/dev/sd''x''而不是/dev/sd''x1''.(就是要使用整个分区而不是第一分区)<br />
<br />
'''检查镜像的完整性md5sum (可选):'''<br />
<br />
记下读入和写出的记录区数目,然后执行以下命令进行检查:<br />
dd if=/dev/sd''x'' count=''记录区数目'' status=noxfer | md5sum<br />
<br />
md5sum命令返回的值(这是你检查U盘上文件得到的)要与你下载的archlinux镜像文件的md5sum校验值相同;它们都应该和镜像站点的md5sum文件列表里相应的值相同。<br />
<br />
'''Windows方式:'''<br />
<br />
从https://launchpad.net/win32-image-writer/+download 下载Disk Imager。插入U盘,启动Disk Imager并选择映像文件,再选择U盘相应的磁盘驱动号,点击"write"即可。<br />
<br />
===二、启动Arch Linux系统安装程序===<br />
Usually, the first item is the preferred selection. However, choose Boot Archlive or Boot Archlive [legacy IDE] if you have trouble with libata/PATA, or have no SATA (Serial ATA) drives.<br />
<br />
Also, to change boot options, press '''e''' for editing the boot lines. Many users may wish to change the resolution of the framebuffer, for more readable console output. Append:<br />
插入刻录好的光盘CD或者USB盘,然后用它启动电脑。可能需要在BIOS里(通常是启动后在加电自检过程中按DEL、F1、F2、F11或者F12)改变一下启动顺序使得CD或者USB先被启动。<br />
<br />
{{Note|内存需求:<br />
* Core : 160 MB RAM x86_64/i686 (选择所有软件包,开启交换分区)<br />
* Netinstall : 160 MB RAM x86_64/i686 (选择所有软件包,开启交换分区)}}<br />
<br />
启动了Arch Linux光盘后,用上下箭头高亮菜单,按下回车键进行选择。<br />
<br />
通常,推荐选择第一项菜单。不过如果使用libata/PATA出现问题或者没有SATA (Serial ATA)驱动器,你也可以选择Boot Archlive或者Boot Archlive [legacy IDE] 。<br />
<br />
如果你需要改变启动参数,可以按‘e ’键来编辑启动行内容。 含多用户可能希望改变framebuffer分辨率以得到更好的终端显示。将<br />
vga=773<br />
加到kernel一行的后面,然后按<ENTER>,就可以得到1024x768的framebuffer。设置完毕后按'''b'''则使用相应的选择项进行启动。<br />
<br />
系统将会启动并提示登录,这时可以用'root'进行登录(不要加上单引号)。<br />
<br />
如果你的机器从live CD启动时发生错误或者一些其它'''硬件hardware'''错误,请参看[[Installation Troubleshooting]]。<br />
<br />
<br />
====登录并根据需要更换键盘映射表====<br />
如果你使用non-US键盘布局,可以用命令选择相应的键盘映射表。<br />
# km<br />
或者是是用loadkeys命令<br />
# loadkeys ''layout''<br />
(把''layout''替换成你需要的,比如 &quot;<code>fr</code>&quot; 或者 &quot;<code>be-latin1</code>&quot;)<br />
<br />
====边安装边查看安装指南====<br />
在刻录的livecd里面,已经包含了官方安装指南,在安装的时候可以边安装边查看,按组合键<ALT>+F2 切换到控制台vc/2(alt+f3,alt+f4……分别可以切换到对应的控制台vc/3,vc/4……以此类推),然后输入:<br />
<br />
# less /arch/docs/official_installation_guide_en<br />
<br />
按组合键<ALT>+F1回到控制台vc/1,继续安装系统。安装过程中可以随时切换回vc/2来查看安装指南。<br />
<code>less</code> 是个文本查看程序,位于<code>/usr/bin/less</code><br />
{{tip|请注意,官方指南仅涵盖基本系统的安装和配置过程。一旦安装完毕,强烈建议回到本wiki浏览更多安装后续已经相关问题。}}<br />
<br />
===三、开始安装===<br />
键入<br />
/arch/setup <br />
开始安装。<br />
<br />
====1、选择安装来源====<br />
接着会出现一个选择安装来源的提示。如果你用core ISO的话请选择CD,如果使用FTP ISO的话则选择FTP。<br />
* 如果选择 CORE installer,可以直接看下面的硬盘分区配置。<br />
* FTP/HTTP only: 选择这个需要预先加载网络驱动以便联网安装. 使用Udev来加载这些模块非常有效.<br />
按组合键ALT+F3切换到控制台vc/3,确认一下看其是否生效 invoking ifconfig -a . (Select OK to continue.) ——把后面的网络配置提前看<br />
<br />
====2、设置时间====<br />
有两个选择:<br />
* UTC - 如果使用unix系统包括Linux, Freebsd等, 建议使用UTC<br />
* local - 如果和Windows共享多引导系统, 建议使用local<br />
<br />
====3、硬盘分区配置====<br />
选择第一个菜单项"Prepare Hard Drive"。请注意,"Auto-Prepare"(自动分区)并不是最佳的选择,因为它只分配了最基本的三个区( /,/home,swap)<br />
在这里我们用手工进行硬盘分区。选择"2. Partition Hard Drives",接着选要分区的硬盘(比如:/dev/sdx),然后按你需要编辑分区表。<br />
<br />
''Arch Linux安装程序使用cfdisk公用程序来对硬盘进行分区。''<br />
<br />
''接下来,熟悉GNU/Linux的用户可以跳过这段内容直接到下面'''[[#选择软件包|选择软件包]]'''。''<br />
<br />
=====分区信息=====<br />
<br />
对磁盘进行分区是指在磁盘上定义若干区域(分区),每个都象是一个独立的磁盘,可以在其上创建(格式化)一个文件系统。 分区的类型分为主分区(Primary)、扩展分区(Extended)和逻辑分区(Logical)三类。 <br />
<br />
主分区可以被启动,一个物理磁盘最多能有4个主分区。要使用超过4个的话,只能使用一个包含了逻辑分区的扩展分区。<br />
(译者注:为避免误解,较易懂的解释应该是:一个磁盘不算逻辑分区最多只能有4个分区,这4个要么全是主分区,要么就是3个主分区+1个扩展分区,当然你将整个磁盘划为1个主分区也是没问题的,只要不超过4个分区即可)<br />
<br />
扩展分区通常不会被直接使用,它是作为逻辑分区的“容器”存在。一个硬盘只能有一个扩展分区,可以在里面继续再划分逻辑分区。<br />
<br />
当对一个磁盘进行分区时,是按这种数字顺序命名:主分区为sda1-3,跟着是扩展分区sda4(译者注:在/dev和fdisk -l里是看不到这个sda4的),在扩展分区中划分出来的逻辑分区分别是sda5、sda6,如此类推。<br />
<br />
=====交换分区swap=====<br />
交换分区Swap是虚拟内存在硬盘上驻留的地方,内核可以用它来储存在物理内存中放不下的数据。<br />
<br />
过去,常用的规则是将交换分区大小设置为物理内存的两倍。但是随着时间推移,现在的计算机已经有更大的内存容量,这条规则已经不适用了。通常,512MB内存的计算机,两倍(1G)的还是够用的。而1G内存的计算机,一倍的也够用了。如果你有更大的内存(比如超过1GB),也许可以完全把交换分区忘了,不推荐这样做!<br />
* ''如果你打算使用休眠到磁盘的电源方案,你必须要有不小于内存容量大小的交换分区,有些用户甚至会推荐大于物理内存容量15%的大小。''<br />
<br />
=====规划分区=====<br />
磁盘分区的规划是十分个人的设置。每位用户的决策都会根据自己计算机的情况和需求而不同。至少需要有一个包含了根[http://en.wikipedia.org/wiki/File_system 文件系统] ( / )的主分区和一个交换分区。你还可以选择给/boot(主要用来存放内核文件)、/usr、/var和/home(用来存放用户个人数据)划出独立分区。一个较好的做法是给 / 和 /home都划分独立分区。这样的话,当你因为某些原因重装Arch Linux(或者其它发行版),你还可以保留你的个人数据例如音乐、图片、桌面环境配置等。<br />
<br />
在本案例中,我们划分一个分区给 /,一个给/home,另外还有一个交换分区。<br />
<br />
=====开始创建分区cfdisk=====<br />
让我们开始创建一个包含'''root'''(/)文件系统的主分区。 <br />
<br />
选择'''N'''ew -> Primary,然后输入你希望的分区大小(对一个完整的Linux系统,4到8G是个不错的选择)。分区要位于磁盘的开头部分。选择刚新建的分区,接着选择'''B'''ootable将它置为可启动。<br />
<br />
同时选择分区文件系统类型'''T'''ype,指定为'83 Linux'.。<br />
<br />
给你的/home目录创建另一个分区。选择另外一个主分区设成你想要的容量大小,这取决于你的用户会在他们的home目录里储存多少文件,其大小可能从几百M办公文档到上百G音频视频,所以这里我无法给出一个建议。如果你要使用磁盘所有的剩余空间,记得保给交换分区留一部分(例如1GB或1024MB)。<br />
<br />
同样的,选择'''T'''ype为'83 Linux'。 <br />
<br />
最后,我们给交换分区创建一个分区。选择一个介于512MB到1GB之间的大小并将'''T'''ype改为82 (Linux swap / Solaris)。<br />
<br />
现在的分区规划看起来应该象这样(基于你的选择大小也许会有所不同):<br />
<br />
Name Flags Part Type FS Type [Label] Size (MB)<br />
-------------------------------------------------------------------------<br />
sda1 Boot Primary Linux (4096 - 8192)<br />
sda2 Primary Linux (> 100)<br />
sda3 Primary Linux swap / Solaris (512 - 1024)<br />
<br />
选择'''W'''rite并输入''''yes''''。要注意如果你删除了分区的话,这个操作会破坏你磁盘上的数据。选择'''Q'''uit退出分区程序。<br />
选择Done离开此菜单,接着选择"Set Filesystem Mountpoints"。<br />
<br />
=====IDE设备,为什么看起来它们和SCSI设备一样?=====<br />
最新开发的Linux内核里包含了libata和PATA模块,所有的IDE、SATA和SCSI都采用sd''x''这种命名方式。这十分正常,无需担心。<br />
<br />
=====设置文件系统挂载点=====<br />
<br />
''' ”文件系统格式(filesystems)“和”文件系统结构(file systems)“的区别:'''<br />
<br />
从技术层面确切的说,'''文件系统格式(filesystems)'''是一种数据'''格式''',涉及信息吞吐,比如ext2;而”文件系统结构(file systems)“则是特定操作系统中文件和目录的布局,比如/home/username/games。因此,当你被问及是否创建'''文件系统格式(filesystems)'''时,是在问你是否要'''格式化'''该分区…但是当程序向你问及挂载点时,你应该给出的则是该分区应该出现在你的Arch Linux ”文件系统结构“中的位置。<br />
<br />
'''文件系统类型:'''<br />
<br />
'''强烈建议:'''创建一个交换分区(SWAP)。选择一个合适的分区(本例中使用的是sda3). 安装程序就会询问你是否要创建swap 文件系统; 选择 yes. 接下来, 选择根分区的挂载点(本例中就是 sda1). 然后安装程序就会询问你需要哪一种文件系统。<br />
<br />
{{Box Note| 采用何种文件系统的类型取决于实际应用需要,没有十全十美的文件系统,选择任何一个文件系统,都需要在数据安全和性能要求方面作出适当倾斜,下面只是简单的介绍各种Arch linux支持的文件系统 }}<br />
<br />
1. '''ext2''' - 古老、 可靠的 GNU/Linux 文件系统。非常的稳定,不过 ''不支持日志记录功能''。磁盘检测速度较慢,因而有些不便. ''ext2可以容易地转换成ext3''。一般认为/boot分区采用此系统最合适,因为/boot里的东西就开机的时候读取一次,而且很少有变动,不需要日志文件系统,如果采用日志文件系统,日志的体积很可能远远大于内核的大小。<br />
<br />
2. '''ext3''' - 基于ext2系统, 并添加了日志记录功能。 一般认为他比其他文件系统要 ''稍微的'' 慢一点, 不过 ''非常的'' 稳定并且使用最为广泛,由 GNU/Linux FS 负责维护和开发。<br />
<br />
'''高性能文件系统:'''<br />
<br />
3. '''ext4''' - 最近加入支持的文件系统,是ext2和ext3的后续发展版本,Ext4增加了48位块地址,最大支持1EB文件系统,和单个16TB的文件,增加子目录限制到64,000。新增了很多功能,提供在线碎片处理,速度比ext3快,系统开销比ext3小。<br />
{{Box Note| 由于此系统较新,目前仍存在一些问题,暂时建议/home分区不采用此文件系统,以保证个人数据安全。}}<br />
<br />
4. '''ReiserFS''' - Hans Reiser 主持编写的高性能的日志文件系统,使用一种非常独特有趣的数据存储检索方法。ReiserFS 效率非常高, 特别在处理很多小文件的时候更是如此。ReiserFS在挂载的时候相对比较慢. 性能稳定。 ReiserFS 现在的开发并不活跃(最新的版本是Reiser4).<br />
<br />
5. '''JFS''' - IBM提供的日志文件系统( '''J'''ournaled '''F'''ile'''S'''ystem首字母缩写). JFS 效率非常高并且CPU资源占用率比其他任何一个文件系统都要低。并且在挂载和磁盘检测的时候都非常快,在各方面的表现都非常突出,尤其是 conjunction with the deadline scheduler. (参见 [[JFS]].) 但是并不像ext或者ReiserFS那样应用广泛。<br />
<br />
6. '''XFS''' - 非常高效的日志文件系统,特别适合处理大文件。在处理小文件的时候稍慢。在挂载的时候也很快。由于 /var 需要处理很多的小文件,所以可能不太适合作为/var 分区的文件系统。 GNU/Linux 文件系统中,最先实现可用的在线碎片处理。应用不及ext和ReiserFS那么广泛。<br />
* JFS 和 XFS 不能被磁盘工具压缩(比如gparted 或者 parted magic)<br />
<br />
'''未来文件系统'''<br />
<br />
7、btrfs - 此文件系统尚未被Arch纳入正式支持。是Oracle提供的copy-on-write档案系统。目标在取代的ext3,提高ext3单一档案的大小,总档案系统大小或档案检查,加入目前ext3未支援的功能,比如:writable snapshots,snapshots of snapshots,内建磁盘阵列(RAID)支援,and subvolumes。<br />
<br />
最主要的差别在于[http://en.wikipedia.org/wiki/Journaling_file_system 日志系统] (一种类似的在数据库环境中记录着日志变更的东西). 除ext2之外,其他文件系统都支持日志记录功能. ext3 完全兼容 ext2,因此哪怕你可以用一个非常古老的CD来挂载他,也没问题。 根分区目前最安全的选择就是使用ext3文件系统。ReiserFS,XFS,和JFS也可以使用,因为GRUB (启动引导管理器,稍候在安装部分将会介绍到) 都可以从这些文件系统中启动。你可以通过选择‘’‘yes’‘’来创建文件系统(并格式化分区),接着你就会被提示添加附加分区。 在我们的例子中, 只有sda2了。 选择一个文件系统类型,并且把这个分区挂在到/home. 再次说明,创建文件系统并且选择Done。然后回到主菜单。<br />
<br />
====4、选择软件包====<br />
现在我们要选择安装哪些软件包到系统中。选择CD作为来源,如果你不止一个光驱的话还需要选择使用哪个的光驱。<br />
<br />
软件包选择分为两个阶段。首先要选择软件包分类,然后出现所选分类中软件包的详细列表供你微调。使用空格键进行选择和取消。<br />
<br />
''*BASE:包含最小的软件包集合,仅够构建一个可运行的系统骨架。''<br />
''*SUPPORT:供网络和文件系统用的额外软件包,例如gpm、fuse、dnsutils、无线驱动、ndiswrapper、ntfs-3g诸如此类。''<br />
''*DEVEL:软件创建工具,如GCC、autoconf、automake和make等等。''<br />
''*LIB:大量的库文件,如gmp、lebelf、libevent等等。''<br />
*''' 2008.06 版'''的软件包选择,只有一个: BASE ,选择之后进入其详细列表. <br />
<br />
在这里,我们对'Select all packages by default'选择'yes'。<br />
<br />
接下来屏幕将显示你所选的软件包。对于新手,较安全的做法是不修改它,而有经验的用户可能希望裁减掉一些不需要的软件包。(例如,不需要的文件系统类型公用程序,不需要的驱动等等。)<br />
<br />
====5、安装软件包====<br />
接着,选择'Install Packages'。你会被询问是否希望保留pacman缓冲里的软件包。如果你选'yes',日后你还可以选择对某些软件包进行降级,因此推荐保留(日后你还是可以清除这些缓存的)。安装脚本跟着就会安装所选软件包到你的系统中。这些软件包是二进制的、针对i686优化的,总共仅100MB,因此安装是相当便捷的。<br />
<br />
====6、配置系统====<br />
系统接着会询问你是否要选择[[Hwdetect|hwdetect]]来收集配置所需信息。新手应该选择是('yes')。<br />
<br />
如果是相当熟悉自己的硬件、所需模块,有能力从零开始手动配置/etc/mkinitcpio和/etc/fstab 的高级用户,可以选择否'no'。(当然,此选项是非常复杂的,已经超过本指南的范围,这里就不详细解释了。)<br />
<br />
接下来,系统会询问你是否需要支持从USB设备、FireWire设备、PCMCIA设备、NFS共享、软RAID阵列、LVM2卷和加密卷上启动。如果需要则选'yes',在本案例中以上都不选。<br />
<br />
新手还应该选择让/etc/mkinitcpio/kernel26-fallback.conf使用[[Hwdetect|hwdetect]]的结果,这将确保你的硬盘控制器相容次序。<br />
<br />
现在系统会询问你使用哪个文本编辑器;如果你不熟悉[http://en.wikipedia.org/wiki/Vim_%28text_editor%29 vi/vim]的话可以选择[http://en.wikipedia.org/wiki/Nano_%28text_editor%29 nano]。然后就会出现一个包含系统中大部分重要配置文件的菜单。如果你打算查找/etc/rc.conf中可用的选项,只需按Alt+F2切换到另外一个虚拟控制台进行查找,然后用Alt+F1切换回安装程序。<br />
<br />
======系统配置主文件'''/etc/rc.conf'''======<br />
Arch Linux继承FreeBSD的传统,使用'''/etc/rc.conf'''作为系统配置的主要文件。这个文件包含了广泛的配置信息,主要用于系统的启动。正如名字中所包含的意思,它还包含了供/etc/rc*文件使用的配置。/etc/rc.conf提供了一个Arch用户可以轻易访问到的,简洁而又范围广泛的精简系统资源配置方案。<br />
* '''LOCALIZATION'''部分<br />
** '''LOCALE'''=: 系统场所(locale)设置,被所有国际化(i18n-aware)的应用程序使用 。从命令行上运行locale可以列出可用的locale设置。此设置缺省是适合英文(US English)用户使用的en_US.utf8。(此处locale的设置必须与/etc/locale.gen一致,'''[[#/etc/locale.gen|详见下文]]'''。)中文一般是zh_CN.UTF-8,如果使用之后乱码,先换回en_US.utf8,等进图形界面后再换回来。<br />
** '''HARDWARECLOCK'''=: 指示开关机时进行同步的硬件时钟,是'''UTC'''时间(协调世界时(Universal Time Coordinated), 过去曾用格林威治平均时(GMT)来表示)还是'''localtime'''(本地时间)。通常UTC较为好,因为它大大简化了时区和日光节约时间(中国过去称为夏时制)的变更。而当你同时还有其它操作系统如windows进行双启动,就必须使用localtime(本地时间),它只把本地时间保存到硬件时钟里。<br />
** '''TIMEZONE'''=: 时区(TIMEZONE)。(所有可用的时区可在/usr/share/zoneinfo/里找到。)<br />
** '''KEYMAP'''=: 可用的键盘映射表可在/usr/share/kbd/keymaps里找到。请注意此设定仅在TTY中有效,在所有图形窗口管理器或者X中都不使用此设置!<br />
** '''CONSOLEFONT'''=: 如果你一定要修改此设置,可在/usr/share/kbd/consolefonts/中找到可用的字体。<br />
** '''CONSOLEMAP'''=: 定义了启动时setfont程序加载的控制台映射表。有需要的话,可在/usr/share/kbd/consoletrans里找到可用的映射表。<br />
** '''USECOLOR'''=: 如果你使用彩色显示器的话请选"yes"。<br />
<br />
LOCALE="zh_CN.UTF-8"<br />
HARDWARECLOCK="localtime"<br />
TIMEZONE="Asia/Shanghai"<br />
KEYMAP="us"<br />
CONSOLEFONT=<br />
CONSOLEMAP=<br />
USECOLOR="yes"<br />
* '''HARDWARE'''部分<br />
** '''MOD_AUTOLOAD'''=: 如果你使用'''udev'''在启动时探测硬件并加载相应模块。请设置为"yes",(适合缺省模块化的内核)。设置为"no"就得靠用户自己指定所需的有关信息。<br />
** '''MOD_BLACKLIST'''=: 模块黑名单。在下面的例子中,IPv6模块和pcspeaker都被列入黑名单而不被加载。<br />
** '''MODULES'''=: 指示了其它模块,如果你知道缺少哪个重要的模块可以加在里面。('''hwdetect'''应该已经填写了最重要的模块):<br />
# Scan hardware and load required modules at bootup<br />
MOD_AUTOLOAD="yes"<br />
# Module Blacklist - modules in this list will never be loaded by '''udev'''<br />
MOD_BLACKLIST=(net-pf-10 pcspkr)<br />
#<br />
MODULES=(e100 eepro100 mii slhc snd-ac97-codec snd-intel8x0 soundcore)<br />
* '''NETWORKING'''部分<br />
** '''HOSTNAME'''=:设置为你喜欢的主机名(HOSTNAME)。<br />
** '''lo'''=: 不修改此行。<br />
** '''eth0'''=: 如果使用'''静态IP'''的话请调整网络接口的IP地址、掩码和广播地址。如果使用'''DHCP'''的话则设为eth0="dhcp"。<br />
** '''INTERFACES'''=: 指定使用哪些网络接口。如果你不使用DHCP来配置设备,而是通过命令行用ifconfig手动配置设备的话,这里的变量值(名字必须等于打算进行配置的设备名一样)必须和ifconfig里加入的内容一样。<br />
** '''gateway'''=: 如果你使用'''静态IP''',将网关(gateway)地址设为路由器的IP。如果使用DHCP,则将此行用'#'注释掉。<br />
** '''ROUTES'''=: 如果你使用'''静态IP''',则将'gateway'前面的'!'去掉。如果使用'''DHCP'''的话则不需要修改此行。<br />
<br />
<br />
例如,当使用'''DHCP''':<br />
HOSTNAME="arch"<br />
lo="lo 127.0.0.1"<br />
#eth0="eth0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255" <br />
eth0="dhcp"<br />
INTERFACES=(lo eth0)<br />
#gateway="default gw 192.168.0.1"<br />
ROUTES=(!gateway)<br />
* '''DAEMONS'''部分<br />
这个序列罗列了位于/etc/rc.d/里需要在启动过程中启动的脚本名字。<br />
<br />
*如果脚本名字前有惊叹号(!),表示它不被执行。<br />
*如果脚本名字前有符号(@),则表示它会在后台被执行,启动序列不会等待此脚本成功执行完毕,而是继续执行下一个守护进程脚本。<br />
<br />
这种'BSD风格'的初始化就是Arch的处理办法,而其它发行版则是在一个init.d目录里使用一大堆符号链接(一个简单的文件 vs 一整个目录)。<br />
<br />
======关于守护进程======<br />
虽然此时你不需修改[[daemons]]行,不过还是有必要解释一下什么是守护进程,因为过一会儿在指南里我们会需要它。<br />
<br />
和Windows服务(service)类似,守护进程(daemon)是一个运行于后台的程序,等待事件发生并提供服务。一个较好的例子是webserver等待请求以发送页面,还有SSH服务等待用户登录。这些都是全功能的程序,还有些守护进程工作起来并不是那么明显的。例如向日志文件里写信息的守护进程(如syslog、metalog),当系统空闲时降低CPU频率的守护进程(如cpufreq),以及提供图形化登录的守护进程(如gdm、kdm)。所有这些程序都可以被加入到daemons行中,在系统启动时被执行。本指南会对一些较有用的守护进程进行介绍。<br />
按Ctrl+X退出nano编辑器。<br />
<br />
======磁盘和分区配置文件:/etc/fstab======<br />
'''fstab''' ('''f'''ile '''s'''ystems '''tab'''le的缩写) 是系统配置的一部分,该文件列出所有可用的磁盘和分区,并指明它们初始化的方式或整合至全局文件系统的方式。'''/etc/fstab'''文件一般被'''mount'''命令读取,以决定某一特定设备被挂载时所采用的选项。<br />
<br />
这是一个'''/etc/fstab'''的例子:<br />
<br />
#<br />
# /etc/fstab: static file system information<br />
#<br />
# <file system> <dir> <type> <options> <dump> <pass><br />
none /dev/pts devpts defaults 0 0<br />
none /dev/shm tmpfs defaults 0 0<br />
#/dev/cdrom /mnt/cdrom iso9660 ro,user,noauto,unhide 0 0<br />
#/dev/dvd /mnt/dvd udf ro,user,noauto,unhide 0 0<br />
#/dev/fd0 /mnt/fd0 vfat user,noauto 0 0<br />
/dev/sda1 / jfs defaults,noatime,nodiratime 0 1 <br />
/dev/sda2 /home jfs defaults,noatime,nodiratime 0 2<br />
/dev/sda3 swap swap defaults 0 0<br />
Hwdetect应该已经有效地配置了一个可用的'''fstab''',但最好还是简要地检查一下。<br />
<br />
*如果你打算用'''hal'''来自动挂载DVD之类的媒体,为了给即将安装的'''hal'''做准备,你可能要注释掉cdrom和dvd条目。 <br />
<br />
''在笔记本电脑和桌面系统上,可以给 / 和 /home加上'noatime'和'nodiratime'选项来提高速度、性能,同时还能省电。无论你采用何种文件系统,这样做都应该是安全的。''<br />
<br />
更多信息请参照[[Fstab]]<br />
<br />
======'''mkinitcpio.conf、modprobe.conf和kernel26-fallback.conf'''======<br />
此时我们无须去修改这些配置文件。'''mkinitcpio.conf'''负责配置ramdisk(例如从RAID、加密卷启动), '''modprobe.conf'''可以用来设置内核模块的的某些配置选项,而'''kernel26-fallback.conf'''则是initramfs后备配置。<br />
<br />
======(对于静态IP)网络配置文件:/etc/resolv.conf ======<br />
*''如果你使用DHCP,完全可以忽略此文件,缺省情况下dhcpd守护进程会自动创建和销毁此文件。''<br />
<br />
如果你使用静态IP,则可在/etc/resolv.conf里设置你的DNS服务器。每行的格式为nameserver <ip地址>,如果有多个DNS服务器则可以填入多行。<br />
<br />
如果你使用路由器,也许会希望由你的路由器本身指定DNS服务器,而在'''resolv.conf'''里只是写入你的路由器的IP(同时也是'''/etc/rc.conf'''里的网关),例如:<br />
nameserver 192.168.1.1<br />
可选的,逐个加入你的DNS服务器,例如:<br />
nameserver 4.2.2.1<br />
nameserver 4.2.2.2<br />
<br />
如果使用'''DHCP''',你也可以在你的路由器里指定你的DNS服务器,或者如果你的ISP支持的话由ISP自动指定。<br />
<br />
======/etc/hosts======<br />
可以在此文件中加入你想要的''hostname'',必须和/etc/rc.conf里的设置一致,因此它应该象这样:<br />
127.0.0.1 localhost.localdomain localhost '''''yourhostname'''''<br />
''为了程序的兼容性,必须严格遵照这个格式,'''包括'localhost' 这项'''!错误的句法可能会导致网络性能低下和/或某些程序运行缓慢甚至无法运行。这对新手来说是十分普遍的错误。''<br />
<br />
对于大部分用户,只要把''yourhostname''加入到行末就就可以了,不过有些用户推荐以下句法:<br />
127.0.0.1 '''''yourhostname'''''.domain.org localhost.localdomain localhost '''''yourhostname'''''<br />
如果你使用静态IP,可以用这种句法加入新行:<static-ip> hostname.domainname.org hostname,例如:<br />
192.168.1.100 '''''yourhostname'''''.domain.org '''''yourhostname'''''<br />
<br />
======/etc/hosts.deny和/etc/hosts.allow======<br />
如果你打算使用[[SSH|ssh]]的话,请根据自己的需要修改此配置。缺省设置是拒绝所有进入的连接,而不只是ssh连接。编辑'''/etc/hosts.allow '''文件加入:<br />
<br />
* 允许所有进入的ssh连接。<br />
sshd:all <br />
<br />
* 允许特定IP地址进入ssh连接。<br />
sshd: 192.168.0.1<br />
<br />
* 允许你指定的网段 (地址从 192.168.0.0 到 192.168.0.255)<br />
sshd: 192.168.0.<br />
<br />
* 允许某个IP地址范围<br />
sshd: 10.0.0.0/255.255.255.0<br />
<br />
如果你不打算使用[[SSH|ssh]],为安全起见请保持此文件的缺省设置(为空)。<br />
<br />
======/etc/locale.gen======<br />
<br />
'''locale-gen''' 命令从 '''/etc/locale.gen'''读取信息设定系统的locales. 这些设置稍后会被'''glibc''' 和其他一些支持本地化的程序或者库用于自动翻译输出各种语言的"独特" 文本, 并且合适的显示地域、货币、时区以及日期格式, 字符排列方式和其他一些本地化的特殊标准。设置默认本地化的功能是类<code>UNIX</code>操作系统的一大特质<br />
<br />
默认情况下 /etc/locale.gen 是一个仅包含注释文档的空文件.编辑后,这个文件将不会get touched again. 每次'''glibc'''更新之后'''locale-gen'''就会运行一次, 以在/etc/locale.gen重新生成所有的本地化设置.<br />
<br />
选定你需要的本地化类型(移除前面的#即可), 比如:<br />
en_US ISO-8859-1<br />
en_US.UTF-8 <br />
('''你这里的设置必须和上文中提到的/etc/rc.conf 的设置一致哦.''')<br />
<br />
现在,安装程序将运行locale-gen 脚本, 以生成你设定的locales。你以后可以通过修改文件/etc/locale.gen变更你的locale, 然后使用根用户(root)运行'locale-gen'脚本使之生效。<br />
<br />
''Note 如果你选择并设置了locale, 他将提示你 "The current locale is invalid..." 错误。可能是因为大多数新Arch用户都会犯的普遍的错误,也是在论坛中问得最多的问题。''<br />
<br />
======Root密码======<br />
最后,设置一个root密码并确定你已牢记它。返回主菜单然后接着安装启动加载器。<br />
<br />
======Pacman镜像======<br />
为'''pacman'''选择一个镜像软件仓库。记住archlinux.org是有流量限制的,下载速度限于50KB/s.。<br />
<br />
*''如果你不熟悉现有的镜像和它们所处的位置,那就随便选一个。稍后你可以运行本指南后面提到的'''rankmirrors'''脚本,它将自动配置最接近你的镜像。''<br />
<br />
返回主菜单。<br />
<br />
====7、安装启动加载器====<br />
因为本案例中没有第二个操作系统,因此我们需要安装一个启动加载器。推荐选择[http://www.gnu.org/software/grub/ GNU GRUB]作为启动加载器。另外一种选择是[http://lilo.go.dyndns.org/ LILO]。缺省的'''GRUB'''配置('''/boot/grub/menu.lst''')应该足够了。唯一你可能想修改的是控制台的分辨率。将vga=<number>加入到第一个kernel行。(menu.lst中已列出一张分辨率和数字的对应表格可供查找。)<br />
title Arch Linux (Main)<br />
root (hd0,0)<br />
kernel /boot/vmlinuz26 root=/dev/sda1 ro vga=773<br />
initrd /boot/kernel26.img<br />
参数"vga=773"表示1024x768分辨率、256色的framebuffer。<br />
<br />
将'''GRUB'''启动加载器安装到主引导区(本例中为sda)。<br />
<br />
====8、系统重启====<br />
退出安装程序。<br />
*建议:为了方便接下来更进一步的安装配置,可以把光盘里的新手指南复制一份到电脑里,这样后面的安装就能查看相应的向导了<br />
<br />
cp /arch/beginnersguide.txt /mnt/home/beginnersguide.txt<br />
<br />
系统重启之后,进入控制台,可以使用下面命令查看这新手指南<br />
less /home/beginnersguide.txt<br />
所有安装完毕之后,可以删了这指南<br />
rm /home/beginnersguide.txt<br />
<br />
输入命令下面命令,重启:<br />
<br />
reboot<br />
<br />
一个新Arch Linux系统就会启动并进入登录提示符(你可能需要在'''BIOS'''将启动顺序改为优先从硬盘启动)。<br />
<br />
'''祝贺你,一个崭新的Arch Linux基础系统闪亮登场了!'''<br />
<br />
==第二部分:完成基本系统并升级==<br />
你的新Arch Linux基础系统现在已是一个功能完整的GNU/Linux环境了,随时可以进行定制。从现在开始,你可以按自己的意图和需求改造它。由于arch是滚动发布的,所以安装包不一定是最新的系统,所以我们在安装完成之后,需要立即更新系统。<br />
<br />
让我们开始吧。<br />
-----<br />
登录入你的root账号。我们将以root身份配置pacman和更新系统,然后创建一个普通用户账号。<br />
<br />
===一、配置网络(如果有需要)===<br />
*''如果安装脚本的自动配置不适合你,本段内容将帮助你配置大部分类型的网络。''<br />
-----<br />
如果一切正常的话,你的网络应该可以正常使用了。先ping www.google.com验证一下:<br />
ping -c 3 www.google.com<br />
<br />
''如果你已经成功建立网络连接,则跳到下面阅读[[#使用pacman更新、同步、升级系统|使用pacman更新、同步、升级系统]]'''。''<br />
<br />
如果ping www.google.com后得到"unknown host"的错误,可以认为你的网络尚未正确配置。你需要重新检查以下内容的完整性和正确性:<br />
'''/etc/rc.conf''' # 特别留意HOSTNAME= 和 NETWORKING 部分有无输入错误。<br />
<br />
'''/etc/hosts''' # 复核一下格式。(看之前的内容。)<br />
<br />
'''/etc/resolv.conf''' # 当你使用静态IP时需要检查。如果你使用DHCP,缺省这个文件会被自动创建和销毁,不过也可以改为你需要的内容。(参见[[Network]]。)<br />
<br />
高级的网络配置方法可以在[[Network]]一文中找到。<br />
<br />
=====有线网络=====<br />
<br />
用以下命令检查网络<br />
ifconfig<br />
你应该看到eth0这一项。如果有需要,你可以这样设置一个新的静态IP:<br />
ifconfig eth0 <ip address> netmask <netmask> up <br />
并且这样设置缺省网关:<br />
route add default gw <ip address of the gateway><br />
查看一下/etc/resolv.conf是否包含你的DNS服务器,不过缺失了则补填进去。<br />
再次用ping www.google.cn检查一下网络。如果一切正常,将/etc/rc.conf调整为刚才新设置的静态IP。如果你的网络使用DHCP服务器/路由器的话,输入:<br />
dhcpcd eth0<br />
如果这样可行的话,则将/etc/rc.conf按之前所述方法调整为动态IP。<br />
<br />
=====无线网络=====<br />
详见安装指南:[[无线设置 (简体中文)|无线设置]]<br />
<br />
=====Analog Modem=====<br />
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.<br />
Tip: Read [[Dialup without a dialer HOWTO]].<br />
<br />
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 [http://www.linmodems.org/ LinModem] homepage.<br />
<br />
=====ISDN=====<br />
<br />
通过三步,完成 ISDN 的安装和配置:<br />
# 安装配置固件Install and configure hardware<br />
# 安装配置ISDN 管理工具<br />
# 添加ISP信息<br />
<br />
现在的 Arch stock kernels 已经包含了ISDN 所需要的modules, 所以不需要重新去编译内核,除非 you're about to use rather odd ISDN hardware. 把ISDN卡插入电脑或者插入USB ISDN-Box之后,you can try loading the modules with modprobe. 绝大部分的ISDN PCI 卡都能被module hisax处理,只需要两个参数:类型和协议。 如果使用的是1TR6标准,则协议设定为 '1' ,如果使用的是EuroISDN (EDSS1),协议设定为 '2', '3' if you're hooked to a so-called leased-line without D-channel, 如果使用的是US NI1,则设为'4'.<br />
<br />
所有配置细节都可以在kernel documentation, more specifically in the isdn subdirectory, and available online中获知。 类型的参数是根据电视卡来设定的,在README.HiSax kernel documentation中,有一个可能类型的列表。 用相应的参数加载moduleChoose,比如这个:<br />
<br />
modprobe hisax type=18 protocol=2<br />
<br />
这个将加载适用于电视卡类型为ELSA Quickstep 1000PCI,德国使用的EDSS1协议的模块hisax。可以在日志文件/var/log/everything.log中查看是否模块被预加载。额外的USB ISDN Adapter需要加载些USB模块才能正常工作。<br />
<br />
通过上述设定之后,如果电视卡能正常工作,那么把下面模块和参数加入/etc/modprobe.conf中:<br />
<br />
alias ippp0 hisax<br />
options hisax type=18 protocol=2<br />
<br />
这么做的好处是,这些模块在不使用时不会被加载。另外的方法是可以在这只加参数,把hisax加入/etc/rc.conf里面的MODULES,这样做的坏处就是不管这些模块是不是在使用,都加载了。 <br />
<br />
完成上述步骤之后,需要安装管理工具<br />
<br />
安装软件包isdn4k-utils,阅读关于isdnctrl的说明手册。在说明手册里,将有详细的说明:如何创建一个配置文件that can be parsed by isdnctrl,安装实例。 Please note that you have to add your SPID to your MSN setting separated by a colon if you use US NI1.<br />
<br />
使用isdnctrl utility配置ISDN卡之后,将可以拨号到你设定的PHONE_OUT参数的机器上,但提示用户名和密码错误。把用户名和密码加入到/etc/ppp/pap-secrets或者/etc/ppp/chap-secrets,这个主要根据的是你的ISP使用的协议授权方式,as if you were configuring a normal analogous PPP link。如果无法确定,可以两个文件都加。<br />
<br />
完成上述设定之后,用root帐号建立一个拨号连接:<br />
isdnctrl dial ippp0<br />
有啥问题,请检查日志文件!<br />
<br />
=====DSL (PPPoE)=====<br />
<br />
仅当需要你的计算机去主动拨号连接ISP的情况下才需参考本段内容。如果你使用独立的路由器来负责这类工作,你只需要设置一个缺省网关即可。<br />
<br />
在使用DSL连接前,你得先在计算机里安装一个连接到DSL-Modem的网卡。将你新装网卡加入到modules.conf/modprobe.conf或者MODULES列表之后,安装rp-pppoe软件包并运行pppoe-setup脚本来配置你的连接。当你输入完有关信息后,可以分别通过以下命令来进行连接和挂断:<br />
<br />
/etc/rc.d/adsl start<br />
<br />
和<br />
<br />
/etc/rc.d/adsl stop<br />
<br />
setup过程一般都是很容易、直观的,如果还有不懂可以阅读man手册。如果你想在启动时自动拨号,可以将adsl加入到DAEMONS列表中。<br />
<br />
<br />
===二、更新Pacman===<br />
<br />
====pacman是什么?====<br />
[[Pacman]]是Arch Linux的软件包管理器('''pac'''kage '''man'''ager)。Pacman是用C语言编写的,速度快,使用简便,功能强大。它可以管理整个软件包系统,负责软件包的安装、删除、降级(通过缓存),也支持自编译的软件包,自动分析依赖关系,可以搜索远程和本地软件仓库,还有大量其它功能。这里我们将用pacman来从远程软件仓库下载软件包并安装到系统中。<br />
<br />
对系统进行定制,pacman是Arch Linux最重要工具。<br />
<br />
====1、配置pacman====<br />
=====pacman总配置文件/etc/pacman.conf=====<br />
Arch通过pacman可以获得对下面 4软件仓库的管理:<br />
<br />
'''[core]'''<br />
<br />
[core](“核心”)仓库的简单原则是只提供一个基本的Arch Linux的基本工具:GNU系列工具,Linux内核,一个文字编辑器,一个命令行浏览器等(这里也有一些例外。比如说,vi和nano是同时提供的,允许用户选择一个或两个)。它包含所有使你的系统正常运转的“必须”安装的包,只有它们完美地工作,你的系统才能继续运行。这些是绝对“system-critical”(对系统来说至关重要)的包。由开发者负责维护。<br />
<br />
*''Core安装媒介(The Core installation media)简单地包含一个安装脚本,一个当前发布版本的核心仓库的快照(snapshot)。''<br />
<br />
'''[extra]'''<br />
<br />
[extra](“额外的”)仓库包含所有的对于一个基本的Arch系统不是必须,但是对于构建一个完整的系统环境有用的的Arch包。 比如'''X''', KDE和Apache,都可以在这里面找到。它也是由开发者维护的。<br />
<br />
'''[testing]'''<br />
<br />
[testing](“测试”)仓库包含的包是[core]和[extra]仓库的候选者。<br />
下面情况下,新的软件包将进入[testing]软件仓库:<br />
* 可能会导致系统出问题的升级,需要测试。<br />
* 需要重新打包其他软件包。这种情况下,所有需要重新打包的软件包将被放在[testing]仓库,直到所有重新打包完成,这些软件包才回归原有的软件仓库。 <br />
<br />
开发者维护。<br />
<br />
[testing]是唯一的一个在名义上与其它官方仓库有冲突的仓库。(that can have name collisions with any of the other official repositories. )<br />
<br />
<font color=&quot;blue&quot;>*如果开启, [testing]必须放在''pacman.conf''的软件仓库的第一个。</font><br />
<br />
<font color=&quot;red&quot;>'''警告''': '''''开启[testing]软件仓库,容易导致系统崩溃,因此只建议有经验的用户开启。'''''</font><br />
<br />
'''[community]'''<br />
<br />
[community](“社区”)仓库是由“信任用户”(''Trusted Users (TUs)'')维护的,是''Arch User Repository ([[AUR]])''(Arch用户仓库)的一部分。它包含的是二进制的包,在用户仓库中有足够的“票数”,并由''信任用戶''挑选出来的。像其它上面列出的仓库一样,[community] 可以用pacman获取。<br />
<br />
'''[[AUR]]''' 也包含'''unsupported''' 分支,这不能直接通过pacman获取。*. [unsupported] 包含多达海量PKGBUILD脚本,用来从源代码编译。这从其它仓库中是不能使用的。 <br />
<br />
<nowiki>*</nowiki> '''''[[AUR Helpers]]''''' 能帮助你无缝地使用AUR。<br />
<br />
'''/etc/pacman.conf'''<br />
<br />
每次调用pacman,它都会读取/etc/pacman.conf文件。这个配置文件分若干段,每一段定义了一个pacman用来搜索软件的仓库。唯一例外的是options段,它定义了全局选项。<br />
nano /etc/pacman.conf<br />
范例:<br />
#<br />
# /etc/pacman.conf<br />
#<br />
# See the pacman.conf(5) manpage for option and repository directives<br />
<br />
#<br />
# GENERAL OPTIONS<br />
#<br />
[options]<br />
# The following paths are commented out with their default values listed.<br />
# If you wish to use different paths, uncomment and update the paths.<br />
#RootDir = /<br />
#DBPath = /var/lib/pacman/<br />
#CacheDir = /var/cache/pacman/pkg/<br />
#LogFile = /var/log/pacman.log<br />
HoldPkg = pacman glibc<br />
# If upgrades are available for these packages they will be asked for first<br />
SyncFirst = pacman<br />
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u<br />
#XferCommand = /usr/bin/curl %u > %o<br />
<br />
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup<br />
#IgnorePkg =<br />
#IgnoreGroup =<br />
<br />
#NoUpgrade =<br />
#NoExtract =<br />
<br />
# Misc options (all disabled by default)<br />
#NoPassiveFtp<br />
#UseSyslog<br />
#ShowSize<br />
#UseDelta<br />
#TotalDownload<br />
#<br />
# REPOSITORIES<br />
# - can be defined here or included from another file<br />
# - pacman will search repositories in the order defined here<br />
# - local/custom mirrors can be added here or in separate files<br />
# - repositories listed first will take precedence when packages<br />
# have identical names, regardless of version number<br />
# - URLs will have $repo replaced by the name of the current repo<br />
#<br />
# Repository entries are of the format:<br />
# [repo-name]<br />
# Server = ServerName<br />
# Include = IncludePath<br />
#<br />
# The header [repo-name] is crucial - it must be present and<br />
# uncommented to enable the repo.<br />
# <br />
<br />
# Testing is disabled by default. To enable, uncomment the following<br />
# two lines. You can add preferred servers immediately after the header,<br />
# and they will be used before the default mirrors.<br />
#[testing]<br />
#Include = /etc/pacman.d/mirrorlist<br />
<br />
[core]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
[extra]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist <br />
<br />
[community]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
# An example of a custom package repository. See the pacman manpage for<br />
# tips on creating your own repositories.<br />
#[custom]<br />
#Server = file:///home/custompkgs<br />
要开启一个软件仓库,只需要将'Include ='和'[repository]'行前的注释符号(#)去除。<br />
<br />
*"Server ="行如果取消注释,将会强制此服务器被首先搜索,详细的仓库配置位于/etc/pacman.d/下。<br />
* 注意:选择仓库时,请确认将仓库名和'Include ='行都一同取消注释。没有这样做的话会导致你选择的仓库被忽略!这是个很普遍的错误。<br />
<br />
=====(如果有必要)配置镜像列表 /etc/pacman.d/mirrorlist=====<br />
更快的镜像能显著改善pacman的性能和你对Arch Linux的总体体验。<br />
<br />
*手动编辑/etc/pacman.d/mirrorlist:<br />
nano /etc/pacman.d/mirrorlist<br />
删除所有不在你所在洲或者太远的镜像。(在nano里你可以用CTRL-K删除每个不需要的行。)保存文件并退出。<br />
<br />
*'''rankmirrors'''脚本可以根据镜像的响应延迟对其自动排名。'''Rankmirrors'''是python脚本,需要安装python:<br />
<br />
pacman -S python<br />
<br />
然后,运行'''rankmirrors'''脚本按响应延迟顺序对镜像进行排名:<br />
rankmirrors -v /etc/pacman.d/mirrorlist<br />
输出会列出所有镜像和它们的响应延迟(ping),例如:<br />
<br />
# United States<br />
# http://mirrors.easynews.com/linux/archlinux/$repo/os/i686 ... 0.96<br />
# ftp://ftp.nethat.com/pub/linux/archlinux/$repo/os/i686 ... unreachable<br />
# ftp://locke.suu.edu/linux/dist/archlinux/$repo/os/i686 ... 2.43<br />
# ftp://mirrors.unixheads.org/archlinux/$repo/os/i686 ... 1.96<br />
<br />
脚本将从低到高的响应延迟顺序显示:<br />
Server = http://mirrors.easynews.com/linux/archlinux/$repo/os/i686<br />
Server = ftp://mirrors.unixheads.org/archlinux/$repo/os/i686<br />
Server = ftp://locke.suu.edu/linux/dist/archlinux/$repo/os/i686<br />
Server = ftp://ftp.nethat.com/pub/linux/archlinux/$repo/os/i686<br />
<br />
要注意的是这个结果对于镜像排列并非很精确,最接近你的镜像或者延迟最低的镜像并不一定是最佳选择。(反应迅速但是内容过时的镜像、或者低延迟但是窄带宽的镜像对你毫无用处)。<br />
<br />
编辑/etc/pacman.d/mirrorlist,将最佳的镜像置于在列表顶端。为了体验多个镜像你可能要不断修改此配置文件,请精明地选择。<br />
<br />
====常用的命令====<br />
<br />
与远程软件仓库同步和更新本地包数据库 (推荐在安装和更新包之前这样做):<br />
pacman -Sy<br />
<br />
'''升级'''系统中所有的包:<br />
pacman -Su<br />
<br />
一条同步、更新、'''升级''' 所有系统中的包的命令:<br />
pacman -Syu<br />
<br />
安装或者升级单个软件包或者一串包(包括其依赖包):<br />
pacman -S packageA packageB<br />
<br />
同步、更新数据库并安装软件包:<br />
pacman -Sy packageA packageB<br />
<br />
移除软件包, 但保留依赖的包:<br />
pacman -R package<br />
<br />
移除单个包,并且移除没有被别的软件依赖的依赖包:<br />
pacman -Rs package<br />
<br />
移除包所有不需要的依赖包并删除其配置文件:<br />
pacman -Rsn package<br />
<br />
通过给定关键词(列表)搜索远程软件仓库数据库(repo):<br />
pacman -Ss keyword<br />
<br />
列出系统中所有的包<br />
pacman -Q<br />
<br />
在本地包数据库搜索 (查询)指定软件包:<br />
pacman -Q package <br />
<br />
在本地包数据库搜索 (查询)指定软件包并列出相关信息:<br />
pacman -Qi package<br />
<br />
To defragment pacman的数据库缓存和速度优化选项:<br />
pacman-optimize<br />
<br />
统计当前系统中的包数量:<br />
pacman -Q | wc -l<br />
<br />
使用ABS和makepkg从源代码编译安装包:<br />
pacman -U packagename.pkg.tar.gz<br />
<br />
Note: pacman有很多很多的选项和功能组合。你可以试试man pacman或者查阅lt the [[pacman]]维基条目<br />
<br />
====软件包管理增强工具====<br />
* Yaourt 可查询aur的pacman增强工具<br />
* Tupac 快速查询的yaourt增强工具<br />
* Powerpill 多进程下载的pacman增强工具<br />
{{Box Note| 强烈建议更新系统完毕后,安装yaourt和powerpill,以便更充分享受Arch Linux的方便和强大。}}<br />
在/etc/pacman.conf文件里,最后添加两行(如果是i686的话,把x86_64换成i686即可):<br />
[archlinuxfr]<br />
Server = http://repo.archlinux.fr/x86_64<br />
然后使用pacman安装yaourt<br />
pacman -Sy yaourt<br />
<br />
以后就可以使用yaourt命令来查找并安装包括[[AUR]]里的软件了。比如bcm无线网卡,需要安装b43-firmware(此软件包在[[AUR]]仓库里,使用pacman无法查找到),使用yaourt命令查找并安装:<br />
yaourt b43-firmware<br />
找到之后,根据相应提示,一直到安装完成。<br />
<br />
====图形化管理工具====<br />
* qt界面的shaman:比较成熟的pacman 图形化管理工具<br />
* gtk界面的gtkpacman :目前BUG比较多,不稳定。<br />
<br />
====Pacman的更多信息====<br />
用此命令查看pacman手册:<br />
man pacman<br />
有空的话可以看看[[pacman (简体中文)]]维基条目。<br />
<br />
====2、更新Pacman自己====<br />
<br />
一开始,系统可能会提示你先更新pacman自身,这取决于Arch安装包的新旧程度:<br />
pacman -Sy pacman<br />
pacman开始查看是否需要更新,如果有提示需要更新,则按‘y’,开始pacman更新。<br />
<br />
'''''有时候,还需要用户主动修改某些配置;请仔细阅读升级过程中的输出获取相关信息。'''''<br />
<br />
===三、更新系统===<br />
====使用[[pacman (简体中文)|pacman]]====<br />
现在我们要用[[pacman (简体中文)|pacman]]来更新系统。要更新、同步并'''升级'''你的系统,可以使用命令:<br />
pacman -Syu<br />
pacman就会获取所有最新可用软件包信息并进行升级。(此时你可能会被提示先升级pacman自身。如果是这样,回答'yes',然后在完毕后再运行一次pacman -Syu命令。)<br />
<br />
===='''滚动发布'''之美====<br />
Arch是一个'''rolling release'''(滚动发布)的发行版。这意味着没有必要重新安装或执行完整的系统重建来升级到最新版本。只需要执行'''pacman -Syu''',就能保持你的系统更新到最新和bleeding edge(表示最新的、因而也并非完美的技术)。<br />
<br />
===四、增加一个用户并设置用户组===<br />
用root账号来处理日常工作是很危险的。Root是用来处理系统管理的任务。我们可以用以下命令增加一个普通用户账号:<br />
adduser<br />
大部分缺省选项都是没问题的,你可能还需要将storage、audio、video、optical和wheel加入到你的用户组中 ── 特别是在你打算使用一个完整功能的桌面环境的情况下。<br />
<br />
用户组和用户的关联定义在/etc/group文件中: <br />
<br />
它包含了:<br />
<br />
*'''audio''' - 关于声卡和相关软件的任务<br />
<br />
*'''wheel''' - 给sudo使用<br />
<br />
*'''storage''' - 负责存储设备<br />
<br />
*'''video''' - 视频任务和3D加速<br />
<br />
*'''optical''' - 和光驱有关的任务<br />
<br />
*'''floppy''' - 软驱访问<br />
<br />
*'''lp''' - 打印任务<br />
<br />
请参看[[Groups]]一文了解你应该属于哪些用户组。<br />
你还可能需要将你的用户账号加入到以下用户组(需要以root身份运行此命令):<br />
usermod -aG audio,video,floppy,lp,optical,network,storage,wheel,dbus,hal USERNAME<br />
详情可看usermod和gpasswd的man手册。<br />
<br />
===五、安装建立Sudo (可选)===<br />
安装Sudo:<br />
# pacman -S sudo<br />
以root身份,运行命令visudo,把用户加入sudo用户 (a &quot;sudoer&quot;).如果不知道怎么使用vi,你可以在用visudo前设置EDITOR环境变量为你喜欢的编辑器。例如:<br />
# EDITOR=nano visudo<br />
如果你对于用vi很适应,去掉EDITOR=nano这个变量就行:<br />
# visudo<br />
这命令将在一个特殊的vi会话中打开文件 /etc/sudoers 。visudo复制文件到一个可编辑的临时文件中,用一个编辑器编辑它(vi是默认的),接下来运行一个安全检查(“sanity check”)。如果通过,这个临时文件就有正确的权限将重写的原始文件。t<br />
<br />
<font color=&quot;red&quot;>'''注意:不要直接用编辑器编辑 /etc/sudoers ; 否则会出现这样的提示:Errors in syntax can cause annoyances (像root帐户不能使用的描述一样)。 必须使用 ''visudo'' 命令来编辑 /etc/sudoers.'''</font><br />
<br />
当用户输入以 &quot;sudo&quot;, 作为开始的命令行时,临时授予该用户root权限。加入下面一行:<br />
USER_NAME ALL=(ALL) ALL<br />
USER_NAME 就是单个用户名。<br />
<br />
更多信息,比如按<TAB> 自动命令补全,请见[[Sudo]]<br />
<br />
==第三部分:安装X并配置ALSA==<br />
一共有三步工作:<br />
*1、安装声卡驱动<br />
*2、安装x-window(包括显卡驱动)<br />
*3、配置X<br />
<br />
{{Box Note | '''在热插拔未配置正确的情况下,或者是/etc/rc.d/hal未启动的情况下,请不要启动开启X(包括重启使用gdm或者kdm登陆),否则可能导致鼠标键盘失去响应!!!'''}}<br />
<br />
===一、配置声卡:使用alsamixer===<br />
高级Linux声音架构(Advanced Linux Sound Architecture,简称ALSA)是一个Linux内核组件。它替换了原有的开放声音系统(OSS),为声卡提供了设备驱动。除了声音设备驱动以外,'''ALSA'''还给应用程序开发人员提供了一个用户空间库,可使更高级的API无需直接与内核驱动打交道就能使用驱动功能。<br />
<br />
{{Box Note| Alsa已经包含进最新的内核kernel,udev 将在系统启动时自动检测硬件,并自动根据声卡加载相应的内核模块。虽然声卡已经在工作,但电脑的声音默认是静音。}}<br />
{{Box Note| OSS4.1已经放出,相对于老的版本,这是一个显著的提升的版本,如果使用ALSA有问题, 或者是想尝试新的功能,可以使用 OSS4.1。 相关说明可见: [[OSS]]}} <br />
<br />
Alsa-utils软件包里的alsamixer让我们可以从命令行来配置声音设备。(你也可以稍后在'''X'''环境中使用alsamixer。)<br />
默认情况下,内核加载模块snd_pcsp,这是一个alsa pc speaker模块。 snd_pcsp通常先于&quot;你实际的&quot;声卡模块加载。大部分情况下,这模块最后加载更好,因为可以让alsamixer正确控制需要的声卡。<br />
<br />
在/etc/modprobe.conf中加入这行,可以使得snd_pcsp最后加载:<br />
options snd-pcsp index=2<br />
<br />
当然,如果你不想让snd_pcsp加载,可以把它放入黑名单,或者是在/etc/rc.conf的Modules里禁止它:<br />
MODULES=(... !snd_pcsp)<br />
<br />
{{Box Note | 想要生效,需要释放并重新加载所有声音模块,当然,系统重启就可以简单解决这问题。 }}<br />
<br />
* 安装alsa-utils软件包:<br />
pacman -S alsa-utils<br />
<br />
* 为了解决Alsa声卡独占问题,可以安装alsa-oss:<br />
# pacman -S alsa-oss <br />
<br />
* 把你的普通用户账号加入到audio用户组中:以root身份,运行<code>/usr/bin/gpasswd</code>程序:<br />
gpasswd -a yourusername audio<br />
*以普通用户身份运行: <br />
alsamixer<br />
用左右光标键移动到Master和PCM声道上,按'''M'''取消掉静音。用向上键增加音量。(70-90的音量是较合适的范围)按ESC键离开alsamixer。<br />
有'''Speaker'''的,需要同时取消静音并调整之. <br />
<br />
====测试声音====<br />
以普通用户身份,使用 <code>/usr/bin/aplay</code>程序来测试你的声音配置:<br />
aplay /usr/share/sounds/alsa/Front_Center.wav<br />
你应该会听到一个女性声音说:“Front,center。”<br />
<br />
====保存声音配置====<br />
以root身份运行<code>/usr/bin/alsactl</code> :<br />
alsactl store<br />
这将创建'/etc/asound.state'文件,用来保存alsamixer的设置。<br />
<br />
为了每次启动都可以自动恢复混音器设置,可将守护进程''alsa''加入到你的/etc/rc.conf中的DAEMONS列表。<br />
nano /etc/rc.conf<br />
DAEMONS=(syslog-ng network crond '''alsa''')<br />
''注意,alsa守护进程在启动过程中仅仅是恢复音量设置。它和alsa音频库(和内核级API)是完全不同的。''<br />
<br />
更多详情请参看[[ALSA 安装设置 (简体中文)|ALSA 安装设置]]。<br />
<br />
===二、安装X===<br />
'''X''' 窗口系统(一般叫'''X11'''或者更简单的叫'''X''') 是一个网络互动和显示服务,提供位图显示器窗口. 提供标准化工具包(toolkit)和协议,用于<code>UNIX</code>类操作系统,构建一个图形界面(GUIs) <br />
<br />
'''X''' 提供最基本、基础的框架,用于构建一个图形操作界面环境。包括:绘图、屏幕窗口移动,与鼠标或者键盘的交互。 '''X''' 并不负责用户交互界面的部分:有独立的客户端程序负责处理这部分。 比如gnome、kde。<br />
<br />
'''X''' 因为它先于'''W'''窗口系统,最初由斯坦福大学开发。 <br />
<br />
*''注意: 如果想使用一个'''开源''' 显卡驱动, 需要3d加速,强烈建议在安装Xorg之前安装库 libgl :''<br />
pacman -S libgl<br />
''(拥有专利的视频驱动提供它们自己的gl库安装(implementations).)''<br />
----- <br />
====1、安装X====<br />
构建一个GUI的第一步:用pacman来安装Xorg包.<br />
<br />
# pacman -S xorg<br />
对于新版的xorg,建议(可能大部分情况下是必须的)安装输入设备驱动evdev。它本来应该作为xorg-server的一个依赖被安装的,不过不知道为什么貌似缺失了:<br />
# pacman -S xf86-input-evdev<br />
3d的工具比如glxgears包含在包'''mesa''' 里(如果需要,也安装):<br />
# pacman -S mesa<br />
<br />
====2、安装显卡驱动====<br />
到这一步,已经有了运行'''X''' Server的基本软件包,接下来需要把显卡的驱动安装到电脑里(e.g. xf86-video-<name>). 最简单的X.org配置方法就是安装正确的驱动包,然后使用自动脚本对 /etc/X11/xorg.conf 进行初始化,比如使用 Xorg -configure(arch团队提供hwd工具,但据以前用户的反映,这个现在还老出问题,新手可以使用,以后有能力再配置其他).<br />
<br />
如果不知道显卡类型,输入下面命令:<br />
lspci | grep VGA<br />
<br />
输入下面命令,查看所有'''开源'''驱动: <br />
pacman -Ss xf86-video | less<br />
<br />
下面是一个'''开源'''的显卡列表和相关说明:<br />
*'''xf86-video-apm''' Alliance ProMotion video driver<br />
*'''xf86-video-ark''' ark video driver<br />
*'''xf86-video-ati''' ati video driver<br />
*'''xf86-video-chips''' Chips and Technologies video driver<br />
*'''xf86-video-cirrus''' Cirrus Logic video driver<br />
*'''xf86-video-dummy''' dummy video driver<br />
*'''xf86-video-fbdev''' framebuffer video driver<br />
*'''xf86-video-glint''' GLINT/Permedia video driver<br />
*'''xf86-video-i128''' Number 0 i128 video driver<br />
*'''xf86-video-i740''' Intel i740 video driver<br />
*'''xf86-video-i810''' Intel i810/i830/i9xx video drivers (deprecated - use -intel)<br />
*'''xf86-video-intel''' Newer Version of Intel i810/i830/i9xx video drivers<br />
*'''xf86-video-imstt''' Integrated Micro Solutions Twin Turbo vidoe driver<br />
*'''xf86-video-mach64''' mach64 video driver <br />
*'''xf86-video-mga''' mga video driver (Matrox Graphics Adapter) <br />
*'''xf86-video-neomagic''' neomagic video driver<br />
*'''xf86-video-nouveau''' Open Source 3D acceleration driver for nVidia cards (eperimental)<br />
*'''xf86-video-nv''' nvidia nv video driver<br />
*'''xf86-video-openchrome''' Openchrome drivers<br />
*'''xf86-video-r128''' ati Rage128 video driver<br />
*'''xf86-video-radeonhd''' Experimental Radeon HD video driver for r500 and r600 ATI cards<br />
*'''xf86-video-rendition''' Rendition video driver<br />
*'''xf86-video-s3''' S3 video driver<br />
*'''xf86-video-s3virge''' S3 Virge video driver<br />
*'''xf86-video-savage''' savage video driver<br />
*'''xf86-video-siliconmotion''' siliconmotion video driver<br />
*'''xf86-video-sis''' SiS video driver<br />
*'''xf86-video-sisusb''' SiS USB video driver<br />
*'''xf86-video-tdfx''' tdfx video driver<br />
*'''xf86-video-trident''' Trident video driver<br />
*'''xf86-video-tseng''' tseng video driver<br />
*'''xf86-video-unichrome''' Unichrome video drivers<br />
*'''xf86-video-v4l''' v4l video driver<br />
*'''xf86-video-vesa''' vesa video driver<br />
*'''xf86-video-vga''' VGA 16 color video driver<br />
*'''xf86-video-via''' via video driver<br />
*'''xf86-video-vmware''' vmware video driver<br />
*'''xf86-video-voodoo''' voodoo video driver<br />
<br />
* 说明:'''vesa'''驱动是最原汁原味的,适用于大部分的显卡。如果实在无法找到合适的显卡驱动,就选用vesa。(这是原话,好像夸张了点!If you cannot find a suitable driver for your video chipset, vesa '''should''' work.)<br />
<br />
用pacman来安装适合你显卡的驱动。例如:<br />
pacman -S xf86-video-savage<br />
(给Savage显卡的驱动。)<br />
<br />
* 如果实在不确定需要安装那个显卡驱动,可以安装所有显卡驱动包, 输入下面命令:<br />
pacman -S xorg-video-drivers<br />
<br />
*如果显卡是nVIDIA 或者ATI的,并'''想安装nVIDIA或者ATI官方提供的显卡驱动,请看下面。'''<br />
-----<br />
<br />
====nVIDIA图形显示卡====<br />
nVIDIA显示卡的驱动程序被许多人认为是非常好的质量,而且带有高级3D性能。<br />
<br />
在设置您的你nVIDIA显卡之前您先要选择您要使用的驱动程序。Arch现在有3种不一样的nVIDIA驱动程序,各自支持不同型号的显卡:<br />
<br />
'''1. nvidia-96xx''' ''直到Ge Force 4的较新显卡''<br />
<br />
'''2. nvidia-173xx''' ''Geforce FX系列显卡''<br />
<br />
'''3. nvidia''' ''在GF FX之后的最新GPU''<br />
<br />
{{Box Note| 一些特别老如TNT和TNT2之类的显卡所需的Nvidia-71xx系列闭源驱动,由于无法在Arch所用的新版Xorg下正常运行,并且nvidia也已不再继续支持它们,因此已被删除。你可以改用xf86-video-nv或者xf86-video-vesa驱动。}}<br />
<br />
到nVIDIA主页,看哪个适合你电脑.区别只是安装,配置过程是一样的.<br />
<br />
''根据你的显卡'',选择合适的nVIDIA驱动安装,比如: <br />
pacman -S nvidia-96xx<br />
<br />
nVIDIA软件包有个工具能自动升级你已有的nVIDIA驱动的配置文件/etc/X11/xorg.conf,输入下列命令即可实现:<br />
nvidia-xconfig<br />
<br />
它也有一些选项,用于更深入和具体地配置xorg.conf文件的内容和选项,例如:<br />
<br />
<br />
nvidia-xconfig --composite --add-argb-glx-visuals<br />
<br />
更详细的信息,请参考:nvidia-xconfig(1).<br />
<br />
一些有用的妙法可用在“device“部分(你要清楚它们不一定都能对你的系统有用):<br />
Option "RenderAccel" "true"<br />
Option "NoLogo" "true"<br />
Option "AGPFastWrite" "true"<br />
Option "EnablePageFlip" "true"<br />
将所有的DRI注释掉:<br />
# Load "dri"<br />
<br />
多检查几次你的/etc/X11/xorg.conf以确定你的默认的depth(色深),horizontal sync(水平同步),垂直刷新率,以及分辨率是可以接受的。<br />
<br />
使用<code>/sbin/depmod</code>命令来更新内核模块依赖:<br />
depmod -a<br />
(也许需要重启。)<br />
{{Tip|nvidia配置的高级的说明参考文章[[NVIDIA]] 。}}<br />
<br />
现在你可以跳到'''[[#三、配置X:创建并修改/etc/X11/xorg.conf|配置X]]'''来进一步熟悉,或者跳到'''[[#3、测试 X|测试 X]]'''继续安装过程。<br />
<br />
====ATI图形显示卡====<br />
ATI用户的驱动可以有几种选择。<br />
* '''xf86-video-ati'''软件包提供的开源'''''radeon'''''驱动。<br />
** 原创的、完全支持Radeon芯片组到X1950(最新的R500芯片组)的逆向工程开源驱动。对9200系列以前的显卡完全支持,可以稳定的提供全2D和3D加速。从9500到X1950完全支持2D加速特性,良好的3D加速,不过缺乏某些闭源驱动的特性(例如能源节省特性仍处于测试阶段)。xf86-video-ati支持从HD2xxx (R6xx)到最新的显卡,不过目前仅提供2D支持。<br />
* '''xf86-video-radeonhd'''软件包提供了开源的'''''radeonhd'''''驱动。<br />
** 此驱动支持ATI R500(Radeon X1000系列)以及更新的芯片组。该驱动由AMD提供文档,Novell为之开发。它支持RandR 1.2,目前的开发工作非常活跃。因此所支持的不同系列显卡的功能可以不一致。(有些用户反映它性能优异,而有些则说它很糟)。它还支持带音频的HDMI。<br />
* AUR中的Catalyst软件包提供了闭源'''''fglrx'''''驱动。稍后将介绍闭源驱动。<br />
开源驱动通常可以满足大部分需求而且较少出问题。<br />
<br />
安装'''''radeon'''''ATI驱动:<br />
# pacman -S xf86-video-ati libgl ati-dri<br />
安装'''''radeonhd'''''ATI驱动:<br />
# pacman -S xf86-video-radeonhd libgl ati-dri<br />
<br />
Arch的<code>extra</code>官方仓库曾经提供过闭源ATI驱动'''Catalyst'''的预编译包,不过在2009年3月以后,由于对闭源驱动的质量和开发进度不满意,官方取消了对它的支持。目前catalyst驱动可以在[http://aur.archlinux.org/packages.php?ID=22899 AUR]中找到。Catalyst驱动的安装信息可以在[[ATI#Proprietary_ATI_Catalyst_driver|这里]]找到。<br />
<br />
{{Warning| 闭源ATI驱动仅支持R600和更新的显卡(即HD2xxx及以上系列),不支持旧系列(X1xxx系列及以下)。}}<br />
<br />
{{Tip|ATI配置的高级指引可以参看[[ATI | ATI wiki 文章]]。}}<br />
<br />
====3、安装输入设备驱动软件包====<br />
最新的X需要你为包括键盘和鼠标在内的输入设备安装驱动。查看可用输入设备驱动的完整列表:<br />
# pacman -Ss xf86-input | less<br />
<br />
对大部分用户,xf86-input-keyboard和xf86-input-mouse应该可以满足基本配置。使用pacman来为你的输入设备安装需要的驱动,例如:<br />
# pacman -S xf86-input-keyboard<br />
===三、配置X:创建并修改/etc/X11/xorg.conf===<br />
====xorg.conf文件====<br />
/etc/X11/xorg.conf 是你的 X-Window-System 的主要配置文件,你的 GUI('''G'''raphical '''U'''ser '''I'''nterface)的基础,它是一个普通的文本文件,里面由 “section” 和 “subsection” 来安排。重要的 section 有 ''Files, InputDevice, Module, Monitor, Modes, Screen, Device'' 和 ''ServerLayout''。各个section安排的前后次序没有关系,对同一种类型的设备也可以有多个section,比如你可能有多个显示器,或者你的本本既有鼠标又有触摸板。<br />
------<br />
从X11R7.2版开始Xserver引入了自动配置特性。在大多情况下,即使没有xorg.conf文件它也能很好地运作。如果''自动检测功能工作正常'',而且你又不需要开启如 aiglx、compositing 等功能的话,你甚至不需要创建这个配置文件。<br />
<br />
====1、创建 /etc/X11/xorg.conf====<br />
<br />
高级用户可以手动创建他们的xorg.conf文件。一般用户可以使用程序<code>/usr/bin/Xorg</code>附加参数-configure来生成一个基本的配置文件;以root身份输入下面命令:<br />
# Xorg -configure<br />
这里生成的文件是/root/xorg.conf.new <br />
<br />
把这文件复制到 <code>/etc/X11/</code>:<br />
# cp /root/xorg.xonf.new /etc/X11/xorg.conf<br />
<br />
====更多的创建/etc/X11/xorg.conf的办法====<br />
* 说明:如果你的电脑已经有一个配置好的xorg.conf文件,不管这个文件是在什么别的发行版下生成的,只要Xorg的版本一致,就可以把该文件复制到你的Arch系统的<code>/etc/X11/</code>目录下。<br />
* 可以使用程序<code>/usr/bin/hwd</code>生成xorg.conf。首先要安装这程序:<br />
# pacman -S hwd<br />
然后输入下面命令:<br />
# hwd -xa<br />
{{Box Note| 目前,hwd在生成的xorg.conf有一行失效。 使用完这程序后,需要手动删除或者是注释掉 Section &quot;Files&quot;下的RgbPath那一行。via nano /etc/X11/xorg.conf or your equivalent, as root/sudo.}}<br />
<br />
* 使用<code>/usr/bin/xorgcfg</code> 脚本生成xorg.conf:<br />
# xorgcfg <br />
* 使用<code>/usr/bin/xorgconfig</code>生成xorg.conf,这个程序以互动方式来创建该文件,输入下面命令运行:<br />
# xorgconfig<br />
<br />
====2、Input设备热插拔问题:请在测试X前阅读====<br />
<br />
xorg 1.5.x版本里已经开启热插拔Input设备。<br />
{{Box Note | 当热插拔开启后, X将清空xorg.conf里所有使用the kbd and mouse 驱动建立的设备。这将导致X被冻结,使得鼠标和键盘失去响应。下面是解决办法。'''方法只能二选一'''}}<br />
<br />
有两个办法可以修复这一问题:<br />
<br />
1) '''配置 input设备热插拔''':安装驱动 xf86-input-evdev,同时配置HAL使其能使用kbd/mouse驱动。<br />
<br />
安装xf86-input-evdev:<br />
# pacman -S xf86-input-evdev<br />
在X.org相关进程启动前,启动守护进程hal:<br />
# /etc/rc.d/hal start<br />
把hal加入/etc/rc.conf里的DAEMONS列表里,这样每次电脑启动,都会自动开启hal。详情请见[[Xorg input hotplugging]] 。<br />
<br />
说明: 开启hal必须首先有一个dbus用户和用户组,以root身份输入下面命令创建用户和用户组<br />
<br />
usr/sbin/groupadd -g 81 dbus<br />
usr/sbin/useradd -c 'System message bus' -u 81 -g dbus -d '/' -s /bin/false dbus<br />
<br />
2) '''关闭input设备热插拔''':在/etc/X11/xorg.conf的ServerFlags段,加入参数''Option &quot;AutoAddDevices&quot; &quot;False&quot;'' 这将忽略hal的硬件检测,并使用你xorg.conf的keyboard/mouse配置。步骤如下<br />
# nano /etc/X11/xorg.conf<br />
加入下面三行:<br />
Section &quot;ServerFlags&quot;<br />
Option &quot;AutoAddDevices&quot; &quot;False&quot;<br />
EndSection<br />
<br />
====3、测试 X====<br />
<br />
在所生成的xorg文件路径''path/to/xorg.conf''前,加入参数''-config'' ,运行 '''X'''脚本,可以测试脚本配置是否正确。<br />
比如要测试你上面生成的xorg是否配置正确,输入:<br />
X -config /root/xorg.conf.new<br />
'''X''' 将启动,在屏幕中央会有一个白色的 X ,鼠标或是触摸板可以移动它,按 CTRL-Alt-Backspace 可以退出 '''X'''<br />
<br />
====对xorg.conf除错====<br />
如果 X 出现错误不能运行,你需要手动检查你的配置文件:<br />
<br />
nano /root/xorg.conf.new<br />
<br />
* 确定 Xorg -configure 命令正确的识别了你的显卡,比如:<br />
Section &quot;Device&quot;<br />
<br />
...<br />
<br />
Driver &quot;savage&quot;<br />
<br />
...<br />
<br />
EndSection<br />
<br />
* 确定里面的 Section "Monitor" 设置了水平同步率和垂直刷新率,如果没有要把它加上:<br />
Section &quot;Monitor&quot;<br />
Identifier &quot;Monitor0&quot;<br />
VendorName &quot;Monitor Vendor&quot;<br />
ModelName &quot;Monitor Model&quot;<br />
HorizSync 30.0 - 130.0 # Safe for LCD's<br />
VertRefresh 50.0 - 100.0 # Safe for LCD's and most CRT's.<br />
EndSection<br />
如果你不知道这些刷新率到底是多少,你就得查一下你显示器的说明书。<br />
<br />
* 在section "Screen"配置默认色深(color depth):<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Card0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
(此处色深被设定为真彩24色。)<br />
<br />
<br />
* 在subsection &quot;Display&quot; 加入你需要的Modes, at least under the Depth 24 header, e.g.:<br />
SubSection &quot;Display&quot;<br />
Viewport 0 0<br />
Depth 24<br />
Modes &quot;1024x768&quot; &quot;800x600&quot; &quot;640x480&quot;<br />
* Add the following section, if you wish to enable eye candy which requires the composite extension: <br />
Section &quot;Extensions&quot;<br />
Option &quot;Composite&quot; &quot;Enable&quot;<br />
EndSection<br />
<br />
* 上述调整完成后,再测试你的配置:<br />
X -config /root/xorg.conf.new<br />
<br />
* 在确认 '''X''' session开启,没有错误之后,把测试好的配置文件移到 /etc/X11下,作为系统的xorg.conf配置文件:<br />
mv /root/xorg.conf.new /etc/X11/xorg.conf<br />
详细的介绍可见[[Xorg]] <br />
<br />
接下来可以简单作测试 '''[[#Simple baseline X test|Simple baseline X test]]'''<br />
<br />
====调整键盘布局====<br />
=====如果开启了input热插拔=====<br />
# cp /usr/share/hal/fdi/policy/10osvendor/10-keymap.fdi /etc/hal/fdi/policy/<br />
# nano /etc/hal/fdi/policy/10-keymap.fdi<br />
Edit the &quot;input.xkb.layout&quot; key and possibly the &quot;input.xkb.variant&quot; key in this file.<br />
Restart hal:<br />
# /etc/rc.d/hal restart<br />
<br />
=====如果关闭了input热插拔=====<br />
Add option lines in the &quot;InputDevice&quot; section of the /etc/X11/xorg.conf file specifying the keyboard layout and variant:<br />
Option &quot;XkbLayout&quot; &quot;be&quot;<br />
Option &quot;XkbVariant&quot; &quot;&quot;<br />
<br />
详情请见 [[Xorg input hotplugging]]。<br />
<br />
===简单的命令行界面X测试(如果需要)===<br />
<br />
在安装了xorg、合适的显卡驱动、创建了一个/etc/X11/xorg.conf文件之后,如果想在安装完整桌面环境之前,快速测试下你的配置,使用'''xterm'''可以实现! <br />
Xterm是个简单的终端模拟程序,作为base xorg软件包的一部分会被自动安装,运行在'''X '''Server环境里。通过配置~/.xinitrc,Xterm可以让我们快速测试显卡驱动和配置文件/etc/X11/xorg.conf是否被正确配置。(另外,如果在没有/etc/X11/xorg.conf的情况下,你想测试下'''X''' 自动检测是否满意,也可以使用这个)<br />
<br />
==== 准备工作:配置~/.xinitrc====<br />
<br />
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. <br />
{{Box Note | '''[[.xinitrc]]''' is a so-called 'dot' (.) file. 在UNIX文件系统下,文件名以 (.)开头的,是 '隐藏文件',,使用普通的命令'ls' 将不显示这些文件,使用加了参数命令'''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 &quot;Run Control&quot;.}}<br />
<br />
'''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. (说明: ''如果没有文件~/.xinitrc, /etc/X11/xinit/xinitrc 将被作为替代来使用,这是个使用TWM and Xterm的默认配置。'')<br />
<br />
切换到'''''普通, 非root'''''用户:<br />
# su - ''yourusername''<br />
* /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.<br />
* 如果没有~/.xinitrc这个文件,到该目录下创建一个,或者从/etc/skel/复制一个同样的文件到你的home目录:: <br />
<br />
$ cp /etc/skel/[[.xinitrc]] ~/<br />
<br />
* 编辑文件: <br />
$ nano ~/.xinitrc<br />
加入这行&quot;<code>exec xterm</code>&quot;像下面这样:<br />
<br />
#!/bin/sh<br />
#<br />
# ~/.xinitrc<br />
#<br />
# Executed by startx (run your window manager from here)<br />
#<br />
exec xterm<br />
# exec wmaker<br />
# exec startkde<br />
# exec icewm<br />
# exec blackbox<br />
# exec fluxbox<br />
<br />
{{Box Note | ''请确保~/.xinitrc''里,以'''exec'''开头的,只有'''一行'''的注释被去掉。}}<br />
<br />
====开始执行测试====<br />
<br />
* 以普通用户身份输入下面命令,开启'''X''',开始测试你的配置:<br />
<br />
$ startx<br />
或者是这命令<br />
$ xinit<br />
<br />
此时会打开一个'''xterm''' session,你可以在这里测试your keyboard and its layout<br />
<br />
* 按Ctrl+Alt+Backspace,或者输入"exit"可以退出'''X''' Server。<br />
* 如果开启'''X'''出现问题,在终端,查看日志文件/var/log/Xorg.0.log的错误信息。<br />
<br />
更多的Xorg configuration介绍可见[[Xorg]] .<br />
<br />
==第四部分:安装并配置桌面环境==<br />
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 icons, applets, windows, toolbars, folders, wallpapers, 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.<br />
<br />
* 如果你需要一个完整功能,类似于Windows和Mac OSX, 可以选择安装'''[[#KDE|KDE]]''' <br />
* If you want something slightly more minimalist, which follows the K.I.S.S. principle more closely, '''[[#GNOME|GNOME]]''' is a good choice<br />
* '''[[#Xfce|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.<br />
<br />
如果你的机器较老,或者是希望使用一个更轻量、更少GUI要求,可以选择只安装 '''Window Manager''', 或者 WM. A WM controls the placement and appearance of application windows in conjunction with the X Window System but does NOT provide such additions as panels, applets, icons, etc.<br />
* Lightweight floating WM's include: [[#Openbox|'''Openbox''']], [[#Fluxbox|'''Fluxbox''']], [[#fvwm2|'''fvwm2''']], '''Windowmaker, Pekwm, and TWM'''.<br />
* If you need something completely different, try '''Awesome, ion, wmii, dwm, or xmonad'''。<br />
<br />
===一、安装字体===<br />
在安装桌面环境/窗口管理器'''之前''',也许你会先安装些美观的字体。Dejavu和bitstream-vera都是不错的字体集。而对于网页,你还可能需要Microsoft字体。如下安装:<br />
pacman -S ttf-ms-fonts ttf-dejavu ttf-bitstream-vera<br />
对于中文字体,开源的文泉驿正黑矢量字体是不错的选择,它还内嵌了9pt-12pt的点阵宋体:<br />
pacman -S wqy-zenhei<br />
<br />
===二、选择默认启动的桌面环境 ~/.xinitrc===<br />
<br />
以普通用户身份编辑/home/username/.xinitrc,加入你要用的DE. This will allow you to use '''startx/xinit''' from the shell, in the future, to open your DE/WM of choice:<br />
<br />
nano ~/.xinitrc<br />
<br />
反注释或者加入相应的桌面环境/窗口管理器的''''exec''' ..'内容行。例如:使用Xfce4桌面环境:<br />
<br />
exec startxfce4 <br />
<br />
记住在~/.xinitrc中只反注释掉一行'''exec'''。这条命令将一直运行到你注销桌面登录。一般的,shell将等到kde完成加载之后,在运行下一条命令。在命令前加 &quot;exec&quot; ,是告诉the shell 这条命令最后执行, 这样shell就不用等待其他命令了,直接载入桌面。<br />
接下来安装你所选的桌面环境/窗口管理器。<br />
<br />
===三、选择安装一个桌面环境===<br />
====GNOME====<br />
=====关于GNOME=====<br />
GNOME是'''G'''NU '''N'''etwork '''O'''bject '''M'''odel '''E'''nvironment的缩写。GNOME项目有两大部分:GNOME桌面环境 ── 既直观又迷人的最终用户桌面,以及GNOME开发平台 ── 一个用来创建可与桌面集成的应用程序的庞大的框架。<br />
<br />
=====安装=====<br />
安装基本的GNOME环境:<br />
pacman -S gnome<br />
<br />
安装额外的GNOME环境:<br />
pacman -S gnome-extra<br />
然后选择提示的所有软件包。 <br />
<br />
=====对GNOME有用的守护进程=====<br />
如之前所述,守护进程(daemon)是运行在后台的程序,它等待事件发生并提供相应的服务。其中'''Hal'''守护进程可以自动挂载磁盘、光驱和U盘给GUI使用。'''Fam'''守护进程可以在GUI中实时反映文件的变动,如最近安装的程序、文件系统的变化等。'''Hal'''和'''fam'''使得GNOME的使用更为方便。Hal和fam软件包在安装GNOME时已一同安装,建议安装社区库的gamin来替代fam。<br />
<br />
{{Box Note|注意,fam是一个比较老的包,很容易造成较大的日志文件。}}<br />
<br />
{{Box Note|在当前的gnome环境中,你可以安装gamin来实现fam的功能。这时,你可以不用在DAEMONS中添加fam启动项了(不需要加入gamin,它会自动被启用)。}}<br />
<br />
* 你需要启动'''hal'''守护进程。<br />
<br />
启动hal:<br />
/etc/rc.d/hal start<br />
<br />
如果您想使用fam,同样需要启动:<br />
/etc/rc.d/fam start<br />
<br />
将hal加入到/etc/rc.conf的DAEMONS中以使得它们随系统启动而自动运行:<br />
nano /etc/rc.conf<br />
<br />
DAEMONS=(syslog-ng network crond alsa '''hal''')<br />
<br />
{{Box Note|注意,如果使用fam,那么把fam加入到hal后面。}}<br />
<br />
* 或许你还会希望安装一个图形界面的登录管理器。在GNOME下'''gdm'''守护进程是个不错的选择。<br />
以root身份运行:<br />
pacman -S gdm<br />
<br />
让gdm启用有两种方式,一种是直接加入到DAEMONS的末尾,通过rc.conf来启动;另外一种方式是用过配置inittab来加载gdm。<br />
<br />
* 通过inittab来加载gdm也很方便(推荐使用这种方式):<br />
nano /etc/inittab<br />
<br />
修改默认启动方式:<br />
<br />
将<br />
id:3:initdefault:<br />
改为<br />
id:5:initdefault:<br />
<br />
然后取消下面代码的注释:<br />
x:5:respawn:/usr/sbin/gdm -nodaemon<br />
<br />
{{Box Note|实际上,可以看到gdm/xdm/kdm/slim等,使用哪个取决于你的喜好,启用喜欢的那个,将其他的注释掉。当然,本章介绍的是gnome,所以推荐gdm,下章中将推荐kdm:)}}<br />
<br />
<br />
* 通过DAEMONS方式启动gdm也很方便:<br />
nano /etc/rc.conf<br />
<br />
DAEMONS=(syslog-ng network crond alsa hal gdm)<br />
<br />
{{Box Note|这是类似debian/ubuntu的做法,这种方式有一点不好:不管什么时候(非修复模式),系统总是会尝试进入gdm引导的X方式下。对于X已经配置得很好,并且不使用纯控制台的人可以使用这种方式。但是选择这种方式的话你将不能通过内核参数3或者5来区分进入纯字符控制台还是X11的gdm登录窗口。}}<br />
<br />
* 开启Gnome<br />
以普通用户身份启动X:<br />
startx<br />
或者这条命令也行:<br />
$ xinit<br />
如果你的 ~/.xinitrc一直没配置,那你将可以一直使用下面这条命令来开启Gnome:<br />
$ xinit /usr/bin/gnome-session<br />
<br />
关于安装和配置GNOME的高级指引可以参见[[GNOME (简体中文)|GNOME]]一文。接下来你可以浏览'''[[#优化和收尾|优化和收尾]]'''。或许你还会对[[ArchTips(简体中文)|Arch安装完后的小技巧]]一文感兴趣。<br />
<br />
=====美化=====<br />
如果不满足于缺省的GNOME主题和图标,那么可以安装一个不错的主题,比如murrine:<br />
pacman -S gtk-engine-murrine<br />
接着在System->Preferences->Theme里选择这个主题。<br />
<br />
Arch Linux也做了些不错的主题,根据你自己的审美观,选择满意的安装吧:<br />
<br />
# pacman -S gtk-engines gtk2-themes-collection gtk-aurora-engine gtk-candido-engine gtk-rezlooks-engine<br />
<br />
你还可以在[http://www.gnome-look.org Gnome Look]里找到更多的主题、图标和壁纸。<br />
<br />
====KDE====<br />
=====关于KDE=====<br />
KDE桌面环境('''K''' '''D'''esktop '''E'''nvironment)的缩写。 KDE是一种著名的运行于GNU/Linux 、 <code>UNIX</code> 工作站等的强大、自由图形工作环境。她拥有对系统内部各功能的强大整合能力、跨平台能力、易用性、优异的初始界面.<br />
<br />
=====安装=====<br />
Arch提供多个版本的kde: '''kde、kdebase 和 KDEmod'''. 选'''一个'''就行了,然后 '''[[#有用的KDE守护进程|有用的KDE守护进程]]''': <br />
<br />
'''1.)''' '''kde'''是完整的kde软件包,大概 ~300MB,适合主要使用kde软件的系统.<br />
pacman -S kde<br />
'''2.)''' '''kdebase'''是kde的基础软件包(里面没有kdm),大概 ~80MB,适合于只想把kde作为基础系统.<br />
pacman -S kdebase<br />
'''3.)''' '''KDEmod''' 是 Arch Linux独有的、社区驱动的项目,目标是把kde更加细致的模块化和达到其极致的运行效率。KDEmod项目的网站在http://chakra-project.org/ 。<br />
<br />
=====有用的KDE守护进程=====<br />
<br />
KDE 需要'''hal''' ('''H'''ardware '''A'''bstraction '''L'''ayer) 作为守护进程(daemons). '''kdm''' ( '''K''' '''D'''isplay '''M'''anager), 提供一个 '''图形化登录界面'''.<br />
{{Box Note|hal守护进程将自动开启dbus守护进程。kde4里已经不需要fam。kdm现在在kdebase-workstation这个包里,如果只安装kdebase,需要再安装此包才能使用kdm}}<br />
<br />
The hal daemon, among other things, will automate the mounting of disks, optical drives, and USB drives/thumbdrives for use in the GUI. <br />
<br />
-----<br />
启动hal进程:<br />
<br />
/etc/rc.d/hal start<br />
<br />
编辑/etc/rc.conf的 DAEMONS部分:<br />
nano /etc/rc.conf<br />
把 '''hal''' 加入 DAEMONS 部分,以便他们在系统启动时加载. 如果想要kde的图形化登录界面,把 '''kdm'''也加进去(或者不加,在/etc/inittab里面设置): <br />
DAEMONS=(syslog-ng network crond alsa '''hal kdm''')<br />
{{Box Note|如果你安装的是KDEmod3,则使用kdm3替换kdm}}<br />
<br />
*This method will start the system at runlevel 3, (/etc/inittab default, multiuser mode), and then start KDM as a daemon. <br />
<br />
*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 [[Adding a login manager (KDM, GDM, or XDM) to automatically boot on startup]] for more.<br />
<br />
*If you prefer to log into the '''console''' at runlevel 3, 手动启动 X, 则不加入kdm, 或者是加个前缀( ! )禁止它。<br />
<br />
* 现在可以试试效果了,用普通用户身份开启X Server:<br />
startx<br />
或者<br />
$ xinit<br />
更多关于安装和配置KDE的文章,请看[[KDE]].<br />
<br />
到此步,可以看 '''[[#优化和收尾]]'''这部分了. You may also be interested in the [[Post Installation Tips]] wiki article.<br />
<br />
====Xfce====<br />
=====关于Xfce=====<br />
和GNMOE、KDE一样,Xfce是一个桌面环境,其目标是快捷、轻量,同时又美观而易用。它还提供了一整套的应用程序如根窗口应用(root window app)、 窗口管理器、文件管理器、面板等等。 Xfce是用GTK2 toolkit编写的(类似GNOME),和其它大型桌面环境一样,它也有自己的开发环境(库文件、守护进程等)。但不象GNOME或者KDE,Xfce是轻量化的,其设计更接近于CDE而不是Windows或者Mac。它的开发周期比较慢,但是十分稳定、速度很快。在老硬件上Xfce可以运行得很好,而在新机器上更是运行如飞。<br />
<br />
=====安装=====<br />
安装完整的xfce环境以及主题和extras:<br />
pacman -S xfce4 xfce4-goodies gtk2-themes-collection <br />
<br />
如果你使用KDM或者GDM的话会显示一个xfce会话。另一种启动方式是:<br />
startxfce4<br />
<br />
关于安装和配置xfce的高级指引可以参见[[Xfce (简体中文)|Xfce]]一文。<br />
<br />
恭喜!欢迎来到Arch Linux系统的Xfce桌面环境!接下来你可以浏览'''[[#优化和收尾|优化和收尾]]''',或者下面的其它内容。或许你还会对[[ArchTips(简体中文)|Arch安装完后的小技巧]]一文感兴趣。<br />
<br />
====*box====<br />
=====Fluxbox=====<br />
Fluxbox © is yet another windowmanager for X.<br />
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).<br />
<br />
Install Fluxbox using <br />
pacman -S fluxbox fluxconf<br />
<br />
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:<br />
exec startfluxbox <br />
<br />
More information is available in the [[Fluxbox]] article.<br />
<br />
=====Openbox=====<br />
Openbox是一个标准的”温顺的“,快速的,轻量级的,可扩展的窗口管理器。<br />
<br />
Openbox与你的应用程序一起工作工作,并使你的的桌面便于管理。这是因为它的开发方式和通常的窗口管理器的方式是相悖的。 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.<br />
<br />
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. <br />
<br />
安装openbox<br />
pacman -S openbox obconf obmenu<br />
<br />
一旦openbox安装好,你将得到一个消息to move menu.xml & rc.xml to ~/.config/openbox/ in your home directory:<br />
<br />
mkdir -p ~/.config/openbox/<br />
cp /etc/xdg/openbox/rc.xml ~/.config/openbox/<br />
cp /etc/xdg/openbox/menu.xml ~/.config/openbox/<br />
<br />
In the file "rc.xml" you can change various settings for Openbox (or you can use OBconf). In "menu.xml" you can change your right-click menu.<br />
<br />
To be able to log into openbox you can either go via graphical login using KDM/GDM or startx, in which case you will need to edit your ~/.xinitrc (as user) and add the following:<br />
<br />
exec openbox<br />
<br />
For KDM there is nothing left to do; openbox is listed in the sessions menu in KDM.<br />
<br />
Useful programs for openbox are:<br />
* PyPanel or LXpanel if you want a panel<br />
* feh if you want to set the background<br />
* ROX if you want a simple file manager and desktop icons<br />
<br />
More information is available in the [[Openbox]] article.<br />
<br />
====fvwm2====<br />
FVWM是一个非常强大的面向X桌面系统的”ICCCM-compliant的多虚拟桌面的窗口管理器“(ICCCM-compliant multiple virtual desktop window manager)。开发活动很活跃,支持也是极好的。 <br />
<br />
输入下面命令安装 fvwm2 <br />
pacman -S fvwm <br />
<br />
fvwm会自动添加进 kdm/gdm会话列表. 如果没有的话,添加 <br />
exec fvwm <br />
<br />
到你的用户文件 .xinitrc.<br />
<br />
注意:这个稳定版已经有些年头了,如果需要最新的fvwm版本,可以安装unstable repo里的fvwm-devel 包.<br />
<br />
===四、优化和收尾===<br />
====HAL====<br />
如果你已经安装了一个桌面环境,但是又觉得用起来不是很方便,那么现在就是个安装HAL的好时机了。HAL使得你的手机、iPod、移动硬盘等等可以即插即用。它会挂载设备并在你的桌面或/和'My Computer'目录中创建相应的图标,使得你可以在插入设备后就能访问到它,无需每次都对每个新设备来手动配置/etc/fstab文件或者udev规则。<br />
<br />
KDE、GNOME和XFCE都使用到HAL。<br />
<br />
安装过程描述可以在[[HAL (简体中文)|HAL]]一文中找到。其它一些信息可以在[http://en.wikipedia.org/wiki/HAL_(software) Wikipedia]上找到。<br />
<br />
====启动时让守护进程在后台执行====<br />
<br />
要加速系统的启动过程,可以在/etc/rc.conf中给守护进程前加上'@'符号使之在后台执行,例如:<br />
<br />
DAEMONS=(@syslog-ng @network crond @alsa @hal @fam @kdm)<br />
这使得守护进程在后台被加载,无需等待它们加载结束。<br />
<br />
在守护进程前加上(!)可以禁止系统启动时加载它,例如:<br />
<br />
DAEMONS=(@syslog-ng @network !crond @alsa @hal @fam @kdm)<br />
<br />
另一种方式是直接将不需要的守护进程删除。<br />
<br />
====美化LCD下的字体====<br />
See [[Fonts]]<br />
<br />
====让所有的鼠标按键生效====<br />
看这个 [[Get All Mouse Buttons Working]]<br />
<br />
====笔记本电脑可能遇到的问题====<br />
(1) 触摸板问题<br />
参看http://wiki.archlinux.org/index.php/Touchpad_Synaptics<br />
<br />
(2) 摄像头问题<br />
参看http://wiki.archlinux.org/index.php/Webcam_Setup<br />
<br />
(3) 无线上网问题<br />
参看http://wiki.archlinux.org/index.php/Wireless<br />
<br />
(4) 快捷键问题<br />
参看http://wiki.archlinux.org/index.php/Extra_Keyboard_Keys<br />
<br />
====配置CPU频率====<br />
现在的处理器能够降低频率和电压,以降温和降低电源消耗。降温能使系统更稳定,笔记本用户肯定是想这样做的,但是即使是台式机也会对系统有利。<br />
<br />
安装CPU频率工具用:<br />
pacman -S cpufrequtils<br />
<br />
把CPU频率在/etc/rc.conf里加入到启动进程(daemons)中。编辑配置文件/etc/conf.d/cpufreq改<br />
governor="conservative"<br />
<br />
这使得在需要的情况下可以动态地增减CPU频率(这是对于台式机来说也是一个安全的选择)。改变最小频率(min_freq)和最大频率(max_freq)以匹配你的CPU的情况。如果你不知道频率,在载入频率测量模块后运行“cpufreq-info”。你也可以将min_freq和max_freq注释掉或删除,这样就能自动进行。加入频率测量模块到/etc/rc.conf的模块行。<br />
几乎所有的笔记本和台式机都可以简单地使用''acpi-cpufreq''驱动,但是也有其它的选择,如:''p4-clockmod, powernow-k6, powernow-k7, powernow-k8, and speedstep-centrino''。 <br />
<br />
通过下面这个命令载入这个模块:<br />
modprobe <modulname> <br />
通过下面命令行开启cpufreq:<br />
/etc/rc.d/cpufreq start<br />
更多细节,请看 [[Cpufrequtils]]<br />
<br />
==第五部分:常用的应用程序==<br />
更多信息,请看[[ArchLinux常用的应用程序(简体中文)]].<br />
<br />
==附录==<br />
新手指南附录[[ArchLinux新手指南附录 (简体中文)]]<br />
<br />
想得到更多的信息和支持,你可以去[http://www.archlinux.org/ homepage], [[Special:Search|search the wiki]],[http://bbs.archlinux.org/ forums],[[ArchChannel|IRC channel]],以及[http://www.archlinux.org/mailman/listinfo/ mailing lists]。<br />
=====问题答疑=====<br />
See [[Arch FAQs for newbies]]<br />
还有这里[http://bbs.archlinux.org/viewtopic.php?t=29055 Arch forum thread] 也是面向初学者的。<br />
<br />
=====术语=====<br />
更多信息关于Arch术语,查阅[[Arch Terminology/Jargon for newbies|this article]].<br />
<br />
=====接下来还有什么?=====<br />
<br />
你还可以阅读:<br />
<br />
[[Arch 官方安装指南 (简体中文)|Arch 官方安装指南]]<br />
<br />
[[Arch AUR (简体中文)|ArchLinux社区用户软件仓库 (AUR)]]<br />
<br />
[[Get All Mouse Buttons Working]]<br />
<br />
[[改善Pacman性能 (简体中文)|改善Pacman性能]]<br />
<br />
[[Kernel Compilation]]<br />
<br />
[[Pm-utils 电源管理 (简体中文)|Pm-utils 电源管理]]<br />
<br />
[[CPU 频率调节 (简体中文)|CPU 频率调节]]<br />
<br />
[[:Category:美化|美化]]</div>
Flydragon
https://wiki.archlinux.org/index.php?title=ArchLinux_%E6%96%B0%E6%89%8B%E6%8C%87%E5%8D%97_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=90844
ArchLinux 新手指南 (简体中文)
2010-01-04T09:17:53Z
<p>Flydragon: /* 2、设置时间 */</p>
<hr />
<div>[[Category:简体中文]]<br />
[[Category:获取并安装Arch (简体中文)]]<br />
[[Category:关于Arch_(简体中文)]]<br />
[[Category:HOWTOs (简体中文)]]<br />
<br />
{{Article summary start}}<br />
{{Article summary text|本文针对新手,提供了极其详尽的Archlinux的安装过程向导,和相关的简要说明。}}<br />
{{Article summary heading|已有的语言版本}}<br />
{{Article summary heading|Available Languages}}<br />
{{i18n_entry|Česky|Průvodce začátečníka (Česky)}}<br />
{{i18n_entry|简体中文|Arch 新手安装指南 (简体中文)}}<br />
{{i18n_entry|正體中文|Beginner's Guide 新手指南}}<br />
{{i18n_entry|Dansk|Dansk_Begynderguide}}<br />
{{i18n_entry|Deutsch|Beginners Guide (Deutsch)}}<br />
{{i18n_entry|English|Beginners Guide}}<br />
{{i18n_entry|Español|Guía para Principiantes (Español)}}<br />
{{i18n_entry|Français|Manuel_du_Débutant_(Français)}}<br />
{{i18n_entry|Italiano|Beginners Guide (Italiano)}}<br />
{{i18n_entry|Indonesia|Beginners_Guide_(Indonesia)}}<br />
{{i18n_entry|Lietuviškai|Pradedančiųjų gidas (Lietuviškai)}}<br />
{{i18n_entry|Nederlands|Beginners_Guide_(Nederlands)}}<br />
{{i18n_entry|Português Brasil|Guia do Iniciante(Português do Brasil)}}<br />
{{i18n_entry|Português|Guia para Principiantes(Português)}}<br />
{{i18n_entry|Русский|Руководство_для_новичков}}<br />
{{i18n_entry|Türkçe|Başlangıç Rehberi (Türkçe)}}<br />
{{i18n_entry|हिन्दी|नौसिखिया गाइड(हिन्दी)}}<br />
{{Article summary heading|相关文章}}<br />
{{Article summary wiki|Arch 官方安装指南 (简体中文)}}(更通用的安装方式)<br />
{{Article summary wiki|ArchLinux新手指南附录 (简体中文)}}<br />
{{Article summary wiki|ArchLinux安装完后的小技巧 (简体中文)}}<br />
{{Article summary wiki|ArchLinux常用的应用程序(简体中文)}}<br />
{{Article summary wiki|Work and Play with Arch (Chinese)}}<br />
{{Article summary end}}<br />
<br />
==前言==<br />
<br />
=====所有你一直想知道的关于安装Arch的事=====<br />
这篇文档将会指导你安装和配置[[ArchLinux (简体中文)|Arch Linux]] ── 一个简洁、轻量级的GNU/Linux发行版,一个类<code>UNIX</code>的操作系统。本文是面向Arch新用户,因此尽力为所有人提供强大的参考资料和信息。本指南讲述该如何获得一个基本配置好的Arch Linux系统(拥有一个图形桌面环境),但显然是不可能涵盖(甚至是预见)所有的信息。因此本指南会专注于某些关键性的步骤,想要进一步深入了解你可以查看[[Main Page (简体中文)|Arch Linux Wiki]]或者[http://bbs.archlinux.org/ Arch Linux论坛]。同时有兴趣的话你还可以了解一下[[Arch 之道 (简体中文)|Arch 之道]],它概述了Arch Linux发行版背后的哲学思想。<br />
<br />
'''Arch Linux的相关特性:'''<br />
* '''[[The Arch Way | Simple]]''' design and philosophy<br />
* Community distro targeted at competent GNU/Linux users<br />
* All packages compiled for '''i686/x86-64'''<br />
* 从底层开始就可以让用户高度定制<br />
* '''[[The Arch boot process | BSD-style init]]''' scripts, featuring one centralized configuration file<br />
* '''滚动升级''' <br />
* '''[[Pacman]]''' package manager is fast, written in '''C''', lightweight and agile, with a very modest memory footprint<br />
* '''[[ABS]]''': The '''A'''rch '''B'''uild '''S'''ystem, a ports-like package building system makes it simple to create your own easily installable Arch packages from source, to use and/or share with the community on the [[AUR]]<br />
* '''[[AUR]]''': The Arch User Repository, offering many thousands of build scripts for Arch user-provided software packages<br />
<br />
=====别怕(DON'T PANIC)!=====<br />
要知道Arch Linux的安装方法和过程也许会和你所使用过的其它GNU/Linux发行版非常不同,特别你是个新手的话将更能体会到这点。通常,GNU/Linux发行版会在一张或者一堆CD(甚至是DVD)上捆绑了大量的软件,包含了缺省桌面环境、缺省的应用程序和设置、硬件自动检测和图形化的安装程序,一切都是替你选择好了的。相反的,Arch Linux系统是让'''用户自己'''只是用一个bash shell和基本系统工具,从ncurses installer和基础系统上建造起来的。这就是[[Arch 之道 (简体中文)|Arch 之道]]。不象其它大型发行版,它没有强加于用户的缺省环境或者配置。你可以在命令行使用[[pacman (简体中文)|pacman]]通过互联网连接从Arch软件仓库安装软件包,直到你的系统配置成你希望的样子。这给予了用户最大的弹性、选择性和对系统资源的控制。因为是'''你'''建造了它,所以你肯定能了解系统里具体细节,知道底层都有些什么。<br />
<br />
Arch Linux系统是通过编辑文本文件进行配置的,没有提供图形界面的工具,所以需要对系统和linux相对熟悉。<br />
Arch Linux针对的是有能力的GNU/Linux用户以及希望花费时间学习系统知识的用户。 <br />
<br />
''Arch是一个可以被用户塑造的工具。''<br />
<br />
=====授权协议=====<br />
<br />
Arch Linux, pacman, documentation, and scripts are copyright<br />
©2002-2007 by Judd Vinet, ©2007-2008 by Aaron Griffin and are licensed under the GNU General Public License Version 2.<br />
<br />
=====[[Arch 之道 (简体中文)|Arch 之道]]=====<br />
<br />
''Arch的设计思想是"保持简洁"(keeping it simple)。'' <br />
<br />
这里的‘简洁’并不是单指‘简单’或者‘用户友好’,而是‘没有不必要的增加、修改或者复杂性’。简而言之,即优雅、极简之法。<br />
<br />
<br />
''"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 crap." -Aaron Griffin''<br />
<br />
<br />
''"The extraordinary part of [my method] lies in its simplicity..I have always believed that the simple way is the right way."'' - Bruce Lee<br />
“(我的方法中)最超凡的部分是它的简单性,我一直相信简单的就是对的。” 李小龙(Bruce Lee)<br />
<br />
Occam's razor: ''Entia non sunt multiplicanda praeter necessitatem'' or "Entities should not be multiplied unnecessarily." The term razor refers to the act of shaving away unnecessary assumptions and complications to get to the simplest explanation, method or theory.<br />
<br />
{{Box Note |'''仔细遵循本指南是成功安装一个配置正常的Arch Linux系统的基本要点,因此''请''认真仔细的阅读本文'''}}<br />
* 你也可以将本指南打印出来,作为一个较为有用的Arch Linux用户手册。<br />
*''如果你想在这个wiki里增加内容,请适当描述清楚“为什么会这样”以及“该怎么办”。最佳的文档应该能教会我们如何做和为什么这么做!''<br />
* Arch的wiki是项优秀的资源,可以[http://wiki.archlinux.org/index.php/Main_Page 第一时间]用来解决日常问题; 如果找不到答案也可以求助IRC和[http://bbs.archlinux.org/ 论坛]。<br />
----<br />
----<br />
欢迎使用Arch!现在,让我们开始吧。<br />
<br />
本文按照安装过程分四大部分:<br />
<br />
'''[[#第一部分:安装基本系统|第一部分:安装基本系统]]'''<br />
<br />
'''[[#第二部分:完成基本系统并升级|第二部分:完成基本系统并升级]]'''<br />
<br />
'''[[#第三部分:安装X并配置ALSA|第三部分:安装X并配置ALSA]]'''<br />
<br />
'''[[#第四部分:安装并配置桌面环境|第四部分:安装并配置桌面环境]]'''<br />
<br />
==第一部分:安装基本系统==<br />
===一、获取最新的系统安装包===<br />
<br />
你可以从[http://archlinux.org/download/ 这里]获取Arch最新的官方系统安装包。最新版本是2009.08<br />
<br />
*不论是Core还是Netinstall系统安装包,都只是包含了安装'''Arch Linux基本系统'''所需的软件包. ''注意,基本系统是不包含GUI图形界面的。它主要包含了GNU的系列工具(编译器、汇编程序、链接、库、脚本,还有其它的一些有用的工具),Linux的内核,还有一些额外的库和模块。<br />
*Core映像文件可以较方便的通过CD或者网络进行安装。<br />
*Netinstall映像文件较小巧,本身没有提供软件包,整个系统都是通过internet来获取的。<br />
*isolinux映像文件是给那些使用grub版本时发生问题的用户的。两者没有其它区别。<br />
*Arch64问答( http://wiki.archlinux.org/index.php/Arch64_问答_(简体中文) )可以帮助你在32位版本和64位版本之间作出选择。<br />
<br />
====CD 系统安装包====<br />
把下载的.iso映像文件刻录到CD上。开机时用CD启动,出现界面,跳到[[#二、启动Arch Linux系统安装程序| 二、启动Arch Linux系统安装程序]]<br />
{{Box Note| 通常为了刻录的稳定可靠(速率越低刻录质量越有保证),推荐刻录的最大速度不超过16倍速。有些用户推荐'''''速度为 4x 或者 2x.''''' 如果所刻录的CD有问题,可以尝试使用你系统所支持的最小速度方式刻录。 }}<br />
<br />
<br />
====USB安装方式====<br />
{{Warning|这样做会把USB盘里面原有的数据格式化。}}<br />
<br />
'''<code>UNIX</code> 方式:'''<br />
<br />
插入USB盘,找到其路径,用<code>/bin/dd</code>命令把.img映像文件写入USB(Linux下):<br />
<br />
dd if=archlinux-2009.08-''{core|netinstall}''-''{i686|x86_64}''.img of=/dev/sd''x''<br />
<br />
if= 后面是.img镜像文件的路径,of= 是你的USB路径. 要使用/dev/sd''x''而不是/dev/sd''x1''.(就是要使用整个分区而不是第一分区)<br />
<br />
'''检查镜像的完整性md5sum (可选):'''<br />
<br />
记下读入和写出的记录区数目,然后执行以下命令进行检查:<br />
dd if=/dev/sd''x'' count=''记录区数目'' status=noxfer | md5sum<br />
<br />
md5sum命令返回的值(这是你检查U盘上文件得到的)要与你下载的archlinux镜像文件的md5sum校验值相同;它们都应该和镜像站点的md5sum文件列表里相应的值相同。<br />
<br />
'''Windows方式:'''<br />
<br />
从https://launchpad.net/win32-image-writer/+download 下载Disk Imager。插入U盘,启动Disk Imager并选择映像文件,再选择U盘相应的磁盘驱动号,点击"write"即可。<br />
<br />
===二、启动Arch Linux系统安装程序===<br />
Usually, the first item is the preferred selection. However, choose Boot Archlive or Boot Archlive [legacy IDE] if you have trouble with libata/PATA, or have no SATA (Serial ATA) drives.<br />
<br />
Also, to change boot options, press '''e''' for editing the boot lines. Many users may wish to change the resolution of the framebuffer, for more readable console output. Append:<br />
插入刻录好的光盘CD或者USB盘,然后用它启动电脑。可能需要在BIOS里(通常是启动后在加电自检过程中按DEL、F1、F2、F11或者F12)改变一下启动顺序使得CD或者USB先被启动。<br />
<br />
{{Note|内存需求:<br />
* Core : 160 MB RAM x86_64/i686 (选择所有软件包,开启交换分区)<br />
* Netinstall : 160 MB RAM x86_64/i686 (选择所有软件包,开启交换分区)}}<br />
<br />
启动了Arch Linux光盘后,用上下箭头高亮菜单,按下回车键进行选择。<br />
<br />
通常,推荐选择第一项菜单。不过如果使用libata/PATA出现问题或者没有SATA (Serial ATA)驱动器,你也可以选择Boot Archlive或者Boot Archlive [legacy IDE] 。<br />
<br />
如果你需要改变启动参数,可以按‘e ’键来编辑启动行内容。 含多用户可能希望改变framebuffer分辨率以得到更好的终端显示。将<br />
vga=773<br />
加到kernel一行的后面,然后按<ENTER>,就可以得到1024x768的framebuffer。设置完毕后按'''b'''则使用相应的选择项进行启动。<br />
<br />
系统将会启动并提示登录,这时可以用'root'进行登录(不要加上单引号)。<br />
<br />
如果你的机器从live CD启动时发生错误或者一些其它'''硬件hardware'''错误,请参看[[Installation Troubleshooting]]。<br />
<br />
<br />
====登录并根据需要更换键盘映射表====<br />
如果你使用non-US键盘布局,可以用命令选择相应的键盘映射表。<br />
# km<br />
或者是是用loadkeys命令<br />
# loadkeys ''layout''<br />
(把''layout''替换成你需要的,比如 &quot;<code>fr</code>&quot; 或者 &quot;<code>be-latin1</code>&quot;)<br />
<br />
====边安装边查看安装指南====<br />
在刻录的livecd里面,已经包含了官方安装指南,在安装的时候可以边安装边查看,按组合键<ALT>+F2 切换到控制台vc/2(alt+f3,alt+f4……分别可以切换到对应的控制台vc/3,vc/4……以此类推),然后输入:<br />
<br />
# less /arch/docs/official_installation_guide_en<br />
<br />
按组合键<ALT>+F1回到控制台vc/1,继续安装系统。安装过程中可以随时切换回vc/2来查看安装指南。<br />
<code>less</code> 是个文本查看程序,位于<code>/usr/bin/less</code><br />
{{tip|请注意,官方指南仅涵盖基本系统的安装和配置过程。一旦安装完毕,强烈建议回到本wiki浏览更多安装后续已经相关问题。}}<br />
<br />
===三、开始安装===<br />
键入<br />
/arch/setup <br />
开始安装。<br />
<br />
====1、选择安装来源====<br />
接着会出现一个选择安装来源的提示。如果你用core ISO的话请选择CD,如果使用FTP ISO的话则选择FTP。<br />
* 如果选择 CORE installer,可以直接看下面的硬盘分区配置。<br />
* FTP/HTTP only: 选择这个需要预先加载网络驱动以便联网安装. 使用Udev来加载这些模块非常有效.<br />
按组合键ALT+F3切换到控制台vc/3,确认一下看其是否生效 invoking ifconfig -a . (Select OK to continue.) ——把后面的网络配置提前看<br />
<br />
====2、设置时间====<br />
有两个选择:<br />
* UTC - 如果使用unix系统包括Linux, Freebsd等, 建议使用UTC<br />
* local - 如果和Windows共享多引导系统, 建议使用local<br />
<br />
====3、硬盘分区配置====<br />
选择第一个菜单项"Prepare Hard Drive"。请注意,"Auto-Prepare"(自动分区)并不是最佳的选择,因为它只分配了最基本的三个区( /,/home,swap)<br />
在这里我们用手工进行硬盘分区。选择"2. Partition Hard Drives",接着选要分区的硬盘(比如:/dev/sdx),然后按你需要编辑分区表。<br />
<br />
''Arch Linux安装程序使用cfdisk公用程序来对硬盘进行分区。''<br />
<br />
''接下来,熟悉GNU/Linux的用户可以跳过这段内容直接到下面'''[[#选择软件包|选择软件包]]'''。''<br />
<br />
=====分区信息=====<br />
<br />
对磁盘进行分区是指在磁盘上定义若干区域(分区),每个都象是一个独立的磁盘,可以在其上创建(格式化)一个文件系统。 分区的类型分为主分区(Primary)、扩展分区(Extended)和逻辑分区(Logical)三类。 <br />
<br />
主分区可以被启动,一个物理磁盘最多能有4个主分区。要使用超过4个的话,只能使用一个包含了逻辑分区的扩展分区。<br />
(译者注:为避免误解,较易懂的解释应该是:一个磁盘不算逻辑分区最多只能有4个分区,这4个要么全是主分区,要么就是3个主分区+1个扩展分区,当然你将整个磁盘划为1个主分区也是没问题的,只要不超过4个分区即可)<br />
<br />
扩展分区通常不会被直接使用,它是作为逻辑分区的“容器”存在。一个硬盘只能有一个扩展分区,可以在里面继续再划分逻辑分区。<br />
<br />
当对一个磁盘进行分区时,是按这种数字顺序命名:主分区为sda1-3,跟着是扩展分区sda4(译者注:在/dev和fdisk -l里是看不到这个sda4的),在扩展分区中划分出来的逻辑分区分别是sda5、sda6,如此类推。<br />
<br />
=====交换分区swap=====<br />
交换分区Swap是虚拟内存在硬盘上驻留的地方,内核可以用它来储存在物理内存中放不下的数据。<br />
<br />
过去,常用的规则是将交换分区大小设置为物理内存的两倍。但是随着时间推移,现在的计算机已经有更大的内存容量,这条规则已经不适用了。通常,512MB内存的计算机,两倍(1G)的还是够用的。而1G内存的计算机,一倍的也够用了。如果你有更大的内存(比如超过1GB),也许可以完全把交换分区忘了,不推荐这样做!<br />
* ''如果你打算使用休眠到磁盘的电源方案,你必须要有不小于内存容量大小的交换分区,有些用户甚至会推荐大于物理内存容量15%的大小。''<br />
<br />
=====规划分区=====<br />
磁盘分区的规划是十分个人的设置。每位用户的决策都会根据自己计算机的情况和需求而不同。至少需要有一个包含了根[http://en.wikipedia.org/wiki/File_system 文件系统] ( / )的主分区和一个交换分区。你还可以选择给/boot(主要用来存放内核文件)、/usr、/var和/home(用来存放用户个人数据)划出独立分区。一个较好的做法是给 / 和 /home都划分独立分区。这样的话,当你因为某些原因重装Arch Linux(或者其它发行版),你还可以保留你的个人数据例如音乐、图片、桌面环境配置等。<br />
<br />
在本案例中,我们划分一个分区给 /,一个给/home,另外还有一个交换分区。<br />
<br />
=====开始创建分区cfdisk=====<br />
让我们开始创建一个包含'''root'''(/)文件系统的主分区。 <br />
<br />
选择'''N'''ew -> Primary,然后输入你希望的分区大小(对一个完整的Linux系统,4到8G是个不错的选择)。分区要位于磁盘的开头部分。选择刚新建的分区,接着选择'''B'''ootable将它置为可启动。<br />
<br />
同时选择分区文件系统类型'''T'''ype,指定为'83 Linux'.。<br />
<br />
给你的/home目录创建另一个分区。选择另外一个主分区设成你想要的容量大小,这取决于你的用户会在他们的home目录里储存多少文件,其大小可能从几百M办公文档到上百G音频视频,所以这里我无法给出一个建议。如果你要使用磁盘所有的剩余空间,记得保给交换分区留一部分(例如1GB或1024MB)。<br />
<br />
同样的,选择'''T'''ype为'83 Linux'。 <br />
<br />
最后,我们给交换分区创建一个分区。选择一个介于512MB到1GB之间的大小并将'''T'''ype改为82 (Linux swap / Solaris)。<br />
<br />
现在的分区规划看起来应该象这样(基于你的选择大小也许会有所不同):<br />
<br />
Name Flags Part Type FS Type [Label] Size (MB)<br />
-------------------------------------------------------------------------<br />
sda1 Boot Primary Linux (4096 - 8192)<br />
sda2 Primary Linux (> 100)<br />
sda3 Primary Linux swap / Solaris (512 - 1024)<br />
<br />
选择'''W'''rite并输入''''yes''''。要注意如果你删除了分区的话,这个操作会破坏你磁盘上的数据。选择'''Q'''uit退出分区程序。<br />
选择Done离开此菜单,接着选择"Set Filesystem Mountpoints"。<br />
<br />
=====IDE设备,为什么看起来它们和SCSI设备一样?=====<br />
最新开发的Linux内核里包含了libata和PATA模块,所有的IDE、SATA和SCSI都采用sd''x''这种命名方式。这十分正常,无需担心。<br />
<br />
=====设置文件系统挂载点=====<br />
<br />
''' ”文件系统格式(filesystems)“和”文件系统结构(file systems)“的区别:'''<br />
<br />
从技术层面确切的说,'''文件系统格式(filesystems)'''是一种数据'''格式''',涉及信息吞吐,比如ext2;而”文件系统结构(file systems)“则是特定操作系统中文件和目录的布局,比如/home/username/games。因此,当你被问及是否创建'''文件系统格式(filesystems)'''时,是在问你是否要'''格式化'''该分区…但是当程序向你问及挂载点时,你应该给出的则是该分区应该出现在你的Arch Linux ”文件系统结构“中的位置。<br />
<br />
'''文件系统类型:'''<br />
<br />
'''强烈建议:'''创建一个交换分区(SWAP)。选择一个合适的分区(本例中使用的是sda3). 安装程序就会询问你是否要创建swap 文件系统; 选择 yes. 接下来, 选择根分区的挂载点(本例中就是 sda1). 然后安装程序就会询问你需要哪一种文件系统。<br />
<br />
{{Box Note| 采用何种文件系统的类型取决于实际应用需要,没有十全十美的文件系统,选择任何一个文件系统,都需要在数据安全和性能要求方面作出适当倾斜,下面只是简单的介绍各种Arch linux支持的文件系统 }}<br />
<br />
1. '''ext2''' - 古老、 可靠的 GNU/Linux 文件系统。非常的稳定,不过 ''不支持日志记录功能''。磁盘检测速度较慢,因而有些不便. ''ext2可以容易地转换成ext3''。一般认为/boot分区采用此系统最合适,因为/boot里的东西就开机的时候读取一次,而且很少有变动,不需要日志文件系统,如果采用日志文件系统,日志的体积很可能远远大于内核的大小。<br />
<br />
2. '''ext3''' - 基于ext2系统, 并添加了日志记录功能。 一般认为他比其他文件系统要 ''稍微的'' 慢一点, 不过 ''非常的'' 稳定并且使用最为广泛,由 GNU/Linux FS 负责维护和开发。<br />
<br />
'''高性能文件系统:'''<br />
<br />
3. '''ext4''' - 最近加入支持的文件系统,是ext2和ext3的后续发展版本,Ext4增加了48位块地址,最大支持1EB文件系统,和单个16TB的文件,增加子目录限制到64,000。新增了很多功能,提供在线碎片处理,速度比ext3快,系统开销比ext3小。<br />
{{Box Note| 由于此系统较新,目前仍存在一些问题,暂时建议/home分区不采用此文件系统,以保证个人数据安全。}}<br />
<br />
4. '''ReiserFS''' - Hans Reiser 主持编写的高性能的日志文件系统,使用一种非常独特有趣的数据存储检索方法。ReiserFS 效率非常高, 特别在处理很多小文件的时候更是如此。ReiserFS在挂载的时候相对比较慢. 性能稳定。 ReiserFS 现在的开发并不活跃(最新的版本是Reiser4).<br />
<br />
5. '''JFS''' - IBM提供的日志文件系统( '''J'''ournaled '''F'''ile'''S'''ystem首字母缩写). JFS 效率非常高并且CPU资源占用率比其他任何一个文件系统都要低。并且在挂载和磁盘检测的时候都非常快,在各方面的表现都非常突出,尤其是 conjunction with the deadline scheduler. (参见 [[JFS]].) 但是并不像ext或者ReiserFS那样应用广泛。<br />
<br />
6. '''XFS''' - 非常高效的日志文件系统,特别适合处理大文件。在处理小文件的时候稍慢。在挂载的时候也很快。由于 /var 需要处理很多的小文件,所以可能不太适合作为/var 分区的文件系统。 GNU/Linux 文件系统中,最先实现可用的在线碎片处理。应用不及ext和ReiserFS那么广泛。<br />
* JFS 和 XFS 不能被磁盘工具压缩(比如gparted 或者 parted magic)<br />
<br />
'''未来文件系统'''<br />
<br />
7、btrfs - 此文件系统尚未被Arch纳入正式支持。是Oracle提供的copy-on-write档案系统。目标在取代的ext3,提高ext3单一档案的大小,总档案系统大小或档案检查,加入目前ext3未支援的功能,比如:writable snapshots,snapshots of snapshots,内建磁盘阵列(RAID)支援,and subvolumes。<br />
<br />
最主要的差别在于[http://en.wikipedia.org/wiki/Journaling_file_system 日志系统] (一种类似的在数据库环境中记录着日志变更的东西). 除ext2之外,其他文件系统都支持日志记录功能. ext3 完全兼容 ext2,因此哪怕你可以用一个非常古老的CD来挂载他,也没问题。 根分区目前最安全的选择就是使用ext3文件系统。ReiserFS,XFS,和JFS也可以使用,因为GRUB (启动引导管理器,稍候在安装部分将会介绍到) 都可以从这些文件系统中启动。你可以通过选择‘’‘yes’‘’来创建文件系统(并格式化分区),接着你就会被提示添加附加分区。 在我们的例子中, 只有sda2了。 选择一个文件系统类型,并且把这个分区挂在到/home. 再次说明,创建文件系统并且选择Done。然后回到主菜单。<br />
<br />
====4、选择软件包====<br />
现在我们要选择安装哪些软件包到系统中。选择CD作为来源,如果你不止一个光驱的话还需要选择使用哪个的光驱。<br />
<br />
软件包选择分为两个阶段。首先要选择软件包分类,然后出现所选分类中软件包的详细列表供你微调。使用空格键进行选择和取消。<br />
<br />
''*BASE:包含最小的软件包集合,仅够构建一个可运行的系统骨架。''<br />
''*SUPPORT:供网络和文件系统用的额外软件包,例如gpm、fuse、dnsutils、无线驱动、ndiswrapper、ntfs-3g诸如此类。''<br />
''*DEVEL:软件创建工具,如GCC、autoconf、automake和make等等。''<br />
''*LIB:大量的库文件,如gmp、lebelf、libevent等等。''<br />
*''' 2008.06 版'''的软件包选择,只有一个: BASE ,选择之后进入其详细列表. <br />
<br />
在这里,我们对'Select all packages by default'选择'yes'。<br />
<br />
接下来屏幕将显示你所选的软件包。对于新手,较安全的做法是不修改它,而有经验的用户可能希望裁减掉一些不需要的软件包。(例如,不需要的文件系统类型公用程序,不需要的驱动等等。)<br />
<br />
====5、安装软件包====<br />
接着,选择'Install Packages'。你会被询问是否希望保留pacman缓冲里的软件包。如果你选'yes',日后你还可以选择对某些软件包进行降级,因此推荐保留(日后你还是可以清除这些缓存的)。安装脚本跟着就会安装所选软件包到你的系统中。这些软件包是二进制的、针对i686优化的,总共仅100MB,因此安装是相当便捷的。<br />
<br />
====6、配置系统====<br />
系统接着会询问你是否要选择[[Hwdetect|hwdetect]]来收集配置所需信息。新手应该选择是('yes')。<br />
<br />
如果是相当熟悉自己的硬件、所需模块,有能力从零开始手动配置/etc/mkinitcpio和/etc/fstab 的高级用户,可以选择否'no'。(当然,此选项是非常复杂的,已经超过本指南的范围,这里就不详细解释了。)<br />
<br />
接下来,系统会询问你是否需要支持从USB设备、FireWire设备、PCMCIA设备、NFS共享、软RAID阵列、LVM2卷和加密卷上启动。如果需要则选'yes',在本案例中以上都不选。<br />
<br />
新手还应该选择让/etc/mkinitcpio/kernel26-fallback.conf使用[[Hwdetect|hwdetect]]的结果,这将确保你的硬盘控制器相容次序。<br />
<br />
现在系统会询问你使用哪个文本编辑器;如果你不熟悉[http://en.wikipedia.org/wiki/Vim_%28text_editor%29 vi/vim]的话可以选择[http://en.wikipedia.org/wiki/Nano_%28text_editor%29 nano]。然后就会出现一个包含系统中大部分重要配置文件的菜单。如果你打算查找/etc/rc.conf中可用的选项,只需按Alt+F2切换到另外一个虚拟控制台进行查找,然后用Alt+F1切换回安装程序。<br />
<br />
======系统配置主文件'''/etc/rc.conf'''======<br />
Arch Linux继承FreeBSD的传统,使用'''/etc/rc.conf'''作为系统配置的主要文件。这个文件包含了广泛的配置信息,主要用于系统的启动。正如名字中所包含的意思,它还包含了供/etc/rc*文件使用的配置。/etc/rc.conf提供了一个Arch用户可以轻易访问到的,简洁而又范围广泛的精简系统资源配置方案。<br />
* '''LOCALIZATION'''部分<br />
** '''LOCALE'''=: 系统场所(locale)设置,被所有国际化(i18n-aware)的应用程序使用 。从命令行上运行locale可以列出可用的locale设置。此设置缺省是适合英文(US English)用户使用的en_US.utf8。(此处locale的设置必须与/etc/locale.gen一致,'''[[#/etc/locale.gen|详见下文]]'''。)中文一般是zh_CN.UTF-8,如果使用之后乱码,先换回en_US.utf8,等进图形界面后再换回来。<br />
** '''HARDWARECLOCK'''=: 指示开关机时进行同步的硬件时钟,是'''UTC'''时间(协调世界时(Universal Time Coordinated), 过去曾用格林威治平均时(GMT)来表示)还是'''localtime'''(本地时间)。通常UTC较为好,因为它大大简化了时区和日光节约时间(中国过去称为夏时制)的变更。而当你同时还有其它操作系统如windows进行双启动,就必须使用localtime(本地时间),它只把本地时间保存到硬件时钟里。<br />
** '''TIMEZONE'''=: 时区(TIMEZONE)。(所有可用的时区可在/usr/share/zoneinfo/里找到。)<br />
** '''KEYMAP'''=: 可用的键盘映射表可在/usr/share/kbd/keymaps里找到。请注意此设定仅在TTY中有效,在所有图形窗口管理器或者X中都不使用此设置!<br />
** '''CONSOLEFONT'''=: 如果你一定要修改此设置,可在/usr/share/kbd/consolefonts/中找到可用的字体。<br />
** '''CONSOLEMAP'''=: 定义了启动时setfont程序加载的控制台映射表。有需要的话,可在/usr/share/kbd/consoletrans里找到可用的映射表。<br />
** '''USECOLOR'''=: 如果你使用彩色显示器的话请选"yes"。<br />
<br />
LOCALE="zh_CN.UTF-8"<br />
HARDWARECLOCK="localtime"<br />
TIMEZONE="Asia/Shanghai"<br />
KEYMAP="us"<br />
CONSOLEFONT=<br />
CONSOLEMAP=<br />
USECOLOR="yes"<br />
* '''HARDWARE'''部分<br />
** '''MOD_AUTOLOAD'''=: 如果你使用'''udev'''在启动时探测硬件并加载相应模块。请设置为"yes",(适合缺省模块化的内核)。设置为"no"就得靠用户自己指定所需的有关信息。<br />
** '''MOD_BLACKLIST'''=: 模块黑名单。在下面的例子中,IPv6模块和pcspeaker都被列入黑名单而不被加载。<br />
** '''MODULES'''=: 指示了其它模块,如果你知道缺少哪个重要的模块可以加在里面。('''hwdetect'''应该已经填写了最重要的模块):<br />
# Scan hardware and load required modules at bootup<br />
MOD_AUTOLOAD="yes"<br />
# Module Blacklist - modules in this list will never be loaded by '''udev'''<br />
MOD_BLACKLIST=(net-pf-10 pcspkr)<br />
#<br />
MODULES=(e100 eepro100 mii slhc snd-ac97-codec snd-intel8x0 soundcore)<br />
* '''NETWORKING'''部分<br />
** '''HOSTNAME'''=:设置为你喜欢的主机名(HOSTNAME)。<br />
** '''lo'''=: 不修改此行。<br />
** '''eth0'''=: 如果使用'''静态IP'''的话请调整网络接口的IP地址、掩码和广播地址。如果使用'''DHCP'''的话则设为eth0="dhcp"。<br />
** '''INTERFACES'''=: 指定使用哪些网络接口。如果你不使用DHCP来配置设备,而是通过命令行用ifconfig手动配置设备的话,这里的变量值(名字必须等于打算进行配置的设备名一样)必须和ifconfig里加入的内容一样。<br />
** '''gateway'''=: 如果你使用'''静态IP''',将网关(gateway)地址设为路由器的IP。如果使用DHCP,则将此行用'#'注释掉。<br />
** '''ROUTES'''=: 如果你使用'''静态IP''',则将'gateway'前面的'!'去掉。如果使用'''DHCP'''的话则不需要修改此行。<br />
<br />
<br />
例如,当使用'''DHCP''':<br />
HOSTNAME="arch"<br />
lo="lo 127.0.0.1"<br />
#eth0="eth0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255" <br />
eth0="dhcp"<br />
INTERFACES=(lo eth0)<br />
#gateway="default gw 192.168.0.1"<br />
ROUTES=(!gateway)<br />
* '''DAEMONS'''部分<br />
这个序列罗列了位于/etc/rc.d/里需要在启动过程中启动的脚本名字。<br />
<br />
*如果脚本名字前有惊叹号(!),表示它不被执行。<br />
*如果脚本名字前有符号(@),则表示它会在后台被执行,启动序列不会等待此脚本成功执行完毕,而是继续执行下一个守护进程脚本。<br />
<br />
这种'BSD风格'的初始化就是Arch的处理办法,而其它发行版则是在一个init.d目录里使用一大堆符号链接(一个简单的文件 vs 一整个目录)。<br />
<br />
======关于守护进程======<br />
虽然此时你不需修改[[daemons]]行,不过还是有必要解释一下什么是守护进程,因为过一会儿在指南里我们会需要它。<br />
<br />
和Windows服务(service)类似,守护进程(daemon)是一个运行于后台的程序,等待事件发生并提供服务。一个较好的例子是webserver等待请求以发送页面,还有SSH服务等待用户登录。这些都是全功能的程序,还有些守护进程工作起来并不是那么明显的。例如向日志文件里写信息的守护进程(如syslog、metalog),当系统空闲时降低CPU频率的守护进程(如cpufreq),以及提供图形化登录的守护进程(如gdm、kdm)。所有这些程序都可以被加入到daemons行中,在系统启动时被执行。本指南会对一些较有用的守护进程进行介绍。<br />
按Ctrl+X退出nano编辑器。<br />
<br />
======磁盘和分区配置文件:/etc/fstab======<br />
'''fstab''' ('''f'''ile '''s'''ystems '''tab'''le的缩写) 是系统配置的一部分,该文件列出所有可用的磁盘和分区,并指明它们初始化的方式或整合至全局文件系统的方式。'''/etc/fstab'''文件一般被'''mount'''命令读取,以决定某一特定设备被挂载时所采用的选项。<br />
<br />
这是一个'''/etc/fstab'''的例子:<br />
<br />
#<br />
# /etc/fstab: static file system information<br />
#<br />
# <file system> <dir> <type> <options> <dump> <pass><br />
none /dev/pts devpts defaults 0 0<br />
none /dev/shm tmpfs defaults 0 0<br />
#/dev/cdrom /mnt/cdrom iso9660 ro,user,noauto,unhide 0 0<br />
#/dev/dvd /mnt/dvd udf ro,user,noauto,unhide 0 0<br />
#/dev/fd0 /mnt/fd0 vfat user,noauto 0 0<br />
/dev/sda1 / jfs defaults,noatime,nodiratime 0 1 <br />
/dev/sda2 /home jfs defaults,noatime,nodiratime 0 2<br />
/dev/sda3 swap swap defaults 0 0<br />
Hwdetect应该已经有效地配置了一个可用的'''fstab''',但最好还是简要地检查一下。<br />
<br />
*如果你打算用'''hal'''来自动挂载DVD之类的媒体,为了给即将安装的'''hal'''做准备,你可能要注释掉cdrom和dvd条目。 <br />
<br />
''在笔记本电脑和桌面系统上,可以给 / 和 /home加上'noatime'和'nodiratime'选项来提高速度、性能,同时还能省电。无论你采用何种文件系统,这样做都应该是安全的。''<br />
<br />
更多信息请参照[[Fstab]]<br />
<br />
======'''mkinitcpio.conf、modprobe.conf和kernel26-fallback.conf'''======<br />
此时我们无须去修改这些配置文件。'''mkinitcpio.conf'''负责配置ramdisk(例如从RAID、加密卷启动), '''modprobe.conf'''可以用来设置内核模块的的某些配置选项,而'''kernel26-fallback.conf'''则是initramfs后备配置。<br />
<br />
======(对于静态IP)网络配置文件:/etc/resolv.conf ======<br />
*''如果你使用DHCP,完全可以忽略此文件,缺省情况下dhcpd守护进程会自动创建和销毁此文件。''<br />
<br />
如果你使用静态IP,则可在/etc/resolv.conf里设置你的DNS服务器。每行的格式为nameserver <ip地址>,如果有多个DNS服务器则可以填入多行。<br />
<br />
如果你使用路由器,也许会希望由你的路由器本身指定DNS服务器,而在'''resolv.conf'''里只是写入你的路由器的IP(同时也是'''/etc/rc.conf'''里的网关),例如:<br />
nameserver 192.168.1.1<br />
可选的,逐个加入你的DNS服务器,例如:<br />
nameserver 4.2.2.1<br />
nameserver 4.2.2.2<br />
<br />
如果使用'''DHCP''',你也可以在你的路由器里指定你的DNS服务器,或者如果你的ISP支持的话由ISP自动指定。<br />
<br />
======/etc/hosts======<br />
可以在此文件中加入你想要的''hostname'',必须和/etc/rc.conf里的设置一致,因此它应该象这样:<br />
127.0.0.1 localhost.localdomain localhost '''''yourhostname'''''<br />
''为了程序的兼容性,必须严格遵照这个格式,'''包括'localhost' 这项'''!错误的句法可能会导致网络性能低下和/或某些程序运行缓慢甚至无法运行。这对新手来说是十分普遍的错误。''<br />
<br />
对于大部分用户,只要把''yourhostname''加入到行末就就可以了,不过有些用户推荐以下句法:<br />
127.0.0.1 '''''yourhostname'''''.domain.org localhost.localdomain localhost '''''yourhostname'''''<br />
如果你使用静态IP,可以用这种句法加入新行:<static-ip> hostname.domainname.org hostname,例如:<br />
192.168.1.100 '''''yourhostname'''''.domain.org '''''yourhostname'''''<br />
<br />
======/etc/hosts.deny和/etc/hosts.allow======<br />
如果你打算使用[[SSH|ssh]]的话,请根据自己的需要修改此配置。缺省设置是拒绝所有进入的连接,而不只是ssh连接。编辑'''/etc/hosts.allow '''文件加入:<br />
sshd:all <br />
这会允许所有进入的ssh连接。<br />
<br />
如果你不打算使用[[SSH|ssh]],为安全起见请保持此文件的缺省设置(为空)。<br />
<br />
======/etc/locale.gen======<br />
<br />
'''locale-gen''' 命令从 '''/etc/locale.gen'''读取信息设定系统的locales. 这些设置稍后会被'''glibc''' 和其他一些支持本地化的程序或者库用于自动翻译输出各种语言的"独特" 文本, 并且合适的显示地域、货币、时区以及日期格式, 字符排列方式和其他一些本地化的特殊标准。设置默认本地化的功能是类<code>UNIX</code>操作系统的一大特质<br />
<br />
默认情况下 /etc/locale.gen 是一个仅包含注释文档的空文件.编辑后,这个文件将不会get touched again. 每次'''glibc'''更新之后'''locale-gen'''就会运行一次, 以在/etc/locale.gen重新生成所有的本地化设置.<br />
<br />
选定你需要的本地化类型(移除前面的#即可), 比如:<br />
en_US ISO-8859-1<br />
en_US.UTF-8 <br />
('''你这里的设置必须和上文中提到的/etc/rc.conf 的设置一致哦.''')<br />
<br />
现在,安装程序将运行locale-gen 脚本, 以生成你设定的locales。你以后可以通过修改文件/etc/locale.gen变更你的locale, 然后使用根用户(root)运行'locale-gen'脚本使之生效。<br />
<br />
''Note 如果你选择并设置了locale, 他将提示你 "The current locale is invalid..." 错误。可能是因为大多数新Arch用户都会犯的普遍的错误,也是在论坛中问得最多的问题。''<br />
<br />
======Root密码======<br />
最后,设置一个root密码并确定你已牢记它。返回主菜单然后接着安装启动加载器。<br />
<br />
======Pacman镜像======<br />
为'''pacman'''选择一个镜像软件仓库。记住archlinux.org是有流量限制的,下载速度限于50KB/s.。<br />
<br />
*''如果你不熟悉现有的镜像和它们所处的位置,那就随便选一个。稍后你可以运行本指南后面提到的'''rankmirrors'''脚本,它将自动配置最接近你的镜像。''<br />
<br />
返回主菜单。<br />
<br />
====7、安装启动加载器====<br />
因为本案例中没有第二个操作系统,因此我们需要安装一个启动加载器。推荐选择[http://www.gnu.org/software/grub/ GNU GRUB]作为启动加载器。另外一种选择是[http://lilo.go.dyndns.org/ LILO]。缺省的'''GRUB'''配置('''/boot/grub/menu.lst''')应该足够了。唯一你可能想修改的是控制台的分辨率。将vga=<number>加入到第一个kernel行。(menu.lst中已列出一张分辨率和数字的对应表格可供查找。)<br />
title Arch Linux (Main)<br />
root (hd0,0)<br />
kernel /boot/vmlinuz26 root=/dev/sda1 ro vga=773<br />
initrd /boot/kernel26.img<br />
参数"vga=773"表示1024x768分辨率、256色的framebuffer。<br />
<br />
将'''GRUB'''启动加载器安装到主引导区(本例中为sda)。<br />
<br />
====8、系统重启====<br />
退出安装程序。<br />
*建议:为了方便接下来更进一步的安装配置,可以把光盘里的新手指南复制一份到电脑里,这样后面的安装就能查看相应的向导了<br />
<br />
cp /arch/beginnersguide.txt /mnt/home/beginnersguide.txt<br />
<br />
系统重启之后,进入控制台,可以使用下面命令查看这新手指南<br />
less /home/beginnersguide.txt<br />
所有安装完毕之后,可以删了这指南<br />
rm /home/beginnersguide.txt<br />
<br />
输入命令下面命令,重启:<br />
<br />
reboot<br />
<br />
一个新Arch Linux系统就会启动并进入登录提示符(你可能需要在'''BIOS'''将启动顺序改为优先从硬盘启动)。<br />
<br />
'''祝贺你,一个崭新的Arch Linux基础系统闪亮登场了!'''<br />
<br />
==第二部分:完成基本系统并升级==<br />
你的新Arch Linux基础系统现在已是一个功能完整的GNU/Linux环境了,随时可以进行定制。从现在开始,你可以按自己的意图和需求改造它。由于arch是滚动发布的,所以安装包不一定是最新的系统,所以我们在安装完成之后,需要立即更新系统。<br />
<br />
让我们开始吧。<br />
-----<br />
登录入你的root账号。我们将以root身份配置pacman和更新系统,然后创建一个普通用户账号。<br />
<br />
===一、配置网络(如果有需要)===<br />
*''如果安装脚本的自动配置不适合你,本段内容将帮助你配置大部分类型的网络。''<br />
-----<br />
如果一切正常的话,你的网络应该可以正常使用了。先ping www.google.com验证一下:<br />
ping -c 3 www.google.com<br />
<br />
''如果你已经成功建立网络连接,则跳到下面阅读[[#使用pacman更新、同步、升级系统|使用pacman更新、同步、升级系统]]'''。''<br />
<br />
如果ping www.google.com后得到"unknown host"的错误,可以认为你的网络尚未正确配置。你需要重新检查以下内容的完整性和正确性:<br />
'''/etc/rc.conf''' # 特别留意HOSTNAME= 和 NETWORKING 部分有无输入错误。<br />
<br />
'''/etc/hosts''' # 复核一下格式。(看之前的内容。)<br />
<br />
'''/etc/resolv.conf''' # 当你使用静态IP时需要检查。如果你使用DHCP,缺省这个文件会被自动创建和销毁,不过也可以改为你需要的内容。(参见[[Network]]。)<br />
<br />
高级的网络配置方法可以在[[Network]]一文中找到。<br />
<br />
=====有线网络=====<br />
<br />
用以下命令检查网络<br />
ifconfig<br />
你应该看到eth0这一项。如果有需要,你可以这样设置一个新的静态IP:<br />
ifconfig eth0 <ip address> netmask <netmask> up <br />
并且这样设置缺省网关:<br />
route add default gw <ip address of the gateway><br />
查看一下/etc/resolv.conf是否包含你的DNS服务器,不过缺失了则补填进去。<br />
再次用ping www.google.cn检查一下网络。如果一切正常,将/etc/rc.conf调整为刚才新设置的静态IP。如果你的网络使用DHCP服务器/路由器的话,输入:<br />
dhcpcd eth0<br />
如果这样可行的话,则将/etc/rc.conf按之前所述方法调整为动态IP。<br />
<br />
=====无线网络=====<br />
详见安装指南:[[无线设置 (简体中文)|无线设置]]<br />
<br />
=====Analog Modem=====<br />
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.<br />
Tip: Read [[Dialup without a dialer HOWTO]].<br />
<br />
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 [http://www.linmodems.org/ LinModem] homepage.<br />
<br />
=====ISDN=====<br />
<br />
通过三步,完成 ISDN 的安装和配置:<br />
# 安装配置固件Install and configure hardware<br />
# 安装配置ISDN 管理工具<br />
# 添加ISP信息<br />
<br />
现在的 Arch stock kernels 已经包含了ISDN 所需要的modules, 所以不需要重新去编译内核,除非 you're about to use rather odd ISDN hardware. 把ISDN卡插入电脑或者插入USB ISDN-Box之后,you can try loading the modules with modprobe. 绝大部分的ISDN PCI 卡都能被module hisax处理,只需要两个参数:类型和协议。 如果使用的是1TR6标准,则协议设定为 '1' ,如果使用的是EuroISDN (EDSS1),协议设定为 '2', '3' if you're hooked to a so-called leased-line without D-channel, 如果使用的是US NI1,则设为'4'.<br />
<br />
所有配置细节都可以在kernel documentation, more specifically in the isdn subdirectory, and available online中获知。 类型的参数是根据电视卡来设定的,在README.HiSax kernel documentation中,有一个可能类型的列表。 用相应的参数加载moduleChoose,比如这个:<br />
<br />
modprobe hisax type=18 protocol=2<br />
<br />
这个将加载适用于电视卡类型为ELSA Quickstep 1000PCI,德国使用的EDSS1协议的模块hisax。可以在日志文件/var/log/everything.log中查看是否模块被预加载。额外的USB ISDN Adapter需要加载些USB模块才能正常工作。<br />
<br />
通过上述设定之后,如果电视卡能正常工作,那么把下面模块和参数加入/etc/modprobe.conf中:<br />
<br />
alias ippp0 hisax<br />
options hisax type=18 protocol=2<br />
<br />
这么做的好处是,这些模块在不使用时不会被加载。另外的方法是可以在这只加参数,把hisax加入/etc/rc.conf里面的MODULES,这样做的坏处就是不管这些模块是不是在使用,都加载了。 <br />
<br />
完成上述步骤之后,需要安装管理工具<br />
<br />
安装软件包isdn4k-utils,阅读关于isdnctrl的说明手册。在说明手册里,将有详细的说明:如何创建一个配置文件that can be parsed by isdnctrl,安装实例。 Please note that you have to add your SPID to your MSN setting separated by a colon if you use US NI1.<br />
<br />
使用isdnctrl utility配置ISDN卡之后,将可以拨号到你设定的PHONE_OUT参数的机器上,但提示用户名和密码错误。把用户名和密码加入到/etc/ppp/pap-secrets或者/etc/ppp/chap-secrets,这个主要根据的是你的ISP使用的协议授权方式,as if you were configuring a normal analogous PPP link。如果无法确定,可以两个文件都加。<br />
<br />
完成上述设定之后,用root帐号建立一个拨号连接:<br />
isdnctrl dial ippp0<br />
有啥问题,请检查日志文件!<br />
<br />
=====DSL (PPPoE)=====<br />
<br />
仅当需要你的计算机去主动拨号连接ISP的情况下才需参考本段内容。如果你使用独立的路由器来负责这类工作,你只需要设置一个缺省网关即可。<br />
<br />
在使用DSL连接前,你得先在计算机里安装一个连接到DSL-Modem的网卡。将你新装网卡加入到modules.conf/modprobe.conf或者MODULES列表之后,安装rp-pppoe软件包并运行pppoe-setup脚本来配置你的连接。当你输入完有关信息后,可以分别通过以下命令来进行连接和挂断:<br />
<br />
/etc/rc.d/adsl start<br />
<br />
和<br />
<br />
/etc/rc.d/adsl stop<br />
<br />
setup过程一般都是很容易、直观的,如果还有不懂可以阅读man手册。如果你想在启动时自动拨号,可以将adsl加入到DAEMONS列表中。<br />
<br />
<br />
===二、更新Pacman===<br />
<br />
====pacman是什么?====<br />
[[Pacman]]是Arch Linux的软件包管理器('''pac'''kage '''man'''ager)。Pacman是用C语言编写的,速度快,使用简便,功能强大。它可以管理整个软件包系统,负责软件包的安装、删除、降级(通过缓存),也支持自编译的软件包,自动分析依赖关系,可以搜索远程和本地软件仓库,还有大量其它功能。这里我们将用pacman来从远程软件仓库下载软件包并安装到系统中。<br />
<br />
对系统进行定制,pacman是Arch Linux最重要工具。<br />
<br />
====1、配置pacman====<br />
=====pacman总配置文件/etc/pacman.conf=====<br />
Arch通过pacman可以获得对下面 4软件仓库的管理:<br />
<br />
'''[core]'''<br />
<br />
[core](“核心”)仓库的简单原则是只提供一个基本的Arch Linux的基本工具:GNU系列工具,Linux内核,一个文字编辑器,一个命令行浏览器等(这里也有一些例外。比如说,vi和nano是同时提供的,允许用户选择一个或两个)。它包含所有使你的系统正常运转的“必须”安装的包,只有它们完美地工作,你的系统才能继续运行。这些是绝对“system-critical”(对系统来说至关重要)的包。由开发者负责维护。<br />
<br />
*''Core安装媒介(The Core installation media)简单地包含一个安装脚本,一个当前发布版本的核心仓库的快照(snapshot)。''<br />
<br />
'''[extra]'''<br />
<br />
[extra](“额外的”)仓库包含所有的对于一个基本的Arch系统不是必须,但是对于构建一个完整的系统环境有用的的Arch包。 比如'''X''', KDE和Apache,都可以在这里面找到。它也是由开发者维护的。<br />
<br />
'''[testing]'''<br />
<br />
[testing](“测试”)仓库包含的包是[core]和[extra]仓库的候选者。<br />
下面情况下,新的软件包将进入[testing]软件仓库:<br />
* 可能会导致系统出问题的升级,需要测试。<br />
* 需要重新打包其他软件包。这种情况下,所有需要重新打包的软件包将被放在[testing]仓库,直到所有重新打包完成,这些软件包才回归原有的软件仓库。 <br />
<br />
开发者维护。<br />
<br />
[testing]是唯一的一个在名义上与其它官方仓库有冲突的仓库。(that can have name collisions with any of the other official repositories. )<br />
<br />
<font color=&quot;blue&quot;>*如果开启, [testing]必须放在''pacman.conf''的软件仓库的第一个。</font><br />
<br />
<font color=&quot;red&quot;>'''警告''': '''''开启[testing]软件仓库,容易导致系统崩溃,因此只建议有经验的用户开启。'''''</font><br />
<br />
'''[community]'''<br />
<br />
[community](“社区”)仓库是由“信任用户”(''Trusted Users (TUs)'')维护的,是''Arch User Repository ([[AUR]])''(Arch用户仓库)的一部分。它包含的是二进制的包,在用户仓库中有足够的“票数”,并由''信任用戶''挑选出来的。像其它上面列出的仓库一样,[community] 可以用pacman获取。<br />
<br />
'''[[AUR]]''' 也包含'''unsupported''' 分支,这不能直接通过pacman获取。*. [unsupported] 包含多达海量PKGBUILD脚本,用来从源代码编译。这从其它仓库中是不能使用的。 <br />
<br />
<nowiki>*</nowiki> '''''[[AUR Helpers]]''''' 能帮助你无缝地使用AUR。<br />
<br />
'''/etc/pacman.conf'''<br />
<br />
每次调用pacman,它都会读取/etc/pacman.conf文件。这个配置文件分若干段,每一段定义了一个pacman用来搜索软件的仓库。唯一例外的是options段,它定义了全局选项。<br />
nano /etc/pacman.conf<br />
范例:<br />
#<br />
# /etc/pacman.conf<br />
#<br />
# See the pacman.conf(5) manpage for option and repository directives<br />
<br />
#<br />
# GENERAL OPTIONS<br />
#<br />
[options]<br />
# The following paths are commented out with their default values listed.<br />
# If you wish to use different paths, uncomment and update the paths.<br />
#RootDir = /<br />
#DBPath = /var/lib/pacman/<br />
#CacheDir = /var/cache/pacman/pkg/<br />
#LogFile = /var/log/pacman.log<br />
HoldPkg = pacman glibc<br />
# If upgrades are available for these packages they will be asked for first<br />
SyncFirst = pacman<br />
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u<br />
#XferCommand = /usr/bin/curl %u > %o<br />
<br />
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup<br />
#IgnorePkg =<br />
#IgnoreGroup =<br />
<br />
#NoUpgrade =<br />
#NoExtract =<br />
<br />
# Misc options (all disabled by default)<br />
#NoPassiveFtp<br />
#UseSyslog<br />
#ShowSize<br />
#UseDelta<br />
#TotalDownload<br />
#<br />
# REPOSITORIES<br />
# - can be defined here or included from another file<br />
# - pacman will search repositories in the order defined here<br />
# - local/custom mirrors can be added here or in separate files<br />
# - repositories listed first will take precedence when packages<br />
# have identical names, regardless of version number<br />
# - URLs will have $repo replaced by the name of the current repo<br />
#<br />
# Repository entries are of the format:<br />
# [repo-name]<br />
# Server = ServerName<br />
# Include = IncludePath<br />
#<br />
# The header [repo-name] is crucial - it must be present and<br />
# uncommented to enable the repo.<br />
# <br />
<br />
# Testing is disabled by default. To enable, uncomment the following<br />
# two lines. You can add preferred servers immediately after the header,<br />
# and they will be used before the default mirrors.<br />
#[testing]<br />
#Include = /etc/pacman.d/mirrorlist<br />
<br />
[core]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
[extra]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist <br />
<br />
[community]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
# An example of a custom package repository. See the pacman manpage for<br />
# tips on creating your own repositories.<br />
#[custom]<br />
#Server = file:///home/custompkgs<br />
要开启一个软件仓库,只需要将'Include ='和'[repository]'行前的注释符号(#)去除。<br />
<br />
*"Server ="行如果取消注释,将会强制此服务器被首先搜索,详细的仓库配置位于/etc/pacman.d/下。<br />
* 注意:选择仓库时,请确认将仓库名和'Include ='行都一同取消注释。没有这样做的话会导致你选择的仓库被忽略!这是个很普遍的错误。<br />
<br />
=====(如果有必要)配置镜像列表 /etc/pacman.d/mirrorlist=====<br />
更快的镜像能显著改善pacman的性能和你对Arch Linux的总体体验。<br />
<br />
*手动编辑/etc/pacman.d/mirrorlist:<br />
nano /etc/pacman.d/mirrorlist<br />
删除所有不在你所在洲或者太远的镜像。(在nano里你可以用CTRL-K删除每个不需要的行。)保存文件并退出。<br />
<br />
*'''rankmirrors'''脚本可以根据镜像的响应延迟对其自动排名。'''Rankmirrors'''是python脚本,需要安装python:<br />
<br />
pacman -S python<br />
<br />
然后,运行'''rankmirrors'''脚本按响应延迟顺序对镜像进行排名:<br />
rankmirrors -v /etc/pacman.d/mirrorlist<br />
输出会列出所有镜像和它们的响应延迟(ping),例如:<br />
<br />
# United States<br />
# http://mirrors.easynews.com/linux/archlinux/$repo/os/i686 ... 0.96<br />
# ftp://ftp.nethat.com/pub/linux/archlinux/$repo/os/i686 ... unreachable<br />
# ftp://locke.suu.edu/linux/dist/archlinux/$repo/os/i686 ... 2.43<br />
# ftp://mirrors.unixheads.org/archlinux/$repo/os/i686 ... 1.96<br />
<br />
脚本将从低到高的响应延迟顺序显示:<br />
Server = http://mirrors.easynews.com/linux/archlinux/$repo/os/i686<br />
Server = ftp://mirrors.unixheads.org/archlinux/$repo/os/i686<br />
Server = ftp://locke.suu.edu/linux/dist/archlinux/$repo/os/i686<br />
Server = ftp://ftp.nethat.com/pub/linux/archlinux/$repo/os/i686<br />
<br />
要注意的是这个结果对于镜像排列并非很精确,最接近你的镜像或者延迟最低的镜像并不一定是最佳选择。(反应迅速但是内容过时的镜像、或者低延迟但是窄带宽的镜像对你毫无用处)。<br />
<br />
编辑/etc/pacman.d/mirrorlist,将最佳的镜像置于在列表顶端。为了体验多个镜像你可能要不断修改此配置文件,请精明地选择。<br />
<br />
====常用的命令====<br />
<br />
与远程软件仓库同步和更新本地包数据库 (推荐在安装和更新包之前这样做):<br />
pacman -Sy<br />
<br />
'''升级'''系统中所有的包:<br />
pacman -Su<br />
<br />
一条同步、更新、'''升级''' 所有系统中的包的命令:<br />
pacman -Syu<br />
<br />
安装或者升级单个软件包或者一串包(包括其依赖包):<br />
pacman -S packageA packageB<br />
<br />
同步、更新数据库并安装软件包:<br />
pacman -Sy packageA packageB<br />
<br />
移除软件包, 但保留依赖的包:<br />
pacman -R package<br />
<br />
移除单个包,并且移除没有被别的软件依赖的依赖包:<br />
pacman -Rs package<br />
<br />
移除包所有不需要的依赖包并删除其配置文件:<br />
pacman -Rsn package<br />
<br />
通过给定关键词(列表)搜索远程软件仓库数据库(repo):<br />
pacman -Ss keyword<br />
<br />
列出系统中所有的包<br />
pacman -Q<br />
<br />
在本地包数据库搜索 (查询)指定软件包:<br />
pacman -Q package <br />
<br />
在本地包数据库搜索 (查询)指定软件包并列出相关信息:<br />
pacman -Qi package<br />
<br />
To defragment pacman的数据库缓存和速度优化选项:<br />
pacman-optimize<br />
<br />
统计当前系统中的包数量:<br />
pacman -Q | wc -l<br />
<br />
使用ABS和makepkg从源代码编译安装包:<br />
pacman -U packagename.pkg.tar.gz<br />
<br />
Note: pacman有很多很多的选项和功能组合。你可以试试man pacman或者查阅lt the [[pacman]]维基条目<br />
<br />
====软件包管理增强工具====<br />
* Yaourt 可查询aur的pacman增强工具<br />
* Tupac 快速查询的yaourt增强工具<br />
* Powerpill 多进程下载的pacman增强工具<br />
{{Box Note| 强烈建议更新系统完毕后,安装yaourt和powerpill,以便更充分享受Arch Linux的方便和强大。}}<br />
在/etc/pacman.conf文件里,最后添加两行(如果是i686的话,把x86_64换成i686即可):<br />
[archlinuxfr]<br />
Server = http://repo.archlinux.fr/x86_64<br />
然后使用pacman安装yaourt<br />
pacman -Sy yaourt<br />
<br />
以后就可以使用yaourt命令来查找并安装包括[[AUR]]里的软件了。比如bcm无线网卡,需要安装b43-firmware(此软件包在[[AUR]]仓库里,使用pacman无法查找到),使用yaourt命令查找并安装:<br />
yaourt b43-firmware<br />
找到之后,根据相应提示,一直到安装完成。<br />
<br />
====图形化管理工具====<br />
* qt界面的shaman:比较成熟的pacman 图形化管理工具<br />
* gtk界面的gtkpacman :目前BUG比较多,不稳定。<br />
<br />
====Pacman的更多信息====<br />
用此命令查看pacman手册:<br />
man pacman<br />
有空的话可以看看[[pacman (简体中文)]]维基条目。<br />
<br />
====2、更新Pacman自己====<br />
<br />
一开始,系统可能会提示你先更新pacman自身,这取决于Arch安装包的新旧程度:<br />
pacman -Sy pacman<br />
pacman开始查看是否需要更新,如果有提示需要更新,则按‘y’,开始pacman更新。<br />
<br />
'''''有时候,还需要用户主动修改某些配置;请仔细阅读升级过程中的输出获取相关信息。'''''<br />
<br />
===三、更新系统===<br />
====使用[[pacman (简体中文)|pacman]]====<br />
现在我们要用[[pacman (简体中文)|pacman]]来更新系统。要更新、同步并'''升级'''你的系统,可以使用命令:<br />
pacman -Syu<br />
pacman就会获取所有最新可用软件包信息并进行升级。(此时你可能会被提示先升级pacman自身。如果是这样,回答'yes',然后在完毕后再运行一次pacman -Syu命令。)<br />
<br />
===='''滚动发布'''之美====<br />
Arch是一个'''rolling release'''(滚动发布)的发行版。这意味着没有必要重新安装或执行完整的系统重建来升级到最新版本。只需要执行'''pacman -Syu''',就能保持你的系统更新到最新和bleeding edge(表示最新的、因而也并非完美的技术)。<br />
<br />
===四、增加一个用户并设置用户组===<br />
用root账号来处理日常工作是很危险的。Root是用来处理系统管理的任务。我们可以用以下命令增加一个普通用户账号:<br />
adduser<br />
大部分缺省选项都是没问题的,你可能还需要将storage、audio、video、optical和wheel加入到你的用户组中 ── 特别是在你打算使用一个完整功能的桌面环境的情况下。<br />
<br />
用户组和用户的关联定义在/etc/group文件中: <br />
<br />
它包含了:<br />
<br />
*'''audio''' - 关于声卡和相关软件的任务<br />
<br />
*'''wheel''' - 给sudo使用<br />
<br />
*'''storage''' - 负责存储设备<br />
<br />
*'''video''' - 视频任务和3D加速<br />
<br />
*'''optical''' - 和光驱有关的任务<br />
<br />
*'''floppy''' - 软驱访问<br />
<br />
*'''lp''' - 打印任务<br />
<br />
请参看[[Groups]]一文了解你应该属于哪些用户组。<br />
你还可能需要将你的用户账号加入到以下用户组(需要以root身份运行此命令):<br />
usermod -aG audio,video,floppy,lp,optical,network,storage,wheel,dbus,hal USERNAME<br />
详情可看usermod和gpasswd的man手册。<br />
<br />
===五、安装建立Sudo (可选)===<br />
安装Sudo:<br />
# pacman -S sudo<br />
以root身份,运行命令visudo,把用户加入sudo用户 (a &quot;sudoer&quot;).如果不知道怎么使用vi,你可以在用visudo前设置EDITOR环境变量为你喜欢的编辑器。例如:<br />
# EDITOR=nano visudo<br />
如果你对于用vi很适应,去掉EDITOR=nano这个变量就行:<br />
# visudo<br />
这命令将在一个特殊的vi会话中打开文件 /etc/sudoers 。visudo复制文件到一个可编辑的临时文件中,用一个编辑器编辑它(vi是默认的),接下来运行一个安全检查(“sanity check”)。如果通过,这个临时文件就有正确的权限将重写的原始文件。t<br />
<br />
<font color=&quot;red&quot;>'''注意:不要直接用编辑器编辑 /etc/sudoers ; 否则会出现这样的提示:Errors in syntax can cause annoyances (像root帐户不能使用的描述一样)。 必须使用 ''visudo'' 命令来编辑 /etc/sudoers.'''</font><br />
<br />
当用户输入以 &quot;sudo&quot;, 作为开始的命令行时,临时授予该用户root权限。加入下面一行:<br />
USER_NAME ALL=(ALL) ALL<br />
USER_NAME 就是单个用户名。<br />
<br />
更多信息,比如按<TAB> 自动命令补全,请见[[Sudo]]<br />
<br />
==第三部分:安装X并配置ALSA==<br />
一共有三步工作:<br />
*1、安装声卡驱动<br />
*2、安装x-window(包括显卡驱动)<br />
*3、配置X<br />
<br />
{{Box Note | '''在热插拔未配置正确的情况下,或者是/etc/rc.d/hal未启动的情况下,请不要启动开启X(包括重启使用gdm或者kdm登陆),否则可能导致鼠标键盘失去响应!!!'''}}<br />
<br />
===一、配置声卡:使用alsamixer===<br />
高级Linux声音架构(Advanced Linux Sound Architecture,简称ALSA)是一个Linux内核组件。它替换了原有的开放声音系统(OSS),为声卡提供了设备驱动。除了声音设备驱动以外,'''ALSA'''还给应用程序开发人员提供了一个用户空间库,可使更高级的API无需直接与内核驱动打交道就能使用驱动功能。<br />
<br />
{{Box Note| Alsa已经包含进最新的内核kernel,udev 将在系统启动时自动检测硬件,并自动根据声卡加载相应的内核模块。虽然声卡已经在工作,但电脑的声音默认是静音。}}<br />
{{Box Note| OSS4.1已经放出,相对于老的版本,这是一个显著的提升的版本,如果使用ALSA有问题, 或者是想尝试新的功能,可以使用 OSS4.1。 相关说明可见: [[OSS]]}} <br />
<br />
Alsa-utils软件包里的alsamixer让我们可以从命令行来配置声音设备。(你也可以稍后在'''X'''环境中使用alsamixer。)<br />
默认情况下,内核加载模块snd_pcsp,这是一个alsa pc speaker模块。 snd_pcsp通常先于&quot;你实际的&quot;声卡模块加载。大部分情况下,这模块最后加载更好,因为可以让alsamixer正确控制需要的声卡。<br />
<br />
在/etc/modprobe.conf中加入这行,可以使得snd_pcsp最后加载:<br />
options snd-pcsp index=2<br />
<br />
当然,如果你不想让snd_pcsp加载,可以把它放入黑名单,或者是在/etc/rc.conf的Modules里禁止它:<br />
MODULES=(... !snd_pcsp)<br />
<br />
{{Box Note | 想要生效,需要释放并重新加载所有声音模块,当然,系统重启就可以简单解决这问题。 }}<br />
<br />
* 安装alsa-utils软件包:<br />
pacman -S alsa-utils<br />
<br />
* 为了解决Alsa声卡独占问题,可以安装alsa-oss:<br />
# pacman -S alsa-oss <br />
<br />
* 把你的普通用户账号加入到audio用户组中:以root身份,运行<code>/usr/bin/gpasswd</code>程序:<br />
gpasswd -a yourusername audio<br />
*以普通用户身份运行: <br />
alsamixer<br />
用左右光标键移动到Master和PCM声道上,按'''M'''取消掉静音。用向上键增加音量。(70-90的音量是较合适的范围)按ESC键离开alsamixer。<br />
有'''Speaker'''的,需要同时取消静音并调整之. <br />
<br />
====测试声音====<br />
以普通用户身份,使用 <code>/usr/bin/aplay</code>程序来测试你的声音配置:<br />
aplay /usr/share/sounds/alsa/Front_Center.wav<br />
你应该会听到一个女性声音说:“Front,center。”<br />
<br />
====保存声音配置====<br />
以root身份运行<code>/usr/bin/alsactl</code> :<br />
alsactl store<br />
这将创建'/etc/asound.state'文件,用来保存alsamixer的设置。<br />
<br />
为了每次启动都可以自动恢复混音器设置,可将守护进程''alsa''加入到你的/etc/rc.conf中的DAEMONS列表。<br />
nano /etc/rc.conf<br />
DAEMONS=(syslog-ng network crond '''alsa''')<br />
''注意,alsa守护进程在启动过程中仅仅是恢复音量设置。它和alsa音频库(和内核级API)是完全不同的。''<br />
<br />
更多详情请参看[[ALSA 安装设置 (简体中文)|ALSA 安装设置]]。<br />
<br />
===二、安装X===<br />
'''X''' 窗口系统(一般叫'''X11'''或者更简单的叫'''X''') 是一个网络互动和显示服务,提供位图显示器窗口. 提供标准化工具包(toolkit)和协议,用于<code>UNIX</code>类操作系统,构建一个图形界面(GUIs) <br />
<br />
'''X''' 提供最基本、基础的框架,用于构建一个图形操作界面环境。包括:绘图、屏幕窗口移动,与鼠标或者键盘的交互。 '''X''' 并不负责用户交互界面的部分:有独立的客户端程序负责处理这部分。 比如gnome、kde。<br />
<br />
'''X''' 因为它先于'''W'''窗口系统,最初由斯坦福大学开发。 <br />
<br />
*''注意: 如果想使用一个'''开源''' 显卡驱动, 需要3d加速,强烈建议在安装Xorg之前安装库 libgl :''<br />
pacman -S libgl<br />
''(拥有专利的视频驱动提供它们自己的gl库安装(implementations).)''<br />
----- <br />
====1、安装X====<br />
构建一个GUI的第一步:用pacman来安装Xorg包.<br />
<br />
# pacman -S xorg<br />
对于新版的xorg,建议(可能大部分情况下是必须的)安装输入设备驱动evdev。它本来应该作为xorg-server的一个依赖被安装的,不过不知道为什么貌似缺失了:<br />
# pacman -S xf86-input-evdev<br />
3d的工具比如glxgears包含在包'''mesa''' 里(如果需要,也安装):<br />
# pacman -S mesa<br />
<br />
====2、安装显卡驱动====<br />
到这一步,已经有了运行'''X''' Server的基本软件包,接下来需要把显卡的驱动安装到电脑里(e.g. xf86-video-<name>). 最简单的X.org配置方法就是安装正确的驱动包,然后使用自动脚本对 /etc/X11/xorg.conf 进行初始化,比如使用 Xorg -configure(arch团队提供hwd工具,但据以前用户的反映,这个现在还老出问题,新手可以使用,以后有能力再配置其他).<br />
<br />
如果不知道显卡类型,输入下面命令:<br />
lspci | grep VGA<br />
<br />
输入下面命令,查看所有'''开源'''驱动: <br />
pacman -Ss xf86-video | less<br />
<br />
下面是一个'''开源'''的显卡列表和相关说明:<br />
*'''xf86-video-apm''' Alliance ProMotion video driver<br />
*'''xf86-video-ark''' ark video driver<br />
*'''xf86-video-ati''' ati video driver<br />
*'''xf86-video-chips''' Chips and Technologies video driver<br />
*'''xf86-video-cirrus''' Cirrus Logic video driver<br />
*'''xf86-video-dummy''' dummy video driver<br />
*'''xf86-video-fbdev''' framebuffer video driver<br />
*'''xf86-video-glint''' GLINT/Permedia video driver<br />
*'''xf86-video-i128''' Number 0 i128 video driver<br />
*'''xf86-video-i740''' Intel i740 video driver<br />
*'''xf86-video-i810''' Intel i810/i830/i9xx video drivers (deprecated - use -intel)<br />
*'''xf86-video-intel''' Newer Version of Intel i810/i830/i9xx video drivers<br />
*'''xf86-video-imstt''' Integrated Micro Solutions Twin Turbo vidoe driver<br />
*'''xf86-video-mach64''' mach64 video driver <br />
*'''xf86-video-mga''' mga video driver (Matrox Graphics Adapter) <br />
*'''xf86-video-neomagic''' neomagic video driver<br />
*'''xf86-video-nouveau''' Open Source 3D acceleration driver for nVidia cards (eperimental)<br />
*'''xf86-video-nv''' nvidia nv video driver<br />
*'''xf86-video-openchrome''' Openchrome drivers<br />
*'''xf86-video-r128''' ati Rage128 video driver<br />
*'''xf86-video-radeonhd''' Experimental Radeon HD video driver for r500 and r600 ATI cards<br />
*'''xf86-video-rendition''' Rendition video driver<br />
*'''xf86-video-s3''' S3 video driver<br />
*'''xf86-video-s3virge''' S3 Virge video driver<br />
*'''xf86-video-savage''' savage video driver<br />
*'''xf86-video-siliconmotion''' siliconmotion video driver<br />
*'''xf86-video-sis''' SiS video driver<br />
*'''xf86-video-sisusb''' SiS USB video driver<br />
*'''xf86-video-tdfx''' tdfx video driver<br />
*'''xf86-video-trident''' Trident video driver<br />
*'''xf86-video-tseng''' tseng video driver<br />
*'''xf86-video-unichrome''' Unichrome video drivers<br />
*'''xf86-video-v4l''' v4l video driver<br />
*'''xf86-video-vesa''' vesa video driver<br />
*'''xf86-video-vga''' VGA 16 color video driver<br />
*'''xf86-video-via''' via video driver<br />
*'''xf86-video-vmware''' vmware video driver<br />
*'''xf86-video-voodoo''' voodoo video driver<br />
<br />
* 说明:'''vesa'''驱动是最原汁原味的,适用于大部分的显卡。如果实在无法找到合适的显卡驱动,就选用vesa。(这是原话,好像夸张了点!If you cannot find a suitable driver for your video chipset, vesa '''should''' work.)<br />
<br />
用pacman来安装适合你显卡的驱动。例如:<br />
pacman -S xf86-video-savage<br />
(给Savage显卡的驱动。)<br />
<br />
* 如果实在不确定需要安装那个显卡驱动,可以安装所有显卡驱动包, 输入下面命令:<br />
pacman -S xorg-video-drivers<br />
<br />
*如果显卡是nVIDIA 或者ATI的,并'''想安装nVIDIA或者ATI官方提供的显卡驱动,请看下面。'''<br />
-----<br />
<br />
====nVIDIA图形显示卡====<br />
nVIDIA显示卡的驱动程序被许多人认为是非常好的质量,而且带有高级3D性能。<br />
<br />
在设置您的你nVIDIA显卡之前您先要选择您要使用的驱动程序。Arch现在有3种不一样的nVIDIA驱动程序,各自支持不同型号的显卡:<br />
<br />
'''1. nvidia-96xx''' ''直到Ge Force 4的较新显卡''<br />
<br />
'''2. nvidia-173xx''' ''Geforce FX系列显卡''<br />
<br />
'''3. nvidia''' ''在GF FX之后的最新GPU''<br />
<br />
{{Box Note| 一些特别老如TNT和TNT2之类的显卡所需的Nvidia-71xx系列闭源驱动,由于无法在Arch所用的新版Xorg下正常运行,并且nvidia也已不再继续支持它们,因此已被删除。你可以改用xf86-video-nv或者xf86-video-vesa驱动。}}<br />
<br />
到nVIDIA主页,看哪个适合你电脑.区别只是安装,配置过程是一样的.<br />
<br />
''根据你的显卡'',选择合适的nVIDIA驱动安装,比如: <br />
pacman -S nvidia-96xx<br />
<br />
nVIDIA软件包有个工具能自动升级你已有的nVIDIA驱动的配置文件/etc/X11/xorg.conf,输入下列命令即可实现:<br />
nvidia-xconfig<br />
<br />
它也有一些选项,用于更深入和具体地配置xorg.conf文件的内容和选项,例如:<br />
<br />
<br />
nvidia-xconfig --composite --add-argb-glx-visuals<br />
<br />
更详细的信息,请参考:nvidia-xconfig(1).<br />
<br />
一些有用的妙法可用在“device“部分(你要清楚它们不一定都能对你的系统有用):<br />
Option "RenderAccel" "true"<br />
Option "NoLogo" "true"<br />
Option "AGPFastWrite" "true"<br />
Option "EnablePageFlip" "true"<br />
将所有的DRI注释掉:<br />
# Load "dri"<br />
<br />
多检查几次你的/etc/X11/xorg.conf以确定你的默认的depth(色深),horizontal sync(水平同步),垂直刷新率,以及分辨率是可以接受的。<br />
<br />
使用<code>/sbin/depmod</code>命令来更新内核模块依赖:<br />
depmod -a<br />
(也许需要重启。)<br />
{{Tip|nvidia配置的高级的说明参考文章[[NVIDIA]] 。}}<br />
<br />
现在你可以跳到'''[[#三、配置X:创建并修改/etc/X11/xorg.conf|配置X]]'''来进一步熟悉,或者跳到'''[[#3、测试 X|测试 X]]'''继续安装过程。<br />
<br />
====ATI图形显示卡====<br />
ATI用户的驱动可以有几种选择。<br />
* '''xf86-video-ati'''软件包提供的开源'''''radeon'''''驱动。<br />
** 原创的、完全支持Radeon芯片组到X1950(最新的R500芯片组)的逆向工程开源驱动。对9200系列以前的显卡完全支持,可以稳定的提供全2D和3D加速。从9500到X1950完全支持2D加速特性,良好的3D加速,不过缺乏某些闭源驱动的特性(例如能源节省特性仍处于测试阶段)。xf86-video-ati支持从HD2xxx (R6xx)到最新的显卡,不过目前仅提供2D支持。<br />
* '''xf86-video-radeonhd'''软件包提供了开源的'''''radeonhd'''''驱动。<br />
** 此驱动支持ATI R500(Radeon X1000系列)以及更新的芯片组。该驱动由AMD提供文档,Novell为之开发。它支持RandR 1.2,目前的开发工作非常活跃。因此所支持的不同系列显卡的功能可以不一致。(有些用户反映它性能优异,而有些则说它很糟)。它还支持带音频的HDMI。<br />
* AUR中的Catalyst软件包提供了闭源'''''fglrx'''''驱动。稍后将介绍闭源驱动。<br />
开源驱动通常可以满足大部分需求而且较少出问题。<br />
<br />
安装'''''radeon'''''ATI驱动:<br />
# pacman -S xf86-video-ati libgl ati-dri<br />
安装'''''radeonhd'''''ATI驱动:<br />
# pacman -S xf86-video-radeonhd libgl ati-dri<br />
<br />
Arch的<code>extra</code>官方仓库曾经提供过闭源ATI驱动'''Catalyst'''的预编译包,不过在2009年3月以后,由于对闭源驱动的质量和开发进度不满意,官方取消了对它的支持。目前catalyst驱动可以在[http://aur.archlinux.org/packages.php?ID=22899 AUR]中找到。Catalyst驱动的安装信息可以在[[ATI#Proprietary_ATI_Catalyst_driver|这里]]找到。<br />
<br />
{{Warning| 闭源ATI驱动仅支持R600和更新的显卡(即HD2xxx及以上系列),不支持旧系列(X1xxx系列及以下)。}}<br />
<br />
{{Tip|ATI配置的高级指引可以参看[[ATI | ATI wiki 文章]]。}}<br />
<br />
====3、安装输入设备驱动软件包====<br />
最新的X需要你为包括键盘和鼠标在内的输入设备安装驱动。查看可用输入设备驱动的完整列表:<br />
# pacman -Ss xf86-input | less<br />
<br />
对大部分用户,xf86-input-keyboard和xf86-input-mouse应该可以满足基本配置。使用pacman来为你的输入设备安装需要的驱动,例如:<br />
# pacman -S xf86-input-keyboard<br />
===三、配置X:创建并修改/etc/X11/xorg.conf===<br />
====xorg.conf文件====<br />
/etc/X11/xorg.conf 是你的 X-Window-System 的主要配置文件,你的 GUI('''G'''raphical '''U'''ser '''I'''nterface)的基础,它是一个普通的文本文件,里面由 “section” 和 “subsection” 来安排。重要的 section 有 ''Files, InputDevice, Module, Monitor, Modes, Screen, Device'' 和 ''ServerLayout''。各个section安排的前后次序没有关系,对同一种类型的设备也可以有多个section,比如你可能有多个显示器,或者你的本本既有鼠标又有触摸板。<br />
------<br />
从X11R7.2版开始Xserver引入了自动配置特性。在大多情况下,即使没有xorg.conf文件它也能很好地运作。如果''自动检测功能工作正常'',而且你又不需要开启如 aiglx、compositing 等功能的话,你甚至不需要创建这个配置文件。<br />
<br />
====1、创建 /etc/X11/xorg.conf====<br />
<br />
高级用户可以手动创建他们的xorg.conf文件。一般用户可以使用程序<code>/usr/bin/Xorg</code>附加参数-configure来生成一个基本的配置文件;以root身份输入下面命令:<br />
# Xorg -configure<br />
这里生成的文件是/root/xorg.conf.new <br />
<br />
把这文件复制到 <code>/etc/X11/</code>:<br />
# cp /root/xorg.xonf.new /etc/X11/xorg.conf<br />
<br />
====更多的创建/etc/X11/xorg.conf的办法====<br />
* 说明:如果你的电脑已经有一个配置好的xorg.conf文件,不管这个文件是在什么别的发行版下生成的,只要Xorg的版本一致,就可以把该文件复制到你的Arch系统的<code>/etc/X11/</code>目录下。<br />
* 可以使用程序<code>/usr/bin/hwd</code>生成xorg.conf。首先要安装这程序:<br />
# pacman -S hwd<br />
然后输入下面命令:<br />
# hwd -xa<br />
{{Box Note| 目前,hwd在生成的xorg.conf有一行失效。 使用完这程序后,需要手动删除或者是注释掉 Section &quot;Files&quot;下的RgbPath那一行。via nano /etc/X11/xorg.conf or your equivalent, as root/sudo.}}<br />
<br />
* 使用<code>/usr/bin/xorgcfg</code> 脚本生成xorg.conf:<br />
# xorgcfg <br />
* 使用<code>/usr/bin/xorgconfig</code>生成xorg.conf,这个程序以互动方式来创建该文件,输入下面命令运行:<br />
# xorgconfig<br />
<br />
====2、Input设备热插拔问题:请在测试X前阅读====<br />
<br />
xorg 1.5.x版本里已经开启热插拔Input设备。<br />
{{Box Note | 当热插拔开启后, X将清空xorg.conf里所有使用the kbd and mouse 驱动建立的设备。这将导致X被冻结,使得鼠标和键盘失去响应。下面是解决办法。'''方法只能二选一'''}}<br />
<br />
有两个办法可以修复这一问题:<br />
<br />
1) '''配置 input设备热插拔''':安装驱动 xf86-input-evdev,同时配置HAL使其能使用kbd/mouse驱动。<br />
<br />
安装xf86-input-evdev:<br />
# pacman -S xf86-input-evdev<br />
在X.org相关进程启动前,启动守护进程hal:<br />
# /etc/rc.d/hal start<br />
把hal加入/etc/rc.conf里的DAEMONS列表里,这样每次电脑启动,都会自动开启hal。详情请见[[Xorg input hotplugging]] 。<br />
<br />
说明: 开启hal必须首先有一个dbus用户和用户组,以root身份输入下面命令创建用户和用户组<br />
<br />
usr/sbin/groupadd -g 81 dbus<br />
usr/sbin/useradd -c 'System message bus' -u 81 -g dbus -d '/' -s /bin/false dbus<br />
<br />
2) '''关闭input设备热插拔''':在/etc/X11/xorg.conf的ServerFlags段,加入参数''Option &quot;AutoAddDevices&quot; &quot;False&quot;'' 这将忽略hal的硬件检测,并使用你xorg.conf的keyboard/mouse配置。步骤如下<br />
# nano /etc/X11/xorg.conf<br />
加入下面三行:<br />
Section &quot;ServerFlags&quot;<br />
Option &quot;AutoAddDevices&quot; &quot;False&quot;<br />
EndSection<br />
<br />
====3、测试 X====<br />
<br />
在所生成的xorg文件路径''path/to/xorg.conf''前,加入参数''-config'' ,运行 '''X'''脚本,可以测试脚本配置是否正确。<br />
比如要测试你上面生成的xorg是否配置正确,输入:<br />
X -config /root/xorg.conf.new<br />
'''X''' 将启动,在屏幕中央会有一个白色的 X ,鼠标或是触摸板可以移动它,按 CTRL-Alt-Backspace 可以退出 '''X'''<br />
<br />
====对xorg.conf除错====<br />
如果 X 出现错误不能运行,你需要手动检查你的配置文件:<br />
<br />
nano /root/xorg.conf.new<br />
<br />
* 确定 Xorg -configure 命令正确的识别了你的显卡,比如:<br />
Section &quot;Device&quot;<br />
<br />
...<br />
<br />
Driver &quot;savage&quot;<br />
<br />
...<br />
<br />
EndSection<br />
<br />
* 确定里面的 Section "Monitor" 设置了水平同步率和垂直刷新率,如果没有要把它加上:<br />
Section &quot;Monitor&quot;<br />
Identifier &quot;Monitor0&quot;<br />
VendorName &quot;Monitor Vendor&quot;<br />
ModelName &quot;Monitor Model&quot;<br />
HorizSync 30.0 - 130.0 # Safe for LCD's<br />
VertRefresh 50.0 - 100.0 # Safe for LCD's and most CRT's.<br />
EndSection<br />
如果你不知道这些刷新率到底是多少,你就得查一下你显示器的说明书。<br />
<br />
* 在section "Screen"配置默认色深(color depth):<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Card0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
(此处色深被设定为真彩24色。)<br />
<br />
<br />
* 在subsection &quot;Display&quot; 加入你需要的Modes, at least under the Depth 24 header, e.g.:<br />
SubSection &quot;Display&quot;<br />
Viewport 0 0<br />
Depth 24<br />
Modes &quot;1024x768&quot; &quot;800x600&quot; &quot;640x480&quot;<br />
* Add the following section, if you wish to enable eye candy which requires the composite extension: <br />
Section &quot;Extensions&quot;<br />
Option &quot;Composite&quot; &quot;Enable&quot;<br />
EndSection<br />
<br />
* 上述调整完成后,再测试你的配置:<br />
X -config /root/xorg.conf.new<br />
<br />
* 在确认 '''X''' session开启,没有错误之后,把测试好的配置文件移到 /etc/X11下,作为系统的xorg.conf配置文件:<br />
mv /root/xorg.conf.new /etc/X11/xorg.conf<br />
详细的介绍可见[[Xorg]] <br />
<br />
接下来可以简单作测试 '''[[#Simple baseline X test|Simple baseline X test]]'''<br />
<br />
====调整键盘布局====<br />
=====如果开启了input热插拔=====<br />
# cp /usr/share/hal/fdi/policy/10osvendor/10-keymap.fdi /etc/hal/fdi/policy/<br />
# nano /etc/hal/fdi/policy/10-keymap.fdi<br />
Edit the &quot;input.xkb.layout&quot; key and possibly the &quot;input.xkb.variant&quot; key in this file.<br />
Restart hal:<br />
# /etc/rc.d/hal restart<br />
<br />
=====如果关闭了input热插拔=====<br />
Add option lines in the &quot;InputDevice&quot; section of the /etc/X11/xorg.conf file specifying the keyboard layout and variant:<br />
Option &quot;XkbLayout&quot; &quot;be&quot;<br />
Option &quot;XkbVariant&quot; &quot;&quot;<br />
<br />
详情请见 [[Xorg input hotplugging]]。<br />
<br />
===简单的命令行界面X测试(如果需要)===<br />
<br />
在安装了xorg、合适的显卡驱动、创建了一个/etc/X11/xorg.conf文件之后,如果想在安装完整桌面环境之前,快速测试下你的配置,使用'''xterm'''可以实现! <br />
Xterm是个简单的终端模拟程序,作为base xorg软件包的一部分会被自动安装,运行在'''X '''Server环境里。通过配置~/.xinitrc,Xterm可以让我们快速测试显卡驱动和配置文件/etc/X11/xorg.conf是否被正确配置。(另外,如果在没有/etc/X11/xorg.conf的情况下,你想测试下'''X''' 自动检测是否满意,也可以使用这个)<br />
<br />
==== 准备工作:配置~/.xinitrc====<br />
<br />
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. <br />
{{Box Note | '''[[.xinitrc]]''' is a so-called 'dot' (.) file. 在UNIX文件系统下,文件名以 (.)开头的,是 '隐藏文件',,使用普通的命令'ls' 将不显示这些文件,使用加了参数命令'''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 &quot;Run Control&quot;.}}<br />
<br />
'''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. (说明: ''如果没有文件~/.xinitrc, /etc/X11/xinit/xinitrc 将被作为替代来使用,这是个使用TWM and Xterm的默认配置。'')<br />
<br />
切换到'''''普通, 非root'''''用户:<br />
# su - ''yourusername''<br />
* /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.<br />
* 如果没有~/.xinitrc这个文件,到该目录下创建一个,或者从/etc/skel/复制一个同样的文件到你的home目录:: <br />
<br />
$ cp /etc/skel/[[.xinitrc]] ~/<br />
<br />
* 编辑文件: <br />
$ nano ~/.xinitrc<br />
加入这行&quot;<code>exec xterm</code>&quot;像下面这样:<br />
<br />
#!/bin/sh<br />
#<br />
# ~/.xinitrc<br />
#<br />
# Executed by startx (run your window manager from here)<br />
#<br />
exec xterm<br />
# exec wmaker<br />
# exec startkde<br />
# exec icewm<br />
# exec blackbox<br />
# exec fluxbox<br />
<br />
{{Box Note | ''请确保~/.xinitrc''里,以'''exec'''开头的,只有'''一行'''的注释被去掉。}}<br />
<br />
====开始执行测试====<br />
<br />
* 以普通用户身份输入下面命令,开启'''X''',开始测试你的配置:<br />
<br />
$ startx<br />
或者是这命令<br />
$ xinit<br />
<br />
此时会打开一个'''xterm''' session,你可以在这里测试your keyboard and its layout<br />
<br />
* 按Ctrl+Alt+Backspace,或者输入"exit"可以退出'''X''' Server。<br />
* 如果开启'''X'''出现问题,在终端,查看日志文件/var/log/Xorg.0.log的错误信息。<br />
<br />
更多的Xorg configuration介绍可见[[Xorg]] .<br />
<br />
==第四部分:安装并配置桌面环境==<br />
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 icons, applets, windows, toolbars, folders, wallpapers, 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.<br />
<br />
* 如果你需要一个完整功能,类似于Windows和Mac OSX, 可以选择安装'''[[#KDE|KDE]]''' <br />
* If you want something slightly more minimalist, which follows the K.I.S.S. principle more closely, '''[[#GNOME|GNOME]]''' is a good choice<br />
* '''[[#Xfce|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.<br />
<br />
如果你的机器较老,或者是希望使用一个更轻量、更少GUI要求,可以选择只安装 '''Window Manager''', 或者 WM. A WM controls the placement and appearance of application windows in conjunction with the X Window System but does NOT provide such additions as panels, applets, icons, etc.<br />
* Lightweight floating WM's include: [[#Openbox|'''Openbox''']], [[#Fluxbox|'''Fluxbox''']], [[#fvwm2|'''fvwm2''']], '''Windowmaker, Pekwm, and TWM'''.<br />
* If you need something completely different, try '''Awesome, ion, wmii, dwm, or xmonad'''。<br />
<br />
===一、安装字体===<br />
在安装桌面环境/窗口管理器'''之前''',也许你会先安装些美观的字体。Dejavu和bitstream-vera都是不错的字体集。而对于网页,你还可能需要Microsoft字体。如下安装:<br />
pacman -S ttf-ms-fonts ttf-dejavu ttf-bitstream-vera<br />
对于中文字体,开源的文泉驿正黑矢量字体是不错的选择,它还内嵌了9pt-12pt的点阵宋体:<br />
pacman -S wqy-zenhei<br />
<br />
===二、选择默认启动的桌面环境 ~/.xinitrc===<br />
<br />
以普通用户身份编辑/home/username/.xinitrc,加入你要用的DE. This will allow you to use '''startx/xinit''' from the shell, in the future, to open your DE/WM of choice:<br />
<br />
nano ~/.xinitrc<br />
<br />
反注释或者加入相应的桌面环境/窗口管理器的''''exec''' ..'内容行。例如:使用Xfce4桌面环境:<br />
<br />
exec startxfce4 <br />
<br />
记住在~/.xinitrc中只反注释掉一行'''exec'''。这条命令将一直运行到你注销桌面登录。一般的,shell将等到kde完成加载之后,在运行下一条命令。在命令前加 &quot;exec&quot; ,是告诉the shell 这条命令最后执行, 这样shell就不用等待其他命令了,直接载入桌面。<br />
接下来安装你所选的桌面环境/窗口管理器。<br />
<br />
===三、选择安装一个桌面环境===<br />
====GNOME====<br />
=====关于GNOME=====<br />
GNOME是'''G'''NU '''N'''etwork '''O'''bject '''M'''odel '''E'''nvironment的缩写。GNOME项目有两大部分:GNOME桌面环境 ── 既直观又迷人的最终用户桌面,以及GNOME开发平台 ── 一个用来创建可与桌面集成的应用程序的庞大的框架。<br />
<br />
=====安装=====<br />
安装基本的GNOME环境:<br />
pacman -S gnome<br />
<br />
安装额外的GNOME环境:<br />
pacman -S gnome-extra<br />
然后选择提示的所有软件包。 <br />
<br />
=====对GNOME有用的守护进程=====<br />
如之前所述,守护进程(daemon)是运行在后台的程序,它等待事件发生并提供相应的服务。其中'''Hal'''守护进程可以自动挂载磁盘、光驱和U盘给GUI使用。'''Fam'''守护进程可以在GUI中实时反映文件的变动,如最近安装的程序、文件系统的变化等。'''Hal'''和'''fam'''使得GNOME的使用更为方便。Hal和fam软件包在安装GNOME时已一同安装,建议安装社区库的gamin来替代fam。<br />
<br />
{{Box Note|注意,fam是一个比较老的包,很容易造成较大的日志文件。}}<br />
<br />
{{Box Note|在当前的gnome环境中,你可以安装gamin来实现fam的功能。这时,你可以不用在DAEMONS中添加fam启动项了(不需要加入gamin,它会自动被启用)。}}<br />
<br />
* 你需要启动'''hal'''守护进程。<br />
<br />
启动hal:<br />
/etc/rc.d/hal start<br />
<br />
如果您想使用fam,同样需要启动:<br />
/etc/rc.d/fam start<br />
<br />
将hal加入到/etc/rc.conf的DAEMONS中以使得它们随系统启动而自动运行:<br />
nano /etc/rc.conf<br />
<br />
DAEMONS=(syslog-ng network crond alsa '''hal''')<br />
<br />
{{Box Note|注意,如果使用fam,那么把fam加入到hal后面。}}<br />
<br />
* 或许你还会希望安装一个图形界面的登录管理器。在GNOME下'''gdm'''守护进程是个不错的选择。<br />
以root身份运行:<br />
pacman -S gdm<br />
<br />
让gdm启用有两种方式,一种是直接加入到DAEMONS的末尾,通过rc.conf来启动;另外一种方式是用过配置inittab来加载gdm。<br />
<br />
* 通过inittab来加载gdm也很方便(推荐使用这种方式):<br />
nano /etc/inittab<br />
<br />
修改默认启动方式:<br />
<br />
将<br />
id:3:initdefault:<br />
改为<br />
id:5:initdefault:<br />
<br />
然后取消下面代码的注释:<br />
x:5:respawn:/usr/sbin/gdm -nodaemon<br />
<br />
{{Box Note|实际上,可以看到gdm/xdm/kdm/slim等,使用哪个取决于你的喜好,启用喜欢的那个,将其他的注释掉。当然,本章介绍的是gnome,所以推荐gdm,下章中将推荐kdm:)}}<br />
<br />
<br />
* 通过DAEMONS方式启动gdm也很方便:<br />
nano /etc/rc.conf<br />
<br />
DAEMONS=(syslog-ng network crond alsa hal gdm)<br />
<br />
{{Box Note|这是类似debian/ubuntu的做法,这种方式有一点不好:不管什么时候(非修复模式),系统总是会尝试进入gdm引导的X方式下。对于X已经配置得很好,并且不使用纯控制台的人可以使用这种方式。但是选择这种方式的话你将不能通过内核参数3或者5来区分进入纯字符控制台还是X11的gdm登录窗口。}}<br />
<br />
* 开启Gnome<br />
以普通用户身份启动X:<br />
startx<br />
或者这条命令也行:<br />
$ xinit<br />
如果你的 ~/.xinitrc一直没配置,那你将可以一直使用下面这条命令来开启Gnome:<br />
$ xinit /usr/bin/gnome-session<br />
<br />
关于安装和配置GNOME的高级指引可以参见[[GNOME (简体中文)|GNOME]]一文。接下来你可以浏览'''[[#优化和收尾|优化和收尾]]'''。或许你还会对[[ArchTips(简体中文)|Arch安装完后的小技巧]]一文感兴趣。<br />
<br />
=====美化=====<br />
如果不满足于缺省的GNOME主题和图标,那么可以安装一个不错的主题,比如murrine:<br />
pacman -S gtk-engine-murrine<br />
接着在System->Preferences->Theme里选择这个主题。<br />
<br />
Arch Linux也做了些不错的主题,根据你自己的审美观,选择满意的安装吧:<br />
<br />
# pacman -S gtk-engines gtk2-themes-collection gtk-aurora-engine gtk-candido-engine gtk-rezlooks-engine<br />
<br />
你还可以在[http://www.gnome-look.org Gnome Look]里找到更多的主题、图标和壁纸。<br />
<br />
====KDE====<br />
=====关于KDE=====<br />
KDE桌面环境('''K''' '''D'''esktop '''E'''nvironment)的缩写。 KDE是一种著名的运行于GNU/Linux 、 <code>UNIX</code> 工作站等的强大、自由图形工作环境。她拥有对系统内部各功能的强大整合能力、跨平台能力、易用性、优异的初始界面.<br />
<br />
=====安装=====<br />
Arch提供多个版本的kde: '''kde、kdebase 和 KDEmod'''. 选'''一个'''就行了,然后 '''[[#有用的KDE守护进程|有用的KDE守护进程]]''': <br />
<br />
'''1.)''' '''kde'''是完整的kde软件包,大概 ~300MB,适合主要使用kde软件的系统.<br />
pacman -S kde<br />
'''2.)''' '''kdebase'''是kde的基础软件包(里面没有kdm),大概 ~80MB,适合于只想把kde作为基础系统.<br />
pacman -S kdebase<br />
'''3.)''' '''KDEmod''' 是 Arch Linux独有的、社区驱动的项目,目标是把kde更加细致的模块化和达到其极致的运行效率。KDEmod项目的网站在http://chakra-project.org/ 。<br />
<br />
=====有用的KDE守护进程=====<br />
<br />
KDE 需要'''hal''' ('''H'''ardware '''A'''bstraction '''L'''ayer) 作为守护进程(daemons). '''kdm''' ( '''K''' '''D'''isplay '''M'''anager), 提供一个 '''图形化登录界面'''.<br />
{{Box Note|hal守护进程将自动开启dbus守护进程。kde4里已经不需要fam。kdm现在在kdebase-workstation这个包里,如果只安装kdebase,需要再安装此包才能使用kdm}}<br />
<br />
The hal daemon, among other things, will automate the mounting of disks, optical drives, and USB drives/thumbdrives for use in the GUI. <br />
<br />
-----<br />
启动hal进程:<br />
<br />
/etc/rc.d/hal start<br />
<br />
编辑/etc/rc.conf的 DAEMONS部分:<br />
nano /etc/rc.conf<br />
把 '''hal''' 加入 DAEMONS 部分,以便他们在系统启动时加载. 如果想要kde的图形化登录界面,把 '''kdm'''也加进去(或者不加,在/etc/inittab里面设置): <br />
DAEMONS=(syslog-ng network crond alsa '''hal kdm''')<br />
{{Box Note|如果你安装的是KDEmod3,则使用kdm3替换kdm}}<br />
<br />
*This method will start the system at runlevel 3, (/etc/inittab default, multiuser mode), and then start KDM as a daemon. <br />
<br />
*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 [[Adding a login manager (KDM, GDM, or XDM) to automatically boot on startup]] for more.<br />
<br />
*If you prefer to log into the '''console''' at runlevel 3, 手动启动 X, 则不加入kdm, 或者是加个前缀( ! )禁止它。<br />
<br />
* 现在可以试试效果了,用普通用户身份开启X Server:<br />
startx<br />
或者<br />
$ xinit<br />
更多关于安装和配置KDE的文章,请看[[KDE]].<br />
<br />
到此步,可以看 '''[[#优化和收尾]]'''这部分了. You may also be interested in the [[Post Installation Tips]] wiki article.<br />
<br />
====Xfce====<br />
=====关于Xfce=====<br />
和GNMOE、KDE一样,Xfce是一个桌面环境,其目标是快捷、轻量,同时又美观而易用。它还提供了一整套的应用程序如根窗口应用(root window app)、 窗口管理器、文件管理器、面板等等。 Xfce是用GTK2 toolkit编写的(类似GNOME),和其它大型桌面环境一样,它也有自己的开发环境(库文件、守护进程等)。但不象GNOME或者KDE,Xfce是轻量化的,其设计更接近于CDE而不是Windows或者Mac。它的开发周期比较慢,但是十分稳定、速度很快。在老硬件上Xfce可以运行得很好,而在新机器上更是运行如飞。<br />
<br />
=====安装=====<br />
安装完整的xfce环境以及主题和extras:<br />
pacman -S xfce4 xfce4-goodies gtk2-themes-collection <br />
<br />
如果你使用KDM或者GDM的话会显示一个xfce会话。另一种启动方式是:<br />
startxfce4<br />
<br />
关于安装和配置xfce的高级指引可以参见[[Xfce (简体中文)|Xfce]]一文。<br />
<br />
恭喜!欢迎来到Arch Linux系统的Xfce桌面环境!接下来你可以浏览'''[[#优化和收尾|优化和收尾]]''',或者下面的其它内容。或许你还会对[[ArchTips(简体中文)|Arch安装完后的小技巧]]一文感兴趣。<br />
<br />
====*box====<br />
=====Fluxbox=====<br />
Fluxbox © is yet another windowmanager for X.<br />
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).<br />
<br />
Install Fluxbox using <br />
pacman -S fluxbox fluxconf<br />
<br />
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:<br />
exec startfluxbox <br />
<br />
More information is available in the [[Fluxbox]] article.<br />
<br />
=====Openbox=====<br />
Openbox是一个标准的”温顺的“,快速的,轻量级的,可扩展的窗口管理器。<br />
<br />
Openbox与你的应用程序一起工作工作,并使你的的桌面便于管理。这是因为它的开发方式和通常的窗口管理器的方式是相悖的。 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.<br />
<br />
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. <br />
<br />
安装openbox<br />
pacman -S openbox obconf obmenu<br />
<br />
一旦openbox安装好,你将得到一个消息to move menu.xml & rc.xml to ~/.config/openbox/ in your home directory:<br />
<br />
mkdir -p ~/.config/openbox/<br />
cp /etc/xdg/openbox/rc.xml ~/.config/openbox/<br />
cp /etc/xdg/openbox/menu.xml ~/.config/openbox/<br />
<br />
In the file "rc.xml" you can change various settings for Openbox (or you can use OBconf). In "menu.xml" you can change your right-click menu.<br />
<br />
To be able to log into openbox you can either go via graphical login using KDM/GDM or startx, in which case you will need to edit your ~/.xinitrc (as user) and add the following:<br />
<br />
exec openbox<br />
<br />
For KDM there is nothing left to do; openbox is listed in the sessions menu in KDM.<br />
<br />
Useful programs for openbox are:<br />
* PyPanel or LXpanel if you want a panel<br />
* feh if you want to set the background<br />
* ROX if you want a simple file manager and desktop icons<br />
<br />
More information is available in the [[Openbox]] article.<br />
<br />
====fvwm2====<br />
FVWM是一个非常强大的面向X桌面系统的”ICCCM-compliant的多虚拟桌面的窗口管理器“(ICCCM-compliant multiple virtual desktop window manager)。开发活动很活跃,支持也是极好的。 <br />
<br />
输入下面命令安装 fvwm2 <br />
pacman -S fvwm <br />
<br />
fvwm会自动添加进 kdm/gdm会话列表. 如果没有的话,添加 <br />
exec fvwm <br />
<br />
到你的用户文件 .xinitrc.<br />
<br />
注意:这个稳定版已经有些年头了,如果需要最新的fvwm版本,可以安装unstable repo里的fvwm-devel 包.<br />
<br />
===四、优化和收尾===<br />
====HAL====<br />
如果你已经安装了一个桌面环境,但是又觉得用起来不是很方便,那么现在就是个安装HAL的好时机了。HAL使得你的手机、iPod、移动硬盘等等可以即插即用。它会挂载设备并在你的桌面或/和'My Computer'目录中创建相应的图标,使得你可以在插入设备后就能访问到它,无需每次都对每个新设备来手动配置/etc/fstab文件或者udev规则。<br />
<br />
KDE、GNOME和XFCE都使用到HAL。<br />
<br />
安装过程描述可以在[[HAL (简体中文)|HAL]]一文中找到。其它一些信息可以在[http://en.wikipedia.org/wiki/HAL_(software) Wikipedia]上找到。<br />
<br />
====启动时让守护进程在后台执行====<br />
<br />
要加速系统的启动过程,可以在/etc/rc.conf中给守护进程前加上'@'符号使之在后台执行,例如:<br />
<br />
DAEMONS=(@syslog-ng @network crond @alsa @hal @fam @kdm)<br />
这使得守护进程在后台被加载,无需等待它们加载结束。<br />
<br />
在守护进程前加上(!)可以禁止系统启动时加载它,例如:<br />
<br />
DAEMONS=(@syslog-ng @network !crond @alsa @hal @fam @kdm)<br />
<br />
另一种方式是直接将不需要的守护进程删除。<br />
<br />
====美化LCD下的字体====<br />
See [[Fonts]]<br />
<br />
====让所有的鼠标按键生效====<br />
看这个 [[Get All Mouse Buttons Working]]<br />
<br />
====笔记本电脑可能遇到的问题====<br />
(1) 触摸板问题<br />
参看http://wiki.archlinux.org/index.php/Touchpad_Synaptics<br />
<br />
(2) 摄像头问题<br />
参看http://wiki.archlinux.org/index.php/Webcam_Setup<br />
<br />
(3) 无线上网问题<br />
参看http://wiki.archlinux.org/index.php/Wireless<br />
<br />
(4) 快捷键问题<br />
参看http://wiki.archlinux.org/index.php/Extra_Keyboard_Keys<br />
<br />
====配置CPU频率====<br />
现在的处理器能够降低频率和电压,以降温和降低电源消耗。降温能使系统更稳定,笔记本用户肯定是想这样做的,但是即使是台式机也会对系统有利。<br />
<br />
安装CPU频率工具用:<br />
pacman -S cpufrequtils<br />
<br />
把CPU频率在/etc/rc.conf里加入到启动进程(daemons)中。编辑配置文件/etc/conf.d/cpufreq改<br />
governor="conservative"<br />
<br />
这使得在需要的情况下可以动态地增减CPU频率(这是对于台式机来说也是一个安全的选择)。改变最小频率(min_freq)和最大频率(max_freq)以匹配你的CPU的情况。如果你不知道频率,在载入频率测量模块后运行“cpufreq-info”。你也可以将min_freq和max_freq注释掉或删除,这样就能自动进行。加入频率测量模块到/etc/rc.conf的模块行。<br />
几乎所有的笔记本和台式机都可以简单地使用''acpi-cpufreq''驱动,但是也有其它的选择,如:''p4-clockmod, powernow-k6, powernow-k7, powernow-k8, and speedstep-centrino''。 <br />
<br />
通过下面这个命令载入这个模块:<br />
modprobe <modulname> <br />
通过下面命令行开启cpufreq:<br />
/etc/rc.d/cpufreq start<br />
更多细节,请看 [[Cpufrequtils]]<br />
<br />
==第五部分:常用的应用程序==<br />
更多信息,请看[[ArchLinux常用的应用程序(简体中文)]].<br />
<br />
==附录==<br />
新手指南附录[[ArchLinux新手指南附录 (简体中文)]]<br />
<br />
想得到更多的信息和支持,你可以去[http://www.archlinux.org/ homepage], [[Special:Search|search the wiki]],[http://bbs.archlinux.org/ forums],[[ArchChannel|IRC channel]],以及[http://www.archlinux.org/mailman/listinfo/ mailing lists]。<br />
=====问题答疑=====<br />
See [[Arch FAQs for newbies]]<br />
还有这里[http://bbs.archlinux.org/viewtopic.php?t=29055 Arch forum thread] 也是面向初学者的。<br />
<br />
=====术语=====<br />
更多信息关于Arch术语,查阅[[Arch Terminology/Jargon for newbies|this article]].<br />
<br />
=====接下来还有什么?=====<br />
<br />
你还可以阅读:<br />
<br />
[[Arch 官方安装指南 (简体中文)|Arch 官方安装指南]]<br />
<br />
[[Arch AUR (简体中文)|ArchLinux社区用户软件仓库 (AUR)]]<br />
<br />
[[Get All Mouse Buttons Working]]<br />
<br />
[[改善Pacman性能 (简体中文)|改善Pacman性能]]<br />
<br />
[[Kernel Compilation]]<br />
<br />
[[Pm-utils 电源管理 (简体中文)|Pm-utils 电源管理]]<br />
<br />
[[CPU 频率调节 (简体中文)|CPU 频率调节]]<br />
<br />
[[:Category:美化|美化]]</div>
Flydragon
https://wiki.archlinux.org/index.php?title=Tile-windows&diff=90682
Tile-windows
2010-01-02T13:18:04Z
<p>Flydragon: </p>
<hr />
<div>[[Category:Desktop environments (English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
{{Article summary start}}<br />
{{Article summary text|Provides a brief overview of how to install tile-windows tool for non-tiling windows managers like fluxbox}}<br />
{{Article summary heading|Language}}<br />
{{i18n entry|English|Tile-windows}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|fluxbox}}<br />
{{Article summary wiki|openbox}}<br />
{{Article summary end}}<br />
<br />
There are many articles out there talking about tiling windows managers like awesome or ion3, etc.<br />
<br />
I actually have tried almost all of them, but I gave up... guess why?<br />
<br />
First of all, why bother study all the hot keys from scratch, while you already get used to your favor, like fluxbox to me?<br />
<br />
2nd of all, why install another big package, which consume more system resource than fluxbox?<br />
<br />
If you use command: top, to check the memory usage, fluxbox only took 0.2% on my pc, which is even smaller than Xorg which is 0.7%<br />
<br />
All the tiling windows manager are taking more, from 0.4% to 1.x%... so I don't see why should I give up fluxbox for them.<br />
<br />
What's the real advantage of awesome anyway?<br />
<br />
Tiling of course.<br />
<br />
Fluxbox itself can easily move windows by ALT+ left mouse drag, or resize the windows by ALT+ right mouse drag.<br />
What's more, with tile-windows, we could even tiling windows in fluxbox or any other non-tiling windows managers like openbox, etc.<br />
<br />
It's just a command, so it only run when you call it, after that, the system resource will be released.<br />
<br />
==Installation==<br />
<br />
Tile-windows is in AUR, so you need to install it either by [[makepkg]] or by [[yaourt]].<br />
<br />
I assume you have yaourt ready to use, which is a very helpful tool to open a window for you to many useful but not so stable applications.<br />
<br />
Ok, let's install tile-windows:<br />
<br />
$> yaourt -S tile-windows<br />
<br />
It will ask if you want to check PKGBUILD file and some install file, you can have a look if you want, but I didn't find anything necessary to change.<br />
Then it will ask you if you want to start build and install, choose yes.<br />
<br />
It will download about 200KB file, and install it.<br />
<br />
That's it, now you can start to use it by: $> tile<br />
<br />
==Configuration==<br />
<br />
For fluxbox and openbox etc, you need to use:<br />
$> tile -m<br />
<br />
This will follow fluxbox rules to choose only some of the windows to tile, not all of them.<br />
<br />
For gnome and net-wm etc. you should use:<br />
$> tile -w<br />
<br />
There is config file: /etc/tile/rc<br />
You may want to make a copy to your home folder like: /home/yourname/.tile/rc<br />
Don't change /etc/tile/rc, because it will not work until you copy it to your .tile folder.<br />
<br />
Then make some changes like change multi-desktop from off to workspace if you are using fluxbox:<br />
# Multiple Desktop support.. netwm (GNOME/etc), workspace (*Box/Oroborus/etc), off. Default: off<br />
# multi-desktop netwm|workspace|off<br />
multi-desktop workspace<br />
<br />
Also you can ignore some of the windows by:<br />
# X11 Atom / String Value pairs to ignore for calculations and re-placement. No Defaults<br />
# Syntax: avoid Atom(STRING) value<br />
avoid WM_NAME Bottom Panel<br />
avoid WM_NAME Desktop<br />
avoid WM_CLASS FrontPanel<br />
<br />
To find out the application you want to ignore in tiling, run this command in your terminal:<br />
$> xprop WM_CLASS<br />
<br />
When you mouse become a cross, click on the application window, then xprop will give you the WM_NAME and WM_CLASS.<br />
I add one line like this for tilda, my pop up command tool:<br />
avoid WM_CLASS Tilda<br />
<br />
Now tell me, do you still want to try awesome? :D</div>
Flydragon
https://wiki.archlinux.org/index.php?title=Tile-windows&diff=90681
Tile-windows
2010-01-02T13:13:48Z
<p>Flydragon: /* Configuration */</p>
<hr />
<div>[[Category:Desktop environments (English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
{{Article summary start}}<br />
{{Article summary text|Provides a brief overview of how to install tile-windows tool for non-tiling windows managers like fluxbox}}<br />
{{Article summary heading|Language}}<br />
{{i18n entry|English|Tile-windows}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|fluxbox}}<br />
{{Article summary wiki|openbox}}<br />
{{Article summary end}}<br />
<br />
There are many articles out there talking about tiling windows managers like awesome or ion3, etc.<br />
<br />
I actually have tried almost all of them, but I gave up... guess why?<br />
<br />
First of all, why bother study all the hot keys from scratch, while you already get used to your favor, like fluxbox to me?<br />
<br />
2nd of all, why install another big package, which consume more system resource than fluxbox?<br />
<br />
If you use command: top, to check the memory usage, fluxbox only took 0.2% on my pc, which is even smaller than Xorg which is 0.7%<br />
<br />
All the tiling windows manager are taking more, from 0.4% to 1.x%... so I don't see why should I give up fluxbox for them.<br />
<br />
What's the real advantage of awesome anyway?<br />
<br />
Tiling of course.<br />
<br />
Fluxbox itself can easily move windows by ALT+ left mouse drag, or resize the windows by ALT+ right mouse drag.<br />
What's more, with tile-windows, we could even tiling windows in fluxbox or any other non-tiling windows managers like openbox, etc.<br />
<br />
It's just a command, so it only run when you call it, after that, the system resource will be released.<br />
<br />
==Installation==<br />
<br />
Tile-windows is in AUR, so you need to install it either by [[makepkg]] or by [[yaourt]].<br />
<br />
I assume you have yaourt ready to use, which is a very helpful tool to open a window for you to many useful but not so stable applications.<br />
<br />
Ok, let's install tile-windows:<br />
<br />
$> yaourt -S tile-windows<br />
<br />
It will ask if you want to check PKGBUILD file and some install file, you can have a look if you want, but I didn't find anything necessary to change.<br />
Then it will ask you if you want to start build and install, choose yes.<br />
<br />
It will download about 200KB file, and install it.<br />
<br />
That's it, now you can start to use it by: $> tile<br />
<br />
==Configuration==<br />
<br />
avoid WM_CLASS FrontPanel<br />
For fluxbox and openbox etc, you need to use: $> tile -m<br />
This will follow fluxbox rules to choose only some of the windows to tile, not all of them.<br />
<br />
For gnome and net-wm etc. you should use: $> tile -w<br />
<br />
There is config file: /etc/tile/rc<br />
You may want to make a copy to your home folder like: /home/yourname/.tile/rc<br />
Don't change /etc/tile/rc, because it will not work until you copy it to your .tile folder.<br />
<br />
Then make some changes like change multi-desktop from off to workspace if you are using fluxbox:<br />
\# Multiple Desktop support.. netwm (GNOME/etc), workspace (*Box/Oroborus/etc), off. Default: off<br />
\# multi-desktop netwm|workspace|off<br />
multi-desktop workspace<br />
<br />
Also you can ignore some of the windows by:<br />
\# X11 Atom / String Value pairs to ignore for calculations and re-placement. No Defaults<br />
\# Syntax: avoid Atom(STRING) value<br />
avoid WM_NAME Bottom Panel<br />
avoid WM_NAME Desktop<br />
avoid WM_CLASS FrontPanel<br />
<br />
To find out the application you want to ignore in tiling, run this command in your terminal:<br />
$> xprop WM_CLASS<br />
<br />
When you mouse become a cross, click on the application window, then xprop will give you the WM_NAME and WM_CLASS.<br />
I add one line like this for tilda, my pop up command tool:<br />
avoid WM_CLASS Tilda<br />
<br />
Now tell me, do you still want to try awesome? :D</div>
Flydragon
https://wiki.archlinux.org/index.php?title=Tile-windows&diff=90680
Tile-windows
2010-01-02T13:11:14Z
<p>Flydragon: </p>
<hr />
<div>[[Category:Desktop environments (English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
{{Article summary start}}<br />
{{Article summary text|Provides a brief overview of how to install tile-windows tool for non-tiling windows managers like fluxbox}}<br />
{{Article summary heading|Language}}<br />
{{i18n entry|English|Tile-windows}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|fluxbox}}<br />
{{Article summary wiki|openbox}}<br />
{{Article summary end}}<br />
<br />
There are many articles out there talking about tiling windows managers like awesome or ion3, etc.<br />
<br />
I actually have tried almost all of them, but I gave up... guess why?<br />
<br />
First of all, why bother study all the hot keys from scratch, while you already get used to your favor, like fluxbox to me?<br />
<br />
2nd of all, why install another big package, which consume more system resource than fluxbox?<br />
<br />
If you use command: top, to check the memory usage, fluxbox only took 0.2% on my pc, which is even smaller than Xorg which is 0.7%<br />
<br />
All the tiling windows manager are taking more, from 0.4% to 1.x%... so I don't see why should I give up fluxbox for them.<br />
<br />
What's the real advantage of awesome anyway?<br />
<br />
Tiling of course.<br />
<br />
Fluxbox itself can easily move windows by ALT+ left mouse drag, or resize the windows by ALT+ right mouse drag.<br />
What's more, with tile-windows, we could even tiling windows in fluxbox or any other non-tiling windows managers like openbox, etc.<br />
<br />
It's just a command, so it only run when you call it, after that, the system resource will be released.<br />
<br />
==Installation==<br />
<br />
Tile-windows is in AUR, so you need to install it either by [[makepkg]] or by [[yaourt]].<br />
<br />
I assume you have yaourt ready to use, which is a very helpful tool to open a window for you to many useful but not so stable applications.<br />
<br />
Ok, let's install tile-windows:<br />
<br />
$> yaourt -S tile-windows<br />
<br />
It will ask if you want to check PKGBUILD file and some install file, you can have a look if you want, but I didn't find anything necessary to change.<br />
Then it will ask you if you want to start build and install, choose yes.<br />
<br />
It will download about 200KB file, and install it.<br />
<br />
That's it, now you can start to use it by: $> tile<br />
<br />
==Configuration==<br />
<br />
avoid WM_CLASS FrontPanel<br />
For fluxbox and openbox etc, you need to use: $> tile -m<br />
This will follow fluxbox rules to choose only some of the windows to tile, not all of them.<br />
<br />
For gnome and net-wm etc. you should use: $> tile -w<br />
<br />
There is config file: /etc/tile/rc<br />
You may want to make a copy to your home folder like: /home/yourname/.tile/rc<br />
Don't change /etc/tile/rc, because it will not work until you copy it to your .tile folder.<br />
<br />
Then make some changes like change multi-desktop from off to workspace if you are using fluxbox:<br />
## Multiple Desktop support.. netwm (GNOME/etc), workspace (*Box/Oroborus/etc), off. Default: off<br />
#multi-desktop netwm|workspace|off<br />
multi-desktop workspace<br />
<br />
Also you can ignore some of the windows by:<br />
## X11 Atom / String Value pairs to ignore for calculations and re-placement. No Defaults<br />
## Syntax: avoid Atom(STRING) value<br />
avoid WM_NAME Bottom Panel<br />
avoid WM_NAME Desktop<br />
avoid WM_CLASS FrontPanel<br />
<br />
To find out the application you want to ignore in tiling, run this command in your terminal:<br />
$> xprop WM_CLASS<br />
<br />
When you mouse become a cross, click on the application window, then xprop will give you the WM_NAME and WM_CLASS.<br />
I add one line like this for tilda, my pop up command tool:<br />
avoid WM_CLASS Tilda<br />
<br />
Now tell me, do you still want to try awesome? :D</div>
Flydragon
https://wiki.archlinux.org/index.php?title=Tile-windows&diff=90679
Tile-windows
2010-01-02T13:06:48Z
<p>Flydragon: </p>
<hr />
<div>[[Category:Desktop environments (English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
{{Article summary start}}<br />
{{Article summary text|Provides a brief overview of how to install tile-windows tool for non-tiling windows managers like fluxbox}}<br />
{{Article summary heading|Language}}<br />
{{i18n entry|English|Tile-windows}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|fluxbox}}<br />
{{Article summary wiki|openbox}}<br />
{{Article summary end}}<br />
<br />
There are many articles out there talking about tiling windows managers like awesome or ion3, etc.<br />
<br />
I actually have tried almost all of them, but I gave up... why?<br />
First of all, why bother study all the hot keys from scratch, while you already get used to your favor, like fluxbox to me?<br />
2nd of all, why install another big package, which consume more system resource then fluxbox?<br />
<br />
If you use top, to check the memory usage, fluxbox only took 0.2% on my pc, which is even smaller than Xorg which is 0.7%<br />
<br />
All the tiling windows manager are taking more, from 0.4% to 1.x%... so I don't see why should I give up fluxbox for them.<br />
<br />
What's the real advantage of awesome anyway?<br />
Tiling of course.<br />
<br />
So now let me show you how we could tile windows in fluxbox or any other non-tiling windows managers like openbox, etc.<br />
<br />
It's just a command, so it only run when you call it, after that, the system resource will be released.<br />
<br />
==Installation==<br />
<br />
Tile-windows is in AUR, so you need to install it either by [[makepkg]] or by [[yaourt]].<br />
<br />
I assume you have yaourt ready to use, which is a very helpful tool to open a window for you to many useful but not so stable applications.<br />
<br />
Ok, let's install tile-windows:<br />
<br />
$> yaourt -S tile-windows<br />
<br />
It will ask if you want to check PKGBUILD file and some install file, you can have a look if you want, but I didn't find anything necessary to change.<br />
Then it will ask you if you want to start build and install, choose yes.<br />
<br />
It will download about 200KB file, and install it.<br />
<br />
That's it, now you can start to use it by: $> tile<br />
<br />
==Configuration==<br />
<br />
avoid WM_CLASS FrontPanel<br />
For fluxbox and openbox etc, you need to use: $> tile -m<br />
This will follow fluxbox rules to choose only some of the windows to tile, not all of them.<br />
<br />
For gnome and net-wm etc. you should use: $> tile -w<br />
<br />
There is config file: /etc/tile/rc<br />
You may want to make a copy to your home folder like: /home/yourname/.tile/rc<br />
Don't change /etc/tile/rc, because it will not work until you copy it to your .tile folder.<br />
<br />
Then make some changes like change multi-desktop from off to workspace if you are using fluxbox:<br />
## Multiple Desktop support.. netwm (GNOME/etc), workspace (*Box/Oroborus/etc), off. Default: off<br />
#multi-desktop netwm|workspace|off<br />
multi-desktop workspace<br />
<br />
Also you can ignore some of the windows by:<br />
## X11 Atom / String Value pairs to ignore for calculations and re-placement. No Defaults<br />
## Syntax: avoid Atom(STRING) value<br />
avoid WM_NAME Bottom Panel<br />
avoid WM_NAME Desktop<br />
avoid WM_CLASS FrontPanel<br />
<br />
To find out the application you want to ignore in tiling, run this command in your terminal:<br />
$> xprop WM_CLASS<br />
<br />
When you mouse become a cross, click on the application window, then xprop will give you the WM_NAME and WM_CLASS.<br />
I add one line like this for tilda, my pop up command tool:<br />
avoid WM_CLASS Tilda</div>
Flydragon
https://wiki.archlinux.org/index.php?title=Tile-windows&diff=90678
Tile-windows
2010-01-02T13:06:13Z
<p>Flydragon: Created page with 'Category:Desktop environments (English) Category:HOWTOs (English) {{Article summary start}} {{Article summary text|Provides a brief overview of how to install tile-windo…'</p>
<hr />
<div>[[Category:Desktop environments (English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
{{Article summary start}}<br />
{{Article summary text|Provides a brief overview of how to install tile-windows tool for non-tiling windows managers like fluxbox}}<br />
{{Article summary heading|Language}}<br />
{{i18n entry|English|Tile-windows}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|fluxbox}}<br />
{{Article summary wiki|openbox}}<br />
{{Article summary end}}<br />
<br />
There are many articles out there talking about tiling windows managers like awesome or ion3, etc.<br />
<br />
I actually had try almost all of them, but I give up... why?<br />
First of all, why bother study all the hot keys from scratch, while you already get used to your favor, like fluxbox to me?<br />
2nd of all, why install another big package, which consume more system resource then fluxbox?<br />
<br />
If you use top, to check the memory usage, fluxbox only took 0.2% on my pc, which is even smaller than Xorg which is 0.7%<br />
<br />
All the tiling windows manager are taking more, from 0.4% to 1.x%... so I don't see why should I give up fluxbox for them.<br />
<br />
What's the real advantage of awesome anyway?<br />
Tiling of course.<br />
<br />
So now let me show you how we could tile windows in fluxbox or any other non-tiling windows managers like openbox, etc.<br />
<br />
It's just a command, so it only run when you call it, after that, the system resource will be released.<br />
<br />
==Installation==<br />
<br />
Tile-windows is in AUR, so you need to install it either by [[makepkg]] or by [[yaourt]].<br />
<br />
I assume you have yaourt ready to use, which is a very helpful tool to open a window for you to many useful but not so stable applications.<br />
<br />
Ok, let's install tile-windows:<br />
<br />
$> yaourt -S tile-windows<br />
<br />
It will ask if you want to check PKGBUILD file and some install file, you can have a look if you want, but I didn't find anything necessary to change.<br />
Then it will ask you if you want to start build and install, choose yes.<br />
<br />
It will download about 200KB file, and install it.<br />
<br />
That's it, now you can start to use it by: $> tile<br />
<br />
==Configuration==<br />
<br />
avoid WM_CLASS FrontPanel<br />
For fluxbox and openbox etc, you need to use: $> tile -m<br />
This will follow fluxbox rules to choose only some of the windows to tile, not all of them.<br />
<br />
For gnome and net-wm etc. you should use: $> tile -w<br />
<br />
There is config file: /etc/tile/rc<br />
You may want to make a copy to your home folder like: /home/yourname/.tile/rc<br />
Don't change /etc/tile/rc, because it will not work until you copy it to your .tile folder.<br />
<br />
Then make some changes like change multi-desktop from off to workspace if you are using fluxbox:<br />
## Multiple Desktop support.. netwm (GNOME/etc), workspace (*Box/Oroborus/etc), off. Default: off<br />
#multi-desktop netwm|workspace|off<br />
multi-desktop workspace<br />
<br />
Also you can ignore some of the windows by:<br />
## X11 Atom / String Value pairs to ignore for calculations and re-placement. No Defaults<br />
## Syntax: avoid Atom(STRING) value<br />
avoid WM_NAME Bottom Panel<br />
avoid WM_NAME Desktop<br />
avoid WM_CLASS FrontPanel<br />
<br />
To find out the application you want to ignore in tiling, run this command in your terminal:<br />
$> xprop WM_CLASS<br />
<br />
When you mouse become a cross, click on the application window, then xprop will give you the WM_NAME and WM_CLASS.<br />
I add one line like this for tilda, my pop up command tool:<br />
avoid WM_CLASS Tilda</div>
Flydragon
https://wiki.archlinux.org/index.php?title=RealPlayer&diff=90018
RealPlayer
2010-01-01T00:28:08Z
<p>Flydragon: </p>
<hr />
<div>[[Category:Audio/Video (English)]] [[Category:HOWTOs (English)]]<br />
{{Article summary start}}<br />
{{Article summary text|Provides a brief overview of how to install RealPlayer to play rmvb files.}}<br />
{{Article summary heading|Language}}<br />
{{i18n entry|English|RealPlayer}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|vlc}}<br />
{{Article summary end}}<br />
Today you can do almost everything in Linux, or specifically in Arch Linux.<br />
<br />
So what do you do with your desktop or laptop? Play music? Play games? and play movies/videos?<br />
<br />
Today the most popular video files are .avi and .rmvb... and of course more and more .flv and .mp4... that's another story.<br />
<br />
You can easily find many applications to play .avi, but it seems no article in Arch Wiki talked about .rmvb yet.<br />
<br />
Let me be the first one then, :)<br />
<br />
==Installation==<br />
The most simple way is to install VLC, which plays .rmvb now, as well as many other video format.<br />
$ [[sudo]] pacman -Sy vlc<br />
<br />
Or if you have logon as root:<br />
# pacman -Sy vlc<br />
<br />
Or you can install RealPlayer 11 Gold via AUR, a little bit more steps:<br />
<br />
Follow the article to install [[Yaourt]] and related programs. You will not be regret, because Yaourt can bring you many useful new options like chromium browser.<br />
<br />
Also we assume you have installed and can use one of the editor in command line, nano or vim or vi, etc.<br />
<br />
Then let's install RealPlayer 11 Gold, the one we will use to play rmvb:<br />
$ yaourt -S realplayer<br />
<br />
Choose no to ignore edit of PKGBUILD for this time. Then choose yes for download and build.<br />
<br />
This would end up fail for the first time after download the rpm file, because this package is out of date, it will report the md5sum is wrong. Don't worry, let's do the next step anyway:<br />
$ cd /tmp/yaourt-tmp-master/realplayer/<br />
<br />
You will find RealPlayer11Gold.rpm here, let's find out the right md5sum:<br />
$ md5sum RealPlayer11GOLD.rpm<br />
<br />
Copy or write down the return value, just the big number, no space or file name included.<br />
Then run yaourt again:<br />
$ yaourt -S realplayer<br />
<br />
Ok, this time choose yes for PKGBUILD, it will ask you what editor do you want to use, it's up to you, whatever you want, nano or vim or vi. Then you'll easily find the md5sum in the file, just replace the exiting one with the md5sum you got for our rpm file. Save the file and exit your editor.<br />
<br />
Now you can continue build and install RealPlayer11, by choose yes, yes, yes...<br />
<br />
Done, now start it by:<br />
$ realplay &<br />
<br />
First time run it will start a wizard to config network etc., basically just next, next, next...<br />
<br />
When it's finished, you can choose a rmvb file to play, it runs perfect on my pc, as my alsa is set up. If you didn't config your sound yet, follow this article to do it: [[ALSA]]<br />
<br />
This should be all, you may want to add realplay in your menu, or if you are using gnome or KDE it should already in the menu. I'm using fluxbox, so I just edit ~/.fluxbox/menu to add a line for it. Or if you are using launchers like dmenu or bashrun, they will find realplay for you.<br />
<br />
Good luck!</div>
Flydragon
https://wiki.archlinux.org/index.php?title=RealPlayer&diff=89264
RealPlayer
2009-12-29T23:28:20Z
<p>Flydragon: </p>
<hr />
<div>[[Category:Audio/Video (English)]] [[Category:HOWTOs (English)]]<br />
{{Article summary start}}<br />
{{Article summary text|Provides a brief overview of how to install RealPlayer to play rmvb files.}}<br />
{{Article summary heading|Language}}<br />
{{i18n entry|English|RealPlayer}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|vlc}}<br />
{{Article summary end}}<br />
Today you can do almost everything in Linux, or specifically in Arch Linux.<br />
<br />
So what do you do with your desktop or laptop? Play music? Play games? and play movies/videos?<br />
<br />
Today the most popular video files are .avi and .rmvb... and of course more and more .flv and .mp4... that's another story.<br />
<br />
You can easily find many applications to play .avi, but it seems no article in Arch Wiki talked about .rmvb yet.<br />
<br />
Let me be the first one then, :)<br />
<br />
==Installation==<br />
The most simple way is to install VLC, which plays .rmvb now, as well as many other video format.<br />
$ sudo pacman -Sy vlc<br />
<br />
Or if you have logon as root:<br />
# pacman -Sy vlc<br />
<br />
Or you can install RealPlayer 11 Gold via AUR, a little bit more steps:<br />
<br />
Follow the article to install [[Yaourt]] and related programs. You will not be regret, because Yaourt can bring you many useful new options like chromium browser.<br />
<br />
Also we assume you have installed and can use one of the editor in command line, nano or vim or vi, etc.<br />
<br />
Then let's install RealPlayer 11 Gold, the one we will use to play rmvb:<br />
$ yaourt -S realplayer<br />
<br />
Choose no to ignore edit of PKGBUILD for this time. Then choose yes for download and build.<br />
<br />
This would end up fail for the first time after download the rpm file, because this package is out of date, it will report the md5sum is wrong. Don't worry, let's do the next step anyway:<br />
$ cd /tmp/yaourt-tmp-master/realplayer/<br />
<br />
You will find RealPlayer11Gold.rpm here, let's find out the right md5sum:<br />
$ md5sum RealPlayer11GOLD.rpm<br />
<br />
Copy or write down the return value, just the big number, no space or file name included.<br />
Then run yaourt again:<br />
$ yaourt -S realplayer<br />
<br />
Ok, this time choose yes for PKGBUILD, it will ask you what editor do you want to use, it's up to you, whatever you want, nano or vim or vi. Then you'll easily find the md5sum in the file, just replace the exiting one with the md5sum you got for our rpm file. Save the file and exit your editor.<br />
<br />
Now you can continue build and install RealPlayer11, by choose yes, yes, yes...<br />
<br />
Done, now start it by:<br />
$ realplay &<br />
<br />
First time run it will start a wizard to config network etc., basically just next, next, next...<br />
<br />
When it's finished, you can choose a rmvb file to play, it runs perfect on my pc, as my alsa is set up. If you didn't config your sound yet, follow this article to do it: [[ALSA]]<br />
<br />
This should be all, you may want to add realplay in your menu, or if you are using gnome or KDE it should already in the menu. I'm using fluxbox, so I just edit ~/.fluxbox/menu to add a line for it. Or if you are using launchers like dmenu or bashrun, they will find realplay for you.<br />
<br />
Good luck!</div>
Flydragon
https://wiki.archlinux.org/index.php?title=RealPlayer&diff=89258
RealPlayer
2009-12-29T23:14:57Z
<p>Flydragon: </p>
<hr />
<div>[[Category:Audio/Video (English)]] [[Category:HOWTOs (English)]]<br />
{{Article summary start}}<br />
{{Article summary text|Provides a brief overview of how to install RealPlayer to play rmvb files.}}<br />
{{Article summary heading|Language}}<br />
{{i18n entry|English|How To Install RealPlayer}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|vlc}}<br />
{{Article summary end}}<br />
{{moveto|Realplayer}}<br />
Today you can do almost everything in Linux, or specifically in Arch Linux.<br />
<br />
So what do you do with your desktop or laptop? Play music? Play games? and play movies/videos?<br />
<br />
Today the most popular video files are .avi and .rmvb... and of course more and more .flv and .mp4... that's another story.<br />
<br />
You can easily find many applications to play .avi, but it seems no article in Arch Wiki talked about .rmvb yet.<br />
<br />
Let me be the first one then, :)<br />
<br />
==Installation==<br />
Follow the article to install [[Yaourt]] and related programs. You will not be regret, because Yaourt can bring you many useful new options.<br />
<br />
Also we assume you have installed and can use one of the editor in command line, nano or vim or vi, etc.<br />
$ yaourt nano<br />
<br />
Then let's install RealPlayer 11 Gold, the one we will use to play rmvb:<br />
$ yaourt -S realplayer<br />
<br />
Choose no to ignore edit of PKGBUILD for this time. Then choose yes for download and build.<br />
<br />
This would end up fail for the first time after download the rpm file, because this package is out of date, it will report the md5sum is wrong. Don't worry, let's do the next step anyway:<br />
$ cd /tmp/yaourt-tmp-master/realplayer/<br />
<br />
You will find RealPlayer11Gold.rpm here, let's find out the right md5sum:<br />
$ md5sum RealPlayer11GOLD.rpm<br />
<br />
Copy or write down the return value, just the big number, no space or file name included.<br />
Then run yaourt again:<br />
$ yaourt -S realplayer<br />
<br />
Ok, this time choose yes for PKGBUILD, it will ask you what editor do you want to use, it's up to you, whatever you want, nano or vim or vi. Then you'll easily find the md5sum in the file, just replace the exiting one with the md5sum you got for our rpm file. Save the file and exit your editor.<br />
<br />
Now you can continue build and install RealPlayer11, by choose yes, yes, yes...<br />
<br />
Done, now start it by:<br />
$ realplay<br />
<br />
First time run it will start a wizard to config network etc., basically just next, next, next...<br />
<br />
When it's finished, you can choose a rmvb file to play, it runs perfect on my pc, as my alsa is set up. If you didn't config your sound yet, follow this article to do it: [[ALSA]]<br />
<br />
This should be all, you may want to add realplay in your menu, or if you are using gnome or KDE it should already in the menu. I'm using fluxbox, so I just edit ~/.fluxbox/menu to add a line for it. Or if you are using launchers like dmenu or bashrun, they will find realplay for you.<br />
<br />
Good luck!</div>
Flydragon
https://wiki.archlinux.org/index.php?title=Talk:RealPlayer&diff=89256
Talk:RealPlayer
2009-12-29T23:13:43Z
<p>Flydragon: moved Talk:How To Play RMVB Video Files to Talk:RealPlayer:&#32;the article is mainly about realplayer installation</p>
<hr />
<div>Isn't easier to just install VLC Media Player? It has all codecs build-in/in_dependecies and it's in pacman's extra.<br />
<br />
==Rename to Realplayer==<br />
Since it seems to cover installing/using this program? <small>[[User:Pwd|pwd]]</small> 07:57, 27 December 2009 (EST)<br />
<br />
==Reason for reverts==<br />
*alsa and yaourt aren't related. mplayer is because it's a media player. Yes, alsa is required for using Realplayer, but you don't see pacman being listed as related in every article even though in most cases people are going to use it to install packages.<br />
*The i18n link is supposed to point the current page, not the one it's being moved to.<br />
*''How To Install RealPlayer and Play RMVB Video Files'' is too long of a title. See: [[Short article names HOWTO (English)]]. Also, just because it currently doesn't cover other subjects other than playing RMVB files, it doesn't mean that the article couldn't be expanded in the future to be more in-tune with a general title like ''Realplayer''. <small>[[User:Pwd|pwd]]</small> 19:18, 27 December 2009 (EST)<br />
*OK, agree your point about title naming. But I could not get VLC to play rmvb on my machine, which codec should I install for vlc? Thanks.<br />
--[[User:Flydragon|flydragon]] 22:03, 27 December 2009 (EST)<br />
*Haha, I did a pacman -Syu, and now VLC plays rmvb too. :)<br />
--[[User:Flydragon|flydragon]] 18:12, 29 December 2009 (EST)</div>
Flydragon
https://wiki.archlinux.org/index.php?title=How_To_Play_RMVB_Video_Files&diff=89255
How To Play RMVB Video Files
2009-12-29T23:13:43Z
<p>Flydragon: moved How To Play RMVB Video Files to RealPlayer:&#32;the article is mainly about realplayer installation</p>
<hr />
<div>#REDIRECT [[RealPlayer]]</div>
Flydragon
https://wiki.archlinux.org/index.php?title=RealPlayer&diff=89254
RealPlayer
2009-12-29T23:13:43Z
<p>Flydragon: moved How To Play RMVB Video Files to RealPlayer:&#32;the article is mainly about realplayer installation</p>
<hr />
<div>[[Category:Audio/Video (English)]] [[Category:HOWTOs (English)]]<br />
{{Article summary start}}<br />
{{Article summary text|Provides a brief overview of how to install RealPlayer to play rmvb files.}}<br />
{{Article summary heading|Language}}<br />
{{i18n entry|English|How To Play RMVB Video Files}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|mplayer}}<br />
{{Article summary end}}<br />
{{moveto|Realplayer}}<br />
Today you can do almost everything in Linux, or specifically in Arch Linux.<br />
<br />
So what do you do with your desktop or laptop? Play music? Play games? and play movies/videos?<br />
<br />
Today the most popular video files are .avi and .rmvb... and of course more and more .flv and .mp4... that's another story.<br />
<br />
You can easily find many applications to play .avi, but it seems no article in Arch Wiki talked about .rmvb yet.<br />
<br />
Let me be the first one then, :)<br />
<br />
==Installation==<br />
Follow the article to install [[Yaourt]] and related programs. You will not be regret, because Yaourt can bring you many useful new options.<br />
<br />
Also we assume you have installed and can use one of the editor in command line, nano or vim or vi, etc.<br />
$ yaourt nano<br />
<br />
Then let's install RealPlayer 11 Gold, the one we will use to play rmvb:<br />
$ yaourt -S realplayer<br />
<br />
Choose no to ignore edit of PKGBUILD for this time. Then choose yes for download and build.<br />
<br />
This would end up fail for the first time after download the rpm file, because this package is out of date, it will report the md5sum is wrong. Don't worry, let's do the next step anyway:<br />
$ cd /tmp/yaourt-tmp-master/realplayer/<br />
<br />
You will find RealPlayer11Gold.rpm here, let's find out the right md5sum:<br />
$ md5sum RealPlayer11GOLD.rpm<br />
<br />
Copy or write down the return value, just the big number, no space or file name included.<br />
Then run yaourt again:<br />
$ yaourt -S realplayer<br />
<br />
Ok, this time choose yes for PKGBUILD, it will ask you what editor do you want to use, it's up to you, whatever you want, nano or vim or vi. Then you'll easily find the md5sum in the file, just replace the exiting one with the md5sum you got for our rpm file. Save the file and exit your editor.<br />
<br />
Now you can continue build and install RealPlayer11, by choose yes, yes, yes...<br />
<br />
Done, now start it by:<br />
$ realplay<br />
<br />
First time run it will start a wizard to config network etc., basically just next, next, next...<br />
<br />
When it's finished, you can choose a rmvb file to play, it runs perfect on my pc, as my alsa is set up. If you didn't config your sound yet, follow this article to do it: [[ALSA]]<br />
<br />
This should be all, you may want to add realplay in your menu, or if you are using gnome or KDE it should already in the menu. I'm using fluxbox, so I just edit ~/.fluxbox/menu to add a line for it. Or if you are using launchers like dmenu or bashrun, they will find realplay for you.<br />
<br />
Good luck!</div>
Flydragon
https://wiki.archlinux.org/index.php?title=Talk:RealPlayer&diff=89253
Talk:RealPlayer
2009-12-29T23:12:05Z
<p>Flydragon: /* Reason for reverts */</p>
<hr />
<div>Isn't easier to just install VLC Media Player? It has all codecs build-in/in_dependecies and it's in pacman's extra.<br />
<br />
==Rename to Realplayer==<br />
Since it seems to cover installing/using this program? <small>[[User:Pwd|pwd]]</small> 07:57, 27 December 2009 (EST)<br />
<br />
==Reason for reverts==<br />
*alsa and yaourt aren't related. mplayer is because it's a media player. Yes, alsa is required for using Realplayer, but you don't see pacman being listed as related in every article even though in most cases people are going to use it to install packages.<br />
*The i18n link is supposed to point the current page, not the one it's being moved to.<br />
*''How To Install RealPlayer and Play RMVB Video Files'' is too long of a title. See: [[Short article names HOWTO (English)]]. Also, just because it currently doesn't cover other subjects other than playing RMVB files, it doesn't mean that the article couldn't be expanded in the future to be more in-tune with a general title like ''Realplayer''. <small>[[User:Pwd|pwd]]</small> 19:18, 27 December 2009 (EST)<br />
*OK, agree your point about title naming. But I could not get VLC to play rmvb on my machine, which codec should I install for vlc? Thanks.<br />
--[[User:Flydragon|flydragon]] 22:03, 27 December 2009 (EST)<br />
*Haha, I did a pacman -Syu, and now VLC plays rmvb too. :)<br />
--[[User:Flydragon|flydragon]] 18:12, 29 December 2009 (EST)</div>
Flydragon