【linux】Debian10.8安装中文输入法-搜狗输入法

1. 系统自带输入法

系统默认使用fcitx输入法平台(即小企鹅输入法),自带有sunpinyin、google输入法,短小精悍、程序的兼容性好

经测试,系统安装后,输入法默认是英文键盘,无法切换到中文输入法

2. 相关命令与设置

2.1 输入法配置

系统自带了几个输入法平台:fcitx、ibus,uim,输入下面命令可进行查看和配置,可看到正常的自动选择为fcitx,使其保持默认即可,无需更改

im-config

2.2 fcitx设置

可以在终端里执行

fcitx-config-gtk3

或者在活动-显示应用程序里打开如下所示应用程序

 注意:不要登录root进行配置,使用普通用户身份登录系统进行配置

打开配置如下,默认有键盘、Sunpinyin、Google拼音、五笔字型

 随便双击打开一个,例如Google拼音,发现是没有内容的,说明是不可用的

点击全局配置,可以看到激活/非激活输入法的快捷键为ctrl+space,输入法切换则为ctrl+shift,正常默认配置下,开机启动后使用的是默认的键盘,即输入英文,不使用其他输入法,想要启动输入法,需要按下ctrl+space,然后可以再使用ctrl+shift进行输入法之间的切换

 2.3 中文支持

如果安装时选择的不是中文,则需要设置中文支持,使用root身份执行

dpkg-reconfigure locales

使用空格键选择zh_CN.UTF-8 UTF-8(还可以连同上面的几个中文都选择),然后tab切换确认更改设置

 3. 搜狗输入法

网上安装最多的就是搜狗输入法,所以我们打算安装搜狗输入法

3.1 搜狗输入法下载

官方下载链接:搜狗输入法 for linux

本文中下载的版本为:sogoupinyin_2.4.0.3469_amd64.deb

3.2 搜狗输入法安装

搜狗输入法有简单的安装指南,对于安装过程中提示缺少依赖,使用apt -f install来解决

 本文环境是在本地iso镜像源的环境中安装,执行以下命令,重启设备

dpkg -i sogoupinyin_2.4.0.3469_amd64.deb
apt -f install  -y
dpkg -i sogoupinyin_2.4.0.3469_amd64.deb

 搜狗输入法可以使用了,快乐的玩耍了一会儿

但是,只要使用apt命令就会报错,提示需要使用apt-get --fix-broken install来解决,执行后,提示将要卸载sogoupinyin,,,这不就扯淡了么

3.3 搜狗输入法安装-正确版本

3.3.1 查看需要哪些依赖库

dpkg -I sogoupinyin_2.4.0.3469_amd64.deb
新格式的 Debian 软件包,格式版本 2.0。
 大小 104827946 字节:主控包=12225 字节。
     121 字节,    3 行      conffiles
    1220 字节,   19 行      control
   94240 字节,  773 行      md5sums
 Package: sogoupinyin
 Version: 2.4.0.3469
 Architecture: amd64
 Maintainer: Ubuntu Kylin Team <ubuntukylin-members@lists.launchpad.net>
 Installed-Size: 237702
 Depends: fcitx (>= 1:4.2.8), fcitx-frontend-gtk2, fcitx-frontend-gtk3, fcitx-frontend-qt5, fcitx-module-kimpanel, fcitx-module-x11, libxtst6, im-config,lsb-release, fcitx-libs | libfcitx-config4, fcitx-libs | libfcitx-qt0, fcitx-libs | libfcitx-utils0, fcitx-ui-classic, libqt5svg5, libqt5qml5, libqt5gui5, libqt5dbus5, libqt5quick5, libqt5core5a, libqt5network5, libqt5quickwidgets5, qml-module-qtquick2
 Recommends: fonts-droid | fonts-droid-fallback
 Breaks: fcitx-ui-qimpanel
 Section: utils
 Priority: optional
 Homepage: http://pinyin.sogou.com/linux
 Description: Business Sogou Input Method
  Based on web search engine technology, Sogou Pinyin input method is
  the next-generation input method designed for Internet users. As it
  is backed with search engine technology, user input method can be
  extremely fast, and it is much more advanced than other input method
  engines in terms of the volume of the vocabulary database and its
  accuracy. Sogou input method is the most popular input methods in
  China, and Sogou promises it will always be free of charge.

 依赖包取出来:

fcitx (>= 1:4.2.8), fcitx-frontend-gtk2, fcitx-frontend-gtk3, fcitx-frontend-qt5, fcitx-module-kimpanel, fcitx-module-x11, libxtst6, im-config,lsb-release, fcitx-libs | libfcitx-config4, fcitx-libs | libfcitx-qt0, fcitx-libs | libfcitx-utils0, fcitx-ui-classic, libqt5svg5, libqt5qml5, libqt5gui5, libqt5dbus5, libqt5quick5, libqt5core5a, libqt5network5, libqt5quickwidgets5, qml-module-qtquick2

 3.3.2 依次尝试安装,看哪些包缺少

apt-get install xxx

 测试结果:

fcitx-frontend-gtk2

fcitx-frontend-gtk3

fcitx-frontend-qt5

libqt5quickwidgets5

qml-module-qtquick2

这5个包是可以安装的,安装上即可

fcitx-module-x11

fcitx-ui-classic

fcitx-module-kimpanel

libfcitx-qt0

这4个包是不存在的

不存在的包怎么办???

答案是网上下载!!!自己动手安装,下面是推荐网站:

阿里巴巴开源镜像站-阿里云官网开发者社区_云计算社区

 分别下载了下面4个包:版本不要太高,这几个包经过测试是可以安装的,4.2.9.8的包无法安装

fcitx-module-x11_4.2.9.1-6_amd64.deb

libfcitx-qt0_4.2.9.6-5+deb10u1_amd64.deb

fcitx-ui-classic_4.2.9.1-6_amd64.deb

 fcitx-module-kimpanel_4.2.9.1-6_amd64.deb

依次安装,注意先安装fcitx-module-x11,再安装fcitx-ui-classic

dpkg -i fcitx-module-x11_4.2.9.1-6_amd64.deb
dpkg -i fcitx-ui-classic_4.2.9.1-6_amd64.deb
dpkg -i fcitx-module-kimpanel_4.2.9.1-6_amd64.deb
dpkg -i libfcitx-qt0_4.2.9.6-5+deb10u1_amd64.deb

 在安装libfcitx-qt0的时候发现报错,需要安装依赖包:

libqt4-dbus、libqtcore4、libqtgui4,使用apt-get 安装即可,再执行安装libfcitx-qt0

apt-get install libqt4-dbus libqtcore4 libqtgui4

3.3.3  安装搜狗输入法

此时,不出大问题,再安装搜狗输入法程序即可正确安装,(出了问题再解决即是!!!)

dpkg -i sogoupinyin_2.4.0.3469_amd64.deb

 安装后重启

4. 使用搜狗输入法

4.1 配置输入法

按照2.2 打开fcitx配置,可设置搜狗输入法的顺序,也可将其他输入法都删掉,只保留键盘和搜狗输入法,或者干脆点,把键盘那个也删掉,只保留搜狗输入法,这样开机之后启用的就是搜狗输入法

4.2 激活输入法

如果保留了键盘那一行,并且在最上面,则默认不启用输入法,输入为英文,需要激活才能使用中文输入法,快捷键:Ctrl+space

4.3 切换输入法

在输入法激活的情况下,快捷键:Ctrl+shift,可切换输入法

5. 安装脚本

以下是安装脚本,删除了sunpinyin

#!/bin/bash

# 卸载sunpinyin
sunpinyin_lists="
fcitx-sunpinyin
libsunpinyin3v5
sunpinyin-data
"
for i in ${sunpinyin_lists}
do
    dpkg -r $i
done
unset i

# apt安装依赖包
install_lists="
fcitx-frontend-gtk2
fcitx-frontend-gtk3
fcitx-frontend-qt5
libqt5quickwidgets5
qml-module-qtquick2
libqt4-dbus
libqtcore4
libqtgui4
"

for i in ${install_lists}
do
    apt-get install -y $i
done
unset i

# 本地安装依赖包
deb_lists="
fcitx-module-x11_4.2.9.1-6_amd64.deb
fcitx-ui-classic_4.2.9.1-6_amd64.deb
fcitx-module-kimpanel_4.2.9.1-6_amd64.deb
libfcitx-qt0_4.2.9.6-5+deb10u1_amd64.deb
"
for i in ${deb_lists}
do
    dpkg -i $i
done
unset i

# 安装输入法
dpkg -i sogoupinyin_2.4.0.3469_amd64.deb

附:相关软件包百度云链接

链接:https://pan.baidu.com/s/1jDUALy6E3X04ugJArOk51w 
提取码:4p6c

  • 6
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值