Ubuntu系统安装完成后的首件事情就是,更换国内清华大学的镜像源,网址是:https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/
sudo gedit /etc/apt/sources.list
打开之后,将原始配置代码删除,重新添加TSU的镜像配置代码:
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
执行更新操作:
sudo apt-get update
在换源完成后,开始进行搜狗拼音输入法的安装,第一步添加fcitx的PPA文件:
sudo add-apt-repository ppa:fcitx-team/nightly
sudo apt-get update#更新系统
执行update更新系统时如果遇到404错误,E: 无法下载 http://ppa.launchpad.NET/fcitx-team/nightly/ubuntu/dists/jessie/main/binary-amd64/Packages 404 Not Found,则进行下面操作:
#1.进入对应的ppa目录
cd /etc/apt/sources.list.d
#2.删除该目录下的fcitx-team-ubuntu-nightly-xenial.list文件并进行替换
mv fcitx-team-ubuntu-nightly-xenial.list fcitx-team-ubuntu-nightly-xenial.list.bak
#3.再次进行更新,此时404问题已经解决
sudo apt-get update
第二步进行fcitx的配置与安装:
sudo apt-get install fcitx
sudo apt-get install fcitx-config-gtk
sudo apt-get install fcitx-table-all#按Y
sudo apt-get install im-switch#按Y
此时如果在左上角搜索框中输入fcitx显示小企鹅就说明第二步进行成功了;
补充:执行安装fcitx后,还需要:
1.打开System Setings
2.打开Language Support(若提示需要更新或修复,执行相关提示命令或按提示install即可)
3.将Keyboard input method system 设置成 fcitx
第三步,去搜狗官网https://pinyin.sogou.com/linux/?r=pinyin下载64位或32位的.deb安装包,选择save,接着进行安装操作
#1.进入.deb文件所在目录
cd Downloads/
#2.执行安装包
sudo dpkg -i sogoupinyin_2.2.0.0108_amd64.deb
If occur problem like this:
dpkg: error processing package sogoupinyin (--install):
dependency problems - leaving unconfigured
Processing triggers for mime-support (3.59ubuntu1) ...
Processing triggers for libglib2.0-0:amd64 (2.48.2-0ubuntu4.1) ...
No such key 'Gtk/IMModule' in schema 'org.gnome.settings-daemon.plugins.xsettings' as specified in override file '/usr/share/glib-2.0/schemas/50_sogoupinyin.gschema.override'; ignoring override for this key.
Processing triggers for gnome-menus (3.13.3-6ubuntu3.1) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu5.2) ...
Processing triggers for bamfdaemon (0.5.3~bzr0+16.04.20180209-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for shared-mime-info (1.5-2ubuntu0.2) ...
Processing triggers for hicolor-icon-theme (0.15-0ubuntu1.1) ...
Errors were encountered while processing:
sogoupinyin
You should excute these code:
sudo apt install libopencc1 fcitx-libs fcitx-libs-qt
sudo dpkg -i sogoupinyin_2.2.0.0108_amd64.deb
Then,you will setup successful like this.
(Reading database ... 275596 files and directories currently installed.)
Preparing to unpack sogoupinyin_2.2.0.0108_amd64.deb ...
Unpacking sogoupinyin (2.2.0.0108) over (2.2.0.0108) ...
Setting up sogoupinyin (2.2.0.0108) ...
Processing triggers for mime-support (3.59ubuntu1) ...
Processing triggers for libglib2.0-0:amd64 (2.48.2-0ubuntu4.1) ...
No such key 'Gtk/IMModule' in schema 'org.gnome.settings-daemon.plugins.xsettings' as specified in override file '/usr/share/glib-2.0/schemas/50_sogoupinyin.gschema.override'; ignoring override for this key.
Processing triggers for gnome-menus (3.13.3-6ubuntu3.1) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu5.2) ...
Processing triggers for bamfdaemon (0.5.3~bzr0+16.04.20180209-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for shared-mime-info (1.5-2ubuntu0.2) ...
Processing triggers for hicolor-icon-theme (0.15-0ubuntu1.1) ...
第三步执行完毕后重启;
第四步,在搜索框中输入Text Entry,打开后点击左下角的‘+’,在Choose an input source的搜索框中输入Sougou pinyin 之后点击Add
第五步,点击右上角的小键盘符号,点击Config,然后同样点击“+”号,将搜狗拼音输入法添加进去
这里要注意一点:一定要记得把选择当前输入法的勾给取消掉,否则你搜索不到Sougou pinyin这个选项的
安装完成,此时再点击右上角小键盘即可发现搜狗拼音输入法已安装成功。