Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

356
Vistas
Install package png on Rstudio on Docker,but failed

I install rstudio server on Docker. When I want to install package png, I got a wrong message that

`* installing *source* package ‘png’ ...
** package ‘png’ successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I/usr/local/lib/R/include -DNDEBUG  -I/usr/local/include    
`libpng-config --cflags` -fpic  -g -O2 -fstack-protector-strong -Wformat -
Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c read.c -o 
read.o
/bin/bash: libpng-config: command not found
read.c:3:17: fatal error: png.h: No such file or directory
#include <png.h>
             ^
compilation terminated.
/usr/local/lib/R/etc/Makeconf:132: recipe for target 'read.o' failed
make: *** [read.o] Error 1
ERROR: compilation failed for package ‘png’
* removing ‘/usr/local/lib/R/site-library/png’
Warning in install.packages :
installation of package ‘png’ had non-zero exit status`

I think maybe I should install a library named libpng-devel,but how to install it under docker?Would you please tell me? If it were a ubuntu or centos I know apt-get or yum,but under a docker,I am confused.

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

You need to identify the running container for Rstudio (e.g. docker ps), then use docker exec -it <container-id> to start a bash shell in that container. From the shell, you can install any system packages that are needed.

Source: https://github.com/rocker-org/rocker/wiki/Using-the-RStudio-image#dependencies-external-to-the-r-system

over 4 years ago · Santiago Trujillo Denunciar

0

Adding to prusswan's answer above. Find out what your containers name is first on the command line with the Windows command:

docker -ps

This will give you the image id and the name if any. I'll use the id to open up a bash command line interface:

docker exec -ti d352815fb16b bash

Now we'll install the required linux library we need for png. In the bash shell type:

apt-get install libpng-dev

You should get a confirm prompt, type in y, and it will install. To exit out of the linux shell, type Cntl-D.

Now go back to your Rocker interface in your browser, and try to install png again:

install.packages('png')
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda