Search code examples
rlinuxrcurlbioconductor

Failing to install R oligo and RCurl packages on Linux CentOS 7


I am trying to install the Bioconductor oligo R package on my laptop where I have Linux CentOS 7. It cannot be installed through the common Bioconductor installation commands because it says that RCurl was installed for anoter Rversion and needs to be reinstalled.

I tried to install it through the command: install.packages("RCurl") but unfortunately it did not work.

Here's the log:

Error: package or namespace load failed for ‘RCurl’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/home/davide/R/x86_64-redhat-linux-gnu-library/3.5/RCurl/libs/RCurl.so':
  libiconv.so.2: cannot open shared object file: No such file or directory
Error: loading failed

Execution halted ERROR: loading failed
* removing ‘/home/davide/R/x86_64-redhat-linux-gnu-library/3.5/RCurl’

The downloaded source packages are in   ‘/tmp/RtmpAcmmPE/downloaded_packages’ Warning message: In install.packages("RCurl") :   installation of package ‘RCurl’ had non-zero exit status

Any idea on how to make it work?


Solution

  • I was able to install the RCurl and oligo packages in R by installing miniconda and using its R version.

    Here's what I did:

    1. I downloaded the miniconda installer from their website (my case was 64-bit (bash installer))
    2. I made the file executable and then executed it. On the shell terminal, I ran:
      chmod 777 ./Downloads/Miniconda3-latest-Linux-x86_64.sh

      ./Downloads/Miniconda3-latest-Linux-x86_64.sh

    3. I replied yes to all the questions miniconda was prompting me.
    4. Once miniconda was installed, I ran R: R
    5. I then reinstalled RCurl: install.packages("RCurl");
    6. I then installed oligo:

      if (!requireNamespace("BiocManager", quietly = TRUE))

      install.packages("BiocManager")

      BiocManager::install("oligo", version = "3.8")

    Everything worked fine to me this way. I hope it can help other people!