今天在WSL里面安裝R包Biobase時(shí)遇到如下的報(bào)錯(cuò)
mv: cannot move '/home/xzg/R/x86_64-pc-linux-gnu-library/3.6/00LOCK-Biobase/00new/Biobase' to '/home/xzg/R/x86_64-pc-linux-gnu-library/3.6/Biobase': Permission denied
ERROR: moving to final location failed
簡(jiǎn)單的說(shuō)由于沒(méi)有權(quán)限重命名,因此安裝失敗。這個(gè)問(wèn)題對(duì)于老版本的R(3.6之前)是不存在的,是新版本增加的特性,設(shè)計(jì)初衷是為了解決R包升級(jí)引起的問(wèn)題。具體作用參考https://developer.r-project.org/Blog/public/2019/02/14/staged-install/
解決方法就是安裝前運(yùn)行如下語(yǔ)句
Sys.setenv(R_INSTALL_STAGED = FALSE)
參考資料: