zoukankan      html  css  js  c++  java
  • 【Linux基础】搜狗输入法在ubuntu18.04中无法安装和安装后无法使用的解决方案

    以下内容转自:https://ywnz.com/linuxjc/1476.html

    问题

    起初,是一次升级系统之后选词框丢失。根据以往经验,删除配置文件。然而无效。于是卸载之后下载最新安装包尝试重新安装。问题出现了,一个依赖问题无法解决:搜狗拼音依赖的fcitx-libs-qt这个包在ubuntu18.04的源里面是不存在的。

    替代品似乎是libfcitx-qt0,我尝试修改deb中的控制文件,将fcitx-libs-qt替代换为libfcitx-qt0,并重新打包。这样可以安装,然而并无卵用。去ubuntu17.10的源下载fcitx-libs-qt,会有冲突,不能与libfcitx-qt0共存。

    解决问题

    经过各种折腾,最终解决了问题,记录如下。

    下载旧版

    首先搜狗官方的最新版(sogoupinyin_2.2.0.0102_amd64.deb)是不能用的,至于为什么不能用,未作深究。需要下载一个旧版本(sogoupinyin_2.1.0.0086_amd64.deb)。

    将该deb包放置于一个空目录。

    创建软件包目录

    mkdir -p extract/DEBIAN
    

      

    解包

    dpkg-deb -x sogoupinyin_2.1.0.0086_amd64.deb extract/
    dpkg-deb -e sogoupinyin_2.1.0.0086_amd64.deb extract/DEBIAN

    修改control文件

    用任意文本编辑器打开extract/DEBIAN/control 找到Depends行,删除fcitx-libs和fcitx-libs-qt,保存退出。

    Package: sogoupinyin
    
    Version: 2.1.0.0086
    
    Architecture: amd64
    
    Maintainer: Ubuntu Kylin Team <ubuntukylin-members@lists.launchpad.net>
    
    Installed-Size: 53018
    
    Depends: fcitx (>= 1:4.2.8.3-3~), fcitx-frontend-gtk2, fcitx-frontend-gtk3, fcitx-frontend-qt4, fcitx-module-kimpanel, im-config, libopencc2 | libopencc1, lsb-release, unzip, x11-utils, libc6 (>= 2.8), libgcc1 (>= 1:4.1.1), libgdk-pixbuf2.0-0 (>= 2.22.0), libglib2.0-0 (>= 2.16.0), libidn11 (>= 1.13), libnotify4 (>= 0.7.0), libqt4-dbus (>= 4:4.8.0), libqt4-declarative (>= 4:4.8.0), libqt4-network (>= 4:4.8.0), libqtcore4 (>= 4:4.8.0), libqtgui4 (>= 4:4.8.0), libstdc++6 (>= 4.6), libx11-6, zlib1g (>= 1:1.2.0)
    
    Recommends: fcitx-frontend-qt5, fonts-droid-fallback | fonts-droid, dconf-gsettings-backend | gsettings-backend
    
    Section: non-free/utils
    
    Priority: optional
    
    Homepage: http://pinyin.sogou.com/linux
    
    Description: Sogou Pinyin 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.
    

      

     打包

    mkdir build
    
    dpkg-deb -b extract/ build/

    执行完毕build目录下会生成一个新的deb包。

    安装

    先彻底卸载掉搜狗输入法,并删除以下配置文件:

    .sogouinput
    .config/fcitx
    .config/sogou-qimpanel
    .config/SogouPY
    .config/SogouPY.users
    .config/fcitx-qimpanel

    然后安装我们重新打包的输入法即可。重启之后,搜狗输入法恢复正常。

  • 相关阅读:
    Android 模拟系统事件(三)
    全民Scheme(2):来自星星的你
    Java经典23种设计模式之行为型模式(三)
    libmysqld,嵌入式MySQLserver库
    闲云控制台(一)控制台命令解析框架
    怎样改动android系统字体大小
    [多校2015.02.1006 高斯消元] hdu 5305 Friends
    换工作经历和心得
    安卓实训第七天---多线程下载实现(进度条)
    校园双选会,你都懂么
  • 原文地址:https://www.cnblogs.com/dreaming-deer/p/12784149.html
Copyright © 2011-2022 走看看