美文网首页
WSL中安装R包

WSL中安装R包

作者: dulunar | 来源:发表于2020-09-01 09:21 被阅读0次

前言

因为安装某些软件,需要用到devtools,但是很可惜,直接在WSL的ubuntu 18.04中,我的R的版本是R version 3.6.1 (2019-07-05),无论使用非sudo用户或者sudo用户安装,都失败了:

sudo R --no-save
install.packages("devtools", repos="http://cran.r-project.org", clean=TRUE)
## ERROR: dependencies ‘usethis’, ‘callr’, ‘desc’, ‘pkgbuild’, ‘pkgload’, ‘rcmdcheck’, ‘roxygen2’, ‘rversions’, ‘testthat’ are not available for package ‘devtools’

## mv: cannot move '/home/luna/R/x86_64-pc-linux-gnu-library/3.6/00LOCK-ps/00new/ps' to '/home/luna/R/x86_64-pc-linux-gnu-library/3.6/ps': Permission denied

安装过程中,一直出现这些错误,实在没办法了,google了一下。

解决

因为R 3.6的一个新的功能,所以会出现这些问题,这个功能的名字是staged installation of packages; 个人感觉这个新功能主要面对的可能是R包的作者或者维护者,对于安装人员好像造成了一些困扰。

这个新功能的介绍中解释了00new文件夹的意义:

The current implementation of package installation by default backs up the old installation of the package by moving it into a per-library 00LOCK directory (or per-package 00LOCK-pkgname). The installation is performed directly into the final directory pkgname in the library. If it fails, it is by default cleaned up and the old version is moved back; otherwise, if it succeeds, the old version is deleted. If the lock directory already exists when the installation is requested, the installation fails with an error and one typically would delete the directory manually. During parallel install, the per package locking is used (00LOCK-pkgname).

This locking mechanism works for backing-up and recovering previous versions of packages in case of error, but it does not prevent access to partially installed packages

可以取消这个功能,在R中:

Sys.setenv(R_INSTALL_STAGED = FALSE)
install.packages("devtools", repos="http://cran.r-project.org", clean=TRUE)

参考

staged installation of packages

“Non Zero Exit Status” R 3.6.0 "Biobase"

                                —— dulunar 后记于 2019.11

相关文章

  • WSL中安装R包

    前言 因为安装某些软件,需要用到devtools,但是很可惜,直接在WSL的ubuntu 18.04中,我的R的版...

  • 2019-07-10R包安装

    安装R包的几种方式从CRAN中安装R包 ########安装R包的几种方式############# 修改清华镜像...

  • 杂项 Windows安装WSL

    安装WSL 检查 cmd下执行wsl查看 windows 中是否已经安装过 wsl,如上所示,表示没有安装。 安装...

  • R包安装、加载与更新

    掌握了R基本的一些概念,今天咱们来简单了解下R包,R包安装、加载与更新 安装R包的几种方式 从CRAN中安装R包 ...

  • 「Debug R」WSL里面R 3.6 安装R包的一个bug

    今天在WSL里面安装R包Biobase时遇到如下的报错 简单的说由于没有权限重命名,因此安装失败。这个问题对于老版...

  • 🎣®[R|报错解决]Error in nchar(object,

    其他资料:从Github上轻松安装R包—githubinstall包 报错信息:在R中安装github R包时弹出...

  • Windows10安装WSL2

    安装WSL内核升级包 wsl_update_x64.msi 以管理员方式启动PowerShell: 验证 WSL2...

  • WSL+Intellij+Xdebug调试php

    配置环境 安装好wsl,wsl中安装php,php安装xdebug参考 配置xdebug 这里intellij中的...

  • Jupyter Notebook 中添加R内核

    首先在R官网下载R安装包和Git安装包,并安装好。打开R GUI,在console中输入install.packa...

  • 学习安装 Bioconductor

    1.R 中安装 2.conda 安装环境 进入R 配置 R 环境下 更新安装R包 安装ggplot2 3、常用安装...

网友评论

      本文标题:WSL中安装R包

      本文链接:https://www.haomeiwen.com/subject/ydbmsktx.html