Unable to install any new packages, any help?

I am trying to install new packages in RStudio, namely "spData", using 'install.packages("spData")'. This hasn't been an issue until yesterday, I haven't changed anything at all as far as I am aware, yet the only way that I could install packages yesterday was after uninstalling and re-installing R. Which was a pain as then I had to reinstall even more packages.

Upon opening RStudio today, the same issue. Now I have since been able to install tidytext, wordcloud, widyr and patchwork in R rather than RStudio. For this I chose a CRAN Mirror near me geographically, as I have no idea what this actually means (no experience with/knowledge of what a CRAN mirror is). Testing again with spData as this still needs to be installed in RStudio with both global CRAN mirror and the same one used in R and same error again, code and output below:

> install.packages("spData")
Warning in install.packages :
  cannot open compressed file 'C:\Users\jacob\AppData\Local\Temp\RtmpyY8c2t/repos_http%3A%2F%2Fcran.rstudio.com%2Fsrc%2Fcontrib.rds', probable reason 'No such file or directory'
Warning in install.packages :
  cannot open compressed file 'C:\Users\jacob\AppData\Local\Temp\RtmpyY8c2t\file5f143e2a4139', probable reason 'No such file or directory'
Warning in install.packages :
  unable to access index for repository http://cran.rstudio.com/src/contrib:
  cannot open the connection
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/jacob/AppData/Local/R/win-library/4.2’
(as ‘lib’ is unspecified)
Warning in install.packages :
  cannot open compressed file 'C:\Users\jacob\AppData\Local\Temp\RtmpyY8c2t/repos_http%3A%2F%2Fcran.rstudio.com%2Fsrc%2Fcontrib.rds', probable reason 'No such file or directory'
Warning in install.packages :
  cannot open compressed file 'C:\Users\jacob\AppData\Local\Temp\RtmpyY8c2t\file5f1446d921c6', probable reason 'No such file or directory'
Warning in install.packages :
  unable to access index for repository http://cran.rstudio.com/src/contrib:
  cannot open the connection
Warning in install.packages :
  package ‘spData’ is not available for this version of R

A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
Warning in install.packages :
  cannot open compressed file 'C:\Users\jacob\AppData\Local\Temp\RtmpyY8c2t/repos_http%3A%2F%2Fcran.rstudio.com%2Fbin%2Fwindows%2Fcontrib%2F4.2.rds', probable reason 'No such file or directory'
Warning in install.packages :
  cannot open compressed file 'C:\Users\jacob\AppData\Local\Temp\RtmpyY8c2t\file5f1442a5e', probable reason 'No such file or directory'
Warning in install.packages :
  unable to access index for repository http://cran.rstudio.com/bin/windows/contrib/4.2:
  cannot open the connection
Warning messages:
1: In download.file(mirrors_csv_url, destfile = mirrors_csv, quiet = TRUE) :
  URL https://cran.r-project.org/CRAN_mirrors.csv: cannot open destfile 'C:\Users\jacob\AppData\Local\Temp\RtmpyY8c2t\mirrors5f1441ed70ee.csv', reason 'No such file or directory'
2: In download.file(mirrors_csv_url, destfile = mirrors_csv, quiet = TRUE) :
  download had nonzero exit status
3: In file(file, "rt") :
  cannot open file 'C:\Users\jacob\AppData\Local\Temp\RtmpyY8c2t\mirrors5f1441ed70ee.csv': No such file or directory```

Hi!

Check if there is that folder in the mentioned path (in the Temp folder); if you find a similar folder with name starting by Rtmp containing the .rds file mentioned, you can rename it according to the path mentioned in the warning message. Then try installing your packages.

I just had the same issue and this solved it for now, but did not found the source of the problem yet.

All the best!

This topic was automatically closed 42 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.