打造完美的 Linux 桌面 — Arch Linux 2007.08-2 (2)

在本文的第一部分中,我们从头至尾描述了 Arch Linux 基本系统的安装过程。此时,我们所得到的仅仅是一个命令行系统,离完美 Linux 桌面的目标还差一大截呢。现在让我们继续余下的工作。

更新系统

在我们进行后续的安装任务之前,先把 Arch Linux 更新到最新状态。你可以通过执行以下指令来完成 (需要 root 权限,如果是普通用户,可以先 su):

pacman -Syu

安装 X.Org

X.Org 是 X Window System 的开源实现。如果我们要在 Arch Linux 中运行图形化的程序,那么 X.Org 的安装是必不可少的。安装 X.Org 可以执行命令:

pacman -S xorg

该指令将为你安装 X.Org 所必需的包,包括 X.Org 服务器、工具、字体、键盘驱动、鼠标驱动、显卡驱动等等。

值得注意的是,默认的 X.Org 安装可能并没有包含你的显卡驱动程序。因此,你需要单独为你的显卡安装驱动。你可以通过下列命令来进行搜索:

pacman -Ss xf86-video

比如,我在 VMware 中测试时,选择安装 xf86-video-vmware:

pacman -S xf86-video-vmware

为 NVIDIA 显卡安装驱动

作为 NVIDIA 和 ATI 显卡的用户,为了获得更好的性能和 3D 加速功能,可以安装它们的私有驱动。由于我本人是使用 NVIDIA 显卡,所以本文就以安装 NVIDIA 的显卡驱动为例来说明。ATI 显卡用户可以参照 Arch Linux 维基的相关介绍

如果你象我一样使用较新的 NVIDIA 显卡,那么可以执行以下指令来安装:

pacman -S nvidia

使用旧卡的朋友可以运行下列命令:

pacman -S nvidia-96xx

或者:

pacman -S nvidia-71xx

生成 xorg.conf 配置文件

在你使用 X.Org 前,需要为其创建 xorg.conf 配置文件。手动创建比较费事,我们选择相关工具自动生成,然后再根据自己需要来编辑调整。

我们选择使用 xorgconfig 工具来生成 xorg.conf 文件。要启动该工具,可以在命令提示符后执行:

xorgconfig

xorgconfig 是一个交互式的程序,它会向你问一些有关鼠标、键盘、显示器、显卡等方面的问题。根据你的实际情况回答即可。

另外,使用 NVIDIA 显卡的朋友,也可以使用 nvidia-xconfig。

编辑 xorg.conf 配置文件

直接由工具所生成的 xorg.conf 配置文件并不能满足实际情况的需要。因此,我们还有必要对该文件进行适当的编辑。

  1. Module 部分

Module 这部分定义默认载入的模块。比如,要载入 GLX 模块,可以去掉下列内容前面的注释符 #:

Load "glx"

  1. Files 部分

在这部分中,你应当开启默认的字体搜索路径。

  1. InputDevice 部分

InputDevice 部分可以让你配置鼠标、键盘等。

  1. Monitor 部分

对显示器进行配置,注意输入正确的水平和垂直刷新率。必要时可以查阅显示器说明手册。

  1. Device 部分

此部分配置显卡。NVIDIA 显卡用户可以加上以下选项,从而去掉 NVIDIA 烦人的标志。

Option "NoLogo" "true"

  1. Screen 部分

Screen 部分可以设置显示器的色深和屏幕分辨率。

Pages: 1 2

Read More:

49 Comments

  1. 1 gemini42 Commented @ 2007-12-18 22:44Reply to this comment

    没有用过这个发行版,请问他的包管理器是?包管理的工具是?谢谢~

  2. 2 xiws Commented @ 2007-12-18 22:44Reply to this comment

    期待继续。。

  3. 3 123 Commented @ 2007-12-18 23:21Reply to this comment

    我也想用,但是网速好慢,所以没有办法了,好郁闷,有快点的源么?

  4. 4 linuxpcman Commented @ 2007-12-18 23:24Reply to this comment

    to gemini42 请看后面那篇装基本系统的文章。我现在已经装在硬盘上了,感觉蛮好的

  5. 5 lh Commented @ 2007-12-18 23:38Reply to this comment

    回一楼的,是pacman,等于debian的dpkg和apt-get,功能比较丰富而且使用简单。。

    特别是依赖关系解决的很简单。

    不错的文章,不过这个只能说能用了,不过比方自动挂载之类的功能还没有实现。需要进一步了解linux下这些功能的实现。。

    玩archlinux真的学到不少哦。以前用linux根本不叫用过了

  6. 6 rainy Commented @ 2007-12-18 23:40Reply to this comment

    补上gnome下的常用工具: pacman -S gedit gnome-terminal gnome-utils gnome-system-monitor nautilus-open-terminal file-roller gksu sudo gconf-editor 浏览器:firefox 星际译王:stardict ntfs读写支持:ntfs-3g 还有ttf-dejavu最好也装上,不然stardict有部分音标无法显示。

    compiz: Gnome用户 pacman -S compiz-fusion-gtk KDE用户 pacman -S compiz-fusion-kde

    还有关于声音的部分,先装上alsa-utils,然后在rc.conf的DAEMONS段加上alsa,这样音量设置才能保存。

    把普通用户加入一些常用组,让普通用户可以使用声卡,光驱等设备。 gpasswd -a "username" optical gpasswd -a "username" audio

  7. 7 rainy Commented @ 2007-12-18 23:50Reply to this comment

    喜欢用雅黑的朋友会发现效果没有ubuntu好,可以这样做:

    退出X,现把原本的cairo和libXft删除

    pacman -Rd cairo libxft (-R是删除,d是不理会依赖关系)

    然后pacman -S cairo-lcd libxft-lcd,再把字体copy过来,

    接着 fc-cache -vf

    把你以前的字体配置文件copy到/etc/fonts,搞定。

  8. 8 lyzzzz Commented @ 2007-12-18 23:56Reply to this comment

    pacman -S dbus hal pmount gnome-volume-manager gnome-mount gpasswd -a “username” hal dbus gvim /etc/rc.conf DAEMONS里加入hal,dbus 重启动 自动挂载安装完毕

  9. 9 lyzzzz Commented @ 2007-12-18 23:59Reply to this comment

    对了 上面gpasswd -a “username” hal dbus这一步写错了 应该分成 gpasswd -a “username” hal gpasswd -a “username” dbus 这两步

  10. 10 rainy Commented @ 2007-12-19 0:01Reply to this comment

    还有个建议: 在/etc/rc.conf里设置LOCALE="enUS.UTF-8" 在~/.xinitrc里设置export LANG="zhCN.UTF-8" 这样在控制台下所有提示信息为英文,X下则是中文。

  11. 11 linuxpcman Commented @ 2007-12-19 0:03Reply to this comment

    大家都在推荐arch啊

  12. 12 lyzzzz Commented @ 2007-12-19 0:07Reply to this comment

    log,network,power,storage,wheel,disk 这几个也是比较重要的用户组

  13. 13 rainy Commented @ 2007-12-19 0:14Reply to this comment

    dbus最好在hal前面启动,因为hal依赖于dbus,当你启动hal的时候如果dbus未启动,它会自动运行dbus,或者你干脆只写hal也可以,写在后面意义不大。

  14. 14 jupiter Commented @ 2007-12-19 0:30Reply to this comment

    前天刚装上,学习中。 速度不错 出问题了:/var/run/gdm.pid doesn't exist, perhaps GDM isn't running 由于在DAEMONS中加入了gdm,无法启动了 还好有ubuntu可用

  15. 15 zlowly Commented @ 2007-12-19 0:51Reply to this comment

    ATI用户是永远的痛。目前用闭源的官方驱动无法打开compiz,连intel 964GM都不如。

    另外除了把gdm加入daemon这种方法,还可以通过修改/etc/inittab方式,好处就是一旦出现问题,你只需要启动时在grub里即时给kernel加上参数single,就可以避免启动到gdm里,直接在文本终端里进行维护。

  16. 16 latteye Commented @ 2007-12-19 1:12Reply to this comment

    profile 文件中不推荐加入 fcitx 程序。 最好是加在 Gnome - 会话 中启动。

    在 profile 中启动fcitx 的问题是,当你通过 ssh 登录的时候,机器也会尝试启动 fcitx。然后会有一个 2 类信息。

  17. 17 latteye Commented @ 2007-12-19 1:16Reply to this comment

    rainy:

    直接安装 -lcd 的包就可以了,它会自动删除老的包的。

  18. 18 nacre Commented @ 2007-12-19 1:23Reply to this comment

    to lyzzzz,rainy:

    其实只要直接加入hal就可以了,hal会自行启动dbus的。

  19. 19 nacre Commented @ 2007-12-19 1:24Reply to this comment

    还有我觉得用Xorg --config生成xorg.conf然后再自己编辑比较好。

  20. 20 nacre Commented @ 2007-12-19 1:52Reply to this comment

    对不起,是Xorg -configure

  21. 21 shanghaikid Commented @ 2007-12-19 7:53Reply to this comment

    arch 速度快,的却不错

  22. 22 左倾45度 Commented @ 2007-12-19 8:20Reply to this comment

    虽然已经不用Arch了,曾经是我的最爱用了快2年

  23. 23 Toy Commented @ 2007-12-19 9:51Reply to this comment

    @rainy, lyzzzz, zlowly, latteye, nacre: 非常感谢你们的补充,之后,我将对本系列文章进行修订和完善。

  24. 24 zop Commented @ 2007-12-19 10:31Reply to this comment

    非常感謝各位提供經驗,讓小弟學習不少。

  25. 25 dream Commented @ 2007-12-19 11:00Reply to this comment

    不知道有没有人听说过CRUX

  26. 26 cagewang Commented @ 2007-12-19 11:08Reply to this comment

    期待后续。。。。。。学习中!!

  27. 27 kpt Commented @ 2007-12-19 12:08Reply to this comment

    用hwd比较方便,生成的xorg.conf基本上不用做什么修改 可惜现在hwd有点问题,听说是每人维护和新版xorg不太兼容

  28. 28 garf Commented @ 2007-12-19 12:23Reply to this comment

    我用oldconfig编译了一下内核,只去掉无线支持IPv6,加上CONFIGSECURITYNETWORK因为学校要用drcom上网,用mkinitcipo -p kernel26生成镜像,但是配置之后发现启动不了,老是提示"/dev/sda10 doesn't exist",sda10是我的根分区,有没有人碰到过,这是咋回事?

  29. 29 白天 Commented @ 2007-12-19 12:43Reply to this comment

    現在的xorg不需要xorg.conf文件。我的arch從裝的時候就沒有,一直用到現在沒有任何問題。

  30. 30 linuxcoffee Commented @ 2007-12-19 13:59Reply to this comment

    一直就喜欢arch的速度,不错,不过国内的知名度不怎么高呢

  31. 31 pig345 Commented @ 2007-12-19 15:01Reply to this comment

    为表支持,特意点了两下广告。;-)

  32. 32 wyg1258 Commented @ 2007-12-19 15:36Reply to this comment

    arch有点折腾~ 特别是在校园网

  33. 33 YuanL Commented @ 2007-12-19 18:31Reply to this comment

    前段时间试了一下,但是Xorg我无论如何也没法让她正常工作,又赶上那之后要用电脑做工,就又回到Debian了。等闲下来时再试一试,希望那时Xorg能正常。本人AMD Duron 800Mhz 支持一下。

  34. 34 YuanL Commented @ 2007-12-19 18:34Reply to this comment

    其实买个64位CPU装Debian AMD64不是更快?

  35. 35 dogfox Commented @ 2007-12-19 19:39Reply to this comment

    看来ATI用户只能看看了?

  36. 36 zlowly Commented @ 2007-12-19 22:41Reply to this comment

    ATI的可以用开源驱动,但是开源驱动相对闭源缺少某些特性,而且3D性能差了一大截,不过跑compiz-fusion还是没问题的。即使是开源驱动,不知道是不是人品问题,在我X550XT显卡的机器上为了调整分辨率和刷新也搞了一两天才摸到门路。用Intel 965GM的笔记本倒是一装就行,随便调一下xorg.conf宽屏就出来了。

    64位的速度我现在还是没感觉和32位差别,无论是ubuntu还是arch,可能没什么大型应用吧,建议不是研究用就别装了,会很有挫折感,主要是现成的应用相对32位少了些,例如想试试看grub-gfx、splashy什么的pacman下来就说不支持arch64环境,真要自己去编译源代码也没那个精力。

  37. 37 白天 Commented @ 2007-12-20 7:15Reply to this comment

    介绍一个教育网内的源,不知道大家知不知道 ftp://its.lzu.edu.cn/pub/archlinux/core/os/i686 依此类推

  38. 38 lh Commented @ 2007-12-20 16:38Reply to this comment

    TO :zlowly

    这个貌似是你太火星了,而且应该很少人遇到这样的问题才对。。ati闭源驱动早支持aiglx了,也就是说compiz之类很容易使用。。

    分辨率问题使用闭源驱动默认会上到最高分辨率,根本不用怎么弄。

    还有,配置好xorg.conf使用hwd也不错。不过最近hwd有些问题

  39. 39 jupiter5188 Commented @ 2007-12-20 17:41Reply to this comment

    gpasswd -a “username” hal gpasswd -a “username” dbus

    我把username添加到hal,dbus组后,FAT分区会被启动两次。 之后只把username加到hal就正常了

  40. 40 sambodhi Commented @ 2007-12-22 11:15Reply to this comment

    能装在华硕Eee PC上吗?

  41. 41 无花果山 » Blog Archive » archlinux初装笔记_01 Pingbacked @ 2007-12-25 12:56Reply to this comment

    [...] 参考: 第一部分 第二部分 第三部分 第四部分 [...]

  42. 42 无花果山 » Blog Archive » archlinux初装笔记_02 Pingbacked @ 2007-12-29 13:52Reply to this comment

    [...] 使用旧卡的朋友可以运行下列命令: pacman -S nvidia-96xx 或者: pacman -S nvidia-71xx (参看:http://linuxtoy.org/archives/the-perfect-linux-desktop-arch-linux-2007-08-2-2.html) [...]

  43. 43 abcx Commented @ 2008-01-14 19:07Reply to this comment

    文章要不断更新才有生命力啊....

  44. 44 tenk Commented @ 2008-01-21 15:25Reply to this comment

    问一个比较白痴的问题,在命令模式下如何修改源

  45. 45 sky Commented @ 2008-01-25 20:06Reply to this comment

    在终端下取得管理员身份, #vi /etc/pacman.conf 比如看到下面一段: [community]

    Add your preferred servers here, they will be used first

    Server =http://mirrors.lcuc.org.cn/archlinux/community/os/i686 Server = ftp://ftp.archlinux.org/community/os/i686 Include = /etc/pacman.d/community Server段就是源,Include 段是以后面的 文件中的服务器列表为源,修改它们就 可以 全身体验,http://mirrors.lcuc.org.cn/archlinux/community/os/i686 是个不错的源!

  46. 46 keke Commented @ 2008-04-08 19:05Reply to this comment

    为什么我在安装gnome的时候会提示缺少一个包呢 gstreamer0.10-alsa 我无法继续下去了

  47. 47 zoujer Commented @ 2008-05-11 23:59Reply to this comment

    你好: 请问下为什么我在使用命令pacman -S xorg的时候会出现:error:'xorg'not found in sync db. 怎么解决这个问题?谢谢

  48. 48 using9 Commented @ 2008-05-29 20:01Reply to this comment

    回47楼,那是因为您没有更新软件库,在基本套件安装完成重启后,使用: pacman -Syu ,更新系统包以及包列表,之后在使用: pacman -S xorg,就可以安装了

  49. 49 wsky Commented @ 2009-11-12 17:29Reply to this comment

    弄了2次也没弄好,来麻烦一下大家了. 我是在VMware 6.5和7.0中安装的

    xorg,gdm和gnome也通过pacman安装好了 并且把gdm添加到了daemons中 重启后不行,然后查找到wiki,把open-vm-tools xf86-input-vmmouse xf86-video-vmware xf86-input-mouse xf86-video-vesa也安装好了

    重启后,还是停在命令行,需要在命令行登录(没有看到登录管理器). 登录后输入startx,启动进入之后不是gnome 而是一个蓝白的界面.能看到一个终端显示在上面,但是鼠标和键盘都无效

    请问接下来应该怎么操作呢,先谢谢大家了(新手努力学习中...)