Setting Default Repositories in Workbench

For R

In R, default repositories are set using files at the server, R version, user, or project level.

In most Workbench installations, server admins set a binary Package Manager repository as the default.

File Level Use
rsession.conf Whole Server Configuring single repo server-wide
repos.conf Whole Server Configuring multiple repos-server wide or Version of R Configuring different repos per R version


Admins configuring a single server-wide default repository for Workbench, you can use the r-cran-repos argument to the rsession.conf file. This argument can only take a single repository.

For example, on a Ubuntu Bionic installation of Workbench, an admin might configure




Admins configuring multiple server-wide default repositories for Workbench can use the repos.conf file.

For example, on a Ubuntu Bionic installation of Workbench, an admin might configure



Admins configuring repositories that are specific to R versions can use either files.

These files are set for each version of R and should be located in $R_HOME/etc/. You can find R_HOME by running the command R.home(component = "home") in a session of that version of R.

For example, if you find that $R_HOME is /opt/R/3.6.2/lib/R, the for R 3.6.2 would go in /opt/R/3.6.2/lib/R/etc/ files are sourced as regular R code, so setting the repository might look like


options(repos = c(CRAN = ""))"

For Python

In Python, repositories can be set in a pip.conf file. These can be set globally for all versions of Python at /etc/pip.conf.

To set a repository for a particular Python version, a virtualenv should be used, and the repository can be set in $VIRTUAL_ENV/pip.conf.

The pip.conf might look like: /etc/pip.conf

index-url = https://my-rstudio-package-manager/latest/simple
Back to top