zoukankan      html  css  js  c++  java
  • Ubuntu更改源和搜狗输入法安装卸载

    安装完Ubuntu 16.04后,要更换为国内的软件源:

              sudo gedit /etc/apt/sources.list   #用文本编辑器打开源列表

    在文件开头添加下面的阿里云的软件源:

    deb http://mirrors.aliyun.com/ubuntu/ quantal main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ quantal-security main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ quantal-updates main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ quantal-proposed main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ quantal-backports main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ quantal main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ quantal-security main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ quantal-updates main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ quantal-proposed main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ quantal-backports main restricted universe multiverse

    更新软件源:sudo apt-get update

    更多软件源请自行百度,阿里云的软件源是Ubuntu官方推荐的国内软件源。,清华的软件源也可以。

          Ubuntu 的键盘输入法系统包含iBus、fcitx等多种,因为sogou是基于fcitx的,而系统默认的是iBus,所以安装使用不同的输入法,相关的键盘输入法系统也要设置改变。

    也可以打开System Settings系统设置里面的 Software & Updates

    一、安装sogou输入法步骤:

    1、首先到搜狗输入法官网下载搜狗输入法,下载的是个deb文件。

          搜狗输入法Linux版下载地址http://pinyin.sogou.com/linux/?r=pinyin

    2、Ubuntu 16.04安装搜狗输入法命令如下:

          sudo apt-get install -f
    
          sudo dpkg -i sogoupinyin_2.2.0.0108_amd64.deb

        deb文件名,要和自己下载的版本一致。

    3、安装完毕,设置语言选项

          到系统设置->语言支持(System->Language Support),将键盘输入法系统由默认的iBus设置为fcitx。如下图:

          操作此步骤时,如果没有出现fcitx选项,说明你的机器还需要安装fcitx键盘输入法系统,直接看第二部分fcitx的安装。

    4、注销,重新登陆。

          将键盘输入法系统改为fcitx后,一定要注销,而且操作顺序不能改。这时还不能马上使用,还要点击右上角的输入法图标,点击设置,进入设置界面,这个时候没有看到搜狗输入法,点击左下角的加号,然后注意先要去掉”只显示当前语言的输入法”前面那个勾,然后再搜索”sogo”,这个时候就看到sogo pinyin了,接着添加就可以了,然后就可以切换输入法了。

          注意: 安装搜狗输入法之前请先更换为国内的软件源,否则无法解决依赖问题。

    二、安装fcitx键盘输入法系统

          sogou是基于fcitx的,而系统默认的键盘输入法系统是iBus。Ubuntu 16.04默认是带有fcitx的,正常安装,如果有的话,按上面步骤即可完成;但有些版本的Ubuntu,需要自己安装 fcitx,才能安装使用sogou。

    1、添加以下源

          sudo add-apt-repository ppa:fcitx-team/nightly

    2、更新系统:sudo apt-get update

    3、安装fcitx:sudo apt-get install fcitx

    4、安装fcitx的配置工具:sudo apt-get install fcitx-config-gtk

    5、安装fcitx的table-all软件包:sudo apt-get install fcitx-table-all

    6、安装im-switch切换工具:sudo apt-get install im-switch

          至此,fcitx键盘输入法系统就安装好了。第5,6步需要按键“Y”确认安装。简单测试的方法就是在终端键入“fcitx”,有各种提示就对了。

          安装完fcitx后,再安装sogou即可。


    ubuntu彻底卸载搜狗拼音输入法

     

    ubuntu彻底卸载搜狗拼音输入法,ubuntu安装搜狗输入法后如果觉得搜狗不是很适合自己,那应该怎么样彻底的卸载搜狗输入法呢?下面我们就来一步步彻底卸载掉搜狗输入法...

    方法/步骤

    1. 1

      找到安装的搜狗输入法

               $sudo dpkg  -l  so*  就可以找到sogoupinyin       

      ubuntu彻底卸载搜狗拼音输入法
    2. 2

      卸载搜狗拼音输入法

                  $sudo dpkg  -r    sogoupinyin  

      ubuntu彻底卸载搜狗拼音输入法
    3. 3

      桌面右上角  开关机按钮  进入  系统设置 

        

      ubuntu彻底卸载搜狗拼音输入法
    4. 4

      重新设置ibus为系统默认输入方式

                   点击  语言支持      键盘输入方式系统  选择IBus

      ubuntu彻底卸载搜狗拼音输入法
      ubuntu彻底卸载搜狗拼音输入法
    5. 5

      卸载fcitx

                   $sudo apt-get purge  fcitx

      ubuntu彻底卸载搜狗拼音输入法
    6. 6

      彻底卸载fcitx及相关配置

                  $sudo apt-get autoremove 

                  

      ubuntu彻底卸载搜狗拼音输入法
    7. 7

      注销系统用户

                 不知道为什么,卸载搜狗后我这边的注销按钮不能使用了,只好通过命令注销

                 $sudo pkill Xorg

      ubuntu彻底卸载搜狗拼音输入法
    8. 8

      再次登陆进入系统,看看是不是已经回到了原来的熟悉的输入方式呢?

      ubuntu彻底卸载搜狗拼音输入法
       
       

      遇到的问题

      1. 修复sogou输入法

        好消息~ Ubuntu Kylin团队与搜狗公司合作开发了“搜狗输入法 for Linux”版本,支持Ubuntu 12.04 和 Ubuntu 14.04,在搜狗官网就可以下载到,附上地址:http://pinyin.sogou.com/linux/

        以前在windows一直用搜狗输入法,所以Ubuntu的内置输入法用得不太习惯,现在终于有顺手的输入法了,开心~

        但是经过一段时间的试用,遇到了输入法面板问题,ctrl+space 调出输入法就会弹出一个对话框提示要重启输入法面板,于是多方搜寻,终于找到解决方案,其实用一条命令就可以修复,方法如下:

        1、ctrl+alt+T 打开终端

        2、输入 sogou-qimpanel &

        3、回车即可,可以看到终端里自动执行了一大段命令

        现在再按ctrl+space看看,可爱的搜狗输入法是不是又回来啦?

      2.  问题表现

      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).

      一看就知道是依赖包存在问题
      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:

      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. 问题解决

         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
        结果 一切顺利,没有报类似的错误信息
      6. 总结

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

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

       
       
       
  • 相关阅读:
    UVa 128 Software CRC
    UVa 11258 String Partition(简单DP)
    POJ 3070 Fibonacci(矩阵乘法logN)
    UVa 10280 Old Wine Into New Bottles(剪枝+完全背包)
    图论笔记第四章 欧拉图与哈密尔顿图(beta.)考点
    图。。珍藏season
    图论及其应用哈密尔顿图(alpha)
    9.保健…todo
    android 移植笔记有感
    unp_exam_要点.doc
  • 原文地址:https://www.cnblogs.com/mohuishou-love/p/10078707.html
Copyright © 2011-2022 走看看