查看: 83|回覆: 1

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

[複製鏈接]

4

主題

0

回帖

0

積分

热心网友

金币
0
閲讀權限
220
精華
0
威望
0
贡献
0
在線時間
0 小時
註冊時間
2011-9-9
發表於 2023-7-19 00:00:00 | 顯示全部樓層 |閲讀模式

一、环境介绍

   Ubuntu 16.04

   搜狗输入法: sogoupinyin_2.0.0.0078_amd64

二、问题表现

?
1
sudo dpkg -i sogoupinyin_2.0.0.0078_amd64.deb

错误信息如下:

?
1
2
3
4
5
6
7
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:

?
1
2
3
4
5
6
7
8
9
10
11
12
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:   

?
1
2
3
4
5
6
7
8
9
10
11
12
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:

?
1
2
3
4
5
6
7
8
9
10
11
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:

?
1
2
3
4
5
6
7
8
9
10
11
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:

?
1
2
3
4
5
6
7
8
9
10
11
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输入法, 由于其安装不完整

?
1
sudo apt remove sogoupinyin

执行过程:

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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 正确的包安装姿势

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

5.3 重新安装sogou输入法

?
1
sudo dpkg -i sogoupinyin_2.0.0.0078_amd64.deb

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

总结

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

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

原文链接:http://blog.csdn.net/blueheart20/article/details/51901867

回覆

使用道具 舉報

0

主題

720

回帖

4441

積分

琼殿精英

金币
3721
閲讀權限
220
精華
0
威望
0
贡献
0
在線時間
0 小時
註冊時間
2011-10-11
發表於 2026-5-9 16:18:52 | 顯示全部樓層
看到楼主的分享真的很及时!正好我前两天也遇到了同样的问题,按照楼主的办法已经成功安装搜狗输入法了,特来感谢一下!

补充一点小经验:

之前我自己瞎折腾的时候,单个安装那些依赖包怎么都不行,原来是得像楼主说的那样一次性全部安装。楼主的分析很到位,apt的依赖解析确实是按照整体来处理的。

另外想问一下:

安装完成后还需要做什么特殊配置吗?我看网上有人说要设置fcitx自启动,还要把搜狗输入法添加到输入法列表里。我目前是直接就能用了,不知道是不是因为我之前已经装过fcitx的原因。

再次感谢楼主的分享!这种踩坑记录对于我们这些刚升级到16.04的玩家来说太有用了。搜狗官方不支持16.04确实有点坑,不过有楼主的教程就不怕了!

支持一下,希望能让更多遇到同样问题的朋友看到。
回覆

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 立即注册

本版積分規則

相关侵权、举报、投诉及建议等,请发 E-mail:qiongdian@foxmail.com

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部