difficulty removing renv-enabled project directories from file system

Hi Folks,

I am doing a bit of testing with the renv package to evaluate whether it will be a good solution to maintain continuity between our development and production environments, and, if so, a good workflow to build around it. One oddity that I am experiencing is difficulty removing renv-enabled project directories from the [linux] file system. That is, if I want to remove a project directory where we have enabled renv from a local file system, I get a permission denied error like the one listed below. This is the case even with rm -rf.

rm: cannot remove 'toy-shiny/renv/sandbox/R-4.2/x86_64-pc-linux-gnu/9a444a72/codetools': Permission denied

Ultimately, the only way that I have been able to remove the project directory is to navigate into the renv/sandbox subdirectory and remove all of the symlinks to libraries as sudo.

Only then can I delete the project directory. I have tried various combinations of deactive, isolate, clean, and completely uninstalling per the docs. renv seems great and this is not a deal breaker necessarily but it does make me worry that I am not fully understanding what it is doing and, thus, some hesitancy to start applying it to production.

Thanks for any insight.

Stevan

1 Like

Hi Stevan,

I've recently been dealing with exactly the same issue.

I experimented with many different things to prevent symlinks being generated with Renv, but there were always symlinks being generated to the system library of base R packages.

I suppose this might be a common issue when using a local runner for processes (e.g. on a self hosted server and not using a clean VM image on the cloud) since R-base will typically be readily installed on the system.

Long story short, I found that this did the trick:

Rscript --vanilla -e "unlink('renv/sandbox', recursive = TRUE, force = TRUE)"

from the R project root.

Hope this help!

Kareem

1 Like

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.