Skip to content

rv upgrade

rv will resolve packages from the source and the version it is locked at. rv upgrade will ignore the lockfile, re-resolve, and install changed packages. This does not guarantee packages will be installed from the same repository, simply installs packages as if there was no lockfile present.

Terminal window
rv upgrade [OPTIONS]
  • --dry-run - No changes made, only reports what would happen if the command was run.

In this example, we will start with the following config and lock files:

rproject.toml
[project]
name = "upgrade"
r_version = "4.4"
repositories = [
{ alias = "PPM", url = "https://packagemanager.posit.co/cran/2025-01-01" },
]
dependencies = [
"R6",
]

Adding a new repository as the first repository in the config does not change the project since R6 is locked to be installed from PPM:

rproject.toml
[project]
name = "upgrade"
r_version = "4.4"
repositories = [
{ alias = "PPM_new", url = "https://packagemanager.posit.co/cran/latest" },
{ alias = "PPM", url = "https://packagemanager.posit.co/cran/2025-01-01" },
]
dependencies = [
"R6",
]

Running rv upgrade ignores the lockfile and is resolved to come from the first repository, PPM_new.

% rv upgrade
- R6
+ R6 (2.6.1, binary from https://packagemanager.posit.co/cran/latest) in 0ms