R version 3.4.4 can't install packages

Hi,
Currently I can't install any package despite every solution out there
here is the error

Warning: unable to access index for repository https://cloud.r-project.org/src/contrib: cannot open URL 'https://cloud.r-project.org/src/contrib/PACKAGES'

i thought it might be one of the two reason (or none at all):

  1. R can't get through proxy (my school use proxy and I prefer R in linux (ubuntu 18.04))
    or
  2. the address https://cloud.r-project.org/src/contrib: .Please take notice that the address ends with ":" here, it might be the wrong address that R tried to connect to, hence the reason R can't connect to the repository (yesterday I was able to download a package but today I can't anymore)
    or it might be other reasons that I am not aware of (I have tried option(repos="https://cran.rstudio.com/") it doesn't work, I manually access those address in the web browser and both works but just not in R)

by the way I am using
R version 3.4.4 (2018-03-15) -- "Someone to Lean On"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

Hi @New1997! Welcome!

This is the most common reason for the error you’re seeing (when people can otherwise reach CRAN in a web browser). This might be helpful: https://support.rstudio.com/hc/en-us/articles/200488488-Configuring-R-to-Use-an-HTTP-or-HTTPS-Proxy

I can understand why you might be concerned because the syntax is a little unclear, but no need to worry about this! The : is not part of the URL that R tried to access. It’s just a separator between the headline and detail parts of the error message.

Hi,
Thank you for all your replies, now I just discover another problem:
R studio connects and download packages without any issues but R in cli still have the same error.
Regards

On the "R can't get through proxy" theory"; If you think your university's internet is preventing you from allowing R to connect to CRAN, you might check with your university's IT folks first. I used to teach an R class in a university computer lab that prevented access to CRAN, (which makes teaching with R quite painful). I got a professor to put in a ticket to whitelist the repos install.packages() was connecting to, and all was good by the next class.

@jcblum
i tried with my personnal network (so no proxy) Rstudio works fine installation went fine but.... the R in the command line still can't connect to the repository, I still don't know why
Thanks

You might try changing the repository from the regular R console, which should carry over to the CLI interface.

You might also try some of the troubleshooting steps and/or workarounds mentioned in this thread:

I'm afraid we're getting into the territory that gets very difficult to debug remotely, since there are many things specific to your system and your computing environment that could be involved. :confused:

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.