Fix ubuntu detect and mktemp