For the purpose of adding ibus-pinyin in ubuntu, we are required to make a few modification to the system.
Firstly, we may install the corresponding package
sudo apt-get install ibus-pinyin -y
Secondly, restart the ibus
ibus restart # no sudo required
And then, we can add it in our system settings: Settings -> Region & Language -> Input Sources -> [+].
We can find an option Chinese (China)
. Click this button, and then we will find a list like Chinese(Cangji3)
and so on. Choose Chinese(Pinyin)
.
We should able to switch the input methods using command + space.
You may also use this link as reference. ibus-sunpinyin
could also been a good alternative solution