Fatal error: cannot mkdir R_TempDir

前端 未结 6 1712
有刺的猬
有刺的猬 2021-02-07 00:53

When attempting to run R, I get this error:

Fatal error: cannot mkdir R_TempDir

I found two possible fixes for this problem by goog

6条回答
  •  说谎
    说谎 (楼主)
    2021-02-07 01:14

    Your default temporary directory appears to have the wrong permissions. Here I have

    $ ls -ld /tmp
    drwxrwxrwt 22 root root 4096 2011-06-10 09:17 /tmp
    

    The key part is 'everybody' can read or write. You need that too. It certainly can contain subdirectories.

    Are you running something like AppArmor or SE Linux?

    Edit 2011-07-21: As someone just deemed it necessary to downvote this answer -- help(tempfile) is very clear on what values tmpdir (the default directory for temporary files or directories) tries:

    By default, 'tmpdir' will be the directory given by 'tempdir()'. This will be a subdirectory of the temporary directory found by the following rule. The environment variables 'TMPDIR', 'TMP' and 'TEMP' are checked in turn and the first found which points to a writable directory is used: if none succeeds '/tmp' is used.

    So my money is on checking those three environment variables. But AppArmor and SELinux have shown to be an issue too on some distributions.

提交回复
热议问题