I am having a problem where I cannot update any packages using R studio. I will use the package "backports" as an example but I have been getting this with many package updates.
This is the error I get when using install.packages("backports")
:
ERROR: failed to lock directory 'D:/Program Files/R/win-library/3.6' for modifying
Try removing 'D:/Program Files/R/win-library/3.6/00LOCK-backports'
Warning in install.packages :
installation of package ‘backports’ had non-zero exit status
And this the error when using BiocManager::install("backports")
:
Warning: cannot remove prior installation of package 'backports'
Warning: restored ‘backports’
Warning messages:
1: In file.copy(savedcopy, lib, recursive = TRUE) :
problem copying D:\Program Files\R\win-library\3.6\00LOCK\backports\libs\x64\backports.dll to D:\Program Files\R\win-library\3.6\backports\libs\x64\backports.dll: Permission denied
One thing I have noticed is that all the files that get these copying errors generated by BiocManager are .dll files. Could this be something to do with it?
Things I have tried:
- Running Rstudio as an administrator
- Moving my library to another location
- Fiddling with permissions on folders
The only thing I can do to update is to delete the folder from the library manually but this is getting annoying.
Thanks in advance for any help.