manager {bspm}R Documentation

Manage Packages from System Repositories


Talk to the system package manager to install/remove... packages from system repositories (see details for further options).







character vector of names of packages.


If R runs with root privileges (e.g., in a docker container), these functions talk directly to the system package manager. Regular users are also able to install/remove packages without any administrative permission via the accompanying D-Bus service if bspm is installed as a system package. If not, these methods fall back on using sudo to elevate permissions (or pkexec in GUIs such as RStudio) in interactive sessions. Note that, if you want to fall back to sudo in a non-interactive session, you need to set options(bspm.sudo=TRUE).

If options(bspm.sudo.autodetect=TRUE), bspm tries to detect whether it is running in an environment where password-less sudo can be used (e.g., in a containerized environment such as a Fedora Toolbox) for every call, and then uses sudo accordingly.

By default, if a package is not available in the system repositories, it is installed from R's configured repositories along with all its dependencies. This behavior can be changed via options(bspm.always.install.deps=TRUE), which tries to install from system repositories recursive dependencies of those packages that are not available. For example, if A depends on B, and B is available in the system repositories but A is not, then only A will be installed from CRAN with this option enabled, and both will be installed from CRAN with this option disabled (default).

The discover method is only needed when e.g. a new repository is added that contains packages with different prefixes (for example, your system repositories may provide packages called r-cran-* and r-bioc-* and then you add a new repository that provides packages called r-github-*). Otherwise, it will not have any effect besides regenerating the internal configuration files.


Functions install_sys and remove_sys return, invisibly, a character vector of the names of packages not available in the system.

See Also



## Not run: 
# install 'units' and all its dependencies from the system repos

# now remove it

## End(Not run)

[Package bspm version 0.3.9 Index]