rocker-org / rocker-versioned

Run current & prior versions of R using docker
https://hub.docker.com/r/rocker/r-ver
GNU General Public License v2.0
297 stars 169 forks source link

can't install mongolite packages on rocker/rstudio #180

Closed samos999 closed 4 years ago

samos999 commented 4 years ago

Hi , I'm trying to install : mongolite I'm using ubuntu 18.04 and rocker/rstudio , running in Docker. On Rstudio server when i try to install mongolite install.packages("mongolite") I have this error:

`./configure: line 34: pkg-config: command not found
Using PKG_CFLAGS=
Using PKG_LIBS=-lssl -lcrypto -lsasl2 -lresolv
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because openssl/sasl was not found. Try installing:
 * deb: libssl-dev, libsasl2-dev (Debian, Ubuntu, etc)
 * rpm: openssl-devel, cyrus-sasl-devel (Fedora, CentOS, RHEL)
 * csw: libssl_dev, sasl_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: configuration failed for package ‘mongolite’
* removing ‘/usr/local/lib/R/site-library/mongolite’
Warning in install.packages :
  installation of package ‘mongolite’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/RtmpwLlnlG/downloaded_packages’`

I've tried to install : libssl-dev, libsasl2-dev but I end up with the same error .

Regards Samuel

eddelbuettel commented 4 years ago

Those are Ubuntu packages so you need apt-get install libssl-dev libsasl2-dev at the command prompt -- which is different from how you install R packages.

samos999 commented 4 years ago

Yes this is what I did : ubuntu@ip-172-31-23-228:~$ sudo apt-get install libssl-dev libsasl2-dev Reading package lists... Done Building dependency tree Reading state information... Done libsasl2-dev is already the newest version (2.1.27~101-g0780600+dfsg-3ubuntu2). libssl-dev is already the newest version (1.1.1-1ubuntu2.1~18.04.5). 0 upgraded, 0 newly installed, 0 to remove and 25 not upgraded.

But nothing change

eddelbuettel commented 4 years ago

The other error is about pkg-config. I am not sure it matters or if @jeroen has a fragility there -- but it can't hurt to install it: sudo apt-get install pkg-config.

None of this is a Rocker bug. You could ask such generic 'how do I ...' questions for Ubuntu on the r-sig-debian list.

samos999 commented 4 years ago

I've tried with: sudo apt-get install pkg-config But same result I will ask the question on Ubuntu .
I've tried with an other OS (Amazon Linux 2 AMI (HVM)) and exactly the same issue. Regards Sam

eddelbuettel commented 4 years ago

Ok, good luck. I'll close this as we haven't demonstrated a fault with Rocker.

jeroen commented 4 years ago

I tested using this Dockerfile:

FROM rocker/rstudio
RUN apt-get update && apt-get install -y libssl-dev libsasl2-dev libz-dev pkg-config
RUN R -e 'install.packages("mongolite")'

And then docker build . and it built just fine. Please provide the exact script that you are using.

eddelbuettel commented 4 years ago

My feeling exactly. Wasn't the most focussed issue ticket and, as filed, not reproducible.

(Nit: RUN install.r mongolite is more idiomatic around Rocker ;-) )

samos999 commented 4 years ago

Thanks jeroen I will try your Dockerfile. This is the exact script I was using : ssh -i "key-aws-2.pem" ubuntu@ec2-35-180-251-201.eu-west-3.compute.amazonaws.com sudo service docker start sudo docker run -d -p 8787:8787 -e PASSWORD=pwd_sam rocker/rstudio

And then I start a rstudio session with Chrome. From Packages I install :mongolite

jeroen commented 4 years ago

You need to install apt-get install libssl-dev, libsasl2-dev in your docker container that runs rstudio, not on the host.

samos999 commented 4 years ago

Thanks jeroen, I understand now

eddelbuettel commented 4 years ago

And look into docker commit to persist the altered container.