Tag Archives: fcitx

Debian Squeeze安装输入法并配置中文环境

fcitx是linux下挺好用的一款中文输入法,词库比较丰富。

1.添加fcitx的源

debian squeeze很保守,因此很稳定,但是这也是源内的软件包版本比较低的原因,所以fcitx没有进debian squeeze,进了testing版本,需要添加下面这行到你的/etc/apt/sources.list:
deb http://download.opensuse.org/repositories/home:hillwood/Debian_6.0/ /

然后:

sudo apt-get update
sudo apt-get install fcitx

新建文件/etc/X11/Xsession.d/95xinput,并把下面这些内容写到里面去:

export XIM=fcitx
export XIM_ARGS="-d"
export XIM_PROGRAM=fcitx
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export LANG="en_US.UTF-8"
export LC_CTYPE="zh_CN.UTF-8"
export XMODIFIERS="@im=fcitx"
fcitx &

如果apt-get update出现以下没有public key的错误:

W: GPG error: http://download.opensuse.org  Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4EE56CE7EBCA0CF4

请加入key:

wget -q http://download.opensuse.org/repositories/home:/hillwood/Debian_6.0/Release.key -O -|apt-key add -

2.设置系统的locale

2.1 什么是locale?

来自wiki pedia:
In computing, a locale is a set of parameters that defines the user’s language, country and any special variant preferences that the user wants to see in their user interface. Usually a locale identifier consists of at least a language identifier and a region identifier. On POSIX platforms such as Unix, Linux and others, locale identifiers are defined similar to the BCP 47 definition of language tags, but the locale variant modifier is defined differently, and the character set is included as a part of the identifier. It is defined in this format: [language[_territory][.codeset][@modifier]]. (For example, Australian English using the UTF-8 encoding is en_AU.UTF-8.)

简而言之,就是系统的字符集。

2.2 配置

sudo apt-get install locales
sudo dpkg-reconfigure locales

选择英语,简体中文和繁体中文的locale:

en_US.ISO-8859-1
en_US.UTF-8
zh_CN.GB2312
zh_CN.GB18030
zh_CN.UTF-8
zh_CN.GBK
zh_TW.BIG5
zh_TW.UTF-8

我缺省locale选择的是英文的en_US.UTF-8,这样系统的默认语言是英文,如果不习惯,请选择zh_CN.UTF-8。

3.安装中文字体

sudo apt-get install ttf-arphic-ukai ttf-arphic-uming xfonts-wqy ttf-bitstream-vera ttf-mscorefonts-installer ttf-wqy-zenhei ttf-wqy-microhei

文泉译的字体挺好看,如果你不喜欢,可以寻找更好看的字体。

4.后记

debian官方中的fcitx包不是很好用,从源代码安装也显得异常麻烦,从debian 6 squeeze升级到debian 7 wheezy之后,fcitx也无法正常工作,出现类似dbus connection error等错误;因此比较推荐从opensuse的这个源安装fcitx。 如果fcitx出现无法启动的其他错误,建议用dpkg –list找到相关软件,然后用apt-get remove删除,然后再重新apt-get install fcitx安装。

5.参考文献