我从来源(./configure
,./make
,./make install
)安装了R-3.2.2。它工作得很好但是当我尝试从任何存储库安装任何软件包时,我收到以下消息:
> install.packages("igraph")
Installing package into ‘/home/jonathan/R/x86_64-pc-linux-gnu-library/3.2’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
Error in download.file(url, destfile = f, quiet = TRUE) :
unsupported URL scheme
HTTPS CRAN mirror
1: 0-Cloud [https] 2: Austria [https]
3: China (Beijing 4) [https] 4: China (Hefei) [https]
5: Colombia (Cali) [https] 6: France (Lyon 2) [https]
7: Iceland [https] 8: Russia (Moscow 1) [https]
9: Switzerland [https] 10: UK (Bristol) [https]
11: UK (Cambridge) [https] 12: USA (CA 1) [https]
13: USA (KS) [https] 14: USA (MI 1) [https]
15: USA (TN) [https] 16: USA (TX) [https]
17: USA (WA) [https] 18: (HTTP mirrors)
Selection: 10
Warning: unable to access index for repository https://www.stats.bris.ac.uk/R/src/contrib
Warning message:
package ‘igraph’ is not available (for R version 3.2.2)
我没有使用任何代理,我尝试按照here进行操作 - 我已经使用apt-get安装了build-essentials
和r-base-dev
,但仍然存在错误。
有什么奇怪的是,在同一台机器上使用RStudio,下载的软件包工作正常,只有当我从命令行使用R时才会出现问题。
答案 0 :(得分:3)
您选择的镜像是https
镜像。您需要设置安全连接才能使用https mirrors
选择18 (HTTP mirrors)
,您将看到其他镜像列表。选择其中一个
可替换地;你可以使用chooseCRANmirror()
:
> chooseCRANmirror()
HTTPS CRAN mirror
1: 0-Cloud [https] 2: Austria [https]
3: Chile [https] 4: China (Beijing 4) [https]
5: Colombia (Cali) [https] 6: France (Lyon 2) [https]
7: Germany (Münster) [https] 8: Iceland [https]
9: Russia (Moscow) [https] 10: Spain (A Coruña) [https]
11: Switzerland [https] 12: UK (Bristol) [https]
13: UK (Cambridge) [https] 14: USA (CA 1) [https]
15: USA (KS) [https] 16: USA (MI 1) [https]
17: USA (TN) [https] 18: USA (TX) [https]
19: USA (WA) [https] 20: (HTTP mirrors)
Selection: 20
HTTP CRAN mirror
1: 0-Cloud 2: Algeria
3: Argentina (La Plata) 4: Australia (Canberra)
5: Australia (Melbourne) 6: Austria
7: Belgium (Antwerp) 8: Belgium (Ghent)
-------------------------------------------------------------
87: USA (MI 1) 88: USA (MI 2)
89: USA (MO) 90: USA (NC)
91: USA (OH 1) 92: USA (OH 2)
93: USA (OR) 94: USA (PA 1)
95: USA (PA 2) 96: USA (TN)
97: USA (TX) 98: USA (WA)
99: Venezuela 100: Vietnam
Selection: 56
>
答案 1 :(得分:0)
我意识到这已经差不多2年了,但我找不到答案,所以在这里添加了我的解决方案。
我遇到了同样的问题。无法从https下载,但可以从Mac版Sierra 10.12.6上使用R版本3.4.1和libcurl 7.55.1下载支持https。对我来说问题是我没有https的证书。我从https://raw.githubusercontent.com/bagder/ca-bundle/master/ca-bundle.crt下载了文件,并将环境变量CURL_CA_BUNDLE设置为ca-bundle.crt的完整路径,这很有效。