manager {CoprManager} | R Documentation |
Talk to the system package manager to install/remove... packages from system repositories (see details for further options).
install_copr(pkgs)
remove_copr(pkgs)
moveto_copr(lib, newer = FALSE)
available_copr()
discover()
pkgs |
character vector of names of packages. |
lib |
a character vector giving the library directories to remove the
packages from. If missing, defaults to the first element in |
newer |
whether to move newer packages from the user library.
The special value |
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 CoprManager 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(CoprManager.sudo=TRUE)
.
If options(CoprManager.sudo.autodetect=TRUE)
, CoprManager 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.
The moveto_copr
method moves existing user packages to the
system library to avoid package shadowing (i.e., installs the
available system packages and removes copies from the user library;
see shadowed_packages
).
This provides a mechanism to easily deploy CoprManager on an existing R
installation with a populated user library.
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_copr
, remove_copr
, and moveto_copr
return, invisibly, a character vector of the names of packages not available
in the system.
Function available_copr
returns a matrix with one row per
package. Row names are the package names, and column names include
"Package"
, "Version"
, "Repository"
.
integration
, CoprManager-scripts
## Not run:
# install 'units' and all its dependencies from the system repos
CoprManager::install_copr("units")
# now remove it
CoprManager::remove_copr("units")
# get available packages
CoprManager::available_copr()
## End(Not run)