Skip to content

rv sync

Synchronize the config file, lock file, and project library, by removing and/or adding packages, to reach the desired project state.

Terminal window
rv sync [OPTIONS]
  • --save-install-logs-in: Directory in which the install logs for packages compiled from source should be copied to. By default is kept in cache.
  • --locked: Fail instead of updating the lockfile. Introduced in rv v0.22.0
Introduced in rv v0.22.0

By default, rv sync will create or update the lockfile as needed to match the config file. --locked is intended for CI and other reproducible-install contexts where an unexpected lockfile change should be treated as an error rather than silently applied:

  • If the lockfile would need to be created or updated to match the config, rv sync --locked fails instead of writing it.
  • If use_lockfile is set to false, --locked fails immediately, since there’s no lockfile to check against.

Run rv sync (without --locked) locally to update the lockfile, then commit it, before relying on --locked in CI.

rproject.toml
[project]
name = "my project"
r_version = "4.4"
repositories = [
{ alias = "PPM", url = "https://packagemanager.posit.co/cran/latest" }
]
dependencies = [
"tibble",
]