R 报错:ERROR: failed to lock directory XXX 00LOCK

Error: install.packages failed to lock directory

在使用bioconductor安装一些包的时候,比如我安装GEOquery时,会有
Error in unpackPkgZip(foundpkgs[okp, 2L], foundpkgs[okp, 1L], lib, libs_only, :
ERROR: failed to lock directory ‘C:\Program Files\R\R-3.6.1\library’ for modifying
如下:

if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")

BiocManager::install("GEOquery")
> BiocManager::install("GEOquery")
Bioconductor version 3.10 (BiocManager 1.30.10), R 3.6.1 (2019-07-05)
Installing package(s) 'GEOquery'
trying URL 'https://bioconductor.org/packages/3.10/bioc/bin/windows/contrib/3.6/GEOquery_2.54.1.zip'
Content type 'application/zip' length 13850910 bytes (13.2 MB)
downloaded 13.2 MB

package ‘GEOquery’ successfully unpacked and MD5 sums checked
Error in unpackPkgZip(foundpkgs[okp, 2L], foundpkgs[okp, 1L], lib, libs_only,  : 
  ERROR: failed to lock directory ‘C:\Program Files\R\R-3.6.1\library’ for modifying
Try removing ‘C:\Program Files\R\R-3.6.1\library/00LOCK’

解决办法:找到‘C:\Program Files\R\R-3.6.1\library/00LOCK’ 将 00LOCK文件夹删掉,重新安装就可以了

你可能感兴趣的:(R 报错:ERROR: failed to lock directory XXX 00LOCK)