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, 请大家彼此周知该情况。

相关文章

  • 详解Apache配置多个监听端口和不同的网站目录

    详解Apache配置多个监听端口和不同的网站目录

    这篇文章主要介绍了详解Apache配置多个监听端口和不同的网站目录的相关资料,希望通过本文能帮助到大家,让大家实现这样的方法,需要的朋友可以参考下
    2017-10-10
  • linux下如何切割大文件

    linux下如何切割大文件

    这篇文章主要介绍了linux下如何切割大文件问题,具有很好的参考价值,希望对大家有所帮助。如有错误或未考虑完全的地方,望不吝赐教
    2023-06-06
  • Linux命令行上如何使用日历详解

    Linux命令行上如何使用日历详解

    这篇文章主要给大家介绍了Linux命令行上如何使用日历的相关资料,文中通过示例代码介绍的非常详细,对大家学习或者使用linux具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧。
    2018-04-04
  • Linux内存管理和寻址详细介绍

    Linux内存管理和寻址详细介绍

    大家好,本篇文章主要讲的是Linux内存管理和寻址详细介绍,感兴趣的同学赶快来看一看吧,对你有帮助的话记得收藏一下,方便下次浏览
    2021-12-12
  • linux apache泛域名解析及dns相关

    linux apache泛域名解析及dns相关

    apache泛域名解析及dns相关,供大家学习参考
    2013-02-02
  • 无法启动Apache的问题解决方法

    无法启动Apache的问题解决方法

    这篇文章主要介绍了无法启动Apache的问题解决方法,需要的朋友可以参考下
    2014-05-05
  • CentOS7挂载新数据盘的完整步骤

    CentOS7挂载新数据盘的完整步骤

    这篇文章主要给大家介绍了关于CentOS7挂载新数据盘的完整步骤,文中通过示例代码将实现的步骤介绍的非常详细,对大家学习或者使用CentOS7具有一定的参考学习价值,需要的朋友们下面来一起学习学习吧
    2019-06-06
  • Linux多线程使用互斥量同步线程

    Linux多线程使用互斥量同步线程

    本文主要介绍了Linux多线程使用互斥量同步线程,详细介绍了互斥量的使用,有需要的可以了解一下。
    2016-10-10
  • linux操作系统原理 linux系统基础教程

    linux操作系统原理 linux系统基础教程

    很多对linux操作系统有兴趣的朋友想有一个深入的学习,本篇文章给大家详细讲解了linux操作系统的原理,希望能够对你有所帮助。
    2018-01-01
  • CentOS平台快速搭建LAMP环境的方法

    CentOS平台快速搭建LAMP环境的方法

    这篇文章主要介绍了CentOS平台快速搭建LAMP环境的方法,结合实例形式分析了CentOS服务器上搭建LAMP环境的步骤、相关命令与操作注意事项,需要的朋友可以参考下
    2019-05-05

最新评论