Home > Software design >  How to resolve R error when installing Ballgown?
How to resolve R error when installing Ballgown?

Time:08-31

I am trying to install the bioconductor package ballgown in R. R: v4.2.1 Ubuntu: 20.04

I am runing one of the latest versions of R on Ubuntu (see above). In this case I actually don't have R-studio installed, I'm just using R on the terminal. This problem has been with me for a few days so any help would be great.

Tried running:

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

BiocManager::install("ballgown")

However I got this error:


/usr/lib/R/bin/R: line 142: /usr/lib/R/etc/ldpaths: No such file or directory
/usr/lib/R/bin/R: line 248: /usr/lib/R/etc/ldpaths: No such file or directory
ERROR: dependency ‘GenomeInfoDb’ is not available for package ‘Biostrings’
* removing ‘/usr/local/lib/R/site-library/Biostrings’
/usr/lib/R/bin/R: line 142: /usr/lib/R/etc/ldpaths: No such file or directory
/usr/lib/R/bin/R: line 248: /usr/lib/R/etc/ldpaths: No such file or directory
ERROR: dependency ‘GenomeInfoDb’ is not available for package ‘GenomicRanges’
* removing ‘/usr/local/lib/R/site-library/GenomicRanges’
/usr/lib/R/bin/R: line 142: /usr/lib/R/etc/ldpaths: No such file or directory
/usr/lib/R/bin/R: line 248: /usr/lib/R/etc/ldpaths: No such file or directory
ERROR: dependencies ‘httr’, ‘Biostrings’ are not available for package ‘KEGGREST’
* removing ‘/usr/local/lib/R/site-library/KEGGREST’
/usr/lib/R/bin/R: line 142: /usr/lib/R/etc/ldpaths: No such file or directory
/usr/lib/R/bin/R: line 248: /usr/lib/R/etc/ldpaths: No such file or directory
ERROR: dependencies ‘GenomicRanges’, ‘GenomeInfoDb’ are not available for package ‘SummarizedExperiment’
* removing ‘/usr/local/lib/R/site-library/SummarizedExperiment’
/usr/lib/R/bin/R: line 142: /usr/lib/R/etc/ldpaths: No such file or directory
/usr/lib/R/bin/R: line 248: /usr/lib/R/etc/ldpaths: No such file or directory
ERROR: dependencies ‘GenomeInfoDb’, ‘GenomicRanges’, ‘Biostrings’, ‘Rhtslib’ are not available for package ‘Rsamtools’
* removing ‘/usr/local/lib/R/site-library/Rsamtools’
/usr/lib/R/bin/R: line 142: /usr/lib/R/etc/ldpaths: No such file or directory
/usr/lib/R/bin/R: line 248: /usr/lib/R/etc/ldpaths: No such file or directory
ERROR: dependency ‘KEGGREST’ is not available for package ‘AnnotationDbi’
* removing ‘/usr/local/lib/R/site-library/AnnotationDbi’
/usr/lib/R/bin/R: line 142: /usr/lib/R/etc/ldpaths: No such file or directory
/usr/lib/R/bin/R: line 248: /usr/lib/R/etc/ldpaths: No such file or directory
ERROR: dependencies ‘GenomeInfoDb’, ‘GenomicRanges’, ‘SummarizedExperiment’, ‘Biostrings’, ‘Rsamtools’ are not available for package ‘GenomicAlignments’
* removing ‘/usr/local/lib/R/site-library/GenomicAlignments’
/usr/lib/R/bin/R: line 142: /usr/lib/R/etc/ldpaths: No such file or directory
/usr/lib/R/bin/R: line 248: /usr/lib/R/etc/ldpaths: No such file or directory
ERROR: dependencies ‘AnnotationDbi’, ‘httr’ are not available for package ‘annotate’
* removing ‘/usr/local/lib/R/site-library/annotate’
/usr/lib/R/bin/R: line 142: /usr/lib/R/etc/ldpaths: No such file or directory
/usr/lib/R/bin/R: line 248: /usr/lib/R/etc/ldpaths: No such file or directory
ERROR: dependencies ‘GenomicRanges’, ‘GenomeInfoDb’, ‘Biostrings’, ‘RCurl’, ‘Rsamtools’, ‘GenomicAlignments’, ‘restfulr’ are not available for package ‘rtracklayer’
* removing ‘/usr/local/lib/R/site-library/rtracklayer’
/usr/lib/R/bin/R: line 142: /usr/lib/R/etc/ldpaths: No such file or directory
/usr/lib/R/bin/R: line 248: /usr/lib/R/etc/ldpaths: No such file or directory
ERROR: dependencies ‘AnnotationDbi’, ‘annotate’ are not available for package ‘genefilter’
* removing ‘/usr/local/lib/R/site-library/genefilter’
/usr/lib/R/bin/R: line 142: /usr/lib/R/etc/ldpaths: No such file or directory
/usr/lib/R/bin/R: line 248: /usr/lib/R/etc/ldpaths: No such file or directory
ERROR: dependency ‘genefilter’ is not available for package ‘sva’
* removing ‘/usr/local/lib/R/site-library/sva’
/usr/lib/R/bin/R: line 142: /usr/lib/R/etc/ldpaths: No such file or directory
/usr/lib/R/bin/R: line 248: /usr/lib/R/etc/ldpaths: No such file or directory
ERROR: dependencies ‘GenomicRanges’, ‘sva’, ‘rtracklayer’, ‘GenomeInfoDb’ are not available for package ‘ballgown’
* removing ‘/usr/local/lib/R/site-library/ballgown’


The downloaded source packages are in
    ‘/tmp/RtmpfKqB1V/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
There were 19 warnings (use warnings() to see them)
> warnings()
Warning messages:
1: In install.packages(...) :
  installation of package ‘curl’ had non-zero exit status
2: In install.packages(...) :
  installation of package ‘Rhtslib’ had non-zero exit status
3: In install.packages(...) :
  installation of package ‘RCurl’ had non-zero exit status
4: In install.packages(...) :
  installation of package ‘openssl’ had non-zero exit status
5: In install.packages(...) :
  installation of package ‘restfulr’ had non-zero exit status
6: In install.packages(...) :
  installation of package ‘httr’ had non-zero exit status
7: In install.packages(...) :
  installation of package ‘GenomeInfoDb’ had non-zero exit status
8: In install.packages(...) :
  installation of package ‘Biostrings’ had non-zero exit status
9: In install.packages(...) :
  installation of package ‘GenomicRanges’ had non-zero exit status
10: In install.packages(...) :
  installation of package ‘KEGGREST’ had non-zero exit status
11: In install.packages(...) :
  installation of package ‘SummarizedExperiment’ had non-zero exit status
12: In install.packages(...) :
  installation of package ‘Rsamtools’ had non-zero exit status
13: In install.packages(...) :
  installation of package ‘AnnotationDbi’ had non-zero exit status
14: In install.packages(...) :
  installation of package ‘GenomicAlignments’ had non-zero exit status
15: In install.packages(...) :
  installation of package ‘annotate’ had non-zero exit status
16: In install.packages(...) :
  installation of package ‘rtracklayer’ had non-zero exit status
17: In install.packages(...) :
  installation of package ‘genefilter’ had non-zero exit status
18: In install.packages(...) :
  installation of package ‘sva’ had non-zero exit status
19: In install.packages(...) :
  installation of package ‘ballgown’ had non-zero exit status
> library('ballgown')
Error in library("ballgown") : there is no package called ‘ballgown’
> library('Ballgown')
Error in library("Ballgown") : there is no package called ‘Ballgown’

I have tried the following command but still no luck:

install.packages(c("curl","Rhtslib","RCurl","openssl","restfulr","httr","GenomeInfoDb","Biostrings","GenomicRanges","KEGGREST","SummarizedExperiment","Rsamtools","AnnotationDbi","GenomicAlignments","annotate","rtracklayer","genefilter","sva","ballgown"))

However, this results in the following error:

/usr/lib/R/bin/R: line 142: /usr/lib/R/etc/ldpaths: No such file or directory
/usr/lib/R/bin/R: line 248: /usr/lib/R/etc/ldpaths: No such file or directory
* installing *source* package ‘curl’ ...
** package ‘curl’ successfully unpacked and MD5 sums checked
** using staged installation
Package libcurl was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcurl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libcurl' found
Package libcurl was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcurl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libcurl' found
/usr/lib/R/bin/R: line 142: /usr/lib/R/etc/ldpaths: No such file or directory
/usr/lib/R/bin/R: line 142: /usr/lib/R/etc/ldpaths: No such file or directory
/usr/lib/R/bin/R: line 142: /usr/lib/R/etc/ldpaths: No such file or directory
Using PKG_CFLAGS=
Using PKG_LIBS=-lcurl
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libcurl was not found. Try installing:
 * deb: libcurl4-openssl-dev (Debian, Ubuntu, etc)
 * rpm: libcurl-devel (Fedora, CentOS, RHEL)
 * csw: libcurl_dev (Solaris)
If libcurl is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libcurl.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------
ERROR: configuration failed for package ‘curl’
* removing ‘/usr/local/lib/R/site-library/curl’
/usr/lib/R/bin/R: line 142: /usr/lib/R/etc/ldpaths: No such file or directory
/usr/lib/R/bin/R: line 248: /usr/lib/R/etc/ldpaths: No such file or directory
* installing *source* package ‘RCurl’ ...
** package ‘RCurl’ successfully unpacked and MD5 sums checked
** using staged installation
checking for curl-config... no
Cannot find curl-config
ERROR: configuration failed for package ‘RCurl’
* removing ‘/usr/local/lib/R/site-library/RCurl’
/usr/lib/R/bin/R: line 142: /usr/lib/R/etc/ldpaths: No such file or directory
/usr/lib/R/bin/R: line 248: /usr/lib/R/etc/ldpaths: No such file or directory
* installing *source* package ‘openssl’ ...
** package ‘openssl’ successfully unpacked and MD5 sums checked
** using staged installation
/usr/lib/R/bin/R: line 142: /usr/lib/R/etc/ldpaths: No such file or directory
/usr/lib/R/bin/R: line 142: /usr/lib/R/etc/ldpaths: No such file or directory
/usr/lib/R/bin/R: line 142: /usr/lib/R/etc/ldpaths: No such file or directory
Using PKG_CFLAGS=
--------------------------- [ANTICONF] --------------------------------
Configuration failed because openssl was not found. Try installing:
 * deb: libssl-dev (Debian, Ubuntu, etc)
 * rpm: openssl-devel (Fedora, CentOS, RHEL)
 * csw: libssl_dev (Solaris)
 * brew: openssl (Mac OSX)
If openssl is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a openssl.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
-------------------------- [ERROR MESSAGE] ---------------------------
tools/version.c:1:10: fatal error: openssl/opensslv.h: No such file or directory
    1 | #include <openssl/opensslv.h>
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
--------------------------------------------------------------------
ERROR: configuration failed for package ‘openssl’
* removing ‘/usr/local/lib/R/site-library/openssl’
/usr/lib/R/bin/R: line 142: /usr/lib/R/etc/ldpaths: No such file or directory
/usr/lib/R/bin/R: line 248: /usr/lib/R/etc/ldpaths: No such file or directory
ERROR: dependency ‘RCurl’ is not available for package ‘restfulr’
* removing ‘/usr/local/lib/R/site-library/restfulr’
/usr/lib/R/bin/R: line 142: /usr/lib/R/etc/ldpaths: No such file or directory
/usr/lib/R/bin/R: line 248: /usr/lib/R/etc/ldpaths: No such file or directory
ERROR: dependencies ‘curl’, ‘openssl’ are not available for package ‘httr’
* removing ‘/usr/local/lib/R/site-library/httr’

The downloaded source packages are in
    ‘/tmp/RtmpYwMfPe/downloaded_packages’
Warning messages:
1: packages ‘Rhtslib’, ‘GenomeInfoDb’, ‘Biostrings’, ‘GenomicRanges’, ‘KEGGREST’, ‘SummarizedExperiment’, ‘Rsamtools’, ‘AnnotationDbi’, ‘GenomicAlignments’, ‘annotate’, ‘rtracklayer’, ‘genefilter’, ‘sva’, ‘ballgown’ are not available for this version of R

Versions of these packages for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages 
2: In install.packages(c("curl", "Rhtslib", "RCurl", "openssl", "restfulr",  :
  installation of package ‘curl’ had non-zero exit status
3: In install.packages(c("curl", "Rhtslib", "RCurl", "openssl", "restfulr",  :
  installation of package ‘RCurl’ had non-zero exit status
4: In install.packages(c("curl", "Rhtslib", "RCurl", "openssl", "restfulr",  :
  installation of package ‘openssl’ had non-zero exit status
5: In install.packages(c("curl", "Rhtslib", "RCurl", "openssl", "restfulr",  :
  installation of package ‘restfulr’ had non-zero exit status
6: In install.packages(c("curl", "Rhtslib", "RCurl", "openssl", "restfulr",  :
  installation of package ‘httr’ had non-zero exit status

Any ideas how I can install Ballgown?

thanks!

CodePudding user response:

You probably need to install additional packages to your linux installation. The error logs show which ones you need to install.

For example:

Configuration failed because libcurl was not found. Try installing:
 * deb: libcurl4-openssl-dev (Debian, Ubuntu, etc)
 * rpm: libcurl-devel (Fedora, CentOS, RHEL)
 * csw: libcurl_dev (Solaris)

and

Configuration failed because openssl was not found. Try installing:
 * deb: libssl-dev (Debian, Ubuntu, etc)
 * rpm: openssl-devel (Fedora, CentOS, RHEL)
 * csw: libssl_dev (Solaris)
 * brew: openssl (Mac OSX)

You can install these using apt or equivalent. I had the same issues (when trying to install different packages) on a Debian setup, and things worked once these missing packages were in place.

Try:

sudo apt update
sudo apt install libcurl4-openssl-dev
sudo apt install libssl-dev
  • Related