rv sync
Synchronize the config file, lock file, and project library, by removing and/or adding packages, to reach the desired project state.
rv sync [OPTIONS]Options
Section titled “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
Using --locked for CI
Section titled “Using --locked for CI”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 --lockedfails instead of writing it. - If
use_lockfileis set tofalse,--lockedfails 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.
Example
Section titled “Example”[project]name = "my project"r_version = "4.4"
repositories = [ { alias = "PPM", url = "https://packagemanager.posit.co/cran/latest" }]
dependencies = [ "tibble",]rv sync installs the tibble package and all of its dependencies, indicating which version, from where, and
the time it took for each installed package.
% rv sync+ cli (3.6.5, binary from https://packagemanager.posit.co/cran/latest) in 1ms+ fansi (1.0.6, binary from https://packagemanager.posit.co/cran/latest) in 1ms+ glue (1.8.0, binary from https://packagemanager.posit.co/cran/latest) in 1ms+ lifecycle (1.0.4, binary from https://packagemanager.posit.co/cran/latest) in 0ms+ magrittr (2.0.3, binary from https://packagemanager.posit.co/cran/latest) in 0ms+ pillar (1.10.2, binary from https://packagemanager.posit.co/cran/latest) in 0ms+ pkgconfig (2.0.3, binary from https://packagemanager.posit.co/cran/latest) in 0ms+ rlang (1.1.6, binary from https://packagemanager.posit.co/cran/latest) in 1ms+ tibble (3.2.1, binary from https://packagemanager.posit.co/cran/latest) in 0ms+ utf8 (1.2.5, binary from https://packagemanager.posit.co/cran/latest) in 0ms+ vctrs (0.6.5, binary from https://packagemanager.posit.co/cran/latest) in 0msDirectorymy-project
Directoryrv/
Directoryscripts/
- …
Directorylibrary/4.4/{arch}/ the installed packages
- cli
- fansi
- glue
- lifecycle
- magrittr
- pillar
- pkgconfig
- rlang
- tibble
- utf8
- vctrs
- rproject.toml
- rv.lock an
rv.lockfile generated to track the package’s sources