Cannot install packages by BiocManager::install()
1
6
Entering edit mode
mizzle ▴ 60
@91208a6c
Last seen 3.6 years ago
United States

Recently I updated my R from 3.6.3 to 4.0.5. I can install packages by BiocManager::install() while I was using R 3.6.3. However, I cannot install packages by BiocManager::install() while I am using R 4.0.5. I can install packages such as ggplot2 by install.packages("ggplot2") in R 4.0.5. I don't know why BiocManager::install() didn't work in my computer for R 4.0.5. Please see the error message below. Thank you!

> if (!requireNamespace("BiocManager", quietly = TRUE))
+     install.packages("BiocManager")
> 
> BiocManager::install("sva")
'getOption("repos")' replaces Bioconductor standard repositories, see '?repositories' for details

replacement repositories:
    CRAN: https://cran.rstudio.com/

Bioconductor version 3.12 (BiocManager 1.30.13), R 4.0.5 (2021-03-31)
Installing package(s) 'BiocVersion', 'sva'
also installing the dependency ‘genefilter’

Error in readRDS(dest) : error reading from connection
BiocManager • 35k views
ADD COMMENT
1
Entering edit mode

I am having the same issue and have tried reinstalling R multiple times (4.0.5 and 3.6.3) and have consistently ran into this issue. I specifically had the issue when trying to install BSgenome, but have also found that I can't install IRanges anymore even though I was able to install that package a few days ago without any errors.

ADD REPLY
4
Entering edit mode

A problem has been identified in BiocManager 1.30.13. Please do the following:

install.packages("devtools")   # unnecessary if you have it already
devtools::install_github("Bioconductor/BiocManager", ref="ghost-binary-repo")

now use BiocManager in the customary way. Let us know how it goes.

ADD REPLY
0
Entering edit mode

This fixed my issue. Thanks so much!

ADD REPLY
0
Entering edit mode

Hi I am still having the same issue after running your above suggestion. Any thoughts? I just upgraded to R 4.0.5 on a Mac M1

BiocManager::install("phyloseq") 'getOption("repos")' replaces Bioconductor standard repositories, see '?repositories' for details

replacement repositories: CRAN: https://cran.rstudio.com/

Bioconductor version 3.12 (BiocManager 1.30.13), R 4.0.5 (2021-03-31) Installing package(s) 'phyloseq' also installing the dependencies ‘hms’, ‘Rhdf5lib’, ‘rhdf5filters’, ‘zlibbioc’, ‘pixmap’, ‘sp’, ‘progress’, ‘rhdf5’, ‘S4Vectors’, ‘IRanges’, ‘XVector’, ‘iterators’, ‘ade4’, ‘ape’, ‘Biobase’, ‘BiocGenerics’, ‘biomformat’, ‘Biostrings’, ‘data.table’, ‘foreach’, ‘igraph’, ‘multtest’, ‘plyr’, ‘reshape2’

Error in readRDS(dest) : error reading from connection

ADD REPLY
0
Entering edit mode

Hi Rachel -- you will have to restart R. You need to see BiocManager 1.30.13.1 -- in the above I only see 1.30.13, so try again with devtools::install_github("Bioconductor/BiocManager", ref="ghost-binary-repo") and then start R again and try the phyloseq installation

ADD REPLY
0
Entering edit mode

It helps! Thank you!

ADD REPLY
0
Entering edit mode

Thank you very much, it works, I was loosing my mind already.

ADD REPLY
0
Entering edit mode

On executing the above code:

devtools::install_github("Bioconductor/BiocManager", ref="ghost-binary-repo")

I get the following error: WARNING: Rtools is required to build R packages, but is not currently installed.

Please download and install Rtools 4.0 from https://cran.r-project.org/bin/windows/Rtools/. Downloading GitHub repo Bioconductor/BiocManager@ghost-binary-repo Error in utils::download.file(url, path, method = method, quiet = quiet, : cannot open URL 'https://api.github.com/repos/Bioconductor/BiocManager/tarball/ghost-binary-repo' In addition: Warning message: Not a validObject(): no slot of name "elementType" for this object of class "GRanges"

How do I resolve it ? Please help.

ADD REPLY
0
Entering edit mode

I restarted the R. I ran R as administrator. I choose another mirror. While the error is still there. I have another computer. I also updated the R from 3.6.3 to 4.0.5. The R version, mirror, the location of the R library are all the same between the two computers. However, the other computer didn't have this error.

ADD REPLY
0
Entering edit mode

Thanks so much for posting this! Have been going crazy all afternoon trying to install a package!

ADD REPLY
0
Entering edit mode
@d27aed9d
Last seen 2.4 years ago
Germany

Hi, I'm having the same issue with GeneAnswers and KEGG.db. I tried to run devtools::install_github("Bioconductor/BiocManager", ref="ghost-binary-repo") but I get following error

Error in utils::download.file(url, path, method = method, quiet = quiet, : URL 'https://api.github.com/repos/Bioconductor/BiocManager/tarball/ghost-binary-repo'

any help? Thanks

ADD COMMENT
0
Entering edit mode

Installing that specific version of BiocManager via Github was a temporary work around to make the fix available immediately, because it take a while for a new version to become available from CRAN.

You should be fine to use the version that is now installed with install.packages("BiocManager").

ADD REPLY
0
Entering edit mode

I also have the same issue. I currently have Bioconductor version 3.13 (BiocManager 1.30.15), R 4.1.0 (2021-05-18) . and the similar error occurs. With other biocmanager installation, the error said

'getOption("repos")' replaces Bioconductor standard repositories, see '?repositories' for
details

Does somebody has any ideas how should I fix this?

ADD REPLY
0
Entering edit mode

Did you re-install BiocManager as Mike recommended?

ADD REPLY
0
Entering edit mode

I am also having this issue installing Bioconductor on fresh new Linux (x86_64-pc-linux-gnu (64-bit), PopOS 21.10); R is 4.1.3. That is a fresh install on a new computer - no updating.

I get the following

> BiocManager::install()
'getOption("repos")' replaces Bioconductor standard repositories, see
'?repositories' for details

replacement repositories:
    CRAN: https://cloud.r-project.org

Bioconductor version 3.14 (BiocManager 1.30.16), R 4.1.3 (2022-03-10)
Installation paths not writeable, unable to update packages
  path: /usr/lib/R/library
  packages:
    cluster, Matrix, mgcv, nlme, spatial, survival

So if I try getOption

> getOption("repos")
                         CRAN 
"https://cloud.r-project.org"

Not sure why the paths aren't writiable... those directories all exist in that location.

I tried the ghost-binary-repo code but it is no longer posted there. I also tried re-installing BiocManager as suggested - no change, but this was a fresh install to begin with.

I have only successfully installed BiocManager and BiocVersion but no packages. I have never previously encountered this issue with Bioconductor on other machines (Mac, Linux/PopOS 20.04)

How is this resolvable? Thanks!

ADD REPLY
0
Entering edit mode

On Linux the /usr/lib directory requires special privileges to make any changes. If you don't have root or sudo privileges, you won't be able to make any modifications to files in that location.

ADD REPLY
0
Entering edit mode

Odd - I run the same setup on Linux PopOS 20.04 without issue. I have never seen anything requiring root access from within R. Can you provide more info or resource for this?

ADD REPLY
0
Entering edit mode

It's got nothing to do with R. It's a Linux thing. For example, on one of my work boxes, here are all the directories under /usr/

$ lsl -la /usr
total 104K
drwxr-xr-x  14 root root 4.0K Mar 10 12:05 .
drwxr-xr-x  23 root root 4.0K Feb  8 13:00 ..
drwxr-xr-x   2 root root  36K Apr 14 06:13 bin
drwxr-xr-x   2 root root 4.0K Apr 15  2020 games
drwxr-xr-x   6 root root 4.0K Nov 10 10:43 include
drwxr-xr-x  86 root root 4.0K Mar 18 08:24 lib
drwxr-xr-x   2 root root 4.0K Aug 24  2021 lib32
drwxr-xr-x   2 root root 4.0K Mar  2 06:54 lib64
drwxr-xr-x   3 root root 4.0K Mar 18 08:24 libexec
drwxr-xr-x   2 root root 4.0K Aug 24  2021 libx32
drwxr-xr-x  10 root root 4.0K Aug 24  2021 local
drwxr-xr-x   2 root root  20K Apr 11 06:22 sbin
drwxr-xr-x 122 root root 4.0K Mar 18 08:24 share
drwxr-xr-x   8 root root 4.0K Apr  2 06:06 src

As you can see they are all owned by root and have no write privileges for anybody else. And on another of my work boxes, here's the site-wide R library dirs:

$ ls -la /usr/local/lib64/
total 36
drwxr-xr-x   9 root root 4096 Jul 26  2021 .
drwxr-xr-x. 44 root root 4096 Mar 14  2021 ..
drwxr-xr-x   2 root root 4096 Jan 16  2018 pkgconfig
drwxr-xr-x  10 root root 4096 Jan 16  2018 R-3.4.3
drwxr-xr-x  10 root root 4096 Jan 29  2018 R-3.4.3p
drwxr-xr-x  10 root root 4096 Jul 11  2018 R-3.5.1
drwxr-xr-x  10 root root 4096 Aug  2  2019 R-3.6.1
drwxr-xr-x  10 root root 4096 Jun 30  2020 R-4.0.1
drwxr-xr-x  10 root root 4096 Jul 26  2021 R-4.0.5

Again, with no write privileges for anybody but root or some with sudo privileges.

I don't know anything about PopOS, but I'd bet it's an Ubuntu/Debian knockoff, and I would also bet that it is conventional in having privileged directories, just like Ubuntu and Debian. If you want to be able to update the recommended packages, I would install R in a non-privileged location where you have read/write privileges.

ADD REPLY
0
Entering edit mode

Yes Ubuntu/Debian knockoff

ADD REPLY
0
Entering edit mode

Other packages install from RStudio as expected. So are you suggesting that to install Bioconductor packages specifically, I should use the command line method instead?

Is Bioconductor available from repository ppa:c2d4u.team/c2d4u4.0+ If so, can you tell me how that is indexed? For example for tidyverse it would be

apt install r-cran-tidyverse

For Bioconductor complete or specific packages within Bioconductor - what is the code or where would I find it?
Thanks again

ADD REPLY
0
Entering edit mode

None of the packages that aren't being updated are Bioconductor packages. They are all recommended packages that come as part of the R installation, and are by default installed in the site-wide R library location, which by default is not accessible to non-root/sudo privileged users.

ADD REPLY
1
Entering edit mode

To be clear, BiocManager::install is just saying it couldn't update the recommended packages. You should be able to install any Bioconductor packages you want.

ADD REPLY
0
Entering edit mode

Okay so I can just install what I need without involving BiocManager at all? That is my solution then - thanks. I have just always followed the advice to use the install manager and never had issues with it before. Thanks for your help.

ADD REPLY
0
Entering edit mode

Okay I see what you mean about root for those directories. However I do have R installed in an unprivileged location (Home) and all other R behaviour is as expected. It seems that BiocManager is pointing to the /usr/lib directory

For example if I try to access the nlme that BiocManager is looking for, it is locked in the privileged folder as you explain. But if I install nlme itself from RStudio, it is there and accessible in the unprivileged folder that R actually runs from.

So it still looks like the problem is BiocManager pointing to an unintended location...

ADD REPLY
0
Entering edit mode

BiocManager doesn't point to anything. It queries .libPaths, which tells it where all the package directories are. If your .libPaths points to a site-wide install dir, then BiocManager will try to update things in that directory. If you have a personal R in your home directory it shouldn't point to the site-wide library dir. If it is, it's because you have somehow added that to your .libPaths or you haven't added that directory to your PATH variable and are mistakenly loading the site-wide R version rather than the one in your home dir.

ADD REPLY
0
Entering edit mode

Also, I never meant to imply that you shouldn't use BiocManager. You absolutely should. I would argue that you should use BiocManager to install any package, regardless of where it comes from (Bioconductor, CRAN, GitHub), because it will ensure that you use the right version for your version of R.

ADD REPLY
0
Entering edit mode

I have 4 paths in .libPaths. The first is the home directory. #4 is the usr/lib privilege site. 2,3&4 are /usr/ directories

I am sitting in front of 2 R4.1.3 on 2 Linux systems (21.10 new and 21.04 old - Ubuntu/Debian base) looking at the file structures and anything else to compare - BiocManager only runs on the old system. Both have the same .libPath outputs. Both have the same wider file structure (R installed in and running out of home directory, same folders in usr/lib/R/library

Also completley removed R from new system and reinstalled. The structure is default.

When BiocManager queries .libPaths, is there a way to force it to choose #1 and not #4?

ADD REPLY
0
Entering edit mode

When you say 'BiocManager runs', I am not sure what that means. If you do the following (here I chose a package you are not likely to have installed)

BiocManager:::install("makecdfenv")

are you saying that it only installs on one of your computers and not the other?

ADD REPLY
0
Entering edit mode

Uh, wait a minnit. There should only be two colons. Like

BiocManager::install("makecdfenv")
ADD REPLY
0
Entering edit mode

Right - what I mean is running BiocManager::install() doesn't install the core packages. The above did work fine though. I guess I can just install things manually. I've just never had to do that before, neither on Mac or other Linux systems.

Literally the first thing I did on this fresh new computer was install R, then RStudio, then Bioconduc... wait no. :) So it's hard to think of what the issue could be.

And yes other computer installing new version of Bioconductor core packages perfectly fine while updating from R 4.0 to 4.1

ADD REPLY
0
Entering edit mode

You don't need to install the core packages. If you do

library(nlme)

It loads, does it not?

ADD REPLY
0
Entering edit mode

Well actually...On the bare bones fresh install, loading nlme gives melibrary(nlme, lib.loc = "/usr/lib/R/library"). That is version 3.1-155 from r-base. I can manually install from RStudio version 3.1-157. That version (157) of nlme loads, no problem.

Side-by-side the contents of usr/lib/R/library are identical between fresh install new machine and old machine running successfully for years. Anything else installed over base R installs into home directory R library. Same for both machines.

The difference is I can see both versions of nlme in the Packages window of RStudio on the new machine. I can run 157 but not 155. I'm locked out of base nlme on the new machine. But if I go into the nlme folder in usr/lib/R/library on the old machine, I can see that it is version 3.1-157. So the old machine can access and update the folders in usr/lib/R/library, but the new machine is locked out.

I can just load those core packages freshly into the home directory to access them I suppose. But you're right there is some kind of path/authorisation problem I have never encountered before...

lib.Paths output is identical on both machines, whether I look via RStudio or raw R in the terminal.

R_LIBS_USER from both machines in etc/R/Renviron are identical (same R version and OS difference is just 21.10 v 21.04)

So this is not a Bioconductor problem clearly now, but any thoughts or advice or resources you could recommend?

ADD REPLY
0
Entering edit mode

Which version gets loaded is determined by the order of your library paths. Here's one of my work boxes:

> library(BiocManager)
Bioconductor version 3.14 (BiocManager 1.30.16), R 4.1.2 (2021-11-01)
> install("nlme", force = T)
Bioconductor version 3.14 (BiocManager 1.30.16), R 4.1.2 (2021-11-01)
Installing package(s) 'nlme'
trying URL 'https://cloud.r-project.org/src/contrib/nlme_3.1-157.tar.gz'
Content type 'application/x-gzip' length 846225 bytes (826 KB)
==================================================
downloaded 826 KB

* installing *source* package ‘nlme’ ...
** package ‘nlme’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gfortran  -fpic  -g -O2  -c chol.f -o chol.o

<snip>

* DONE (nlme)

The downloaded source packages are in
        ‘/tmp/RtmpBVPHXP/downloaded_packages’
Installation paths not writeable, unable to update packages
  path: /share/apps/R/R-4.1.2/lib64/R/library
  packages:
    class, cluster, foreign, MASS, Matrix, mgcv, nlme, nnet, rpart, spatial,
    survival

> library(nlme)
> packageDescription("nlme")$V
[1] "3.1-157"
> .libPaths()
[1] "/share/groups/edge/R/R-4.1.2"
[2] "/share/apps/R/R-4.1.2/lib64/R/library"

And the first path is the one that I have write privileges and the second I do not.

> do.call(rbind, lapply(.libPaths(), function(x) installed.packages(x)["nlme",1:4]))
     Package LibPath                                 Version   Priority
[1,] "nlme"  "/share/groups/edge/R/R-4.1.2"          "3.1-157" "recommended"
[2,] "nlme"  "/share/apps/R/R-4.1.2/lib64/R/library" "3.1-153" "recommended"
ADD REPLY

Login before adding your answer.

Traffic: 947 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6