Troubleshooting R Package Installation on Red Hat Enterprise Linux 6

I thought I’d take the opportunity to work through an example to demonstrate a basic problem-solving method for R on RHEL:

When attempting to install the R packages “ggmap” and its dependent package “jpeg,” one might encounter output with the following line included:

rjcommon.h:11:21: error: jpeglib.h: No such file or directory

Missing file issues are probably the most common issues encountered by those attempting to install R packages on a Linux distribution.  In RHEL 6, the best avenue for resolving the problem is to check which RPM (if any) provides that missing file:

$ sudo yum provides "*jpeglib.h"

libjpeg-turbo-devel-1.2.1-3.el6_5.i686 : Headers for the libjpeg-turbo library
Repo        : rhel-6-server-rpms
Matched from:
Filename    : /usr/include/jpeglib.h

libjpeg-devel-6b-46.el6.x86_64 : Development tools for programs which will use the libjpeg library
Repo        : rhel-6-server-rpms
Matched from:
Filename    : /usr/include/jpeglib.h

libjpeg-devel-6b-46.el6.i686 : Development tools for programs which will use the libjpeg library
Repo        : rhel-6-server-rpms
Matched from:
Filename    : /usr/include/jpeglib.h

libjpeg-turbo-devel-1.2.1-1.el6.i686 : Headers for the libjpeg-turbo library
Repo        : rhel-6-server-rpms
Matched from:
Filename    : /usr/include/jpeglib.h

libjpeg-turbo-devel-1.2.1-1.el6.x86_64 : Headers for the libjpeg-turbo library
Repo        : rhel-6-server-rpms
Matched from:
Filename    : /usr/include/jpeglib.h

libjpeg-turbo-devel-1.2.1-3.el6_5.x86_64 : Headers for the libjpeg-turbo library
Repo        : rhel-6-server-rpms
Matched from:
Filename    : /usr/include/jpeglib.h

libjpeg-turbo-devel-1.2.1-3.el6_5.x86_64 : Headers for the libjpeg-turbo library
Repo        : installed
Matched from:
Filename    : /usr/include/jpeglib.h

Sometimes, as you can see, multiple packages are returned.  The information you need to determine the proper package to install is that the libjpeg-turbo* series of packages has made obsolete the old libjpeg package series.  Aside from that, we should take the most up to date version of the package which is available in the RHEL repositories to which we are subscribed, and that’s the first package listed in the output above.

So to rectify the problem, simply install that package:

$ sudo yum install libjpeg-turbo-devel

Since I didn’t specify the version or architecture, those values are automatically selected for me (and unless you have problems with an installed package, that’s always the way to go).

And your R installation is probably now successful!

Advertisements
This entry was posted in Information Technology and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s