Unable to install packages in RStudio 2023.09.0.463

Hi all,

I've recently updated R and RStudio for an end user, but he is getting the following when attempting to install packages.

> install.packages('tidyverse')
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/pkeef/AppData/Local/R/win-library/4.3’
(as ‘lib’ is unspecified) 

I can't post the rest of the error as I am only able to post 2 links.

Are you behind a proxy? Can you access that file from your browser?

Can you download it manually from R? I.e. what's the output of

download.file("https://cran.rstudio.com/src/contrib/PACKAGES", tmp <- tempfile())


Hi Gabor,

I think it may be because I haven't updated RTools along with the other 2. I'm going to try this this morning and see if that fixes the problem.


RTools have nothing to do with this, I am afraid. It is still a good idea to install the newer version, but it won't fix this issue.

Sorry I don't use R myself, how would I format this line of code when downloading tidyverse?

What I meant, can you run this code in R, and show us the output you get?

Also, are you behind a proxy? Can you access that file from your browser?

This is the error I get when running that code -

trying URL 'https://cran.rstudio.com/src/contrib/PACKAGES'
Error in download.file("", :
cannot open URL ''
In addition: Warning message:
In download.file("https://cran.rstudio.com/src/contrib/PACKAGES", :
URL '': status was 'HTTP response code said error'

We can access the file from our browser successfully and download the package files

(Links redacted as I can only post 2 links in my replies)

Mark the output as mardown code:

<code here>

Are you behind a proxy?

If yes, you probably need to set the http_proxy and https_proxy environment variables. If you are on Windows, that might or might not work, depending on your proxy setup.

A workaround that probably works is to use the wininet method to download files:

options(download.file.method = "wininet")

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.