在Ubuntu下安装谷歌输入法

2011-11-10 11:58


注:本文仅适用于采用ibus输入法框架的情况

检查系统上是否已经安装了cmake,gcc,cpp,g++软件包,没有的话则运行下述命令进行安装。

# sudo apt-get insall cmake,gcc,cpp,g++

下载并解压libgooglepinyin,ibus-googlepinyin。下载页面在这里: 

http://code.google.com/p/libgooglepinyin/downloads/list

先安装libgooglepinyin,在shell中执行下述各行命令

# cd libgooglepinyin
# mkdir build; cd build
# cmake .. -DCMAKE_INSTALL_PREFIX=/usr
# make
# sudo make install

再安装ibus-googlepinyin,在shell中执行下述各行命令

# cd ibus-googlepinyin
# mkdir build; cd build
# cmake .. -DCMAKE_INSTALL_PREFIX=/usr
# make
# sudo make install

特别需要注意的是,如果没有安装g++,在执行cmake的过程中,是可能报如下异常的。

CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.

重新启动ibus输入法,右击任务栏上的输入法图标->重新启动即可。也可以输入下述命令重启。

# pkill -f ibus-daemon ; ibus-daemon -d -x

在ibus中选择谷歌输入法

右击任务栏上的输入法图标->首选项->选择输入法页签->点击选择输入法下拉列表(依次选择汉语、googlepinyin)->添加->关闭

VIA http://www.linuxde.net/2011/11/1686.html