tidyverse installation failure - connected to new R version?

I am trying to teach myself R and have successfully downloaded R and RStudio, but cannot get tidyverse to download for some reason. I've tried looking at other posts, but am honestly very stuck still. I think it could have to do with the new updated version of R but am not sure.

Could I get any feedback please? I'm not sure if I need to keep waiting and trying to install until it does work or if there is a different issue here. Thank you in advance

Warning in install.packages :
  unable to access index for repository https://cran.rstudio.com/bin/windows/contrib/4.4:
  cannot open URL 'https://cran.rstudio.com/bin/windows/contrib/4.4/PACKAGES'
Packages which are only available in
  source form, and may need compilation
  of C/C++/Fortran: ‘ellipsis’ ‘cli’
  ‘readxl’ ‘rlang’ ‘xml2’
installing the source packages ‘withr’, ‘cellranger’, ‘broom’, ‘ggplot2’, ‘hms’, ‘pillar’, ‘tidyverse’

trying URL 'https://cran.rstudio.com/src/contrib/withr_3.0.0.tar.gz'
Warning in install.packages :
  URL 'https://cran.rstudio.com/src/contrib/withr_3.0.0.tar.gz': status was 'SSL connect error'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'https://cran.rstudio.com/src/contrib/withr_3.0.0.tar.gz'
Warning in install.packages :
  download of package ‘withr’ failed
trying URL 'https://cran.rstudio.com/src/contrib/cellranger_1.1.0.tar.gz'
Warning in install.packages :
  URL 'https://cran.rstudio.com/src/contrib/cellranger_1.1.0.tar.gz': status was 'SSL connect error'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'https://cran.rstudio.com/src/contrib/cellranger_1.1.0.tar.gz'
Warning in install.packages :
  download of package ‘cellranger’ failed
trying URL 'https://cran.rstudio.com/src/contrib/broom_1.0.5.tar.gz'
Content type 'application/x-gzip' length 641849 bytes (626 KB)
downloaded 626 KB

trying URL 'https://cran.rstudio.com/src/contrib/ggplot2_3.5.1.tar.gz'
Content type 'application/x-gzip' length 3604371 bytes (3.4 MB)
downloaded 3.4 MB

trying URL 'https://cran.rstudio.com/src/contrib/hms_1.1.3.tar.gz'
Warning in install.packages :
  URL 'https://cran.rstudio.com/src/contrib/hms_1.1.3.tar.gz': status was 'SSL connect error'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'https://cran.rstudio.com/src/contrib/hms_1.1.3.tar.gz'
Warning in install.packages :
  download of package ‘hms’ failed
trying URL 'https://cran.rstudio.com/src/contrib/pillar_1.9.0.tar.gz'
Warning in install.packages :
  URL 'https://cran.rstudio.com/src/contrib/pillar_1.9.0.tar.gz': status was 'SSL connect error'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'https://cran.rstudio.com/src/contrib/pillar_1.9.0.tar.gz'
Warning in install.packages :
  download of package ‘pillar’ failed
trying URL 'https://cran.rstudio.com/src/contrib/tidyverse_2.0.0.tar.gz'
Warning in install.packages :
  URL 'https://cran.rstudio.com/src/contrib/tidyverse_2.0.0.tar.gz': status was 'SSL connect error'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'https://cran.rstudio.com/src/contrib/tidyverse_2.0.0.tar.gz'
Warning in install.packages :
  download of package ‘tidyverse’ failed
ERROR: dependencies 'ellipsis', 'rlang' are not available for package 'broom'
* removing 'C:/Users/alexa/AppData/Local/R/win-library/4.4/broom'
Warning in install.packages :
  installation of package ‘broom’ had non-zero exit status

Welcome to our community.
I'm not the most qualified to help you here and I'm only writing from my own experience:

Your error message starts with being unable to update packages like readxl rlang...
Please go to your R installation and try updating them one by one.


In packages menu go to update packages and follow instructions.

If you managed to update those packages, next step should be to try and download other dependencies of the brrom package and see if there are still problems.

That file is definitely there, so maybe this is a one off network failure? Can you try running it again, and if the issue persists, can you send the output of the commands below?

sessionInfo()
getOption("repos")

I seem to be getting a different error now:

> install.packages("tidyverse")
Installing package into ‘C:/Users/alexa/AppData/Local/R/win-library/4.4’
(as ‘lib’ is unspecified)
also installing the dependencies ‘cellranger’, ‘cli’, ‘hms’, ‘pillar’, ‘readxl’, ‘rlang’, ‘xml2’

trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.4/cellranger_1.1.0.zip'
Content type 'application/zip' length 106564 bytes (104 KB)
downloaded 104 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.4/cli_3.6.2.zip'
Warning in install.packages :
  URL 'https://cran.rstudio.com/bin/windows/contrib/4.4/cli_3.6.2.zip': status was 'SSL connect error'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'https://cran.rstudio.com/bin/windows/contrib/4.4/cli_3.6.2.zip'
Warning in install.packages :
  download of package ‘cli’ failed
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.4/hms_1.1.3.zip'
Warning in install.packages :
  URL 'https://cran.rstudio.com/bin/windows/contrib/4.4/hms_1.1.3.zip': status was 'SSL connect error'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'https://cran.rstudio.com/bin/windows/contrib/4.4/hms_1.1.3.zip'
Warning in install.packages :
  download of package ‘hms’ failed
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.4/pillar_1.9.0.zip'
Warning in install.packages :
  URL 'https://cran.rstudio.com/bin/windows/contrib/4.4/pillar_1.9.0.zip': status was 'SSL connect error'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'https://cran.rstudio.com/bin/windows/contrib/4.4/pillar_1.9.0.zip'
Warning in install.packages :
  download of package ‘pillar’ failed
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.4/readxl_1.4.3.zip'
Warning in install.packages :
  URL 'https://cran.rstudio.com/bin/windows/contrib/4.4/readxl_1.4.3.zip': status was 'SSL connect error'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'https://cran.rstudio.com/bin/windows/contrib/4.4/readxl_1.4.3.zip'
Warning in install.packages :
  download of package ‘readxl’ failed
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.4/rlang_1.1.3.zip'
Warning in install.packages :
  URL 'https://cran.rstudio.com/bin/windows/contrib/4.4/rlang_1.1.3.zip': status was 'SSL connect error'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'https://cran.rstudio.com/bin/windows/contrib/4.4/rlang_1.1.3.zip'
Warning in install.packages :
  download of package ‘rlang’ failed
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.4/xml2_1.3.6.zip'
Warning in install.packages :
  URL 'https://cran.rstudio.com/bin/windows/contrib/4.4/xml2_1.3.6.zip': status was 'SSL connect error'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'https://cran.rstudio.com/bin/windows/contrib/4.4/xml2_1.3.6.zip'
Warning in install.packages :
  download of package ‘xml2’ failed
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.4/tidyverse_2.0.0.zip'
Warning in install.packages :
  URL 'https://cran.rstudio.com/bin/windows/contrib/4.4/tidyverse_2.0.0.zip': status was 'SSL connect error'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'https://cran.rstudio.com/bin/windows/contrib/4.4/tidyverse_2.0.0.zip'
Warning in install.packages :
  download of package ‘tidyverse’ failed
package ‘cellranger’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
	C:\Users\alexa\AppData\Local\Temp\RtmpaI9uGh\downloaded_packages

I ran what you recommended and this is the output:

> sessionInfo()
R version 4.4.0 (2024-04-24 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 11 x64 (build 22631)

Matrix products: default


locale:
[1] LC_COLLATE=English_United States.utf8 
[2] LC_CTYPE=English_United States.utf8   
[3] LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.utf8    

time zone: America/New_York
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils    
[5] datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_4.4.0 tools_4.4.0   
> get0ption("repos")
Error in get0ption("repos") : could not find function "get0ption"
> getOption("repos")
                       CRAN 
"https://cran.rstudio.com/" 
attr(,"RStudio")
[1] TRUE

The program says that all of my packages are up to date. I tried installing rlang and ellipsis for broom but those failed as well. I still get the SSL connect error after the URL

trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.4/rlang_1.1.3.zip'
Warning in install.packages :
  URL 'https://cran.rstudio.com/bin/windows/contrib/4.4/rlang_1.1.3.zip': status was 'SSL connect error'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'https://cran.rstudio.com/bin/windows/contrib/4.4/rlang_1.1.3.zip'
Warning in install.packages :
  download of package ‘rlang’ failed

The SSL certificates of cran.rstudio.com are fine, so this seems like a configuration problem on your machine.

I don't know how the first download succeeded, but you can try installing pak with

install.packages("pak", repos = sprintf(
  "https://r-lib.github.io/p/pak/stable/%s/%s/%s",
  .Platform$pkgType,
  R.Version()$os,
  R.Version()$arch
))

(Coming from All about installing pak. — Installing pak • pak) and if that's successful, then call

pak::pkg_install("tidyverse")

to install tidyverse and all its dependencies.

I tried and this error is still occurring:

> install.packages("pak", repos = sprintf(
+     "https://r-lib.github.io/p/pak/stable/%s/%s/%s",
+     .Platform$pkgType,
+     R.Version()$os,
+     R.Version()$arch))
Warning in install.packages :
  unable to access index for repository https://cran.rstudio.com/src/contrib:
  cannot open URL 'https://cran.rstudio.com/src/contrib/PACKAGES'
Installing package into ‘C:/Users/alexa/AppData/Local/R/win-library/4.4’
(as ‘lib’ is unspecified)
trying URL 'https://r-lib.github.io/p/pak/stable/win.binary/mingw32/x86_64/bin/windows/contrib/4.4/../../../../../../../mingw32/x86_64/pak_0.7.2_R-4-4_x86_64-mingw32.zip'
Content type 'application/zip' length 8610467 bytes (8.2 MB)
downloaded 8.2 MB


The downloaded binary packages are in
	C:\Users\alexa\AppData\Local\Temp\RtmpaI9uGh\downloaded_packages
> 

Not sure why it is having issues accessing the repository

I tried the second code and it partially worked:


The downloaded binary packages are in
	C:\Users\alexa\AppData\Local\Temp\RtmpaI9uGh\downloaded_packages
> library()
> pak::pkg_install("tidyverse")
✔ Updated metadata database: 5.67 MB in 15 files.                         
✔ Updating metadata database ... done                                     
                                                                             
→ Will install 35 packages.
→ Will download 35 packages with unknown size.
+ base64enc     0.1-3   [dl]
+ bit64         4.0.5   [dl]
+ bslib         0.7.0   [dl]
+ cachem        1.0.8   [dl]
+ callr         3.7.6   [dl]
+ cli           3.6.2   [dl]
+ DBI           1.2.2   [dl]
+ digest        0.6.35  [dl]
+ ellipsis      0.3.2   [dl]
+ farver        2.1.1   [dl]
+ fastmap       1.1.1   [dl]
+ fontawesome   0.5.2   [dl]
+ highr         0.10    [dl]
+ hms           1.1.3   [dl]
+ htmltools     0.5.8.1 [dl]
+ ids           1.0.1   [dl]
+ jquerylib     0.1.4   [dl]
+ knitr         1.46    [dl]
+ pillar        1.9.0   [dl]
+ ps            1.7.6   [dl]
+ readxl        1.4.3   [dl]
+ rematch2      2.1.2   [dl]
+ rlang         1.1.3   [dl]
+ sass          0.4.9   [dl]
+ stringi       1.8.3   [dl]
+ sys           3.4.2   [dl]
+ systemfonts   1.0.6   [dl]
+ textshaping   0.3.7   [dl]
+ tidyverse     2.0.0   [dl]
+ viridisLite   0.4.2   [dl]
+ vroom         1.6.5   [dl]
+ withr         3.0.0   [dl]
+ xfun          0.43    [dl]
+ xml2          1.3.6   [dl]
+ yaml          2.3.8   [dl]
ℹ Getting 35 pkgs with unknown sizes
✖ Failed to download DBI 1.2.2 (i386+x86_64-w64-mingw32)                                            
✖ Failed to download base64enc 0.1-3 (x86_64-w64-mingw32)                                            
✖ Failed to download bslib 0.7.0 (i386+x86_64-w64-mingw32)                                           
✖ Failed to download callr 3.7.6 (i386+x86_64-w64-mingw32)                                           
✖ Failed to download cli 3.6.2 (x86_64-w64-mingw32)                                                  
✖ Failed to download pillar 1.9.0 (i386+x86_64-w64-mingw32)                                          
✔ Got cachem 1.0.8 (x86_64-w64-mingw32) (73.81 kB)                                                   
✔ Got bit64 4.0.5 (x86_64-w64-mingw32) (504.16 kB)                                                   
✔ Got fastmap 1.1.1 (x86_64-w64-mingw32) (135.08 kB)                                                 
✔ Got xfun 0.43 (x86_64-w64-mingw32) (496.17 kB)                                                     
✔ Got sys 3.4.2 (x86_64-w64-mingw32) (47.87 kB)                                                     
✔ Got ellipsis 0.3.2 (x86_64-w64-mingw32) (41.05 kB)                                     
✔ Got ids 1.0.1 (i386+x86_64-w64-mingw32) (126.11 kB)                                    
✔ Got viridisLite 0.4.2 (i386+x86_64-w64-mingw32) (1.30 MB)                              
✔ Got farver 2.1.1 (x86_64-w64-mingw32) (1.52 MB)                                        
✔ Got fontawesome 0.5.2 (i386+x86_64-w64-mingw32) (1.35 MB)                             
✔ Got htmltools 0.5.8.1 (x86_64-w64-mingw32) (362.99 kB)                           
✔ Got textshaping 0.3.7 (x86_64-w64-mingw32) (1.19 MB)                            
✔ Got highr 0.10 (i386+x86_64-w64-mingw32) (46.73 kB)                     
✔ Got hms 1.1.3 (i386+x86_64-w64-mingw32) (105.42 kB)                     
✔ Got rlang 1.1.3 (x86_64-w64-mingw32) (1.62 MB)                          
✔ Got systemfonts 1.0.6 (x86_64-w64-mingw32) (1.32 MB)                    
✔ Got yaml 2.3.8 (x86_64-w64-mingw32) (119.11 kB)                         
✔ Got ps 1.7.6 (x86_64-w64-mingw32) (558.02 kB)                           
✔ Got readxl 1.4.3 (x86_64-w64-mingw32) (1.20 MB)                         
✔ Got digest 0.6.35 (x86_64-w64-mingw32) (219.36 kB)                      
✔ Got jquerylib 0.1.4 (i386+x86_64-w64-mingw32) (526.06 kB)               
✔ Got knitr 1.46 (i386+x86_64-w64-mingw32) (1.09 MB)                      
✔ Got tidyverse 2.0.0 (i386+x86_64-w64-mingw32) (431.35 kB)               
✔ Got vroom 1.6.5 (x86_64-w64-mingw32) (1.34 MB)                          
✔ Got rematch2 2.1.2 (i386+x86_64-w64-mingw32) (48.75 kB)                 
✔ Got withr 3.0.0 (i386+x86_64-w64-mingw32) (249.59 kB)                   
✔ Got xml2 1.3.6 (x86_64-w64-mingw32) (1.61 MB)                           
✔ Got sass 0.4.9 (x86_64-w64-mingw32) (2.61 MB)                           
✔ Got stringi 1.8.3 (x86_64-w64-mingw32) (15.03 MB)                       
✖ Failed to download 6 packages.                                          
Error: 
! error in pak subprocess
Caused by error: 
! Failed to download DBI from `https://cran.rstudio.com//bin/windows/contrib/4.4/DBI_1.2.2.zip`.
Failed to download base64enc from `https://cran.rstudio.com//bin/windows/contrib/4.4/base64enc_0.1-3.zip`.
Failed to download bslib from `https://cran.rstudio.com//bin/windows/contrib/4.4/bslib_0.7.0.zip`.
Failed to download callr from `https://cran.rstudio.com//bin/windows/contrib/4.4/callr_3.7.6.zip`.
Failed to download cli from `https://cran.rstudio.com//bin/windows/contrib/4.4/cli_3.6.2.zip`.
Failed to download pillar from `https://cran.rstudio.com//bin/windows/contrib/4.4/pillar_1.9.0.zip`.
Type .Last.error to see the more details.
> 

It downloaded most packages. I don't know why your downloads randomly fail, but you can also try to set a different CRAN mirror, e.g. try the main site:

options(repos = c(CRAN = "https://cran.r-project.org"))

and then re-run the pak install:

pak::pkg_install("tidyverse")

It caches the downloads, so if you try it a couple of times, it might work eventually.

Ultimately, you'll need to investigate why your downloads are randomly failing.

1 Like

This worked perfectly on the first try- thank you so much. I was getting really discouraged before even starting to actually learn R.

OK, if the cran.r-project.org repo works better for you, then you could set it as the default by including

options(repos = c(CRAN = "https://cran.r-project.org"))

in your R profile. You can see where your R profile is with this command:

path.expand("~/.Rprofile")

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