Installing the sf package in RedHat Linux

Por Emilio L. Cano | 2019-04-22

We have some Shiny Applications in our Shiny server that plot interactive maps. They use the sf package to read shape files, but when installing the package in the RedHat Linux server we found several dependency problems. This is the path we follow to get it working.

The R package needs the rgdal Linux package (>2.0.0), but in the repositories the available version is older. Then we had to install from source.

tar xvzf gdal-2.4.1.tar.gz 
cd gdal-2.4.1
make install

Still, the package installation did not find the programs. Not sure if this was necessary or not:

cd /etc/
touch libgdal-x86_64.conf
vi libgdal-x86_64.conf # /usr/local/lib

Errors keep showing, not found PROJ. Then we did the following and after the last step it worked:

yum install proj proj-devel
yum install proj-epsg proj-nad
yum install
yum install geos-devel

This was after a lot of Internet searchers, most of the tips were fond in StackOverflow.