Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

345
Views
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.

about 4 years ago · Santiago Trujillo
2 answers
Answer question

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

about 4 years ago · Santiago Trujillo Report

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')
about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!