rv configure repository
Used to add, update, or remove repositories from the configuration file, while maintaining the file’s formatting and comments.
This command has 5 subcommands for fine tuned repository configuration.
Adds a new repository to the repositories section of the config file.
rv configure repository add <ALIAS> --url <URL> [OPTIONS]
Arguments
Section titled “Arguments”ALIAS
- the repository alias to add
Options
Section titled “Options”--url <URL>
required - the url of the repository to add--force-source
- enableforce_source
for this repository--first
— Add as first repository entry--last
default - Add as last repository entry--before <alias>
- Add before the specified alias--after <alias>
- Add after the specified alias
Examples
Section titled “Examples”All examples on this page will start with the following configuration:
[project]name = "configure"repositories = [ { alias = "CRAN", url = "https://cran.r-project.org" }, { alias = "PPM", url = "https://packagemanager.posit.co/cran/2025-01-01" },]
Add repository as last entry
Section titled “Add repository as last entry”rv configure repository add "bioconductor" --url "https://bioconductor.org/packages/3.18/bioc"ORrv configure repository add "bioconductor" --url "https://bioconductor.org/packages/3.18/bioc" --last
[project]name = "configure"repositories = [ { alias = "CRAN", url = "https://cran.r-project.org" }, { alias = "PPM", url = "https://packagemanager.posit.co/cran/2025-01-01" }, { alias = "bioconductor", url = "https://bioconductor.org/packages/3.18/bioc" },]
Repository 'bioconductor' added successfully with URL: https://bioconductor.org/packages/3.18/bioc
Add a repository with force_source
as the middle repository
Section titled “Add a repository with force_source as the middle repository”rv configure repository add "bioconductor" --url "https://bioconductor.org/packages/3.18/bioc" --force-source --after CRANORrv configure repository add "bioconductor" --url "https://bioconductor.org/packages/3.18/bioc" --force-source --before PPM
[project]name = "configure"repositories = [ { alias = "CRAN", url = "https://cran.r-project.org" }, { alias = "bioconductor", url = "https://bioconductor.org/packages/3.18/bioc", force_source = true }, { alias = "PPM", url = "https://packagemanager.posit.co/cran/2025-01-01" },]
Repository 'bioconductor' added successfully with URL: https://bioconductor.org/packages/3.18/bioc
replace
Section titled “replace”Replace an existing repository entry, keeping the original alias unless otherwise specified.
rv configure repository replace <OLD_ALIAS> --url <URL> [OPTIONS]
Arguments
Section titled “Arguments”OLD_ALIAS
- the repository alias to replace
Options
Section titled “Options”--url <URL>
required - the url of the repository to replace--alias <ALIAS>
- new repository alias. Will keep the original alias if not specified.--force-source
- enable/disableforce_source
for this repository
Example
Section titled “Example”We start with the same configuration file as the first example, then update the CRAN
alias
to be the latest Posit Package Manager url and enable the force_source
option using the following command:
rv configure repository replace CRAN --url "https://packagemanager.posit.co/cran/latest" --force-source
[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" },]
Repository replaced successfully - new alias: 'CRAN', URL: https://packagemanager.posit.co/cran/latest
update
Section titled “update”Update an existing repository’s fields
rv configure repository update <TARGET_ALIAS> [OPTIONS]
Arguments
Section titled “Arguments”TARGET_ALIAS
- The alias of the repository to update. Required unless using--match-url
Options
Section titled “Options”--match-url <URL>
- Match repository based on the URL instead of the alias--alias <ALIAS>
- The new repository alias--url <URL>
- The new repository url--force-source
- Enableforce_source
--no-force-source
- Disableforce_source
Examples
Section titled “Examples”Updating a repositories snapshot date
Section titled “Updating a repositories snapshot date”rv configure repository update PPM --url "https://packagemanager.posit.co/cran/2025-05-01"
[project]name = "configure"repositories = [ { alias = "CRAN", url = "https://cran.r-project.org" }, { alias = "PPM", url = "https://packagemanager.posit.co/cran/2025-05-01" },]
Repository 'PPM' updated successfully
Updating a CRAN URL
Section titled “Updating a CRAN URL”rv configure repository update --match-url https://cran.r-project.org -- url https://cran.rstudio.com
[project]name = "configure"repositories = [ { alias = "CRAN", url = "https://cran.rstudio.com" }, { alias = "PPM", url = "https://packagemanager.posit.co/cran/2025-05-01" },]
Repository 'CRAN' updated successfully
remove
Section titled “remove”Remove an existing repository
rv configure repository <ALIAS> [OPTIONS]
Arguments
Section titled “Arguments”ALIAS
- repository alias to remove
Example
Section titled “Example”We start with the same configuration file as the first example, then to remove CRAN as a repository entry, we will use the following command:
rv configure repository remove CRAN
[project]name = "configure"repositories = [ { alias = "PPM", url = "https://packagemanager.posit.co/cran/2025-05-01" },]
Repository 'CRAN' removed successfully
Clear all repositories
rv configure repository clear [OPTIONS]
Example
Section titled “Example”We start with the same configuration file as the first example, then to clear the repositories section, we run the following command:
rv configure repository clear
[project]name = "configure"repositories = []
All repositories cleared successfully