Skip to content

Installing Posit Package Manager#

These instructions describe how to install Posit Package Manager, formerly RStudio Package Manager, on a Linux server. See Install Posit Professional Products for alternative installation instructions.

Depending on your environment, additional steps may be required to install RSPM.

Prerequisites

For air-gapped or offline installations additional steps are required:

Step 1. Download and install#

As a first step, download and install the server application. See the Signed RSPM Build section below to verify the signature of the package.

sudo apt update
sudo apt install gdebi-core
curl -fO https://cdn.rstudio.com/package-manager/ubuntu/amd64/rstudio-pm_2022.11.2-18_amd64.deb
sudo gdebi rstudio-pm_2022.11.2-18_amd64.deb
sudo apt update
sudo apt install gdebi-core
curl -fO https://cdn.rstudio.com/package-manager/ubuntu20/amd64/rstudio-pm_2022.11.2-18_amd64.deb
sudo gdebi rstudio-pm_2022.11.2-18_amd64.deb
sudo apt update
sudo apt install gdebi-core
curl -fO https://cdn.rstudio.com/package-manager/ubuntu22/amd64/rstudio-pm_2022.11.2-18_amd64.deb
sudo gdebi rstudio-pm_2022.11.2-18_amd64.deb
curl -fO https://cdn.rstudio.com/package-manager/centos/x86_64/rstudio-pm-2022.11.2-18.x86_64.rpm
sudo yum install rstudio-pm-2022.11.2-18.x86_64.rpm
curl -fO https://cdn.rstudio.com/package-manager/rhel8/x86_64/rstudio-pm-2022.11.2-18.x86_64.rpm
sudo dnf install rstudio-pm-2022.11.2-18.x86_64.rpm
curl -fO https://cdn.rstudio.com/package-manager/rhel9/x86_64/rstudio-pm-2022.11.2-18.x86_64.rpm
sudo dnf install rstudio-pm-2022.11.2-18.x86_64.rpm
sudo zypper refresh
curl -fO https://cdn.rstudio.com/package-manager/opensuse15/x86_64/rstudio-pm-2022.11.2-18.x86_64.rpm
sudo zypper install rstudio-pm-2022.11.2-18.x86_64.rpm

These commands will install the product into /opt/rstudio-pm.

Note

See the Manual Installation for Minimal Root Use to install into a non-default location or to perform a non-root install.

Signed RSPM Build#

The RSPM installer is signed with a key belonging to Posit. If you'd like to know more about the benefits of using signed builds, see the Signed Builds page.

If you wish to verify this signature, then do one of the following:

  • Obtain the public key from our website and save it into a file (e.g., rstudio-code-signing.key).
  • Obtain the key from a GnuPG keyserver using the following commands:
gpg --keyserver keyserver.ubuntu.com --recv-keys 3F32EE77E331692F
gpg --keyserver keyserver.ubuntu.com --recv-keys 3F32EE77E331692F
gpg --armor --export 3F32EE77E331692F > rstudio-code-signing.key

# Import the key into the set of keys RPM uses to validate package signatures
sudo rpm --import rstudio-code-signing.key

After obtaining the GnuPG key, validate the RSPM installer executing the following commands:

dpkg-sig --verify rstudio-pm_2022.11.2-18_amd64.deb
rpm -K rstudio-pm-2022.11.2-18.x86_64.rpm

Step 2. Initial Configuration#

By default, the RSPM settings are controlled by a configuration file located at /etc/rstudio-pm/rstudio-pm.gcfg. At a minimum, complete the Address property within the Server section.

Do this by specifying the URL used to access RSPM:

; /etc/rstudio-pm/rstudio-pm.gcfg
[Server]
Address = http://r-packages.example.com

Replace http://r-packages.example.com with the value appropriate for your organization.

There are many other options that you may want to configure now or at a later point, such as:

Tip

An example configuration file that includes all of the available configuration settings along with their defaults is installed at /etc/rstudio-pm/rstudio-pm.gcfg.defaults.

Step 3. Activate license#

To verify the status of your license:

Terminal
/opt/rstudio-pm/bin/license-manager status

If you have a license key, then activate the license by replacing LICENSE_KEY with the value of your license key:

Terminal
/opt/rstudio-pm/bin/license-manager activate LICENSE_KEY

See the Licensing page for full details and information about offline activation.

Step 4. Restart Package Manager#

After updating the configuration file and activating the license, it is required that you restart the RSPM service.

Tip

Most configuration setting changes can also be updated by taking the RSPM service offline and bringing it back online. See the Online and Offline Modes page for more information.

To restart the RSPM service, run the following commands:

Terminal
sudo systemctl stop rstudio-pm
sudo systemctl start rstudio-pm

RSPM supports the HUP signal when:

  • You are making licensing changes.
  • Activating a new license.

Step 5. Verify installation#

View the Package Manager Web UI#

As a user, you can view RSPM in a web browser, which provides you a user-friendly interface for viewing information about packages, package READMEs, metrics, etc.

To view RSPM in a web browser:

  1. Open a web browser.
  2. Navigate to RSPM by following https://r-packages.example.com:<port> (the default port is 4242).

Once you navigate to the link, the RSPM Welcome page displays. For any administrative changes, use the CLI.

The Admin Command-line Interface#

RSPM is administered through a command-line interface (CLI) which administrators can use to create:

  • Create repositories and sources
  • Setup sync schedules for CRAN sources

To invoke the Admin CLI, run: /opt/rstudio-pm/bin/rspm list

If you aren't able to access the Admin CLI, then verify that your user is a member of the rstudio-pm group by doing the following:

  1. Run the following to add USER to the rstudio-pm group (replace <USER> with your username):

    Terminal
    sudo usermod -aG rstudio-pm <USER>
    
  2. Close the terminal or SSH session.

  3. Start a new session and run the groups command. This enumerates the groups that the current user is a member of.
  4. Confirm that rstudio-pm is listed.
  5. Re-run the command:

    Terminal
    /opt/rstudio-pm/bin/rspm list
    

Note

You can select a different group to grant access to the Admin CLI. For more information, see the Changing RunAs User page.

Optional Downloads#

There are two additional executables that are optional depending on the intended installation. These are the:

  • RSPM Standalone CLI: Used to remotely manage the server with actions like adding packages or uploading binaries
  • RSPM Offline Downloader: Used to download remote assets to initialize or upgrade air-gapped servers

See the sections below and Package Manager administrative guide for usage.

Download and install the standalone CLI#

The standalone RSPM CLI can be used for several actions such as adding packages or uploading binaries remotely. For more information see the quickstart page.

RSPM_SERVER_VERSION=2022.11.2-18
curl -o rspm -f https://cdn.rstudio.com/package-manager/linux/amd64/rspm-cli-linux-${RSPM_SERVER_VERSION}
chmod +x rspm
RSPM_SERVER_VERSION=2022.11.2-18
curl -o rspm -f https://cdn.rstudio.com/package-manager/darwin/amd64/rspm-cli-darwin-${RSPM_SERVER_VERSION}
chmod +x rspm

Tip

Ensure compatibility by setting the RSPM_SERVER_VERSION environment variable to the server version. The server version can be found by running the following commands on a running RSPM server:

$ rspm --version
...
RStudio Package Manager Server Version: 2022.11.2-18; ...

Download and install offline downloader#

The rspm-offline-downloader utility is required for air-gapped installations of RSPM to function correctly. See the admin guide for more information on installing in an air-gapped or offline environment.

For a list of changes, see the RSPM Offline Downloader release notes.

curl -o rspm-offline-downloader -f https://cdn.rstudio.com/package-manager/linux/amd64/rspm-offline-downloader-linux-2022.11.2-18
chmod +x rspm-offline-downloader
curl -o rspm-offline-downloader -f https://cdn.rstudio.com/package-manager/darwin/amd64/rspm-offline-downloader-darwin-2022.11.2-18
chmod +x rspm-offline-downloader