R studio install package Error cannot move 00LOCK Permission denied

Viewed 4375

I'm trying to install rlang package using Rstudio but I'm getting this error:

mv: cannot move '/usr/local/lib/R/site-library/rlang' to '/usr/local/lib/R/site-library/00LOCK-rlang/rlang': Permission denied

Could anyone help please ?

Thanks a lot.

5 Answers

Sometimes, adding the --no-lock option helps

install.packages("rlang", INSTALL_opts = '--no-lock')

See here for more details

I had the same problem. what worked for me, after trying everything else

  1. Detach packages you are trying to update
  2. Physically remove / delete these packages from library
  3. Install packages from R-Studio

An option would be to remove the folder with the /00LOCK-rlang/rlang and then reinstall the package

install.packages('rlang')

Not sure if it is the same problem, but I had a similar issue

ERROR: failed to lock directory ‘[myhome]/R/x86_64-pc-linux-gnu-library/4.2’ for modifying

Try removing ‘[myhome]/R/x86_64-pc-linux-gnu-library/4.2/00LOCK-vctrs’

And I solved it with this pacman function that attempts to delete a 00LOCK(s) if it exists:

install.packages('pacman')
pacman::p_unlock()

It worked for me! Hope it works for you :)

I encountered the same issue on my server and I found that this can be solved by changing the default installation path of R package

Related