Search code examples
rubuntur-packagebiomart

Install biomaRt package (R version 3.5.2) for linux (Ubuntu for Windows)


I am trying to install Biomart package, and I used this code:

source("https://bioconductor.org/biocLite.R")
    biocLite("biomaRt")
    library("biomaRt")

and I get this warning message:

Warning messages:
1: In install.packages(pkgs = doing, lib = lib, ...) :
  installation of package ‘curl’ had non-zero exit status
2: In install.packages(pkgs = doing, lib = lib, ...) :
  installation of package ‘openssl’ had non-zero exit status
3: In install.packages(pkgs = doing, lib = lib, ...) :
  installation of package ‘XML’ had non-zero exit status
4: In install.packages(pkgs = doing, lib = lib, ...) :
  installation of package ‘RCurl’ had non-zero exit status
5: In install.packages(pkgs = doing, lib = lib, ...) :
  installation of package ‘httr’ had non-zero exit status
6: In install.packages(pkgs = doing, lib = lib, ...) :
  installation of package ‘biomaRt’ had non-zero exit status

Someone to help, please? Thanks.


Solution

  • The issue here is that R needs to compile other R packages: curl, openssl, XML, RCurl. To do this, some development libraries need to be installed on your Linux platform.

    You can often guess what they might be called: if R package "XXX" is a problem, you need to apt-cache search for something like libXXX-dev. Often the name includes a number too. So you can try, for example, from the command line:

    sudo apt-get update
    apt-cache search libcurl | grep dev
    

    to search for libcurl development packages.

    Then you can install them, for example:

    sudo apt-get install libcurl4-openssl-dev
    

    As a minimum, I think you need something like:

    sudo apt-get install libcurl4-openssl-dev
    sudo apt-get install libxml2-dev
    

    Then try the R package installation again. Note any error messages, install more libraries as necessary, repeat until it works.

    Web search with appropriate terms should locate more information about required system dependencies for installation.