R Install.Packages Returns "Failed to Create Lock Directory"

R install.packages returns failed to create lock directory

On NFS file systems it is sometimes not obvious what things you have to close.

The best way to avoid this is to use the --no-lock argument on the command line, i.e.:

R CMD INSTALL --no-lock <pkg>

From within R, you can do this from within your command using:

install.packages("Rcpp", dependencies = TRUE, INSTALL_opts = '--no-lock')

Snakemake installing R package in rule environment: error cannot move 00LOCK permission denied

The YAML shown is substandard (incorrect channel order). But more importantly, it generally does not work well to install anything other than Conda packages in Conda-managed R environments. Fortunately, all Bioconductor packages are on the bioconda channel (usually with a bioconductor- prefix and all lowercase), hence, everything should work perfectly fine with simply:

channels:
- conda-forge
- bioconda
- defaults
dependencies:
- r-base=4.1.1
- r-ggplot2=3.3.5
- bioconductor-ggbio

Why I get Warning in install.packages : cannot remove prior installation of package ‘tibble’Permission restored ‘tibble’?

I also encountered this situation when a package installation went wrong.

This problem occured to others, and there's even a function against this in the pacman Package Management package :

Sometimes install.packages can "fail so badly that the lock directory is not removed: this inhibits any further installs to the library directory (or for –pkglock, of the package) until the lock directory is removed manually." p_unlock deletes the directory 00LOCK that is left behind.

You can also do it manually : stop all R / RStudio sessions, find the 00LOCK directory (which might disappear as you close RStudio), and delete it.

This post explains how to avoid the lock.



Related Topics



Leave a reply



Submit