error installing Biostrings

Hello everyone!

I am trying to install Biostrings in the R studio with command:
BiocManager::install("Biostrings")
The installed Biocmanager version is:
Bioconductor version 3.18 (BiocManager 1.30.22), R 4.3.1 (2023-06-16)

However, I am getting this error while using the first command:
io_utils.c:16:10: fatal error: zlib.h: No such file or directory
16 | #include <zlib.h>
| ^~~~~~~~
compilation terminated.
make: *** [/usr/lib/R/etc/Makeconf:191: io_utils.o] Error 1
ERROR: compilation failed for package β€˜XVector’

  • removing β€˜/home/pc-586441/R/x86_64-pc-linux-gnu-library/4.3/XVector’
    ERROR: dependency β€˜RCurl’ is not available for package β€˜GenomeInfoDb’
  • removing β€˜/home/pc-586441/R/x86_64-pc-linux-gnu-library/4.3/GenomeInfoDb’
    ERROR: dependencies β€˜XVector’, β€˜GenomeInfoDb’ are not available for package β€˜Biostrings’
  • removing β€˜/home/pc-586441/R/x86_64-pc-linux-gnu-library/4.3/Biostrings’

The downloaded source packages are in
β€˜/tmp/RtmphPaqqq/downloaded_packages’
Installation paths not writeable, unable to update packages
path: /usr/lib/R/library
packages:
boot, cluster, codetools, foreign, lattice, MASS, Matrix, mgcv, nlme, rpart, spatial, survival
Warning messages:
1: In install.packages(...) :
installation of package β€˜RCurl’ had non-zero exit status
2: In install.packages(...) :
installation of package β€˜XVector’ had non-zero exit status
3: In install.packages(...) :
installation of package β€˜GenomeInfoDb’ had non-zero exit status
4: In install.packages(...) :
installation of package β€˜Biostrings’ had non-zero exit status

Can anyone share insight on solving this error. Thanks!

Hi @swaiba , I'm identified that you need update many packages. Others install.

But first update R and Rstudio.

# update this libraries:
XVector, boot, cluster, codetools, foreign, lattice, MASS, Matrix, mgcv, nlme, rpart, spatial, survival

@swaiba - installing Biostrings will automatically identifiy and update all needed packages - this is not something you need to worry about directly. The root cause of your problem that prevents you to install Biostrings is that you are missing some software provided by the Linux OS, i.e. zlib.h.

You can solve the problem by running yum install zlib-devel on a RedHat Enterprise Linux based system or by running apt-get install zlib1g-dev on an Debian/Ubuntu based system. Once you installed this, the installation of Biostrings should be successful.

In case you are interested in determining those OS dependencies specifically for your linux distribution, you can also use https://pak.r-lib.org/, e.g. pak::pkg_sysreqs("Biostrings")

On my little test system it reports

> pak::pkg_sysreqs("Biostrings")
── Install scripts ────────────────────────────────────────────────────────────────────────────────────────── Ubuntu 20.04 ──
apt-get -y update
apt-get -y install make libcurl4-openssl-dev

── Packages and their system dependencies ───────────────────────────────────────────────────────────────────────────────────
RCurl – libcurl4-openssl-dev, make

You also could use pak::pkg_install("Biostrings") which will install Biostrings as well - it will also tell you if any operating system dependencies (e.g. zlib.h) are missing - if run with admin privilegs, pak will automatically install those operating system dependencies for you.

2 Likes

I would not do that. RStudio certainly has nothing to do with package installation failures, and it is very-very unlikely that reinstalling R solves package installation issues.

1 Like