Ubuntu 16.04下安装sogou 拼音输入法的错误问题

引言: sogou输入法是市场上最为好用和流行的输入法,最为良心的是还有Linux版本,这让我等Linux人士欢呼雀跃。在新出的Ubuntu 16.04上安装sogou输入法的时候,碰到了一些问题,主要还是依赖包没有正确安装,我们一起来看如何来解决这个问题。

1.  环境介绍

   Ubuntu 16.04,   sogou输入法: sogoupinyin_2.0.0.0078_amd64

2.  问题表现

[html]  view plain  copy
  1. sudo dpkg -i sogoupinyin_2.0.0.0078_amd64.deb  
   错误信息如下:
[html]  view plain  copy
  1. sogoupinyin : Depends: libopencc2 but it is not installable or  
  2. libopencc1 but it is not going to be installed  
  3. Depends: fcitx-libs (>= 4.2.7) but it is not going to be installed  
  4. Depends: fcitx-libs-qt (>= 4.2.7) but it is not going to be installed  
  5. Recommends: fonts-droid-fallback but it is not going to be installed or  
  6. fonts-droid but it is not installable  
  7. E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).  
一看就知道是依赖包存在问题

3.  问题分析

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

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

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

4.  试错分析

     试错1:

[html]  view plain  copy
  1. bladestone@bladestone-laptop:~$ sudo apt install fcitx-libs  
  2. Reading package lists... Done  
  3. Building dependency tree         
  4. Reading state information... Done  
  5. You might want to run 'apt-get -f install' to correct these:  
  6. The following packages have unmet dependencies:  
  7.  sogoupinyin : Depends: libopencc2 but it is not installable or  
  8.                         libopencc1 but it is not going to be installed  
  9.                Depends: fcitx-libs-qt (>= 4.2.7) but it is not going to be installed  
  10.                Recommends: fonts-droid-fallback but it is not going to be installed or  
  11.                            fonts-droid but it is not installable  
  12. E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).  
   试错2:    
[html]  view plain  copy
  1. bladestone@bladestone-laptop:~$ sudo apt install fcitx-libs-qt  
  2. Reading package lists... Done  
  3. Building dependency tree         
  4. Reading state information... Done  
  5. You might want to run 'apt-get -f install' to correct these:  
  6. The following packages have unmet dependencies:  
  7.  sogoupinyin : Depends: libopencc2 but it is not installable or  
  8.                         libopencc1 but it is not going to be installed  
  9.                Depends: fcitx-libs (>= 4.2.7) but it is not going to be installed  
  10.                Recommends: fonts-droid-fallback but it is not going to be installed or  
  11.                            fonts-droid but it is not installable  
  12. E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).  
   试错3:
[html]  view plain  copy
  1. bladestone@bladestone-laptop:~$ sudo apt install fcitx-libs-qt fcitx-libs  
  2. Reading package lists... Done  
  3. Building dependency tree         
  4. Reading state information... Done  
  5. You might want to run 'apt-get -f install' to correct these:  
  6. The following packages have unmet dependencies:  
  7.  sogoupinyin : Depends: libopencc2 but it is not installable or  
  8.                         libopencc1 but it is not going to be installed  
  9.                Recommends: fonts-droid-fallback but it is not going to be installed or  
  10.                            fonts-droid but it is not installable  
  11. E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).  
  试错4:

[html]  view plain  copy
  1. bladestone@bladestone-laptop:~$ sudo apt install fonts-droid-fallback  
  2. Reading package lists... Done  
  3. Building dependency tree         
  4. Reading state information... Done  
  5. You might want to run 'apt-get -f install' to correct these:  
  6. The following packages have unmet dependencies:  
  7.  sogoupinyin : Depends: libopencc2 but it is not installable or  
  8.                         libopencc1 but it is not going to be installed  
  9.                Depends: fcitx-libs (>= 4.2.7) but it is not going to be installed  
  10.                Depends: fcitx-libs-qt (>= 4.2.7) but it is not going to be installed  
  11. E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).  
  试错5:
[html]  view plain  copy
  1. bladestone@bladestone-laptop:~$ sudo apt install libopencc1  
  2. Reading package lists... Done  
  3. Building dependency tree         
  4. Reading state information... Done  
  5. You might want to run 'apt-get -f install' to correct these:  
  6. The following packages have unmet dependencies:  
  7.  sogoupinyin : Depends: fcitx-libs (>= 4.2.7) but it is not going to be installed  
  8.                Depends: fcitx-libs-qt (>= 4.2.7) but it is not going to be installed  
  9.                Recommends: fonts-droid-fallback but it is not going to be installed or  
  10.                            fonts-droid but it is not installable  
  11. E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).  
 分析: 经过各种尝试,发现依然无法正常解决问题,类库包之间的依赖关系还是非常复杂的。

5. 问题解决

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

[html]  view plain  copy
  1. sudo apt remove sogoupinyin  
  执行过程:
[html]  view plain  copy
  1. Reading package lists... Done  
  2. Building dependency tree         
  3. Reading state information... Done  
  4. The following packages will be REMOVED:  
  5.   sogoupinyin  
  6. 0 upgraded, 0 newly installed, 1 to remove and 43 not upgraded.  
  7. 1 not fully installed or removed.  
  8. After this operation, 42.6 MB disk space will be freed.  
  9. Do you want to continue? [Y/n] y  
  10. (Reading database ... 214444 files and directories currently installed.)  
  11. Removing sogoupinyin (2.0.0.0078) ...  
  12. Processing triggers for libglib2.0-0:amd64 (2.48.1-1~ubuntu16.04.1) ...  
  13. Processing triggers for hicolor-icon-theme (0.15-0ubuntu1) ...  
  14. Processing triggers for shared-mime-info (1.5-2ubuntu0.1) ...  
  15. Processing triggers for bamfdaemon (0.5.3~bzr0+16.04.20160523-0ubuntu1) ...  
  16. Rebuilding /usr/share/applications/bamf-2.index...  
  17. Processing triggers for gnome-menus (3.13.3-6ubuntu3) ...  
  18. Processing triggers for desktop-file-utils (0.22-1ubuntu5) ...  
  19. Processing triggers for mime-support (3.59ubuntu1) ...  
  5.2 正确的包安装姿势

[html]  view plain  copy
  1. sudo apt install libopencc1 fcitx-libs fcitx-libs-qt fonts-droid-fallback  
  5.3 重新安装sogou输入法
[html]  view plain  copy
  1. sudo dpkg -i sogoupinyin_2.0.0.0078_amd64.deb  
  结果 一切顺利,没有报类似的错误信息

6. 总结

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

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

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

0X码上链

你的鼓将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值