Ubuntu 16.04安装搜狗拼音输入法错误问题的解决方法

 更新时间:2016年11月16日 11:10:05   作者:bladestone  
目前来说搜狗输入法是市场上最为好用和流行的输入法,最为良心的是还有Linux版本,这让众多Linux人士欢呼雀跃。最近在新出的Ubuntu 16.04上安装sogou输入法的时候,碰到了一些问题,主要还是依赖包没有正确安装,下面让我们一起来看如何来解决这个问题。

一、环境介绍

   Ubuntu 16.04

   搜狗输入法: sogoupinyin_2.0.0.0078_amd64

二、问题表现

sudo dpkg -i sogoupinyin_2.0.0.0078_amd64.deb 

错误信息如下:

sogoupinyin : Depends: libopencc2 but it is not installable or 
libopencc1 but it is not going to be installed 
Depends: fcitx-libs (>= 4.2.7) but it is not going to be installed 
Depends: fcitx-libs-qt (>= 4.2.7) but it is not going to be installed 
Recommends: fonts-droid-fallback but it is not going to be installed or 
fonts-droid but it is not installable 
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution). 

一看就知道是依赖包存在问题

三、问题分析

之前在Ubuntu 15.10的版本之时,使用同样的sogou版本,不存在此类的问题。 但是在Ubuntu 16.04中,却存在此类问题,说明Ubuntu升级之后,sogou输入法并未做相应的系统兼容性测试, 故起最高的Ubuntu支持版本时15.10.

虽然我们知道了问题,但是该如何解决呢?

基于错误信息,我们发现起依赖包有以下几个: libopencc1 libopencc2,  fcitx-libs, fcitx-libs-qt  font-droid-fallback.  

四、试错分析

试错1:

bladestone@bladestone-laptop:~$ sudo apt install fcitx-libs 
Reading package lists... Done 
Building dependency tree     
Reading state information... Done 
You might want to run 'apt-get -f install' to correct these: 
The following packages have unmet dependencies: 
 sogoupinyin : Depends: libopencc2 but it is not installable or 
            libopencc1 but it is not going to be installed 
        Depends: fcitx-libs-qt (>= 4.2.7) but it is not going to be installed 
        Recommends: fonts-droid-fallback but it is not going to be installed or 
              fonts-droid but it is not installable 
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution). 

试错2:   

bladestone@bladestone-laptop:~$ sudo apt install fcitx-libs-qt 
Reading package lists... Done 
Building dependency tree     
Reading state information... Done 
You might want to run 'apt-get -f install' to correct these: 
The following packages have unmet dependencies: 
 sogoupinyin : Depends: libopencc2 but it is not installable or 
            libopencc1 but it is not going to be installed 
        Depends: fcitx-libs (>= 4.2.7) but it is not going to be installed 
        Recommends: fonts-droid-fallback but it is not going to be installed or 
              fonts-droid but it is not installable 
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution). 

试错3:

bladestone@bladestone-laptop:~$ sudo apt install fcitx-libs-qt fcitx-libs 
Reading package lists... Done 
Building dependency tree     
Reading state information... Done 
You might want to run 'apt-get -f install' to correct these: 
The following packages have unmet dependencies: 
 sogoupinyin : Depends: libopencc2 but it is not installable or 
            libopencc1 but it is not going to be installed 
        Recommends: fonts-droid-fallback but it is not going to be installed or 
              fonts-droid but it is not installable 
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

试错4:

bladestone@bladestone-laptop:~$ sudo apt install fonts-droid-fallback 
Reading package lists... Done 
Building dependency tree     
Reading state information... Done 
You might want to run 'apt-get -f install' to correct these: 
The following packages have unmet dependencies: 
 sogoupinyin : Depends: libopencc2 but it is not installable or 
            libopencc1 but it is not going to be installed 
        Depends: fcitx-libs (>= 4.2.7) but it is not going to be installed 
        Depends: fcitx-libs-qt (>= 4.2.7) but it is not going to be installed 
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution). 

试错5:

bladestone@bladestone-laptop:~$ sudo apt install libopencc1 
Reading package lists... Done 
Building dependency tree     
Reading state information... Done 
You might want to run 'apt-get -f install' to correct these: 
The following packages have unmet dependencies: 
 sogoupinyin : Depends: fcitx-libs (>= 4.2.7) but it is not going to be installed 
        Depends: fcitx-libs-qt (>= 4.2.7) but it is not going to be installed 
        Recommends: fonts-droid-fallback but it is not going to be installed or 
              fonts-droid but it is not installable 
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution). 

分析: 经过各种尝试,发现依然无法正常解决问题,类库包之间的依赖关系还是非常复杂的。

五、问题解决

5.1 移除sogou输入法, 由于其安装不完整

sudo apt remove sogoupinyin 

执行过程:

Reading package lists... Done 
Building dependency tree     
Reading state information... Done 
The following packages will be REMOVED: 
 sogoupinyin 
0 upgraded, 0 newly installed, 1 to remove and 43 not upgraded. 
1 not fully installed or removed. 
After this operation, 42.6 MB disk space will be freed. 
Do you want to continue? [Y/n] y 
(Reading database ... 214444 files and directories currently installed.) 
Removing sogoupinyin (2.0.0.0078) ... 
Processing triggers for libglib2.0-0:amd64 (2.48.1-1~ubuntu16.04.1) ... 
Processing triggers for hicolor-icon-theme (0.15-0ubuntu1) ... 
Processing triggers for shared-mime-info (1.5-2ubuntu0.1) ... 
Processing triggers for bamfdaemon (0.5.3~bzr0+16.04.20160523-0ubuntu1) ... 
Rebuilding /usr/share/applications/bamf-2.index... 
Processing triggers for gnome-menus (3.13.3-6ubuntu3) ... 
Processing triggers for desktop-file-utils (0.22-1ubuntu5) ... 
Processing triggers for mime-support (3.59ubuntu1) ... 

5.2 正确的包安装姿势

sudo apt install libopencc1 fcitx-libs fcitx-libs-qt fonts-droid-fallback 

5.3 重新安装sogou输入法

sudo dpkg -i sogoupinyin_2.0.0.0078_amd64.deb

结果 一切顺利,没有报类似的错误信息

总结

安装依赖需要一次安装完成,切勿单个安装,主要是由于包之间彼此会有一定的依赖关系,这个是你无法准确定位的,故在 一次安装动作中做完。

另外需要注意的是: sogou输入法的Linux版本目前只兼容到Ubunut 15.10, 请大家彼此周知该情况。

相关文章

  • Linux 使用init命令实现关机,重启,切换模式

    Linux 使用init命令实现关机,重启,切换模式

    这篇文章主要介绍了Linux 使用init命令实现关机,重启,切换模式的相关资料,需要的朋友可以参考下
    2017-03-03
  • Centos 7下利用crontab定时执行任务详解

    Centos 7下利用crontab定时执行任务详解

    这篇文章主要给大家介绍了关于Centos 7下利用crontab定时执行任务的相关资料,文中对crontab进行了详细的介绍,并给出了一些实例代码供大家参考学习,需要的朋友们下面跟着小编一起来学习学习吧。
    2017-06-06
  • Linux服务器利用防火墙iptables策略进行端口跳转的方法

    Linux服务器利用防火墙iptables策略进行端口跳转的方法

    这篇文章主要介绍了Linux服务器利用防火墙iptables策略进行端口跳转的方法,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
    2019-10-10
  • Linux服务器被黑以后的详细处理步骤

    Linux服务器被黑以后的详细处理步骤

    作为一个Linux运维工程师,能够清晰地鉴别异常机器是否已经被入侵了显得至关重要,个人结合自己的工作经历,整理了几种常见的机器被黑情况供参考
    2018-01-01
  • Linux中shell解析脚本的通配符、元字符、转义符说明

    Linux中shell解析脚本的通配符、元字符、转义符说明

    这篇文章主要介绍了shell通配符、元字符、转义符以及shell解析脚本的过程,通配符用于路径扩展,元字符用于多命令分割,转义符用于将特殊字符变为普通字符,shell在解析脚本时会根据引号的不同进行不同的处理
    2025-01-01
  • 阿里云申请云盾免费SSL证书(https)

    阿里云申请云盾免费SSL证书(https)

    这篇文章主要介绍了阿里云申请云盾免费SSL证书(https),文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
    2020-07-07
  • 基于gentoo安装Nginx php mysql的方法

    基于gentoo安装Nginx php mysql的方法

    新买的VPS。在上面部署了nginx mysql php。需要的朋友可以参考下。
    2011-05-05
  • Linux进程地址空间详解

    Linux进程地址空间详解

    在C语言编程中,内存管理是一个重要的环节,本文详细解析了C语言中的内存区域划分,包括栈区、堆区、全局区等,并探讨了fork函数的遗留问题,即如何出现一个变量同时等于0又大于0的情况,此外,文章还深入讨论了进程地址空间的概念
    2024-10-10
  • 详解CentOS阿里云云服务器硬盘分区及挂载

    详解CentOS阿里云云服务器硬盘分区及挂载

    这篇文章主要介绍了详解CentOS阿里云云服务器硬盘分区及挂载 ,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
    2016-12-12
  • 如何使用Linux的rsync

    如何使用Linux的rsync

    rsync是linux系统下的数据镜像备份工具。使用快速增量备份工具Remote Sync可以远程同步,支持本地复制,或者与其他SSH、rsync主机同步
    2021-06-06

最新评论