<< Back to handbook

Chapter 7. Debian桌面系统

Table of Contents

7.1. Debian base系统安装

7.2. 安装2.6.10内核,并支持图形化启动界面。

7.3. 安装GNOME中文桌面环境

7.4. 配置“Debian菜单

7.5. 安装NVIDIA显卡驱动程序

7.6. 配置有滑轮的串口鼠标

7.7. 中文字体模糊不清的解决方法

7.8. 安装配置Firefox

7.9. 安装Adobe Reader 7.0 for Linux

7.10. 安装rxvt中文终端

7.11. 安装KDE中文桌面环境

7.12. 安装ALSA多媒体系统

7.13. pptp client连接远程VPN服务器

7.14. 使挂载的fat32ntfs分区正常显示中文名

7.15. 配置Java环境

7.15.1. 安装

7.15.2. 设置JAVA的中文显示

7.16. Gnome下安装Fcitx并设置开机自启动

7.17. KDE环境下设置fcit开机自启动

7.18. 使用update-alternatives工具配置可选系统

7.19. 安装星际译王

7.20. 播放rmvbrm格式文件

7.20.1. RealPlayer

7.20.2. totem

7.21. xCHM.chm格式文件

7.22. 安装GDM

7.23. 安装splash主题

7.24. 安装QEMU模拟器

7.25. 生成Debian软件包依赖关系图

7.26. 使用rdesktop连接Windows远程桌面

7.27. 保存GNOME桌面环境中声卡的音量设置

7.28. 屏幕截图

7.29. 访问WebDAV服务

7.30. 安装OpenOffice

Linux等开源软件的优点是可配置性强,同一种功能可通过不同的方法来实现,所以我们使用的系统都会有差别,配置方式也不尽相同。为了积累知识和备忘,我把我在安装和配置Debian桌面系统的所有操作都记录在该章节中。

7.1. Debian base系统安装

Debian发行版为我们提供了灵活的安装方式,可以先安装一个很小的(几十兆)base系统,再通过网络更新系统和安装其它应用软件。这种方式要求有较好的网络环境,比如ADSL。我就是采用这种方式安装的,下面是我的具体操作步骤:

·         http://people.debian.org/~blade/boot-floppies/netinst-full-pre/下载bootbf2_4_iso.zip安装镜像。解压密码是:“Yes, I know that this data may be harmful!”。注意密码串中的标点符号和空格都要正确输入。解压后,刻录成启动光盘。

·         用启动光盘启动电脑,在出现boot:提示符状态后直接按回车载入内核。

·         对硬盘分区,我的分区在安装之前已用分区工具分好,所以可直接挂接。我设置了一个交换分区(swap)和一个linux分区(ext2)。完成格式化后把分区挂接为根分区。接着就可配置主机名和网络了,我的网卡需加载设备驱动模组才能识别,我的网卡是最常见的RTL-8139,选择“ne”模组支持即可。最后选安装基本系统开始安装。

[Note]

 

如果启动盘找不到硬盘,可用我的方法,先用一些分区工具分好区再装,或下载500多兆那个启动盘,在出现boot:提示符时打bf24启动应该就可以找到硬盘了。

·         安装完基本系统后,需配置系统的启动信息。Debian默认使用lilo做为启动管理器,我的系统中本来已有windows XP系统,我用lilo来统一管理双系统的启动,所以我把lilo安装到MBR中。

·         取出光盘重启电脑,成功启动Linux后,系统会自动运行base-config程序进行系统的初始配置,配置的内容有:

o        时区设置:亚洲/上海

o        设置root用户密码和启动shadow

o        设置sorucelisthttp方式

o        我不想用exim作为我的邮件客户端,所以不配置exim程序。

·         进入Debian系统后,首先配置ADSL拔号程序,运行pppoeconfig进行配置。按提示填上ADSL帐号和密码即可。注意,eth0的网关不要设,否则会连接不上外网。

·         成功连接Internet后就可进行下一步安装了,首先把系统升级到testing。把/etc/apt/sources.list里所有的stable改成testing。再运行apt-get update获取最新的软件包信息,最后运行apt-get dist-upgrade更新整个系统。以后升级系统中的软件只需运行apt-get updateapt-get upgrade两步即可。apt-get dist-upgrade只用于debian系统版本的升级,如stable升级到testing

·         更新完系统后,需运行lilo -v -v -v更新启动信息,否则在系统重启时会出现LI两个字符后停住,不能正常启动系统。

7.2. 安装2.6.10内核,并支持图形化启动界面。

光盘上的内核较旧,所以成功安装完成系统后,一般都要更新内核,以支持更多的硬件和提高系统性能。在Debian发行版中,更新内核也可使用apt-get install kernel-image-2.x.x方式来直接更新。但这样更新有两个问题,一是内核包的更新要滞后于Linux内核的更新速度,也就是说采用该方式你用不到最新的内核;二是内核包不是针对你的计算机编译的,所以性能和配置可能会不符合你的要求。我一般不用这种方式更新我的内核,而是采用直接编译内核源码,再用make-kpkg命令打包的方式来安装。make-kpkgDebian的内核打包工具,它可编译Linux源码,并打包成Debian格式的内核安装包。这样我们即可使用最新的Linux内核,又可用Debian的方式安装和管理内核包,一举两得。现在来看看具体的安装过程,我把2.4.20内核更新到最新的2.6.10

·         http://www.kernel.org下载最新的2.6.10内核,解压到/usr/src目录下。

·         安装编译2.6内核所需的软件

·                # apt-get install kernel-package ncurses-dev fakeroot module-init-tools

·         /usr/src/linux-2.6.10目录下运行以下命令配置和编译新内核:

·                # make menuconfig
·                # make-kpkg clean
·                # fakeroot make-kpkg --revision=mykernel.1.0 kernel_image

[Note]

 

如果编译失败,可用make cleanmake menuconfig重新配置和编译。配置信息默认会保存在/usr/src/linux-2.6.10/.config文件中。

·         内核编译完成后在/usr/src目录下就会生成一个kernel-image-2.6.10_mykernel.1.0_i386.deb软件包,用以下命令安装:

·                # dpkg -i kernel-image-2.6.10_mykernel.1.0_i386.deb

这样,在/boot目录下会生成System.map-2.6.10vmlinuz-2.6.10文件。在安装内核时会提示是否制作启动盘和是否自动配置LILO,我都选择NO。用手动方式设置LILO。打开/etc/lilo.conf文件,修改相关部份的内容,修改的内容如下:

...
#使用图形菜单
bitmap=/boot/coffee.bmp
bmp-colors=14,11,,15,9,0
#bmp-table=120p,173p,1,15,17
bmp-timer=254p,432p,1,0,0
# Installs the specified file as the new boot sector
# You have the choice between: bmp, compat, menu and text
# Look in /boot/ and in lilo.conf(5) manpage for details
#
install=bmp
...
#内核配置
default=Linux2.6.10
 
image=/boot/vmlinuz-2.6.10
        label=Linux2.6.10
        read-only
#       restricted
#       alias=1
 
image=/boot/vmlinuz-2.4.20-bf2.4
        label=Linuxold
        read-only
        optional
#       restricted
#       alias=2
...

·         lilo -v -v -v更新启动信息。如果没有出错信息则可重启电脑,默认是以新内核来启动的。用上下光标可选择不同的启动内核。

[Note]

 

如想用dpkg -i 重新安装相同内核,要做一些清理工作。需把/boot/System.map-2.6.10/boot/vmlinuz-2.6.10/lib/modules/2.6.10改名备份起来或删除掉,但为了安全,建议采用改名备份方式。安装时会提示需重启来重建/lib/modules/2.6.10目录,按继续即可。

2.6.10内核配置备忘录

·         内核配置完成后,在退出配置菜单时如果选择保存配置,则会在当前目录中生成一个.config文件,记录内核的所有配置参数。该配置文件会在下次配置内核时自动导入。也可以通过内核配置菜单的导入和存盘功能导入其它内核配置文件和把当前配置以任意的名字保存在其它地方。

·         Loadable module support-->Module unloading选项可允许卸载已加载的内核模块。通过该功能,我们可以通过rmmod module_namemodprobe module_name命令改变内核模块的加载参数。

·         如需支持富士FinePix 2800 Zoom数码相机,需选中Device Drivers-->USB support-->UHCI HCD(most Intel and VIA) support支持。如果成功配置,在启动时会自动检测到数码相机,并自动把相机的存储卡挂接在/media/usbdisk目录下。如果对自已机器上的USB设备接口不清楚,可用# lspci -v命令来列出本机的设备信息。

·         在我的Fosa手提电脑上编译内核2.6.10以支持USB鼠标和触摸板。用lspci -v命令列出本机USB设备的硬件信息如下:

·                0000:00:01.2 USB Controller: Silicon Integrated Systems [SiS] USB 1.0 Controller                               (rev 07) (prog-if 10 [OHCI])
·                        Subsystem: Silicon Integrated Systems [SiS] USB 1.0 Controller
·                        Flags: bus master, medium devsel, latency 64, IRQ 11
·                        Memory at 000d0000 (32-bit, non-prefetchable) [size=4K]

USB设备接口类型是OHCI的,所以配置内核时选中Device Drivers--->Usb Support--->OHCI HCD support,并把它编译进内核。重启手提电脑,自检时出现如下信息,驱动成功。

ohci_hcd 0000:00:01.2: Silicon Integrated Systems [SiS] USB 1.0 Controller
ohci_hcd 0000:00:01.2: USB HC TakeOver from BIOS/SMM
ohci_hcd 0000:00:01.2: irq 11, pci mem 0xd0000
ohci_hcd 0000:00:01.2: new USB bus registered, assigned bus number 1
ohci_hcd 0000:00:01.2: resetting from state 'reset', control = 0x0
ohci_hcd 0000:00:01.2: enabling initreset quirk
ohci_hcd 0000:00:01.2: OHCI controller state
ohci_hcd 0000:00:01.2: OHCI 1.0, with legacy support registers
ohci_hcd 0000:00:01.2: control 0x083 HCFS=operational CBSR=3
ohci_hcd 0000:00:01.2: cmdstatus 0x00000 SOC=0
ohci_hcd 0000:00:01.2: intrstatus 0x00000044 RHSC SF
ohci_hcd 0000:00:01.2: intrenable 0x8000000a MIE RD WDH
ohci_hcd 0000:00:01.2: hcca frame #0003
ohci_hcd 0000:00:01.2: roothub.a 01000203 POTPGT=1 NPS NDP=3
ohci_hcd 0000:00:01.2: roothub.b 00000000 PPCM=0000 DR=0000
ohci_hcd 0000:00:01.2: roothub.status 00008000 DRWE
ohci_hcd 0000:00:01.2: roothub.portstatus [0] 0x00010301 CSC LSDA PPS CCS
ohci_hcd 0000:00:01.2: roothub.portstatus [1] 0x00000100 PPS
ohci_hcd 0000:00:01.2: roothub.portstatus [2] 0x00000100 PPS
usb usb1: new device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: default language 0x0409
usb usb1: Product: Silicon Integrated Systems [SiS] USB 1.0 Controller
usb usb1: Manufacturer: Linux 2.6.10 ohci_hcd
usb usb1: SerialNumber: 0000:00:01.2
usb usb1: hotplug
usb usb1: adding 1-0:1.0 (config #1, interface 0)
usb 1-0:1.0: hotplug
hub 1-0:1.0: usb_probe_interface
hub 1-0:1.0: usb_probe_interface - got id
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 3 ports detected
hub 1-0:1.0: standalone hub
hub 1-0:1.0: no power switching (usb 1.0)
hub 1-0:1.0: global over-current protection
hub 1-0:1.0: power on to power good time: 2ms
hub 1-0:1.0: local power source is good
hub 1-0:1.0: no over-current condition exists
ohci_hcd 0000:00:01.2: created debug files
hub 1-0:1.0: state 5 ports 3 chg ffff evt ffff
usbcore: registered new driver hiddev
ohci_hcd 0000:00:01.2: GetStatus roothub.portstatus [0] = 0x00010301 CSC LSDA PPS CCS
hub 1-0:1.0: port 1, status 0301, change 0001, 1.5 Mb/s
hub 1-0:1.0: debounce: port 1: total 100ms stable 100ms status 0x301
ohci_hcd 0000:00:01.2: GetStatus roothub.portstatus [0] = 0x00100303 PRSC LSDA PPS PES CCS
usb 1-1: new low speed USB device using ohci_hcd and address 2
ohci_hcd 0000:00:01.2: GetStatus roothub.portstatus [0] = 0x00100303 PRSC LSDA PPS PES CCS
usb 1-1: skipped 1 descriptor after interface
usb 1-1: new device strings: Mfr=0, Product=2, SerialNumber=0
usb 1-1: default language 0x0409
usb 1-1: Product: USB OpticalWheel Mouse
usb 1-1: hotplug
usb 1-1: adding 1-1:1.0 (config #1, interface 0)
usb 1-1:1.0: hotplug
hub 1-0:1.0: port 2, status 0100, change 0000, 12 Mb/s
hub 1-0:1.0: port 3, status 0100, change 0000, 12 Mb/s
usbhid 1-1:1.0: usb_probe_interface
usbhid 1-1:1.0: usb_probe_interface - got id
input: USB HID v1.10 Mouse [USB OpticalWheel Mouse] on usb-0000:00:01.2-1
usbcore: registered new driver usbhid
drivers/usb/input/hid-core.c: v2.0:USB HID core driver
mice: PS/2 mouse device common for all mice
input: AT Translated Set 2 keyboard on isa0060/serio0
Synaptics Touchpad, model: 1
 Firmware: 4.6
 180 degree mounted touchpad
 Sensor: 18
 new absolute packet format
 Touchpad has extended capability bits
 -> four buttons
 -> multifinger detection
 -> palm detection
input: SynPS/2 Synaptics TouchPad on isa0060/serio4

/etc/X11/XF86config-4配置文件中与鼠标配置相关的内容如下:

Section "InputDevice"
        Identifier      "Configured Mouse"
        Driver          "mouse"
        Option          "CorePointer"
        Option          "Device"                "/dev/psaux"
        Option          "Protocol"              "Auto"
        Option          "Emulate3Buttons"       "true"
        Option          "ZAxisMapping"          "4 5"
EndSection
Section "InputDevice"
        Identifier      "Generic Mouse"
        Driver          "mouse"
        Option          "SendCoreEvents"        "true"
        Option          "Device"                "/dev/input/mice"
        Option          "Protocol"              "Auto"
        Option          "Emulate3Buttons"       "true"
        Option          "ZAxisMapping"          "4 5"
EndSection
 
...
 
Section "ServerLayout"
        Identifier      "Default Layout"
        Screen          "Default Screen"
        InputDevice     "Generic Keyboard"
        InputDevice     "Configured Mouse"    #这里的两个Mouse设备标识名要对应上面
        InputDevice     "Generic Mouse"
EndSection

·         配置内核支持图形化启动界面。以下网站http://www.bootsplash.org/有详细介绍。为了支持图形化启动界面,我们需为内核打补丁。我的内核版本是2.6.10。到http://www.bootsplash.de/files/下载与内核对应的补丁文件bootsplash-3.1.4-2.6.10.diff。用以下命令为内核源码打上该补丁:

·                # cd /usr/src/linux-2.6.10
·                # patch -p1 < bootsplash-3.1.4-2.6.10.diff

接着配置内核,选中以下选项,以下所有选项不能以内核模块形式编译,都要直接编译进内核:

1.    Device Drivers --> Block Devices --> Initial RAM disk(initrd) support

2.    Device Drivers --> Graphics Support --> VGA 16-color graphics support

3.    Device Drivers --> Graphics Support --> VESA VGA graphics support

4.    Device Drivers --> Graphics Support --> Console display driver support --> Framebuffer Console support

5.    Device Drivers --> Graphics Support --> Bootsplash configuration --> Bootup splash Screen

[Note]

 

该选项在打了内核补丁后才会出现。

6.    File systems --> Miscellaneous filesystems --> Compressed ROM file system support (cramfs)

配置内核后就可以用上面介绍的方法重新编译内核了。下一步是安装bootsplash工具。把下面这句加到/etc/apt/source.list里。

deb http://www.bootsplash.de/files/debian/ unstable main

用以下方法安装:

# apt-get update
# apt-get install bootsplash
# apt-get install sysv-rc-bootsplash       该软件包启用进度条和动画

在配置bootsplash时会问你是否安装一个新的bootsplash主题替换已存在的主题。如果你是第一次安装,请选择none,这样将会自动生成一个/boot/initrd.splash映像,并设置一个默认的newlinux主题。

接下来要更新启动器了,我是用lilo的,配置内容如下:

default=Linux2.6.10
 
image=/boot/vmlinuz-2.6.10
        label=Linux2.6.10
        read-only
        initrd=/boot/initrd.splash       #新增选项,指出映像文件
        vga=791                          #新增选项,设置显示像素1024X768
        append="splash=verbose"          #新增选项,设置显示模式为详细
#       restricted
#       alias=1

vga的取值见下表:

Table 7.1. 

Colors

640X480

800X600

1024X768

1280X1024

256(8 bit)

769 or 0x301

771 or 0x303

773 or 0x305

775 or 0x307

32000(15 bit)

784 or 0x310

787 or 0x313

790 or 0x316

793 or 0x319

65000(16 bit)

785 or 0x311

788 or 0x314

791 or 0x317

794 or 0x31A

16.7 Mill.(24 bit)

786 or 0x312

789 or 0x315

792 or 0x318

795 or 0x31B

[Note]

 

791为十进制表示法,0x317为十六进制表示法。较旧的lilo不支持十六进制,需用十进制表示法。

运行lilo命令更新启动信息,重启电脑就可看到有底图的开机画面了。如果选择append="splash=silent",则不会显示启动信息,只会显示一幅开机图和一条进度条,就象Windows一样。

安装其它主题的方法也很简单,用apt-cache search bootsplash查出主题的名称再用apt-get安装即可,使用Debian就是方便。

·         用新内核重启时提示VFS不能挂接问题(由kennycx兄分享)

提示出错信息类似以下内容:

VFS:Cannot open root device "hdb2" or unknow-block(0,0)
Please append a correct "root=" boot option
kernel panic-not syncing: VFS:Unable to mount root fs on unknow-block(0,0) 

以下是由网友提供的一些解决方法,以供参考:

o        原因一:ext2文件格式支持没有编译进内核,不论你使用ext3或其它文件格式,ext2支持都必须直接编译进内核,不能以内核模块形式编译。

o        原因二:如果使用initrd.img启动系统,则cromfs必须编译进内核。(由西安交通大学的张成分享)

·         使用Grub启动器代替LiLo启动。

o        首先用apt-get install gurb安装相关软件。

o        再用gurb-install /dev/hda命令在分区上创建启动信息。

o        使用update-grub命令自动生成menu.lst文件。

o        编辑/boot/grub/menu.lst文件以满足你的需求,最后重启计算机。

[Note]

 

如果启动失败,可用Live系统(如Knoppix)或rescure模式启动计算机,再mount启动分区,chroot到故障系统来进行修复。

7.3. 安装GNOME中文桌面环境

·         安装基本的X系统

·                # apt-get install x-window-system-core

·         安装GNOME桌面环境

·                # apt-get install gnome

·         到现在为止,我们已成功安装完成gnome桌面环境了,但桌面的语言环境默认是英文的,为了能显示中文,我们需安装中文字体和中文locales,开源的中文字体现在很少,且效果都不是很理想,所以Linux中文化还有很多工作要做。其中较好的有文鼎科技贡献的arphic TrueType字体,在Debian中字体包的名字分别是:

o        ttf-arphic-bkai00mp:文鼎PL中楷(Big5码)

o