No way of installing packages work on RStudio

Every package I try to install gives me the following error

I have the Use Secure download method disabled, but still nothing.

Any thoughts anyone?


Does R have access to the Internet? What happens if you run:

              destfile = tempfile())

Hi Alexis,

I am connected to internet and here's the output from your snippet

The issue seems to be with CRAN or other servers getting the packages


I don't have the answer, but some ideas to narrow down the problem:

0/ I'm 99.9% sure this will fail, but just in case try:


1/ You haven't used renv, packrat or similar? If in doubt, try installing from a new RStudio project. Also try installing in R (not RStudio); on Windows you can use RGui.

2/ Change the repo url to cran.rproject


(note I'm not using the geojson example as the github repo looks orphaned, though it still seems available on CRAN)

3/ download the binary first, then do a local install. Under the scenes, install.packages() does this two steps, you can separate them:

dir_to_save <- tempdir()
path_to_save <- file.path(dir_to_save, "")
              destfile = path_to_save)

                 contriburl = NULL)


note the library() call should fail in any case because of missing dependencies. You can clean up afterwards with:


4/ very unlikely, but in case the function is overwritten somehow you can try calling it explicitely:


You can also try starting R (not RStudio) from the command line with option --vanilla to ignore any local configuration which could interfere with normal function.

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.