Installation path not writeable on posit.cloud (/opt/R/4.3.0/lib/R/library)

Hello,

The installation of a Bioconductor package ShortRead in posit.cloud (free tier) fails due to apparent lack of permissions to write to /opt/R/4.3.0/lib/R/library/. I attach a screenshot of the error message (apologies for this, but I am solving someone else's problem via screenshare).

The project is https://posit.cloud/content/5941822 the command to reproduce the error is:

if (!require("BiocManager", quietly = TRUE))
    install.packages("BiocManager")

BiocManager::install("ShortRead")

.libPaths() is:

/cloud/lib/x86_64-pc-linux-gnu-library/4.3
/opt/R/4.3.0/lib/R/library/

I should also add that this error happened after a successful installation of CRAN package tidyverse and Bioconductor package Biostrings. Bioconductor package ShortRead is required in addition to Biostrings to install another CRAN package, SimRAD.

Any advice on how to fix this would be very much appreciated!

FJ

That's probably expected, and you cannot update packages in the system library. So don't update them. Or install their new new versions in your user package library, if you really need to update them.

Thanks. Do I then understand correctly that not much can be done? Unless the package is forced to install in /cloud/lib/x86_64-pc-linux-gnu-library/4.3 rather than /opt/R/4.3.0/lib/R/library/ (which I believe I cannot do)?

Best
FJ

You can probably install these packages to .libPaths()[1]:

install.packages(
  c("class", "KernSmooth", "MASS", "nnet"), 
  lib = .libPaths()[1]
)

But again, these packages receive minimal updates, and it is most likely that you are fine with the versions you already have and you don't actually need to update them.

I am stuck with similar error while deploying shiny io.

2023-05-17T08:20:29.023272+00:00 shinyapps[9119680]: Bioconductor version 3.17 (BiocManager 1.30.20), R 4.3.0 (2023-04-21)
2023-05-17T08:20:29.023647+00:00 shinyapps[9119680]: Warning: package(s) not installed when version(s) same as or greater than current; use
2023-05-17T08:20:29.023665+00:00 shinyapps[9119680]: force = TRUE to re-install: 'BiocVersion'
2023-05-17T08:20:30.235041+00:00 shinyapps[9119680]: Installation paths not writeable, unable to update packages
2023-05-17T08:20:30.235071+00:00 shinyapps[9119680]: path: /opt/R/4.3.0/lib/R/library
2023-05-17T08:20:30.235077+00:00 shinyapps[9119680]: packages:
2023-05-17T08:20:30.235081+00:00 shinyapps[9119680]: class, KernSmooth
2023-05-17T08:20:30.240128+00:00 shinyapps[9119680]: 'getOption("repos")' replaces Bioconductor standard repositories, see
2023-05-17T08:20:30.240155+00:00 shinyapps[9119680]: 'help("repositories", package = "BiocManager")' for details.
2023-05-17T08:20:30.240163+00:00 shinyapps[9119680]: Replacement repositories:
2023-05-17T08:20:30.240178+00:00 shinyapps[9119680]: BioCsoft: Bioconductor - 3.17 Software Packages
2023-05-17T08:20:30.240185+00:00 shinyapps[9119680]: BioCann: Bioconductor - 3.17 AnnotationData Packages
2023-05-17T08:20:30.240192+00:00 shinyapps[9119680]: BioCexp: Bioconductor - 3.17 ExperimentData Packages
2023-05-17T08:20:30.240196+00:00 shinyapps[9119680]: BioCworkflows: Bioconductor - 3.17 Workflow Packages
2023-05-17T08:20:30.241448+00:00 shinyapps[9119680]: BioCbooks: https://bioconductor.org/packages/3.17/books
2023-05-17T08:20:30.241463+00:00 shinyapps[9119680]: CRAN: https://cloud.r-project.org
2023-05-17T08:20:30.920556+00:00 shinyapps[9119680]: Bioconductor version 3.17 (BiocManager 1.30.20), R 4.3.0 (2023-04-21)
2023-05-17T08:20:30.920771+00:00 shinyapps[9119680]: Installing package(s) 'AnnotationDbi'
2023-05-17T08:20:30.923167+00:00 shinyapps[9119680]: Warning in install.packages(...) :
2023-05-17T08:20:30.923176+00:00 shinyapps[9119680]: 'lib = "/opt/R/4.3.0/lib/R/library"' is not writable
2023-05-17T08:20:30.931057+00:00 shinyapps[9119680]: Error in install.packages(...) : unable to install packages
2023-05-17T08:20:30.931073+00:00 shinyapps[9119680]: Calls: local ... tryCatch -> tryCatchList -> tryCatchOne ->
2023-05-17T08:20:30.931078+00:00 shinyapps[9119680]: Execution halted
2023-05-17T08:20:30.931083+00:00 shinyapps[9119680]: Shiny application exiting ...
2023-05-17T08:26:25.511595+00:00 shinyapps[9119680]: Container event from container-8151093: stop

@smruthi I suggest that you create a new question with the shinyapps.io tag. Does your package call BiocManager::install() explicitly?

1 Like

Thank you very much. Yes, it was called explicitly. Removed it and it works better.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.