R - When Trying to Install Package: Internetopenurl Failed

R - when trying to install package: InternetOpenUrl failed

The problem might be a failure to handle https properly by the underlying method used by R for downloading files. This can be verified by trying

fname <- tempfile()
download.file("https://cran.uni-muenster.de/", destfile=fname)
file.remove(fname)

If that does not work but replacing https with http does, this most likely means that the method used by R's download.file cannot deal with https at all or fails verifying SSL certificates.

You can try

  • using regular http mirrors instead of https
  • update your CA certificate bundle to allow proper certificate validation
  • setting the default download method to "libcurl" and see if that helps:

    options(download.file.method="libcurl")

Unable to install R packages for R 4.1

The issue was eventually solved by options(download.file.method="libcurl").

Following another suggested answer, I tried options(repos = "http://cran.rstudio.com/") but got the below message:

Warning message:
In download.file(mirrors_csv_url, destfile = mirrors_csv, quiet = TRUE) :
InternetOpenUrl failed: 'ìÂs°þ$'

Then the answer to this question did the trick.



Related Topics



Leave a reply



Submit