Skip to content

Package Manager

Package Manager is your organization's package repository: a mirror of CRAN, Bioconductor, PyPI, and Open VSX, plus a home for internal packages.1 Users and Connect install from it instead of the internet. The configuration file is on Configuration File, and file owners and modes are on Directories and Files.

Sources and repositories

Two concepts drive everything:

  • A source holds packages from one place: the built in cran, pypi, bioconductor, openvsx sources, a curated subset of CRAN, a Git builder, or local uploads.
  • A repository is what clients point at. It subscribes to one or more sources.1
graph LR
    CRANsrc("cran source") --> CRANrepo("cran repo")
    Curated("curated-cran source<br/>(approved list)") --> Validated("validated repo")
    Git("git source<br/>(internal packages)") --> Internal("internal repo")
    Local("local source<br/>(uploaded tarballs)") --> Internal
    PyPIsrc("pypi source") --> PyPIrepo("pypi repo")
    CRANrepo --> Clients(["Workbench, Connect,<br/>desktops, CI"])
    Validated --> Clients
    Internal --> Clients
    PyPIrepo --> Clients
    style CRANrepo fill:#e8f5ec,stroke:#3f8f5a,stroke-width:2px,color:#1a1a1a
    style Validated fill:#e8f5ec,stroke:#3f8f5a,stroke-width:2px,color:#1a1a1a
    style Internal fill:#e8f5ec,stroke:#3f8f5a,stroke-width:2px,color:#1a1a1a
    style PyPIrepo fill:#e8f5ec,stroke:#3f8f5a,stroke-width:2px,color:#1a1a1a

New installations create cran and pypi repositories automatically.2 To recreate them:

rspm create repo --name=cran --description='CRAN packages'
rspm subscribe --repo=cran --source=cran
rspm create repo --name=pypi --type=python --description='PyPI packages'
rspm subscribe --repo=pypi --source=pypi

List what exists:

rspm list
rspm list sources

Using the CLI

rspm lives in /opt/rstudio-pm/bin. Users who run it must belong to the primary group of the service account (default rstudio-pm):3

sudo usermod -aG rstudio-pm $(whoami)

Log out and back in for the group change to take effect. sudo does not inherit your aliases or PATH, so sudo rspm fails with "command not found". Either call the full path, or add a shell function to ~/.bashrc:

rspm() { /opt/rstudio-pm/bin/rspm "$@"; }

There is no rspm status command.3 Check the service with systemctl status rstudio-pm, and use rspm --help for the command list.

Syncing

The CRAN, Bioconductor, PyPI, and Open VSX sources get metadata from the Posit Package Service (rspm-sync.rstudio.com). Package Manager checks for updates every 10 minutes on its own.2 Force an immediate sync:

rspm sync --type=cran

Package files are downloaded on demand, the first time a client requests them.4

Legacy sync schedules

Old config files often contain [CRAN] SyncSchedule, [PyPI] SyncSchedule, or [Bioconductor] SyncSchedule. These came from older releases, where syncs ran on a cron schedule. Current versions check continuously, and SyncSchedule no longer appears in the configuration reference for any of the three sections.5 Check the release notes and remove keys your version no longer documents.

To hold back updates on purpose, use DelaySyncDuration.5 Snapshots are the better choice; see Change Control.

Outbound access

Outbound access needed for an online install:6

Destination Port Purpose
rspm-sync.rstudio.com 443 Metadata, binaries, and package files
www.wyday.com 443 Online license key activation only

Air gapped installs use the rspm-offline-downloader tool to carry data across. The downloader version must match the server version.7