1

I am unable to install any R packages today. The issue did not happen until last week (the last time I use the command). My laptop system is a Windows 10, and I am not using any local network/proxy/work Internet, so pretty sure it is not the proxy server or firewall issue. I updated my R, restart the program and the computer, no help.

Here is the error message.

Warning in install.packages : unable to access index for repository http://cran.rstudio.com/src/contrib: cannot open URL 'http://cran.rstudio.com/src/contrib/PACKAGES'

Here are the methods I have tried from the Internet but did NOT work:

  1. Update the CRAN Repository for installing packages
  2. Uncheck the "Use secure download method for HTTP" and "Use Internet Explorer library/proxy for HTTP" options
  3. Run R as administrator
  4. Change the library to install packages
  5. Use the install.packages('package_name', dependencies=TRUE, repos='http://cran.rstudio.com/')

Again, I am pretty sure there is no firewall/proxy issue, as I never had the problem until last week, using the same Internet and the same device. Does anyone have ideas? Thanks in advance for the help!

RitaL
  • 31
  • 6
  • I had no problem opening: http://cran.rstudio.com/src/contrib/PACKAGES This is http not https... maybe you need use https instead of http – Jose Cabrera Zuniga Oct 11 '21 at 21:17
  • Make sure you can access the URL from your web browser. http://cran.rstudio.com/src/contrib/PACKAGES. If you cannot, then it's not an R issue, it's a network configuration issue. It's unclear who controls your internet network settings but make sure you can access the website. – MrFlick Oct 11 '21 at 22:10
  • @MrFlick Thank you. I can open the URL with my browser. – RitaL Oct 12 '21 at 01:05
  • @JoseCabreraZuniga I had no problem using a browser, either. With my R, neither http nor https works. – RitaL Oct 12 '21 at 01:08

1 Answers1

0

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.

RitaL
  • 31
  • 6