-
Notifications
You must be signed in to change notification settings - Fork 27
Description
I support a research organisation that provides R on a shared HPC system. We sporadically encounter researchers seeing this R error and being confused:
Installation paths not writeable, unable to update packages
In some cases this happens even when the package does install correctly, which makes the message even more confusing. I've dug into this problem and been able to identify a minimal reproducible example. This happen when you have a writeable library (ie a user library), and a non-writeable library (ie a site library, provided by the HPC admins).
To reproduce, firstly setup an renv that emulates a shared HPC installation of R, e.g.
install.packages("renv")
renv::init()Then restart R and run:
install.packages("BiocManager")
BiocManager::install("BiocVersion")You will likely get the following output:
# Installing packages --------------------------------------------------------
- Installing BiocManager ... OK [linked from cache]
Successfully installed 1 package in 45 milliseconds.
> BiocManager::install("BiocVersion")
'getOption("repos")' replaces Bioconductor standard repositories, see
'help("repositories", package = "BiocManager")' for details.
Replacement repositories:
CRAN: https://packagemanager.posit.co/cran/__linux__/rhel9/latest
Bioconductor version 3.22 (BiocManager 1.30.27), R 4.5.2 (2025-10-31)
Installing package(s) 'BiocVersion'
trying URL 'https://bioconductor.org/packages/3.22/bioc/src/contrib/BiocVersion_3.22.0.tar.gz'
Content type 'application/x-gzip' length 1112 bytes
==================================================
downloaded 1112 bytes
* installing *source* package ‘BiocVersion’ ...
** this is package ‘BiocVersion’ version ‘3.22.0’
** package ‘BiocVersion’ successfully unpacked and MD5 sums checked
** using staged installation
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BiocVersion)
The downloaded source packages are in
‘/XXX/RtmpOM95W8/downloaded_packages’
Installation paths not writeable, unable to update packages
path: /XXX/cache/R/renv/sandbox/linux-rhel-9.3/R-4.5/x86_64-pc-linux-gnu/cae5638a
packages:
mgcv, survival
Old packages: 'renv'
Update all/some/none? [a/s/n]: n
Note how BiocVersion did successfully install, but we still get Installation paths not writeable, unable to update packages.
This replicates my HPC issue because renv uses a "sandbox" which is read only, so this will trigger our error.
It would be great if we could avoid this confusing error.