Cannot install 'png' package on RHEL 8.

I cannot get the package png to install on my RHEL 8.6 machine. I have install many other packages, but png cannot install. Here is my error:

trying URL ''
Content type 'application/x-gzip' length 24990 bytes (24 KB)

downloaded 24 KB

  • installing source package ‘png’ ...
    ** package ‘png’ successfully unpacked and MD5 sums checked
    ** using staged installation
    ** libs
    gcc -I"/opt/R/4.2.1/lib/R/include" -DNDEBUG -I/usr/local/include libpng-config --cflags -fpic -g -O2 -c read.c -o read.o
    /bin/sh: libpng-config: command not found
    read.c:3:10: fatal error: png.h: No such file or directory
    #include <png.h>
    compilation terminated.
    make: *** [/opt/R/4.2.1/lib/R/etc/Makeconf:168: read.o] Error 1
    ERROR: compilation failed for package ‘png’
  • removing ‘/opt/R/4.2.1/lib/R/library/png’

The downloaded source packages are in
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Installed: png
Warning message:
In install.packages(p[i]) :
installation of package ‘png’ had non-zero exit status

Any suggestions? It is likely I need to install an additional object library to RHEL.

Yes you are missing a system library, I'm not an RHEL user so I'm not sure about the library name but you can try with this

yum install libpng-devel

Thank you. It worked!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.