Skip to content

rv configure repository replace

Replace an existing repository entry, keeping the original alias unless otherwise specified.

rv configure repository replace <OLD_ALIAS> --url <URL> [OPTIONS]
  • OLD_ALIAS - The repository alias to replace
  • --url <URL> - The url of the repository to replace
  • --alias <ALIAS> - New repository alias. Will keep the original alias if not specified.
  • --force-source - Enable force_source for this repository

Starting with the following configuration:

rproject.toml
[project]
name = "configure"
repositories = [
{ alias = "CRAN", url = "https://cran.r-project.org" },
{ alias = "PPM", url = "https://packagemanager.posit.co/cran/2025-01-01" },
]

We update the CRAN alias to be the latest Posit Package Manager url and enable the force_source option using the following command:

Terminal window
rv configure repository replace CRAN --url "https://packagemanager.posit.co/cran/latest" --force-source
rproject.toml
[project]
name = "configure"
repositories = [
{ alias = "CRAN", url = "https://packagemanager.posit.co/cran/latest", force_source = true },
{ alias = "PPM", url = "https://packagemanager.posit.co/cran/2025-01-01" },
]