How to get screenshot in ubuntu

Hi,
I want to get the screenshot in ubuntu, but it does not work with below code:

base.graphicsEngine.renderFrame()
tex = base.win.getScreenshot()

In windows , I can get the texture, but in ubuntu, tex is none, what’s wrong ?