6.2 Configuring Package Manager
In this session, you will:
- Configure RSPM
- Use the RSPM command line interface (CLI)
The goal is to gain a good understanding of the configuration, administration and maintenance of RSPM.
Consider how your RSPM instance will function. There are numerous ways RSPM can be used to serve packages to your users and they can be used in any combination.
Items configured via RSPM CLI:
- Initial CRAN metadata sync
- Package sources (CRAN, CRAN subset, Git, Local)
- Repositories (per your organizations needs)
- Download / update airgapped packages
Items configured via RSPM configuration file:
- Lazy or eager package downloads
- Connectivity via HTTP/HTTPS
- Network ports
- Disk storage locations
- Database settings
- Security settings
; RStudio Package Manager configuration file [Server] ; Address is a public URL for this RStudio Package Manager server. Address = https://rstudio-pm.company.com ; ; Git sources require a configured R installation RVersion = /opt/R/3.5.1 [HTTP] ; RStudio Package Manager will listen on this network address ; for HTTP connections. Listen = :80
All of the RSPM settings are documented in the Appendix on Configuration Options.
Starting, stopping and restarting#
Occasionally it is necessary to start and stop the RStudio Package Manager
Stopping and starting is handled by
- For Ubuntu 16.04/18.04, RHEL/CentOS 7, SUSE 12:
sudo systemctl stop rstudio-pm sudo systemctl start rstudio-pm
sudo systemctl restart rstudio-pm
After a restart, any scheduled syncs that were missed during downtime will automatically begin.
More details on stopping and starting RSPM are provided in the documentation on Server Management - Stopping and Starting.
Upgrading RStudio Package Manager requires limited downtime. During an upgrade users will not be able to install packages. It is recommended that you perform upgrades during a period of downtime.
Steps for the upgrade process:
- Download the latest installer
- Run the install command
Upgrading does not affect packages or other variable data.
More details on upgrades are provided in the documentation on Server Management - Upgrading.
It is recommended that you back up the following locations:
||Packages and variable data|
A running RStudio Package Manager server may be writing into the data directory. You should stop the RStudio Package Manager server before taking a backup.
If you have configured the databases to be stored outside the data directory, ensure that it is also included in the backup and that it is performed at the same time as the file backup.
More details on backups are provided in the documentation on Server Management - Backups.
You can find logs at:
- Server logs:
- Access logs:
In addition, the activity log is available in the web interface:
Find more information in the RSPM admin guide:
View license status:
sudo /opt/rstudio-pm/bin/license-manager status
sudo /opt/rstudio-pm/bin/license-manager activate LICENSE_KEY
List of available commands:
Supported commands: acquire-lease, acquire-lease-verbose, activate, activate-offline, activate-offline-request, begin-evaluation-offline,...
More details on licensing are provided in the documentation on Licensing.
High availability and load balancing#
Multiple instances of RStudio Package Manager can share the same data in highly available (HA) and load-balanced configurations.
- External database
- Shared file storage for packages
More details on high availability are provided in the documentation on High Availability and Load Balancing:
RSPM command line#
To use the RSPM command line interface:
Usage: rspm [flags] rspm [command] Available Commands: add Command to add packages to sources air-gap Command to print help for setting up an air-gapped RStudio Package Manager service archive Command to archive packages in sources ... Flags: -c, --config string Path to config file -h, --help help for rspm -v, --verbose Provide additional output Use "rspm [command] --help" for more information about a command.
In the following exercise you'll learn about the tools used to configure your instance of RSPM.
Signs of success:
- You know how to use the RSPM CLI
- You understand the different administrative tasks in RSPM
- You can run diagnostics!