解決 gcin 在 KDE 無法輸入中文 (Ubuntu 16.04)

今天把系統從 Kubuntu 換成 KDE neon User Edition 並裝完 gcin 之後,發現 gcin 不能在 Konsole 中輸入中文。

解決方法很簡單也很困難,簡單之處在於安裝 gcin-qt5-immodule,難也難在安裝 gcin-qt5-immodule

1
~$ sudo apt-get install gcin-qt5-immodule

輸入之後,會出現錯誤:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
~$ sudo apt-get install gcin-qt5-immodule 
Reading package lists... Done
Building dependency tree
Reading state information... Done
Starting pkgProblemResolver with broken count: 1
Starting 2 pkgProblemResolver with broken count: 1
Investigating (0) gcin-qt5-immodule [ amd64 ] < 2.8.6+eliu-0 > ( utils )
Broken gcin-qt5-immodule:amd64 Depends on qtbase-abi-5-5-1 [ amd64 ] < none -> > ( none )
Considering libqt5core5a:amd64 2904 as a solution to gcin-qt5-immodule:amd64 10000
Considering libqt5core5a:amd64 2904 as a solution to gcin-qt5-immodule:amd64 10000
Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
gcin-qt5-immodule : Depends: qtbase-abi-5-5-1
E: Unable to correct problems, you have held broken packages.

之前裝 LinuxMint 18 的時候有解過一次這個問題。

解決方法如下

1
2
3
sudo apt download gcin-qt5-immodule
ar x gcin-qt5-immodule_2.8.6+eliu-0_amd64.deb
vim control.tar.gz

tarfile::./control 中的 Depends

Depends: gcin-im-client (>= 2.8.6+eliu-0), libc6 (>= 2.4), libgcc1 (>= 1:3.0), libqt5core5a (>= 5.0.2), libqt5gui5 (>= 5.4.1) | libqt5gui5-gles (>= 5.4.1), qtbase-abi-5-5-1

改為:

Depends: gcin-im-client (>= 2.8.6+eliu-0), libc6 (>= 2.4), libgcc1 (>= 1:3.0), libqt5core5a (>= 5.0.2), libqt5gui5 (>= 5.4.1) | libqt5gui5-gles (>= 5.4.1)

wq 儲存

1
2
ar r gcin-qt5-immodule_2.8.6+eliu-0_amd64.deb control.tar.gz
sudo dpkg -i gcin-qt5-immodule_2.8.6+eliu-0_amd64.deb

重新執行 gcin 即可。

也可以直接下載我包好的:Download

1
2
3
4
~$ md5sum gcin-qt5-immodule_2.8.6+eliu-0_amd64.deb 
55ccc5e54dad0665f81b8885c920a00d gcin-qt5-immodule_2.8.6+eliu-0_amd64.deb
~$ sha256sum gcin-qt5-immodule_2.8.6+eliu-0_amd64.deb
87c7edc510f0de68c47a9ababc16ec36c7a765a61343e474e5d6a30f6b1570a3 gcin-qt5-immodule_2.8.6+eliu-0_amd64.deb