Package installation in R 4.2.2

I recently upgraded my version R 4.2.2 and since then I can't install literally ANY package at all. I thought may be it is because of proxy or firewall or something from my end but when I manually switch to older version of R and then tried to install the packages which was done without any errors. the error suggest it cannot connect to CRAN repository but manually tried to open the link so it was accessible. Whatever package I try to install , even latest packages like "tidyverse" which are available on CRAN; I get the following error as shown in image

Pls someone help me with this because this way I can't use latest version it's such a hindrance in work when I can't install relevant packages for my codes.
Thanks in advance

Another thing is that it is not internet connection problem because if i switch to older version my rstudio can install packages without any problem but as soon as I open for new version and even click on "install package" button following msg appear:

Warning: unable to access index for repository http://cran.rstudio.com/src/contrib:

It is definitely a connectivity issue, have in mind that on Windows each R version gets installed independently therfore the firewall might be blocking just the new version and not the old one.

These are some things to try:

  • Enable the 'secure download" setting. This might help when some download methods are not available in your system
  • Check if your internet connection has traffic restrictions of some kind, like a firewall, proxy server, etc. This is usually the case when you are at work or school.

What was the reason?
I have the same problem with latest R-version 4.2.3 and Rstudio 2023.03.0-386 on win10.
I have already checked Windows Firewall settings and temporarly switched it off - no effect.
My PC is located inside a domain network.

Well I still can't find any reason for this. I have checked firewall setting as well and even tried secure download option nothing is working. I'm just manually changed version to previous one where I can use and install packages.

Well I've tried secure download option but to no avail same problem persist. The previous version of R is working fine, there is no error in installing package or connecting to CRAN

I have found a solution: setting two environment variables in windows:
name1: http_proxy
value1: http proxy address of domain network (http://proxy.domainXXX.com:port)
name2: https_proxy
value2: http proxy address of domain network
(http://proxy.domainXXX.com:port)
Note that for both environment variables there is the same proxy adress. I don't know if this is really correct or necessary but it works with me. I have not tried other things, for it was an advise from a colleague who had the same problem with Python installation.

That was one of the things I recommended to check, your connection is behind a proxy server so you definitely need to set your credentials.

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.