Unable to install packages and switching between CRAN mirrors does not help

Running R 4.0.5 on a Linux command line (RedHat Centos 7) and unable to install any packages. Checked for internet connectivity and it passed the test. Switched between CRAN mirrors using chooseCRANmirror() and didn't help.


Warning: unable to access index for repository https://cloud.r-project.org/src/contrib:
cannot open URL 'https://cloud.r-project.org/src/contrib/PACKAGES'
Warning message:
package ‘rlang’ 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

This is very like a connectivity issue, R is not being able to connect to the CRAN repository you have selected.
Try disabling the secure download setting.

If that doesn't work, 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.

I have already disabled the secure download setting. I am using R at work and there has been no change in traffic restrictions according to our IT. The issue just suddenly happened while everything was fine the day before.

Well, I can access the CRAN repository so servers are working, the connection issue must be on your side, if there are no network changes at your workplace then maybe it is an issue with your internet provider. Either way, I would insist with your IT department to check on this.

Our IT put the server on bypass and still I have the issue.

On a Vanilla R and still on Linux command window (suggested here r - Warning: unable to access index for repository internet routines cannot be loaded - Stack Overflow), I can install packages with no issues. What does it mean?

My session info is:

R version 4.0.5 (2021-03-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux

Matrix products: default
BLAS/LAPACK: /usr/lib64/libopenblasp-r0.3.3.so


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

loaded via a namespace (and not attached):
[1] compiler_4.0.5 cli_3.3.0 tools_4.0.5

Maybe you have a startup file that changes your network configuration in some way that is no longer valid (proxy server credentials maybe)? That is the only thing it comes to my mind.

Would you be able to walk me through that please? I searched for it but I have lack of knowledge to work with those files and didn't understand much about it. Really appreciate it.

If you had modified any Rprofile.site or .Rprofile file, I would expect you to be aware of the location of those files, in other words, if you had change them, you would know it, so it is unlikely to be the cause.

I have heard that RedHat based Linux distributions have very restrictive firewall rules that requires you to "white list" any software you want to be able to connect to the internet instead of only blocking specific ones but I'm not sure of that since I have never use it myself. Sorry I can't be of more help but I'm out of ideas about what might be your problem.

1 Like

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.