一、更換為國內的軟件源
安裝搜狗輸入法之前請先更換為國內的軟件源,否則無法解決依賴問題。首先,用以下命令打開源列表:
sudo gedit /etc/apt/sources.list #用文本編輯器打開源列表
在文件開頭添加下面的阿里雲的軟件源:
deb http://mirrors.aliyun.com/ubuntu/ quantal main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ quantal-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ quantal-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ quantal-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ quantal-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ quantal main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ quantal-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ quantal-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ quantal-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ quantal-backports main restricted universe multiverse
或者加上清華的軟件源:
# 默認注釋了源碼鏡像以提高 apt update 速度,如有需要可自行取消注釋 deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse # 預發布軟件源,不建議啟用 # deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
然后輸入以下命令,更新軟件源:
sudo apt-get update
二、安裝sogou輸入法
1、首先到搜狗輸入法官網下載搜狗輸入法, 搜狗輸入法Linux版下載地址:http://pinyin.sogou.com/linux/?r=pinyin ,下載的是個deb文件。文件默認下載在當前用戶的下載目錄下,如下所示:
heyun@heyun-Alienware-15-R3:~/下載$ ls sogoupinyin_2.2.0.0102_amd64.deb heyun@heyun-Alienware-15-R3:~/下載$ pwd /home/heyun/下載
2、進入到下載目錄下,接着,在Ubuntu 16.04安裝搜狗輸入法命令如下:
sudo apt-get install -f sudo dpkg -i sogoupinyin_2.0.0.0072_amd64.deb # deb文件名,要和自己下載的版本一致。
3、安裝完畢,設置語言選項
到系統設置->語言支持(System->Language Support),將鍵盤輸入法系統由默認的iBus設置為fcitx。如下圖:
操作此步驟時,如果沒有出現fcitx選項,說明你的機器還需要安裝fcitx鍵盤輸入法系統,直接看第二部分fcitx的安裝。
4、注銷,重新登陸。
三、安裝fcitx鍵盤輸入法系統
sogou是基於fcitx的,而系統默認的鍵盤輸入法系統是iBus。Ubuntu 16.04默認是帶有fcitx的,正常安裝,如果有的話,按上面步驟即可完成;但有些版本的Ubuntu,需要自己安裝 fcitx,才能安裝使用sogou。
1、添加以下源
sudo add-apt-repository ppa:fcitx-team/nightly
2、更新系統:sudo apt-get update
3、安裝fcitx:sudo apt-get install fcitx
4、安裝fcitx的配置工具:sudo apt-get install fcitx-config-gtk
5、安裝fcitx的table-all軟件包:sudo apt-get install fcitx-table-all
6、安裝im-switch切換工具:sudo apt-get install im-switch
至此,fcitx鍵盤輸入法系統就安裝好了。第5,6步需要按鍵“Y”確認安裝。簡單測試的方法就是在終端鍵入“fcitx”,有各種提示就對了。
安裝完fcitx后,再安裝sogou即可。
--------------------------------------------------------------------
轉載自:http://blog.csdn.net/ljheee/article/details/52966456