sudo apt-get install ibus-pinyin
it needs to download about 63MB data,atfer that ,you need to reboot your input module:
and then select Prefence.. to add pinyin input method.
enjoy it.