Skip to content

Installation of R packages with install.R fails #1450

@rgaiacs

Description

@rgaiacs

This is a regression introduced in #1432.

R --vanilla disable the execution of Rprofile.site and .Rprofile. This means that the Rprofile.site created in

#7 [18/32] RUN R RHOME && mkdir -p /etc/rstudio && EXPANDED_CRAN_MIRROR_URL="$(. /etc/os-release && echo https://packagemanager.posit.co/all/__linux__/${VERSION_CODENAME}/2025-07-01+OM7RXCua | envsubst)" && echo "options(repos = c(CRAN = "${EXPANDED_CRAN_MIRROR_URL}"))" > /opt/R/4.4.2/lib/R/etc/Rprofile.site && echo "r-cran-repos=${EXPANDED_CRAN_MIRROR_URL}" > /etc/rstudio/rsession.conf

is not executed and a call of install.packages() results in

Error in contrib.url(repos, type) : 
  trying to use CRAN without setting a mirror
Calls: install.packages -> startsWith -> contrib.url

The --vanilla should be replaced with

--no-save --no-restore --no-init-file --no-environ

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions