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β
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!
@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.
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.