Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

354
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda