[TOC]
使用ibus默认输入法,中文体验不好。因此本文记录CentOS7安装搜狗输入法的过程。
## 安装Fcitx输入法框架
1.安装fcitx
`yum install -y fcitx`
2.安装fcitx配置工具
`yum install -y fcitx-configtool`
3.安装qt库
`yum install -y fcitx-qt4 fcitx-qt5`
4.配置环境变量
```
vi ~/.bashrc
...
# 末尾追加
export XMODIFIERS=@im=fcitx
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XIM=fcitx
```
5.切换使用的输入法
`imsettings-switch fcitx`
6.重启
`reboot`
7.fcitx-diagnose查看安装状态
```
...
4. KDE \u7684\u914d\u7f6e\u754c\u9762\uff1a
**`kcmshell4` 未找到.**
...
```
此告警不用管,我们用的fcitx-configtool
## 安装搜狗输入法
1.安装alien
`yum install -y alien`
2.下载搜狗deb包。最新版需要升级gcc,暂不支持,所以我这里用的版本是2.2.0.0108
`wget http://cdn2.ime.sogou.com/dl/index/1524572264/sogoupinyin_2.2.0.0108_amd64.deb`
3.deb 转rpm
`alien -r --scripts sogoupinyin_2.2.0.0108_amd64.deb`
4.安装依赖
`yum install -y qtwebkit`
5.安装rpm包
`rpm -ivh --force sogoupinyin-2.2.0.0108-2.x86_64.rpm`
如果不用--force,会提示与filesystem包冲突
~~~
Transaction check error:
file / from install of sogoupinyin-2.2.0.0108-2.x86_64 conflicts with file from package filesystem-3.2-25.el7.x86_64
file /usr/bin from install of sogoupinyin-2.2.0.0108-2.x86_64 conflicts with file from package filesystem-3.2-25.el7.x86_64
file /usr/lib from install of sogoupinyin-2.2.0.0108-2.x86_64 conflicts with file from package filesystem-3.2-25.el7.x86_64
错误概要
~~~
6.复制移动库文件
`cp -R /usr/lib/x86_64-linux-gnu/fcitx/* /usr/lib64/fcitx/`
7.更改库文件权限
`chmod -R 755 /usr/lib64/fcitx/`
8.重新启动fcitx
```
# 查看fcitx进程
[root@localhost fcitx]# ps -ef|grep fcitx
root 3364 1524 0 16:17 ? 00:00:00 /usr/bin/fcitx -D
root 3369 1 0 16:17 ? 00:00:00 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --config-file /usr/share/fcitx/dbus/daemon.conf
root 3375 1 0 16:17 ? 00:00:00 /usr/bin/fcitx-dbus-watcher unix:abstract=/tmp/dbus-Ei9mwAAdJA,guid=d16d9a632bcd2e163e7da9fc5f44c905 3369
root 3556 2808 0 16:18 pts/0 00:00:00 grep --color=auto fcitx
[root@localhost fcitx]#
# 杀掉当前进程
[root@localhost fcitx]# kill 3364
# 守护进程自动重启
[root@localhost fcitx]# ps -ef|grep fcitx
root 3587 1524 6 16:19 ? 00:00:00 /usr/bin/fcitx -D
root 3592 1 0 16:19 ? 00:00:00 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --config-file /usr/share/fcitx/dbus/daemon.conf
root 3598 1 0 16:19 ? 00:00:00 /usr/bin/fcitx-dbus-watcher unix:abstract=/tmp/dbus-MB7VXQYG1L,guid=050eeca767d93f78d49b5a295f44c97c 3592
root 3617 2808 0 16:19 pts/0 00:00:00 grep --color=auto fcitx
[root@localhost fcitx]#
```
9.配置搜狗输入法
输入命令
`fcitx-configtool`
或点击屏幕右上角图标
如图所示:

- python setup.py install报错
- from future import absolute_import 的使用
- celery 4以上的版本不支持windows解决办法
- 'ascii' codec can't decode byte 0xe4 in position 0: ordinal not in range(128)
- Python开发环境CentOS
- dosh-to-dock启动报错
- 创建了__init__.py文件,找不到模块
- CentOS切换中文输入法
- vncserver:1非正常中断后启动不来
- CentOS7安装搜狗输入法
- 安装第三方包常见报错
- Django for Professionals
- Chapter 1:Docker
- What is Docker?
- Containers vs. Virtual Environments
- Install Docker
- Docker Hello, World
- Django Hello, World
- Pages App
- Images, Containers, and the Docker Host
- Git
- Conclusion
- 设置pip/pyenv国内加速源
- 使用stackedit在github编辑文档
- python2.x与python3.x的区别
- python多任务实现
- python执行Linux命令的方法