【问题标题】:Unable to download packages from R 3.2.2 in Linux Mint 17.1无法在 Linux Mint 17.1 中从 R 3.2.2 下载包
【发布时间】:2015-10-14 10:49:52
【问题描述】:

我从源代码(./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-essentialsr-base-dev,但错误仍然存​​在。

但奇怪的是,在同一台机器上使用 RStudio,下载包工作正常,只有当我从命令行使用 R 时才会出现问题。

【问题讨论】:

    标签: r


    【解决方案1】:

    您选择的镜像是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
    > 
    

    【讨论】:

    • 我刚刚测试过,是的,它有效,谢谢。但是我有另一台机器(Gentoo Linux),我可以从 HTTPS 镜像下载包,为什么我现在不能用我拥有的这台 Linux Mint 机器呢?我有什么需要设置的吗?
    • 您可以查看this link,了解有关 CRAN 的 https 连接的更多信息。从外观上看,您需要设置安全连接才能使用 https。
    【解决方案2】:

    我意识到这已经是将近 2 年了,但我找不到答案,所以在这里添加了我的解决方案。

    我遇到了同样的问题。无法从 https 下载,但可以从带有 R 版本 3.4.1 的 MacOS Sierra 10.12.6 和带有 https 支持的 libcurl 7.55.1 上的 http 下载。我的问题是我没有 https 证书。我从https://raw.githubusercontent.com/bagder/ca-bundle/master/ca-bundle.crt 下载了文件,并将环境变量 CURL_CA_BUNDLE 设置为 ca-bundle.crt 的完整路径,这很有效。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-01-03
      • 2015-04-06
      • 1970-01-01
      • 1970-01-01
      • 2020-06-02
      相关资源
      最近更新 更多