How to use a local package repository


Often, a Revolution R Enterprise server, for security reason, does not have an internet connection over which to download and install R packages so a local repository is setup internally. This article describes configuring Revolution R to use that local package repository.

The instructions in sections 4.1 and 4.2 of the Revolution R Enterprise Installation Guide for Linux ( are generally correct though there is a mistake in the doc in the tools::write_PACKAGES command at the end of 4.2.

1. Create the parent directory of the repo. This can be any directory but in the example is /local/repos.

2. For a Linux repo, you will need the package sources (.tar.gz) in src/contrib underneath the parent repo directory (ex. /local/repos/src/contrib). You can create the src/contrib manually and manually download the tar.gz packages there or use rsync as in the guide which will mirror the entire repo and create src/contrib for you.

3. Start Revolution R and create e the PACKAGES and PACKAGES.gz index files for the repo using tools::write_PACKAGES. This should be done for the /local/repos/src/contrib directory where the src packages actually reside:
> tools:::write_PACKAGES("/local/repos/src/contrib")
Note this is different from the example in the documentation that says to create the package index files in /local/repos.

4. Configure RRE to use the local repo. Edit /usr/lib64/Revo-7.3/R-3.1.1/lib64/R/etc/ and edit or comment out the line that points to the default Revo CRAN mirror:
} else {r <- c(REVO=Revobase::getRevoRepos())

If you do not have internet access from your RRE installation and will be using the local repo exclusively, replace this line with a pointer to only the local repo:
} else {#r <- c(REVO=Revobase::getRevoRepos())r <- c(LOCAL="/local/repos")}
Note that you specify the parent directory for the repo location, not the full /local/repos/src/contrib path.

If you have internet access and are just using a local repo for a few local packages, you can configure both repos:
} else {r <- c(REVO=Revobase::getRevoRepos(), LOCAL="/local/repos")}
Start RRE and verify the current configuration for the repo(s):
> options("repos")
If correct, test installing packages. Be sure your RRE user has rw permissions on both the full path of the local repos and the RRE library.

Article ID: 3103790 - Last Review: 1 Nov 2015 - Revision: 1