[R] Problems installing jpeg package

Marc Schwartz marc_schwartz at me.com
Tue Jan 27 14:01:43 CET 2015

> On Jan 27, 2015, at 6:05 AM, Jorge Fernández García <jorfega80 at hotmail.com> wrote:
> I need help installing jpeg package. Simple command install.package("jpeg") produce the following result. My OS is Fedora 21. Thanks in advance for your help.
>> install.packages("jpeg")
> Installing package into ‘/home/cgg/R/x86_64-redhat-linux-gnu-library/3.1’
> (as ‘lib’ is unspecified)
> trying URL 'http://cran.rstudio.com/src/contrib/jpeg_0.1-8.tar.gz'
> Content type 'application/x-gzip' length 18046 bytes (17 Kb)
> opened URL
> ==================================================
> downloaded 17 Kb
> * installing *source* package ‘jpeg’ ...
> ** package ‘jpeg’ successfully unpacked and MD5 sums checked
> ** libs
> gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG  -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches  -m64 -mtune=generic  -c read.c -o read.o
> In file included from read.c:1:0:
> rjcommon.h:11:21: fatal error: jpeglib.h: No such file or directory
> #include <jpeglib.h>
>                     ^
> compilation terminated.
> /usr/lib64/R/etc/Makeconf:133: recipe for target 'read.o' failed
> make: *** [read.o] Error 1
> ERROR: compilation failed for package ‘jpeg’
> * removing ‘/home/cgg/R/x86_64-redhat-linux-gnu-library/3.1/jpeg’
> Warning in install.packages :
>  installation of package ‘jpeg’ had non-zero exit status
> The downloaded source packages are in
>    ‘/tmp/RtmpYpmDcb/downloaded_packages’


You are missing the header file jpeglib.h, which is required for compiling the package from source.

On Fedora, such files are typically contained in a *-devel RPM, where the '*' is the prefix for the Fedora RPM that provides the binary and related files.

Specifically in this case, libjpeg is contained in the libjpeg-turbo RPM, thus you need, as root:

  yum install libjpeg-turbo-devel


  sudo yum install libjpeg-turbo-devel

from the CLI. The R Installation and Administration manual covers this in:


As an aside, there is a SIG list specifically for R on RH/Fedora based Linux distros:



Marc Schwartz


More information about the R-help mailing list