Support

Manual Installation of RStudio Package Manager for Minimal Root Use

Follow

Discussion

The RStudio Package Manager installer requires root privileges and installs the RStudio Package Manager to /opt/rstudio-pm. Additionally, it configures services for Upstart or systemd (depending on your OS), adds log files to /var/log, adds a configuration file under /etc/rstudio-pm, creates an rstudio-pm user account and group, and places a logentries configuration.

It is possible to extract the RStudio Package Manager files manually and configure the service to use configuration and data files at a custom location. Most of these steps can be performed without root privileges.

First, download the latest version of RStudio Package Manager from the link provided by RStudio. Then, extract the files from the installer by following the instructions for your operating system, below.

Extracting Files (Ubuntu)

Note you may need to install binutils with sudo apt install binutils to use the ar utility.

mkdir rspm
ar x rstudio-pm_<version>_amd64.deb
tar -xzvf data.tar.gz -C rspm/
cd rspm

Extracting Files (Red Hat/CentOS 7, SUSE 12)

mkdir rspm
cd rspm
rpm2cpio ../rstudio-pm-<version>.x86_64.rpm | cpio -div

Create Directories

Create the directories you need to run RStudio Package Manager.

mkdir log
touch log/rstudio-pm.log
touch log/rstudio-pm.access.log
mkdir run
mkdir data

SUSE Only - Create OpenSSL Softlinks

  ln -s -f /lib64/libssl.so.1.0.0 ./opt/rstudio-pm/ext/activation/libssl.so.10
  ln -s -f /lib64/libcrypto.so.1.0.0 ./opt/rstudio-pm/ext/activation/libcrypto.so.10

Licensing

The license manager used by RStudio Package Manager supports userspace license activation. If you wish to activate a system-wide license, root privileges are required. See Section 2.5 of the admin guide for more details on system-wide licensing.

# Initialize a trial in userspace
./opt/rstudio-pm/bin/license-manager initialize --userspace

# Activate a userspace license key, if you have a license key
./opt/rstudio-pm/bin/license-manager activate --userspace <key>

Edit config file

Next, edit the RStudio Package Manager configuration file to point to the directories and access log you created. Add the following lines to the [Server] configuration section.

; ./etc/rstudio-pm/rstudio-pm.gcfg

[Server]
DataDir = <path-to-unbundled-rspm-dir>/data
SockFileDir = <path-to-unbundled-rspm-dir>/run
AccessLog = <path-to-unbundled-rspm-dir>/log/rstudio-pm.access.log

Start the RStudio Package Manager Service

When RStudio Package Manager is installed without root, the system daemons are not used to automatically start RStudio Package Manager. Instead, the user is required to start RStudio Package Manager manually and ensure the process continues to run. The command to start RStudio Package Manager is:

./opt/rstudio-pm/bin/rstudio-pm --config \
./etc/rstudio-pm/rstudio-pm.gcfg >> ./log/rstudio-pm.log 2>&1

As an example, nohup can be used to launch this command without blocking or depending on the terminal using:

nohup ./opt/rstudio-pm/bin/rstudio-pm --config \
./etc/rstudio-pm/rstudio-pm.gcfg >> ./log/rstudio-pm.log 2>&1 &

Use the CLI to Manage RStudio Package Manager

./opt/rstudio-pm/bin/rspm --config ./etc/rstudio-pm/rstudio-pm.gcfg help

In this mode, every CLI command will require the config flag that points at the configuration file.

Comments