无法安装任何 R 包"unable to access index for repository"



我已经尝试了stackoverflow上的主要修复程序,但没有成功:

  • 关闭"使用安全下载方法
  • 将主CRAN存储库更改为Global
  • 卸载/重新安装R
Warning in install.packages :
unable to access index for repository http://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6:
cannot open URL "http://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/PACKAGES"

有什么想法吗?这一切都是在尝试安装pdftools之后开始的(它本身就存在pkgconfig问题(。

编辑:这是完整的代码块。它设法从源下载,但随后给出零退出状态

install.packages("ggplot2")
Installing package into ‘/Users/jackshaw/Library/R/3.6/library’
(as ‘lib’ is unspecified)
Warning: unable to access index for repository https://cloud.r-project.org/bin/macosx/el-capitan/contrib/3.6:
cannot open URL 'https://cloud.r-project.org/bin/macosx/el-capitan/contrib/3.6/PACKAGES'
installing the source package ‘ggplot2’
trying URL 'https://cloud.r-project.org/src/contrib/ggplot2_3.3.0.tar.gz'
Content type 'application/x-gzip' length 3031461 bytes (2.9 MB)
==================================================
downloaded 2.9 MB
[1] "R PROFILE LOADED"
The downloaded source packages are in
‘/private/var/folders/c1/5c3yn_tx2fq7nrcjs_kn637r0000gn/T/RtmpjcV10X/downloaded_packages’
Warning message:
In install.packages("ggplot2") :
installation of package ‘ggplot2’ had non-zero exit status

如果您在Mac/OS上工作,您可能需要使用以下方法重定向您的回购:

install.packages("dplyr", repo = 'https://mac.R-project.org')

CRAN最近似乎出现了故障:https://community.rstudio.com/t/i-can-t-install-packages-on-r-studio-non-zero-exit-status/52135

相关内容

最新更新