1. 程式人生 > >Debian下安裝Google、雲中文輸入法

Debian下安裝Google、雲中文輸入法

Debian下安裝Sougou、Google中文輸入法
第一步 安裝add-apt-repository
在ubuntu下安裝python-software-properties和software-properties-common之活,即可使用add-apt-repository。
在Debian下要麻煩一點:
1. 下載add-apt-repository指令碼:
$ wget http://blog.anantshri.info/content/uploads/2010/09/add-apt-repository.sh.txt


2. 將下載的指令碼儲存為/bin/add-apt-repository
$ cp add-apt-repository.sh.txt /bin/add-apt-repository


3. 修改/bin/add-apt-repository的執行許可權:
$ chmod o+x /bin/add-apt-repository


4. 修改/bin/add-apt-repository的擁有者為root
$chown root:root /bin/add-apt-repository


附指令碼內容:
File :add-apt-repository
#!/bin/bash
if [ $# -eq 1 ]
NM=`uname -a && date`
NAME=`echo $NM | md5sum | cut -f1 -d" "`
then
ppa_name=`echo "$1" | cut -d":" -f2 -s`
if [ -z "$ppa_name" ]
then
echo "PPA name not found"
echo "Utility to add PPA repositories in your debian machine"
echo "$0 ppa:user/ppa-name"
else
echo "$ppa_name"
echo "deb http://ppa.launchpad.net/$ppa_name/ubuntu lucid main" >> /etc/apt/sources.list
apt-get update >> /dev/null 2> /tmp/${NAME}_apt_add_key.txt
key=`cat /tmp/${NAME}_apt_add_key.txt | cut -d":" -f6 | cut -d" " -f3`
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys $key
rm -rf /tmp/${NAME}_apt_add_key.txt
fi
else
echo "Utility to add PPA repositories in your debian machine"
echo "$0 ppa:user/ppa-name"
fi


附add-apt-repository使用示例(安裝fcitx和雲輸入法):
sudo add-apt-repository ppa:fcitx-team/nightly
sudo apt-get update
sudo apt-get install fcitx
sudo apt-get install fcitx-module-cloudpinyin


第二步 安裝fcitx、輸入法(搜狗輸入法,Google輸入法,雲輸入法)、設定fcitx為預設
sudo apt-get install fcitx fcitx-config-gtk fcitx-sunpinyin fcitx-googlepinyin fcitx-module-cloudpinyin fcitx-sogoupinyin
sudo apt-get install fcitx-table-all
im-switch -s fcitx -z default


附fcitx配置工具
sudo apt-get install fcitx-config-gtk
開啟語言支援和輸入法切換,將輸入法設定成fcitx,登出
在終端輸入:
fcitx-config-gtk3


注意:完成之後可能需要重起!


附:經本人親測,在Debian6.04下,Sougou輸入法仍然顯示ficitx版本不對,其他的可以正確安裝和使用。