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.