Open terminal and input:
sudo -i
apt install fcitx fcitx-googlepinyin
Wait for it to finish.
Search fcitx:
"Settings"-->"Input Method":
Finally, we get the following result:
Ctrl + Space:Switch the input method.
The test results are as follows: