三天前,我可以在三个不同的系统上安装包没有任何问题。 R在所有三个系统上重建(Gentoo强制重建),现在我无法从CRAN上下载和安装任何系统....
> install.packages('rmarkdown')
Warning: unable to access index for repository https://r-forge.r-project.org/src/contrib:
internet routines cannot be loaded
Warning: unable to access index for repository https://cran.rstudio.com/src/contrib:
internet routines cannot be loaded
Warning: unable to access index for repository https://cran.uk.r-project.org/src/contrib:
internet routines cannot be loaded
这是我在.Rprofile
...
## Set CRAN mirrors
local({r <- getOption("repos"); r["CRAN"] <- "https://cran.uk.r-project.org"; options(repos=r)})
options(repos=c(RStudio='https://rstudio.org/_packages', getOption('repos')))
options(repos=c(RStudio='https://cran.rstudio.com/', getOption('repos')))
并获取完整信息..
> sessionInfo()
R version 3.2.3 (2015-12-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Gentoo/Linux
locale:
[1] LC_CTYPE=en_GB.utf8 LC_NUMERIC=C
[3] LC_TIME=en_GB.utf8 LC_COLLATE=en_GB.utf8
[5] LC_MONETARY=en_GB.utf8 LC_MESSAGES=en_GB.utf8
[7] LC_PAPER=en_GB.utf8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_GB.utf8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] devtools_1.10.0
loaded via a namespace (and not attached):
[1] memoise_1.0.0 digest_0.6.9
搜索我发现了几个线程。前两个是镜像关闭或错误指定的地方,因为不支持https ...
...这两者都不是问题,因为我使用的镜像是向上的(e.g.)。然后我遇到了以下两个线程(一个引用了另一个)......
去年11月还提到thread on R-help。
阅读这些似乎问题可能是少数几件事之一......
LD_LIBRARY_PATH
的问题。LD_LIBRARY_PATH
检查这个我遇到了我的三个系统......
> Sys.getenv("LD_LIBRARY_PATH")
[1] "/usr/lib64/R/lib:/usr/lib64/blas/reference:/usr/lib64/lapack/reference"
> Sys.getenv("LD_LIBRARY_PATH")
[1] "/usr/lib64/R/lib:/usr/lib64/blas/reference:/usr/lib64/lapack/reference:/etc/java-config-2/current-system-vm/jre/lib/amd64/server"
> Sys.getenv("LD_LIBRARY_PATH")
[1] "/usr/lib64/R/lib:/usr/lib64/blas/reference:/usr/lib64/lapack/reference:/etc/java-config-2/current-system-vm/jre/lib/amd64/server"
所以R可以找到自己的库。这表明它可能是SSL支持的另一个问题
我发现有其他人遇到此问题(请参阅here),因此我检查了Curl是否可以访问这些网址,因此获得了SSL支持...
# curl https://cran.rstudio.com/src/contrib/
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<title>Index of /src/contrib</title>
</head>
<body>
<h1>Index of /src/contrib</h1>
<table><tr><th><img src="/icons/blank.gif" alt="[ICO]"></th><th><a href="?C=N;O=D">Name</a></th><th><a href="?C=M;O=A">Last modified</a></th><th><a href="?C=S;O=A">Size</a></th><th><a href="?C=D;O=A">Description</a></th></tr><tr><th colspan="5"><hr></th></tr>
<tr><td valign="top"><img src="/icons/back.gif" alt="[DIR]"></td><td><a href="/src/">Parent Directory</a></td><td> </td><td align="right"> - </td><td> </td></tr>
<tr><td valign="top"><img src="/icons/folder.gif" alt="[DIR]"></td><td><a href="00Archive/">00Archive/</a></td><td align="right">03-Mar-2016 04:50 </td><td align="right"> - </td><td> </td></tr>
....
所以看起来Curl工作正常,我可以访问URL,但R不能。
关于如何解决这个问题的任何指示都会受到欢迎,因为我无法弄明白。
提前致谢。
答案 0 :(得分:0)
我尝试使用R --vanilla
开始简单的R会话(在earlier post on R-help中建议)并且显示了更多信息......
# R --vanilla
R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> install.packages('rmarkdown')
--- Please select a CRAN mirror for use in this session ---
Error in download.file(url, destfile = f, quiet = TRUE) :
internet routines cannot be loaded
In addition: Warning message:
In download.file(url, destfile = f, quiet = TRUE) :
unable to load shared object '/usr/lib64/R/modules//internet.so':
/usr/lib64/libcurl.so.4: undefined symbol: SSLv2_client_method
Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") :
cannot open file '/usr/share/doc/R-3.2.3/CRAN_mirrors.csv': No such file or directory
因此,我从源代码重建了net-misc/curl-7.47.1
和dev-lang/R-3.2.3
并解决了问题。