RStudio Connect QuickStart - install.packages() Issue

:rofl: Definitely an unintentional trap... but maybe one that we don't mind :laughing: RSPM was born out of challenging customer offline environments, where package provisioning and management was one of the key problems for RSP / RSC servers, where arbitrary user code is being executed and needs package dependencies. One exciting new feature that the QuickStart does not yet showcase for RSPM is package binaries (for CRAN), which we describe a bit here: Faster package installs on Linux with Package Manager beta release

Setting HTTP_PROXY is often done just by setting environment variables. I.e. HTTP_PROXY=someurl:8080 HTTPS_PROXY=someurl:8080 curl -i -v https://cran.rstudio.com.

However, setting them for other software can be a bit tricky, depending on the software. We have specific guidance for Connect and RSPM:

https://docs.rstudio.com/connect/admin/package-management.html#proxy-configuration
and
https://docs.rstudio.com/rspm/admin/outbound-proxy.html

In RSP, I think this normally just takes the form of /etc/profile or ~/.bashrc or /etc/environment or something of that nature. You could also set these types of variables inside of ~/.Rprofile, Rprofile.site, , ~/.Renviron, Renviron.site, etc. in the R configuration.

It's worth noting that sometimes setting HTTP_PROXY, etc. can cause trouble, because certain URLs require the outbound proxy to be reached (i.e. cran.rstudio.com), where others cannot be reached from the outbound proxy (i.e. localhost or other internal infrastructure, on occasion). Basically, proxies can be painful.

If you do need to install packages not in CRAN, you can also add them to RSPM if you want :smile:

https://docs.rstudio.com/rspm/admin/repositories.html#git-sources

1 Like