You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

R中无法更新terra包:无00LOCK文件但权限被拒问题求助

Permission Denied Error When Updating terra Package in R 4.2.2 (Triggered by raster Update for dismo)

I’m hitting a permission denied error while trying to update the terra package in R 4.2.2. The root cause is that the dismo package requires raster version ≥3.5.21, and updating raster automatically triggers a download of terra—which is where the error pops up. My currently loaded raster version is 3.5.15.

The exact error message I receive is:

Warning message:
In file.copy(savedcopy, lib, recursive = TRUE) :
  problem copying C:\Users\xxxxx\Documents\R\win-library\4.2\00LOCK\terra\libs\x64\terra.dll 
to C:\Users\xxxxx\Documents\R\win-library\4.2\terra\libs\x64\terra.dll: Permission denied

Steps I’ve Already Tried

  • Standard installation commands:
    • install.packages("terra")
    • install.packages('terra', repos='https://rspatial.r-universe.dev')
  • Installation with the --no-lock flag:
    • install.packages('terra', repos='https://rspatial.r-universe.dev', INSTALL_opts = '--no-lock')
  • Troubleshooting by searching for and deleting the 00LOCK file (a common fix for similar issues), but I couldn’t locate this file anywhere on my system.

Session Information

> sessionInfo()
R version 4.2.2 (2022-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17763)

Matrix products: default

locale:
[1] LC_COLLATE=English_United Kingdom.1252  LC_CTYPE=English_United Kingdom.1252   
[3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C                           
[5] LC_TIME=English_United Kingdom.1252    

内容的提问来源于stack exchange,提问作者Sam

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.04 16:25:16