Repositories

Configure public, private, and fallback package repositories for rpx.

rpx resolves packages from enabled repositories. The public rrepo registry is enabled by default and serves package metadata from:

https://upstream.rrepo.dev/cran

Keep the default registry enabled for most projects. It exposes package metadata through a low-latency API, which keeps dependency resolution fast.

Add a repository

Add repositories from the project root with rpx repo add.

rpx repo add https://<org-slug>.rrepo.dev/<repo-slug>
rpx repo add https://packagemanager.posit.co/cran/latest

rpx detects whether the URL exposes the rrepo API or a CRAN-like src/contrib/PACKAGES index.

List and remove repositories

Use rpx repo list to see the repositories configured for the project.

rpx repo list

Remove a repository by URL when a project no longer needs it.

rpx repo remove https://packagemanager.posit.co/cran/latest

Use a binary fallback

A useful setup is to keep the default rrepo registry enabled and add Posit Package Manager's latest CRAN repository as a fallback for binary artifacts.

rpx repo add https://packagemanager.posit.co/cran/latest

rpx sync tries Windows and macOS binary artifacts from enabled repositories when they are available, then falls back to the locked source artifact.

Locking behavior

During rpx lock, rpx merges package versions across enabled repositories.

Existing locked versions are preferred when they are still available from enabled repositories. If the same version is available from multiple repositories, the earlier repository wins for the locked source URL.

Private repositories

Private rrepo repositories use organization URLs under rrepo.dev.

https://<org-slug>.rrepo.dev/<repo-slug>

When a repository requires authentication, rpx prompts for an API key and stores it in the operating system keyring for that repository URL.

Use a packages:read API key for installs. Use a packages:write key only for publishing workflows.

Override the default registry

Set RPX_REGISTRY_BASE_URL when you need to point rpx at a different default registry root for one command.

RPX_REGISTRY_BASE_URL=https://example.rrepo.dev/cran rpx lock

To lock without the default public registry, use --no-default-repo.

rpx lock --no-default-repo

The default-repository choice is recorded in rpx.lock. Use --default-repo to enable it again when regenerating the lockfile.

rpx lock --default-repo