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?

Thanks!!

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

download.file("https://community.rstudio.com/t/no-way-of-installing-packages-work-on-rstudio/149389",
              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

Thanks!!

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:

available.packages()

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

options(repos="https://cran.r-project.org")
install.packages("tidyverse")

(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, "geojson_0.3.4.zip")
download.file("https://cran.r-project.org/bin/windows/contrib/4.0/geojson_0.3.4.zip",
              destfile = path_to_save)



install.packages(path_to_save,
                 contriburl = NULL)

library(geojson)

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

remove.packages("geojson")

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

utils::install.packages("tidyverse")

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.