Skip to content

R is not correctly configured for the proxy on Linux #4657

@TonyWildish-BH

Description

@TonyWildish-BH

Describe the bug
R and RStudio rely on /etc/R/* for configuration. The /etc/R/Rprofile file is set during system boot to point to Nexus. This code has a bug, so R still tries to use the official CRAN repositories by default. The result is that R cannot install packages correctly.

Steps to reproduce

  1. Start a Linux VM
  2. Start R or RStudio
  3. Run install.packages( "tidyverse" )

The fix is straightforward, there are too many double-quotes in templates/workspace_services/guacamole/user_resources/guacamole-azure-linuxvm/terraform/vm_config.sh, at line 160.

echo -e "local({\n    r <- getOption(\"repos\")\n    r[\"Nexus\"] <- \"""${NEXUS_PROXY_URL}\"/repository/r-proxy/\"\n    options(repos = r)\n})" | tee /etc/R/Rprofile.site

needs to be replaced with

echo -e "local({\n    r <- getOption(\"repos\")\n    r[\"Nexus\"] <- \"${NEXUS_PROXY_URL}/repository/r-proxy/\"\n    options(repos = r)\n})" | tee /etc/R/Rprofile.site

that's one \" removed at the end of the proxy environment variable and a pair of extra double-quotes removed from the beginning of it.

This bug exists in the current head of the repo.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions