2015-10-14 104 views
1

我從源代碼安裝了R-3.2.2(./configure,./make,./make install)。它的工作原理完全正常,但是當我試圖從任何存儲庫安裝任何包,我得到以下信息:無法從Linux 3.2.2下載軟件包Mint 17.1

> 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 - 我已經安裝了build-essentialsr-base-dev與apt-get,但仍然錯誤仍然存​​在。

奇怪的是,如果RStudio在同一臺機器上,軟件包的下載工作正常,只有當我從命令行使用R時纔會出現問題。

回答

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 
> 
+0

我剛剛測試過,是的,它的工作原理,謝謝。但是我有另一臺機器(Gentoo Linux),我可以從HTTPS鏡像下載軟件包,爲什麼我現在不能使用這臺Linux Mint機器來完成它?我需要設置什麼嗎? –

+1

您可以查看[此鏈接](https://support.rstudio.com/hc/en-us/articles/206827897-Secure-Package-Downloads-for-R)以獲取有關https連接CRAN的更多信息。從外觀上看,你需要建立一個安全的連接來使用https。 – Bas

0

我意識到這是近2年後,但我無法找到答案,所以在這裏加了我的解決方案。

我想出了同樣的問題。無法從https下載,但可以從MacOS Sierra 10.12.6(R版本3.4.1)和httpcurl 7.55.1(https支持)上的http下載。我的問題是我沒有https的證書。我從https://raw.githubusercontent.com/bagder/ca-bundle/master/ca-bundle.crt下載了該文件,並將環境變量CURL_CA_BUNDLE設置爲ca-bundle.crt的完整路徑,並且工作正常。