Saturday, October 8, 2022

[SOLVED] Error Installing redux R package on centos7

Issue

Am getting an error trying to install redux r package on centos7, and have no idea how to fix it. Has anybody come across it before?

my Dockerfile is:

FROM centos:centos7

RUN yum -y install wget git tar

RUN yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

RUN yum -y install epel-release openssh-server

ENV R_VERSION=4.0.5

RUN wget https://cdn.rstudio.com/r/centos-7/pkgs/R-${R_VERSION}-1-1.x86_64.rpm \
  && yum -y install R-${R_VERSION}-1-1.x86_64.rpm \
  && rm R-${R_VERSION}-1-1.x86_64.rpm

ENV PATH="${PATH}:/opt/R/${R_VERSION}/bin/"

RUN yum -y install openssl-devel


RUN Rscript -e "install.packages(c('redux'), repos = 'https://packagemanager.rstudio.com/all/__linux__/centos7/latest')"

RUN Rscript -e "library(redux)"

CMD ["/bin/bash"]

Then i build the image:

docker build -t test-3:latest .

And the error i get is:

=> ERROR [8/8] RUN Rscript -e "library(redux)"                                                                                                                                                                    0.6s
------                                                                                                                                                                                                                  
 > [8/8] RUN Rscript -e "library(redux)":                                                                                                                                                                               
#12 0.528 Error: package or namespace load failed for 'redux' in dyn.load(file, DLLpath = DLLpath, ...):                                                                                                                
#12 0.528  unable to load shared object '/opt/R/4.0.5/lib/R/library/redux/libs/redux.so':                                                                                                                               
#12 0.528   libhiredis.so.0.12: cannot open shared object file: No such file or directory                                                                                                                               
#12 0.528 Execution halted
------
executor failed running [/bin/sh -c Rscript -e "library(redux)"]: exit code: 1

ps. I am able to install any other package and reference it without problems


Solution

That file seems to come from the hiredis package: https://rhel.pkgs.org/7/okey-x86_64/hiredis-0.12.1-1.el7.centos.x86_64.rpm.html

Try adding the line RUN yum -y install hiredis or maybe adding that package to one of your existing yum install lines.



Answered By - joanis
Answer Checked By - Senaida (WPSolving Volunteer)