QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 4782|回复: 6

FreeBSD桌面系统安装(转贴)

[复制链接]
发表于 2005-11-1 20:22:56 | 显示全部楼层 |阅读模式
FreeBSD桌面系统安装


好不容易安装完了FreeBSD5.4的桌面系统,觉得使用起来比较稳定,简洁,现在整理出来,为朋友提供点参考。
第一、下载ISO,刻录,安装基本系统。
这方面比较全面的ftp有ftp://ftp.tsinghua.edu.cn/mirror/FreeBSD
安装时一般选择就可以,最好选择Xorg和相关的桌面配置,我喜欢WindowMaker,IceWm。具体的安装细节handbook里面很细,参考一下不错。
Gnome,KDE 太大了,而且不稳定,影响情绪,不使用。

安装完成之后配置一下X环境,也比较方便,root登陆,然后:

Xorg -configure

之后在root目录底下产生xorg.conf.new文件,如果没有什么问题,把这个文件直接cp到/etc/X11/目录底下,具体的配置细节,handbook中的描写足够使用了,下面贴上我的xorg.conf:
Section "ServerLayout"
Identifier "X.org Configured"
Screen 0 "Screen0" 0 0
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
RgbPath "/usr/X11R6/lib/X11/rgb"
ModulePath "/usr/X11R6/lib/modules"
FontPath "/usr/X11R6/lib/X11/fonts/misc/"
FontPath "/usr/X11R6/lib/X11/fonts/TTF/"
FontPath "/usr/X11R6/lib/X11/fonts/Type1/"
FontPath "/usr/X11R6/lib/X11/fonts/CID/"
FontPath "/usr/X11R6/lib/X11/fonts/75dpi/"
FontPath "/usr/X11R6/lib/X11/fonts/100dpi/"
FontPath "/usr/X11R6/lib/X11/fonts/TrueType/"
EndSection

Section "Module"
Load "dbe"
Load "dri"
Load "extmod"
Load "glx"
Load "record"
Load "xtrap"
Load "freetype"
Load "type1"
EndSection

Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
EndSection

Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/sysmouse"
Option "ZAxisMapping" "4 5" #支持鼠标滑轮
Option "Emulate3Buttons" "no"
EndSection

Section "Monitor"
#DisplaySize 280 210 # mm
Identifier "Monitor0"
VendorName "LCS"
ModelName "d556"
### Uncomment if you don't want to default to DDC:
HorizSync 50.0 - 54.0
VertRefresh 70.0 - 120.0
Option "DPMS"
EndSection

Section "Device"
### Available Driver options are:-
### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
### <string>: "String", <freq>: "<f> Hz/kHz/MHz"
### [arg]: arg optional
#Option "accel" # [<bool>]
#Option "crt_display" # [<bool>]
#Option "composite_sync" # [<bool>]
#Option "hw_cursor" # [<bool>]
#Option "linear" # [<bool>]
#Option "mmio_cache" # [<bool>]
#Option "test_mmio_cache" # [<bool>]
#Option "panel_display" # [<bool>]
#Option "probe_clocks" # [<bool>]
#Option "reference_clock" # <freq>
#Option "shadow_fb" # [<bool>]
#Option "sw_cursor" # [<bool>]
Identifier "Card0"
Driver "ati"
VendorName "ATI"
BoardName "3D Rage Pro AGP 1X/2X"
ChipSet "ati"
ChipId 0x4742
ChipRev 0x5c
BusID "PCI:1:0:0"
EndSection

Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
SubSection "Display"
Viewport 0 0
Depth 1
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 4
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 8
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 15
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 16
EndSubSection
EndSection


第二、配置中文系统:
首先,配置个人文件~/.xinitrc
LC_ALL=zh_CN.eucCN
LANG=zh_CN.eucCN
LC_CTYPE=zh_CN.eucCN
export LC_ALL LANG LC_TYPE
这里当然也可以编辑个人的 .cshrc,.profile等文件,但是如果编辑这些文件的话,终端下的date等命令也试图显示中文,可是一般时候终端界面不显示中文,(除非安装了cce,zhcon之类)因此会出现乱码,而只编辑.xinitrc这些显示就会在x window中显示,配合rxvt,这样就没有乱码了。
其次,安装相关字体,可以从Windows下面copy下面的字体:heiti,minglu,pminglu,simsun,tahoma,tahomabd等字体。(最简单的就是mount windows的分区,然后直接cp就可以了)然后把字体复制到
/sr/X11R6/lib/X11/fonts/TrueType下面。
下面要安装这些字体,handbook 上使用ttmkfdir这个工具,不过这个工具不支持gb编码,因此我们这类选择ttfm(ports/chinese/ttfm)这个工具,ttfm -add 就可以安装所有的字体,包括所有的编码。
然后就是/usr/X11R6/etc/fonts/fonts.conf 了,当然可以不使用他,不过如果不使用的话,汉字的显示可能不好看,所以还是选择使用的比较好,这个文件的编辑有点麻烦,下面是我使用的fonts.conf:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts.conf file to configure system font access -->
<fontconfig>

<!--
The intent of this standard configuration file is to be adequate for
most environments. If you have a reasonably normal environment and
have found problems with this configuration, they are probably
things that others will also want fixed. Please send any suggested
changes to [email protected] so that future releases can include
such changes.

Note that the normal 'make install' procedure for XFree86 is to
replace any existing fonts.conf file with the new version. Place
any local customizations in local.conf which this file references.

Keith Packard
-->
<!-- Font directory list configured on Thu Apr 3 13:42:53 CST 2003 -->

<dir>/usr/X11R6/lib/X11/fonts/TrueType</dir>
<dir>/usr/X11R6/lib/X11/fonts/Type1</dir>
<dir>/usr/X11R6/lib/X11/fonts/TrueType</dir>
<dir>/usr/X11R6/lib/X11/fonts/Type1</dir>
<dir>/usr/X11R6/lib/X11/fonts/OTF</dir>
<dir>~/.fonts</dir>

<!--
Enable sub-pixel rendering
<match target="font">
<test qual="all" name="rgba">
<const>unknown</const>
</test>
<edit name="rgba" mode="assign"><const>rgb</const></edit>
</match>
-->

<!--
Accept deprecated 'mono' alias, replacing it with 'monospace'
-->
<match target="pattern">
<test qual="any" name="family">
<string>mono</string>
</test>
<edit name="family" mode="assign">
<string>monospace</string>
</edit>
</match>
<!--
Accept alternate 'sans serif' spelling, replacing it with 'sans-serif'
-->
<match target="pattern">
<test qual="any" name="family">
<string>sans serif</string>
</test>
<edit name="family" mode="assign">
<string>sans-serif</string>
</edit>
</match>

<!--
Accept deprecated 'sans' alias, replacing it with 'sans-serif'
-->
<match target="pattern">
<test qual="any" name="family">
<string>sans</string>
</test>
<edit name="family" mode="assign">
<string>sans-serif</string>
</edit>
</match>

<!--
Mark common families with their generics so we'll get
something reasonable
-->
<!--
Serif faces
-->
<alias>
<family>Times New Roman</family>
<family>Times</family>
<family>Nimbus Roman No9 L</family>
<family>Luxi Serif</family>
<family>Simsun</family>
<family>Kochi Mincho</family>
<family>AR PL SungtiL GB</family>
<family>AR PL Mingti2L Big5</family>
<family>Baekmuk Batang</family>
<default><family>serif</family></default>
</alias>
<!--
Sans-serif faces
-->
<alias>
<family>Tahoma</family>
<family>Verdana</family>
<family>Helvetica</family>
<family>Arial</family>
<family>Nimbus Sans L</family>
<family>Luxi Sans</family>
<family>Simsun</family>
<family>Kochi Gothic</family>
<family>AR PL KaitiM GB</family>
<family>AR PL KaitiM Big5</family>
<family>Baekmuk Dotum</family>
<default><family>sans-serif</family></default>
</alias>
<!--
Monospace faces
-->
<alias>
<family>Courier</family>
<family>Courier New</family>
<family>Andale Mono</family>
<family>Luxi Mono</family>
<family>Nimbus Mono L</family>
<family>NSimSun</family>
<default><family>monospace</family></default>
</alias>
<!--
If the font still has no generic name, add sans-serif
-->
<match target="pattern">
<test qual="all" name="family" compare="not_eq">
<string>SimSun</string>
</test>
<test qual="all" name="family" compare="not_eq">
<string>SimSun</string>
</test>
<test qual="all" name="family" compare="not_eq">
<string>SimSun</string>
</test>
<edit name="family" mode="append_last">
<string>SimSun</string>
</edit>
</match>

<!--
Load per-user customization file
-->
<include ignore_missing="yes">~/.fonts.conf</include>

<!--
Load local system customization file
-->
<include ignore_missing="yes">local.conf</include>
<!--
Alias well known font names to available TrueType fonts
-->
<alias>
<family>Times</family>
<accept><family>Times New Roman</family></accept>
</alias>
<alias>
<family>Helvetica</family>
<accept><family>Verdana</family></accept>
</alias>
<alias>
<family>Arial</family>
<accept><family>Verdana</family></accept>
</alias>
<alias>
<family>Courier</family>
<accept><family>Courier New</family></accept>
</alias>

<!--
Provide required aliases for standard names
-->
<alias>
<family>serif</family>
<prefer>
<family>SimSun</family>
<family>Times New Roman</family>
<family>Nimbus Roman No9 L</family>
<family>Luxi Serif</family>
<family>Times</family>
<family>Simsun</family>
<family>Kochi Mincho</family>
<family>AR PL SungtiL GB</family>
<family>AR PL Mingti2L Big5</family>
<family>Baekmuk Batang</family>
</prefer>
</alias>
<alias>
<family>sans-serif</family>
<prefer>
<family>Tahoma</family>
<family>Verdana</family>
<family>Nimbus Sans L</family>
<family>Luxi Sans</family>
<family>Arial</family>
<family>Helvetica</family>
<family>SimSun</family>
<family>Kochi Gothic</family>
<family>AR PL KaitiM GB</family>
<family>AR PL KaitiM Big5</family>
<family>Baekmuk Dotum</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>SimSun</family>
<family>Andale Mono</family>
<family>Courier New</family>
<family>Luxi Mono</family>
<family>Nimbus Mono L</family>
<family>NSimSun</family>
<family>Kochi Gothic</family>
<family>AR PL KaitiM GB</family>
<family>Baekmuk Dotum</family>
</prefer>
</alias>
<!--
Artificial oblique for fonts without an italic or oblique version
-->

<match target="font">
<!-- check to see if the font is roman -->
<test name="slant">
<const>roman</const>
</test>
<!-- check to see if the pattern requested non-roman -->
<test target="pattern" name="slant" compare="not_eq">
<const>roman</const>
</test>
<!-- multiply the matrix to slant the font -->
<edit name="matrix" mode="assign">
<times>
<name>matrix</name>
<matrix><double>1</double><double>.2</double>
<double>0</double><double>1</double>
</matrix>
</times>
</edit>
<!-- pretend the font is oblique now -->
<edit name="slant" mode="assign">
<const>oblique</const>
</edit>
</match>
<!--
This expression is added by Akito Hirai<[email protected]> for convenience.
It can be used to make artificial bold versions in client libraries/applications.
-->
<match target="font">
<test name="weight">
<const>medium</const>
</test>
<test target="pattern" name="weight" compare="more">
<const>medium</const>
</test>
<edit name="weight" mode="assign">
<if>
<more>
<name>spacing</name>
<const>proportional</const>
</more>
<const>demibold</const> <!-- for monospace -->
<const>bold</const> <!-- for proportional -->
</if>
</edit>
</match>

<match target="font">
<test name="pixelsize" compare="less_eq">
<double>16</double>
</test>
<test name="pixelsize" compare="more_eq">
<double>8</double>
</test>
<edit name="antialias" mode="assign">
<bool>f</bool>
</edit>
</match>
<match target="font">
<test name="size" compare="less_eq">
<double>16</double>
</test>
<test name="size" compare="more_eq">
<double>8</double>
</test>

<edit name="antialias" mode="assign">
<bool>f</bool>
</edit>
</match>

<config>
<!--
These are the default Unicode chars that are expected to be blank
in fonts. All other blank chars are assumed to be broken and
won't appear in the resulting charsets
-->
<blank>
<int>0x0020</int> <!-- SPACE -->
<int>0x00a0</int> <!-- NO-BREAK SPACE -->
<int>0x00ad</int> <!-- SOFT HYPHEN -->
<int>0x115f</int> <!-- HANGUL CHOSEONG FILLER -->
<int>0x1160</int> <!-- HANGUL JUNGSEONG FILLER -->
<int>0x1680</int> <!-- OGHAM SPACE MARK -->
<int>0x2000</int> <!-- EN QUAD -->
<int>0x2001</int> <!-- EM QUAD -->
<int>0x2002</int> <!-- EN SPACE -->
<int>0x2003</int> <!-- EM SPACE -->
<int>0x2004</int> <!-- THREE-PER-EM SPACE -->
<int>0x2005</int> <!-- FOUR-PER-EM SPACE -->
<int>0x2006</int> <!-- SIX-PER-EM SPACE -->
<int>0x2007</int> <!-- FIGURE SPACE -->
<int>0x2008</int> <!-- PUNCTUATION SPACE -->
<int>0x2009</int> <!-- THIN SPACE -->
<int>0x200a</int> <!-- HAIR SPACE -->
<int>0x200b</int> <!-- ZERO WIDTH SPACE -->
<int>0x200c</int> <!-- ZERO WIDTH NON-JOINER -->
<int>0x200d</int> <!-- ZERO WIDTH JOINER -->
<int>0x200e</int> <!-- LEFT-TO-RIGHT MARK -->
<int>0x200f</int> <!-- RIGHT-TO-LEFT MARK -->
<int>0x2028</int> <!-- LINE SEPARATOR -->
<int>0x2029</int> <!-- PARAGRAPH SEPARATOR -->
<int>0x202a</int> <!-- LEFT-TO-RIGHT EMBEDDING -->
<int>0x202b</int> <!-- RIGHT-TO-LEFT EMBEDDING -->
<int>0x202c</int> <!-- POP DIRECTIONAL FORMATTING -->
<int>0x202d</int> <!-- LEFT-TO-RIGHT OVERRIDE -->
<int>0x202e</int> <!-- RIGHT-TO-LEFT OVERRIDE -->
<int>0x202f</int> <!-- NARROW NO-BREAK SPACE -->
<int>0x205f</int> <!-- MEDIUM MATHEMATICAL SPACE -->
<int>0x2060</int> <!-- WORD JOINER -->
<int>0x2061</int> <!-- FUNCTION APPLICATION -->
<int>0x2062</int> <!-- INVISIBLE TIMES -->
<int>0x2063</int> <!-- INVISIBLE SEPARATOR -->
<int>0x206A</int> <!-- INHIBIT SYMMETRIC SWAPPING -->
<int>0x206B</int> <!-- ACTIVATE SYMMETRIC SWAPPING -->
<int>0x206C</int> <!-- INHIBIT ARABIC FORM SHAPING -->
<int>0x206D</int> <!-- ACTIVATE ARABIC FORM SHAPING -->
<int>0x206E</int> <!-- NATIONAL DIGIT SHAPES -->
<int>0x206F</int> <!-- NOMINAL DIGIT SHAPES -->
<int>0x3000</int> <!-- IDEOGRAPHIC SPACE -->
<int>0x3164</int> <!-- HANGUL FILLER -->
<int>0xfeff</int> <!-- ZERO WIDTH NO-BREAK SPACE -->
<int>0xffa0</int> <!-- HALFWIDTH HANGUL FILLER -->
<int>0xfff9</int> <!-- INTERLINEAR ANNOTATION ANCHOR -->
<int>0xfffa</int> <!-- INTERLINEAR ANNOTATION SEPARATOR -->
<int>0xfffa</int> <!-- INTERLINEAR ANNOTATION TERMINATOR -->
</blank>
<!--
Rescan configuration every 30 seconds when FcFontSetList is called
-->
<rescan>
<int>30</int>
</rescan>
</config>



</fontconfig>

当然也可以把这个文件放在自己的主目录底下。

然后安装中文输入法,我比较喜欢fcitx,在ports/chinese/底下,安装之后,修改.xinitrc成为如下:
LC_ALL=zh_CN.eucCN
LANG=zh_CN.eucCN
LC_CTYPE=zh_CN.eucCN
export LC_ALL LANG LC_TYPE
export XMODIFIERS='@im=fcitx'
export XIM=fcitx
export XIM_PROGRAM=fcitx
fcitx&

然后ports/x11-wm/windowmaker底下make windowmaker,
在.xinitrc中加入这样的语句以启动windowmaker
exec /usr/X11R6/bin/wmaker

这样就可以显示中文,输入中文了。如果喜欢什么桌面,就到ports里面去安装,本人选择试用了两种:windowmaker,IceWM.觉得都可以的,小巧,比较简单。

下面安装terminal下面的中文输入的zhcon和cce,由于zhcon会出现花屏,我现在选择的是比较简单的cce.直接在ports里面  make就可以了。在从ports安装软件的时候,最好修改一下/etc/make.conf,以便能从最近的ftp下载软件。在文件的最后加上类似的配置:
MASTER_SITE_BACKUP?= \
ftp://ftp.tsinghua.edu.cn/mirror/FreeBSD/distfiles/${DIST_SUBDIR}/\
ftp://ftp.freebsd.org.cn/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}/ \
ftp://ftp.freebsdchina.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}/
MASTER_SITE_OVERRIDE?= ${MASTER_SITE_BACKUP}
这样就可以比较快的下载文件了。
顺便说一下,为了更好的显示中文,make.conf最好加上:
WITH_CJK=yes


如果这些ftp上面还没有的话,那就需要配置理了,这样配置:
FETCH_ENV=FTP_PROXY=ftp://202.102.103.105:80
FETCH_ENV=HTTP_PROXY=http://202.102.103.105:80


到现在,一个最基本的中文FreeBSD桌面系统就安装好了。现在一般的中文显示应该没有问题了,但是一些GTK的程序可能不能正常显示中文,这时可以到  ports/x11/gtk2-theme-switch下make gtk2-theme-switch,然后在x window 底下执行gtk2 -theme-switch,然后选择相关的选项就可以在自己的主目录底下产生相关的配置文件,一般的gtk程序都可以正常使用了。


下面再安装一些相关的应用软件。
Office
=============================
StarSuite7,直接到ports/editors/staroffice70底下make就可以了,不过这个需要在x window安张的。
这样配合emacs,gvim就可以完成绝大部分的文档编辑工作,当然gvim完全支持中文还需要一定的配置
==============================
Multi&&Pictures
===============================

Gimp,XV,gqview
直接到ports下面安装就可以了。
Xmms,Mplayer,mpg123
直接在ports下面安装,一些配置可以在选项里面修改。这里需要驱动声卡,相关的方法在文后编译内核的部分。

================================

Internet
================================

Mozilla
可以在安装系统的时候选择安装。虽然ports里面提供了firefox,但是有很多的bug,试用起来很是不爽,因此只使用Mozilla就可以了,也许将来有更好的浏览软件,再使用吧。
Gaim&&QQ
实际上,我主要是为了安装QQ才安装Gaim的,但是ports里面提供的Gaim还不能使用QQ,需要使用ports底下的gaim-openq,当然还有一些别的qq软件,比如LumaQQ,evaq等,自己选择好了。
Gftp
=====================================
至此一个基本的系统配置成功了,可以完成大部分的工作。剩下的ruhe配置,就是一些优化的问题了,有了成功的经验之后也要写入的。


第三、配置内核等等

首先配置/etc/rc.conf
去掉不需要的服务。

内核的配置handbook有非常详细的说明,这里不说了。打这么多字,都快累死了,这篇文档是在gvim下完成的,恩,觉得gvim非常不错。


=======================================


目前来看,大体只有这些了,想起来更多在修改。
需要声明的是,本人参考了网上的一些材料,这里不一一列出了,感谢网上所有热心的朋友。FreeBSD的中文化还有很多的工作要作,有心人一起努力吧!!
各位有什么指教的话,给我email吧:[email protected]
欢迎到我的blog看看:http:// leehsin.wordpress.com/tag/FreeBSD,正在建设中,希望大家给意见:_)


==========================================

写完之后,发现有些东西需要补充,、但是这几天太忙了,有空了再好好整理一下。希望大家也多补充。
--
--

※ 来源:·水木社区 http://newsmth.net·[FROM: 218.57.243.*]
发表于 2005-11-7 12:15:40 | 显示全部楼层
嚴重支持!!!!
回复

使用道具 举报

发表于 2005-11-7 14:55:44 | 显示全部楼层
zh_CN.eucCN 。。。
个人感觉啊,在5。4及以上版本里,用GBK的效果更好些
回复

使用道具 举报

 楼主| 发表于 2005-11-8 01:10:36 | 显示全部楼层
我用UTF-8,可惜这个locale对ntfs分区上的中文支持的不够好
回复

使用道具 举报

发表于 2005-11-8 03:17:29 | 显示全部楼层
UTF8?!够强
回复

使用道具 举报

 楼主| 发表于 2005-11-10 11:56:57 | 显示全部楼层
不就是个utf8嘛,大惊小怪
回复

使用道具 举报

发表于 2005-11-10 12:15:52 | 显示全部楼层
怎么不大惊小怪呵,BSD对UTF8的支持好象挺差的
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-9-24 01:23 , Processed in 0.166145 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表