on a windows machine u can easily change the location where QGIS stores its temp files (see here: https://gis.stackexchange.com/questions/156129/how-can-i-change-the-folder-location-for-qgis-temporary-files).
However, in Ubuntu I would not know which environmental variable to change. There is no Temp or Tmp variable indicated and there is also no variable linked to the path where I would expect the Temp files to be stored (which would be "/tmp"). See the image blow leading to the Settings > Options > System interface.

TMPDIRif set, if not default to/tmp. Try withTMPDIR=/some/path.