在Centos 7上安装搜狗输入法

Centos 7 自带的中文输入法比较难用,就想着在Centos上安装搜狗输入法,结果发现,

搜狗输入法只支持Ubuntu。通过查阅相关资料,加上自己的摸索,最终在系统上安装上了

搜狗输入法,本博客就记录一下在Centos 7上安装搜狗输入法的过程(暂时只测试了Centos7,

其他系统没有测试)。

另外,本博客主要参考了sogou输入法论坛中jeyCheng的博客

,在此表示感谢。

0. 配置清华开源镜像

该步骤并不是必须的。

如果是教育网用户,推荐使用清华开源镜像,因为支持IPV6,下载的速度比较快。(下面的

步骤适用于Centos 7, 如果是其他的系统,请参考此链接)

# 备份原先的CentOS-Base.repo

$sudo mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak

# 新建一个CentOS-Base.repo

$sudovim /etc/yum.repos.d/CentOS-Base.repo

然后将下面的内容复制到CentOS-Base.repo文件中,然后保存退出

# CentOS-Base.repo

#

# The mirror system uses the connecting IP address of the client and the

# update status of each mirror to pick mirrors that are updated to and

# geographically close to the client. You should use this for CentOS updates

# unless you are manually picking other mirrors.

#

# If the mirrorlist= does not work for you, as a fall back you can try the

# remarked out baseurl= line instead.

#

#

[base]

name=CentOS-$releasever - Base

baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/os/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#released updates

[updates]

name=CentOS-$releasever - Updates

baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/updates/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#additional packages that may be useful

[extras]

name=CentOS-$releasever - Extras

baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/extras/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#additional packages that extend functionality of existing packages

[centosplus]

name=CentOS-$releasever - Plus

baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/centosplus/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus

gpgcheck=1

enabled=0

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

最后通过下面的命令,更新软件包缓存

$sudoyum makecache

1. 配置 epel 源

首先按照下面的命令配置epel源。

$sudoyum install -y epel-release

$sudoyum clean all

$sudoyum makecache

epel源平常用的还是听多的,而且此时必须匹配,如果不配置,可能出现的错误有

Error: Package: fcitx-configtool-0.4.7-4.el7.centos.x86_64.rpm

Requires: libunique-1.0.so.0()(64bit)

You could try using --skip-broken to work around the problem

You could try running: rpm -Va --nofiles --nodigest

2. 卸载ibus

Centos 7的输入法是基于ibus的,而搜狗拼音是基于fcitx的,如果不卸载,可能会发生冲突,

这里为了方便和减少出错的可能性,直接卸载ibus。

$sudoyum remove -y ibus

3. 安装fcitx及其相关依赖

$sudoyum install -y dpkg fcitx fcitx-devel fcitx-configtool qtwebkit

如果后续仍然出错,通过下面命令将与fcitx相关的软件全部按上

$sudoyum install -y fcitx*

注意:如果没有正确安装,可能会缺少某些依赖,例如

Error: Package: fcitx-configtool-0.4.7-4.el7.centos.x86_64 (/fcitx-configtool-0.4.7-4.el7.centos.x86_64)

Requires: libfcitx-gclient.so.0()(64bit)

You could try using --skip-broken to work around the problem

4. 下载需要的文件

$git clone https://github.com/hydrogenlee/sogou-input-in-centos7.git

$cdsogou-input-in-centos7.git

5. 安装搜狗输入法

$sudoyum installsogou-pinyin-1.1.0.0037-1.el7.centos.x86_64.rpm

6. 配置环境变量

新建sogou-input.sh配置文件

$sudovim /etc/profile.d/sogou-input.sh

写入如下配置

# sogou-input

exportGTK_IM_MODULE=fcitx

exportXMODIFIERS="@im=fcitx"

exportQT_IM_MODULE=fcitx

使环境变量生效

$source /etc/profile

7. 搜狗输入法后序配置

# 关闭 gnome-shell 对键盘的监听

$gsettings setorg.gnome.settings-daemon.plugins.keyboard active false

# 切换输入法为 fcitx

$imsettings-switch fcitx

# 然后重启一下电脑

$reboot

8. 最后配置一下输入法

# 重启fcitx

$fcitx -r

# 配置搜狗输入法

$fcitx-configtool

然后按照下面的步骤添加搜狗输入法

最后通过ctrl + 空格调出搜狗输入法

如果出现下面的情况,可能需要再重启一次

9. 如果有新版本,通过下面的命令进行更新

$ar vx sogoupinyin_2.2.0.0108_amd64.deb

$sudo tar -Jxvf data.tar.xz -C /

$sudo cp /usr/lib/x86_64-linux-gnu/fcitx/fcitx-sogoupinyin.so /usr/lib64/fcitx/fcitx-sogoupinyin.so

最后重启电脑(如果出现问题,可能需要删除~/.config/SogouPY文件夹)

centos7安裝搜狗輸入法_sogou-input-in-centos7相关推荐

  1. [Ubuntu]安裝搜狗輸入法

    本文介紹如何在Ubuntu系統下安裝搜狗輸入法. 1.打開搜狗輸入法的下載頁面: http://pinyin.sogou.com/linux/ 2.下載對應的安裝包,本文使用的是64位系統,所以選擇了 ...

  2. ubuntu18.04安裝搜狗輸入法

    一.安裝fcitx 打开ubuntu software,安装Fcitx和Fcitx Configuration 打开setting => Region & Language => ...

  3. 在ubuntu17.10上裝搜狗輸入法

    这篇教程讲解如何在 Ubuntu 17.10 系统上安装 Fcitx 五笔拼音输入法.Ubuntu 17.10 抛弃了 Unity,使用 Gnome 作为默认的桌面环境,所以安装输入法的步骤与之前的版 ...

  4. 搜狗輸入法, 今日輸入統計 排名捷徑

    作者:韩亚飞_yue31313_韩梦飞沙 QQ:313134555 这个搜狗输入法,  等级排名岂不是很难超过  之前的了么..    我草,  不科学. 不好. 好了 今天的每日事件,  20篇完成 ...

  5. win10輸入法去掉语言栏?win10輸入法切换简体繁体?

    经常碰到win10輸入法打出来的字体是繁体的?或者不小心把语言栏显示出来无法回去?有根治的方法. 开始菜单-->搜索高级键盘设置,打勾使用语言栏就是有显示语言栏的,去掉就没有了. 在有显示语言栏 ...

  6. win10輸入法,繁體字,簡體字切換

    win10輸入法,繁體字,簡體字切換 Ctrl+Shift+F

  7. 對 RIME 輸入法粵拼詞庫的點點建議

    在 Fedora 下試用一下 RIME 輸入法的粵拼,相信輸入法本身應該基本的功能都齊備了,可是如果說要進一步提升輸入的效率,我想應該主要還是從詞庫開始說起,我很簡單地抓了系統裡的 /usr/shar ...

  8. 批次程序安裝手冊寫法

    系統同步資料處理程式安裝手冊實例 Document No. 0.0.0.1 Creation Date 2012/02/25 Document Version 0.0.0.1 Revision Dat ...

  9. Centos7安裝GitHub

    先查看版本 git --version 如果沒有安裝 接下來 生成ssh密钥 ssh-keygen -t rsa -C "your email address" Generatin ...

最新文章

  1. 计算机网络的性能指标和非性能特征
  2. php判断是否已关注,php判断用户是否关注微信订阅号或公众号
  3. netstat -ano
  4. 一个需要原创精神的年代
  5. mybatis简单案例源码详细【注释全面】——实体层(User.java)
  6. mybatis_user_guide(7) SQL语句构建器类
  7. 使用Python爬虫爬取网络美女图片
  8. 可提高效率的网页设计PS插件
  9. ASP.NET MVC Pager Helper Extensions
  10. 计算机应用 winxp,XP平台:计算机应用基础
  11. python 写命令行_一个用python写的用命令行看糗百的小工具
  12. 走近棒球运动·堪萨斯城皇家队·MLB棒球创造营
  13. Android MVP 架构设计 (一)
  14. 工业触屏没有反应的原因?
  15. 三升序列(蓝桥杯真题)——python
  16. PPTV多屏互动服务器可以看文档吗,关闭或删除PPTv多屏互动服务器的方法
  17. 【其他】神舟精盾K470-i3 D3更换支持5GHz的双频无线网卡
  18. 熟悉FreeSWITCH 一
  19. python语言是什么语言-python是一门什么样的语言?
  20. MBTI测试结果:您的性格类型倾向为“ ENFP ”

热门文章

  1. 渗透测试-内网横向移动专题
  2. CentOS7安装harbor仓库+修改默认用户+仓库登录报错
  3. aps自动排程助企业缩短制造周期
  4. 招聘网探究分析报告(以描述性分析为主)
  5. NAACL 2022事件相关(事件抽取、事件关系抽取、事件预测等)论文汇总
  6. 2013年多益网络校园招聘笔试题
  7. ES6----promise方法解决回调地狱问题
  8. 我的世界java1.13下_Minecraft我的世界Java版1.13-pre3更新内容
  9. extJs 2.0学习笔记(Ext.Panel篇四)
  10. 解决sudo update-initramfs -u 时报错