1

I installed R-3.2.2 from the source (./configure, ./make, ./make install). It works perfectly fine but when I try to install any package from any repository, I get the following message:

> 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) 

I'm not using any proxy and I tried doing what is said here - I've installed build-essentials and r-base-dev with apt-get, but still, the error continues.

What is strange though is that with RStudio on the same machine, the download of packages works fine, the problem occurs only when I use R from the command line.

Community
  • 1
  • 1
Jon Cardoso-Silva
  • 991
  • 11
  • 25

2 Answers2

3

The mirror you chose is a https mirror. You need to have setup a secure connection in order to use https mirrors.
Select 18 (HTTP mirrors) and you will see a list of additional mirrors. Pick one of those

Alternatively; you can use 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
> 
Bas
  • 1,066
  • 1
  • 10
  • 28
  • I just tested and yes, it works, thanks. But I have another machine (Gentoo Linux) and I can download packages from HTTPS mirrors, why can't I do it now with this Linux Mint machine that I have? Is there anything I need to set up? – Jon Cardoso-Silva Oct 14 '15 at 11:39
  • 1
    You can check out [this link](https://support.rstudio.com/hc/en-us/articles/206827897-Secure-Package-Downloads-for-R) for more information about https connection for CRAN. By the looks of it, you need to have setup a secure connection to use https. – Bas Oct 14 '15 at 11:44
0

I realise this is almost 2 years later but I couldn't find an answer so have added my solution here.

I came up against the same problem. Couldn't download from https but could from http on MacOS Sierra 10.12.6 with R version 3.4.1 and libcurl 7.55.1 with https support. The problem for me was I had no certificates for https. I downloaded the file from https://raw.githubusercontent.com/bagder/ca-bundle/master/ca-bundle.crt and set the environment variable CURL_CA_BUNDLE to the full path to ca-bundle.crt and this worked.

Wajid
  • 119
  • 1
  • 7