rig repos

Manage the R package repositories that rig configures for your R installations.

rig sets up the repositories R uses to install packages (the repos option in R), typically a CRAN mirror and the Posit Public Package Manager (P3M). These are configured per R version, and you can control them when installing R (see the --with-repos and --without-repos options of rig add) or afterwards with the subcommands here.

To look up the packages the repositories offer, see rig pkg.

Subcommands

available
List available R package repositories
list
List configured R package repositories
setup
Set up R package repositories
status
Check the configured R package repositories

rig repos available

List the package repositories that rig knows about and can set up.

These are the repositories you can enable with --with-repos when running rig add or rig repos setup.

Without arguments rig prints one row per repository: its name, whether it is part of the default repository set, and its title.

Pass a repository name to see its description and its URLs, together with the platforms, architectures and R versions each URL applies to. Repository names are matched case insensitively.

Usage

rig repos available [OPTIONS] [name]

Arguments

[name]
Repository to show in detail, e.g. ‘P3M’ (case insensitive)

Options

--admin
Run in admin mode (overrides RIG_MODE and config)
-h, --help
Print help (see a summary with ‘-h’)
--json
JSON output
--no-cache
Do not read or write rig’s cache (overrides RIG_NO_CACHE and config)
--user
Run in user mode (overrides RIG_MODE and config)

Examples

# List all repositories rig knows about
rig repos available
# Show the URLs of one repository
rig repos available P3M

rig repos list

List the package repositories configured for an R version.

By default rig shows the repositories of the default R version; use --r-version to pick another. Add --all to include repositories that are not enabled by default, and --raw to show repository URLs without resolving the % variables in them.

Usage

rig repos list [OPTIONS]

Options

--admin
Run in admin mode (overrides RIG_MODE and config)
--all
Show all repositories, not just the default ones
-h, --help
Print help (see a summary with ‘-h’)
--json
JSON output
--no-cache
Do not read or write rig’s cache (overrides RIG_NO_CACHE and config)
-r, --r-version <r-version>
R version to list repositories for, instead of the default
--raw
Do not resolve % variables in repository URLs.
--user
Run in user mode (overrides RIG_MODE and config)

rig repos setup

Set up the package repositories for installed R versions.

By default rig configures the repositories for all installed R versions; use --r-version to restrict it to one. Use --with-repos and --without-repos to control which repositories are enabled, the same way as for rig add.

Usage

rig repos setup [OPTIONS]

Options

--admin
Run in admin mode (overrides RIG_MODE and config)
-h, --help
Print help (see a summary with ‘-h’)
--no-cache
Do not read or write rig’s cache (overrides RIG_NO_CACHE and config)
-r, --r-version <r-version>
R version to set up repositories for (default: all)
--user
Run in user mode (overrides RIG_MODE and config)
--with-repos=<with-repos>
Repositories to enable, in addition to the ones enabled by default. If --without-repos is also specified (without a value), then only these repositories will be enabled.
--without-repos[=<without-repos>]
Do not set up package repositories. Alternatively, specify which ones to skip, a comma-separated list. If --with-repos is also specified, then only the repositories in that argument will be enabled.

rig repos status

Check the package repositories configured for an R version: how quickly each one responds, whether it responds at all, what kinds of packages it serves, and how fresh its package index is.

rig checks the same repositories that rig repos list shows, in the same order. By default these are the repositories of the default R version; use --r-version to pick another one. Add --all to include repositories that are not enabled by default.

The report

For each repository rig prints:

  • ping — how long the repository took to answer a request for the package index. rig asks for the very index R would use on this machine, for the selected R version, so this is the latency you pay when installing a package. It is a HEAD request: the index itself is not downloaded, and the time does not depend on how large it is.

  • statusok if the index is there. source only means the repository has no index for this platform and R version, but it does have source packages. Anything else is the HTTP status code the server returned, or why it returned nothing at all, e.g. timeout or cannot connect.

  • types — the package types the R installation’s repositories file declares for the repository: source, win (Windows binaries) and mac (macOS binaries). These are declarations, not measurements; the status column is what says whether the index for this platform is really there.

  • updated — the Last-Modified date of the package index, i.e. how fresh the repository’s view of the packages is.

  • url — the repository URL, with the Bioconductor %v and %bm variables resolved. Use --raw to print the URLs unresolved; rig still resolves them internally, since an unresolved URL cannot be checked.

A repository whose types column ends in * serves prebuilt Linux binaries as source packages. Linux binaries have no package type of their own in R, so a Posit Package Manager repository offers them from a distribution-specific URL instead, and rig recognizes those URLs.

The repositories are checked in parallel, so the command takes about as long as the slowest repository, not as long as all of them together. An unreachable repository is reported in its row; it does not fail the command.

Usage

rig repos status [OPTIONS]

Options

--admin
Run in admin mode (overrides RIG_MODE and config)
--all
Check all repositories, not just the default ones
-h, --help
Print help (see a summary with ‘-h’)
--json
JSON output
--no-cache
Do not read or write rig’s cache (overrides RIG_NO_CACHE and config)
-r, --r-version <r-version>
R version to check repositories for, instead of the default
--raw
Show repository URLs without resolving % variables.
--user
Run in user mode (overrides RIG_MODE and config)

Examples

# Check the repositories of the default R version
rig repos status
# Include repositories that are not enabled by default
rig repos status --all
# Check the repositories of another R version
rig repos status --r-version 4.4.1
# Machine readable output, with the exact URLs, statuses and timings
rig repos status --json