Trouble with fresh install of Shiny Server on CentOS7

Hello everyone,

I've been tasked with setting up a fresh install of shiny server on a CentOS virtual machine.

So far, I've been following the tutorial listed here:

When I try to run my application, it is giving me the message 'An error occurred, the application failed to start'. My next step was to check the logs, and I found that the error message I'm getting is the following:
Error in library(leaflet): there is no package called 'leaflet'.

I went back and looked at the code, and tried to load each package manually in R. The ones that are failing to load are the following:

  • mapview
  • plotKML
  • leafpop
  • rgdal

I'm using the following command to try to install them:

su - -c "R -e \"install.packages(c('mapview', 'plotKML', 'leafpop', 'rgdal'), repos='http://cran.rstudio.com/')\""

The error message I got says the following:

> install.packages(c('mapview', 'plotKML', 'leafpop', 'rgdal'), repos='http://cran.rstudio.com/')
Installing packages into ‘/usr/lib64/R/library’
(as ‘lib’ is unspecified)
also installing the dependencies ‘units’, ‘gdtools’, ‘leafem’, ‘sf’, ‘svglite’, ‘XML’, ‘RSAGA’

trying URL 'http://cran.rstudio.com/src/contrib/units_0.6-5.tar.gz'
Content type 'application/x-gzip' length 959970 bytes (937 KB)
==================================================
downloaded 937 KB

trying URL 'http://cran.rstudio.com/src/contrib/gdtools_0.2.1.tar.gz'
Content type 'application/x-gzip' length 32043 bytes (31 KB)
==================================================
downloaded 31 KB

trying URL 'http://cran.rstudio.com/src/contrib/leafem_0.0.1.tar.gz'
Content type 'application/x-gzip' length 2844830 bytes (2.7 MB)
==================================================
downloaded 2.7 MB

trying URL 'http://cran.rstudio.com/src/contrib/sf_0.8-1.tar.gz'
Content type 'application/x-gzip' length 8469173 bytes (8.1 MB)
==================================================
downloaded 8.1 MB

trying URL 'http://cran.rstudio.com/src/contrib/svglite_1.2.3.tar.gz'
Content type 'application/x-gzip' length 43314 bytes (42 KB)
==================================================
downloaded 42 KB

trying URL 'http://cran.rstudio.com/src/contrib/XML_3.99-0.3.tar.gz'
Content type 'application/x-gzip' length 968543 bytes (945 KB)
==================================================
downloaded 945 KB

trying URL 'http://cran.rstudio.com/src/contrib/RSAGA_1.3.0.tar.gz'
Content type 'application/x-gzip' length 2599558 bytes (2.5 MB)
==================================================
downloaded 2.5 MB

trying URL 'http://cran.rstudio.com/src/contrib/mapview_2.7.0.tar.gz'
Content type 'application/x-gzip' length 2029313 bytes (1.9 MB)
==================================================
downloaded 1.9 MB

trying URL 'http://cran.rstudio.com/src/contrib/plotKML_0.6-0.tar.gz'
Content type 'application/x-gzip' length 3448183 bytes (3.3 MB)
==================================================
downloaded 3.3 MB

trying URL 'http://cran.rstudio.com/src/contrib/leafpop_0.0.5.tar.gz'
Content type 'application/x-gzip' length 1868188 bytes (1.8 MB)
==================================================
downloaded 1.8 MB

trying URL 'http://cran.rstudio.com/src/contrib/rgdal_1.4-8.tar.gz'
Content type 'application/x-gzip' length 1698902 bytes (1.6 MB)
==================================================
downloaded 1.6 MB

* installing *source* package ‘units’ ...
** package ‘units’ successfully unpacked and MD5 sums checked
** using staged installation
configure: units: 0.6-4
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ -m64 -std=gnu++11 accepts -g... yes
checking how to run the C++ preprocessor... g++ -m64 -std=gnu++11 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... no
checking for error_at_line... yes
checking for gcc... gcc -m64 -std=gnu99
checking whether we are using the GNU C compiler... yes
checking whether gcc -m64 -std=gnu99 accepts -g... yes
checking for gcc -m64 -std=gnu99 option to accept ISO C89... none needed
checking for XML_ParserCreate in -lexpat... yes
checking udunits2.h usability... no
checking udunits2.h presence... no
checking for udunits2.h... no
checking udunits2/udunits2.h usability... no
checking udunits2/udunits2.h presence... no
checking for udunits2/udunits2.h... no
checking for ut_read_xml in -ludunits2... no
configure: error: in `/tmp/Rtmp018p3x/R.INSTALL479336682487/units':
configure: error: 
--------------------------------------------------------------------------------
  Configuration failed because libudunits2.so was not found. Try installing:
    * deb: libudunits2-dev (Debian, Ubuntu, ...)
    * rpm: udunits2-devel (Fedora, EPEL, ...)
    * brew: udunits (OSX)
  If udunits2 is already installed in a non-standard location, use:
    --configure-args='--with-udunits2-lib=/usr/local/lib'
  if the library was not found, and/or:
    --configure-args='--with-udunits2-include=/usr/include/udunits2'
  if the header was not found, replacing paths with appropriate values.
  You can alternatively set UDUNITS2_INCLUDE and UDUNITS2_LIBS manually.
--------------------------------------------------------------------------------

See `config.log' for more details
ERROR: configuration failed for package ‘units’
* removing ‘/usr/lib64/R/library/units’
* installing *source* package ‘gdtools’ ...
** package ‘gdtools’ successfully unpacked and MD5 sums checked
** using staged installation
Package cairo was not found in the pkg-config search path.
Perhaps you should add the directory containing `cairo.pc'
to the PKG_CONFIG_PATH environment variable
No package 'cairo' found
Package cairo was not found in the pkg-config search path.
Perhaps you should add the directory containing `cairo.pc'
to the PKG_CONFIG_PATH environment variable
No package 'cairo' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lcairo -lfreetype
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because cairo freetype2 was not found. Try installing:
 * deb: libcairo2-dev (Debian, Ubuntu)
 * rpm: cairo-devel (Fedora, CentOS, RHEL)
 * csw: libcairo_dev (Solaris)
 * brew: cairo (OSX)
If cairo freetype2 is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a cairo freetype2.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------
ERROR: configuration failed for package ‘gdtools’
* removing ‘/usr/lib64/R/library/gdtools’
* installing *source* package ‘XML’ ...
** package ‘XML’ successfully unpacked and MD5 sums checked
** using staged installation
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for sed... /usr/bin/sed
checking for pkg-config... /bin/pkg-config
checking for xml2-config... no
Cannot find xml2-config
ERROR: configuration failed for package ‘XML’
* removing ‘/usr/lib64/R/library/XML’
* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ successfully unpacked and MD5 sums checked
** using staged installation
configure: R_HOME: /usr/lib64/R
configure: CC: gcc -m64 -std=gnu99
configure: CXX: g++ -m64 -std=gnu++11
configure: C++11 support available
configure: rgdal: 1.4-7
checking for /usr/bin/svnversion... no
configure: svn revision: 845
checking for gdal-config... no
no
configure: error: gdal-config not found or not executable.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/usr/lib64/R/library/rgdal’
ERROR: dependency ‘units’ is not available for package ‘sf’
* removing ‘/usr/lib64/R/library/sf’
ERROR: dependency ‘gdtools’ is not available for package ‘svglite’
* removing ‘/usr/lib64/R/library/svglite’
ERROR: dependency ‘rgdal’ is not available for package ‘RSAGA’
* removing ‘/usr/lib64/R/library/RSAGA’
ERROR: dependency ‘sf’ is not available for package ‘leafem’
* removing ‘/usr/lib64/R/library/leafem’
ERROR: dependencies ‘XML’, ‘rgdal’, ‘RSAGA’ are not available for package ‘plotKML’
* removing ‘/usr/lib64/R/library/plotKML’
ERROR: dependencies ‘sf’, ‘svglite’ are not available for package ‘leafpop’
* removing ‘/usr/lib64/R/library/leafpop’
ERROR: dependencies ‘leafem’, ‘leafpop’, ‘sf’, ‘svglite’ are not available for package ‘mapview’
* removing ‘/usr/lib64/R/library/mapview’

The downloaded source packages are in
	‘/tmp/Rtmp0b5kvE/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
There were 11 warnings (use warnings() to see them)

What should I do next?

Next I tried running the commands:

yum install udunits2-devel
yum install cairo-devel

I tried running the install packages command again,and got this result

install.packages(c('mapview', 'plotKML', 'leafpop', 'rgdal'), repos='http://cran.rstudio.com/')
Installing packages into ‘/usr/lib64/R/library’
(as ‘lib’ is unspecified)
also installing the dependencies ‘gdtools’, ‘leafem’, ‘sf’, ‘svglite’, ‘XML’, ‘RSAGA’

trying URL 'http://cran.rstudio.com/src/contrib/gdtools_0.2.1.tar.gz'
Content type 'application/x-gzip' length 32043 bytes (31 KB)
==================================================
downloaded 31 KB

trying URL 'http://cran.rstudio.com/src/contrib/leafem_0.0.1.tar.gz'
Content type 'application/x-gzip' length 2844830 bytes (2.7 MB)
==================================================
downloaded 2.7 MB

trying URL 'http://cran.rstudio.com/src/contrib/sf_0.8-1.tar.gz'
Content type 'application/x-gzip' length 8469173 bytes (8.1 MB)
==================================================
downloaded 8.1 MB

trying URL 'http://cran.rstudio.com/src/contrib/svglite_1.2.3.tar.gz'
Content type 'application/x-gzip' length 43314 bytes (42 KB)
==================================================
downloaded 42 KB

trying URL 'http://cran.rstudio.com/src/contrib/XML_3.99-0.3.tar.gz'
Content type 'application/x-gzip' length 968543 bytes (945 KB)
==================================================
downloaded 945 KB

trying URL 'http://cran.rstudio.com/src/contrib/RSAGA_1.3.0.tar.gz'
Content type 'application/x-gzip' length 2599558 bytes (2.5 MB)
==================================================
downloaded 2.5 MB

trying URL 'http://cran.rstudio.com/src/contrib/mapview_2.7.0.tar.gz'
Content type 'application/x-gzip' length 2029313 bytes (1.9 MB)
==================================================
downloaded 1.9 MB

trying URL 'http://cran.rstudio.com/src/contrib/plotKML_0.6-0.tar.gz'
Content type 'application/x-gzip' length 3448183 bytes (3.3 MB)
==================================================
downloaded 3.3 MB

trying URL 'http://cran.rstudio.com/src/contrib/leafpop_0.0.5.tar.gz'
Content type 'application/x-gzip' length 1868188 bytes (1.8 MB)
==================================================
downloaded 1.8 MB

trying URL 'http://cran.rstudio.com/src/contrib/rgdal_1.4-8.tar.gz'
Content type 'application/x-gzip' length 1698902 bytes (1.6 MB)
==================================================
downloaded 1.6 MB

* installing *source* package ‘gdtools’ ...
** package ‘gdtools’ successfully unpacked and MD5 sums checked
** using staged installation
Found pkg-config cflags and libs!
Using PKG_CFLAGS=-I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng15 -I/usr/include/uuid -I/usr/include/libdrm
Using PKG_LIBS=-lcairo -lfreetype
** libs
rm -f gdtools.so CairoContext.o RcppExports.o font_metrics.o gdtools.o raster_to_base64.o versions.o
g++ -m64 -std=gnu++11 -I"/usr/include/R" -DNDEBUG -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng15 -I/usr/include/uuid -I/usr/include/libdrm   -I../inst/include/ -I"/usr/lib64/R/library/Rcpp/include" -I/usr/local/include -fvisibility=hidden -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -c CairoContext.cpp -o CairoContext.o
g++ -m64 -std=gnu++11 -I"/usr/include/R" -DNDEBUG -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng15 -I/usr/include/uuid -I/usr/include/libdrm   -I../inst/include/ -I"/usr/lib64/R/library/Rcpp/include" -I/usr/local/include -fvisibility=hidden -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -c RcppExports.cpp -o RcppExports.o
g++ -m64 -std=gnu++11 -I"/usr/include/R" -DNDEBUG -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng15 -I/usr/include/uuid -I/usr/include/libdrm   -I../inst/include/ -I"/usr/lib64/R/library/Rcpp/include" -I/usr/local/include -fvisibility=hidden -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -c font_metrics.cpp -o font_metrics.o
g++ -m64 -std=gnu++11 -I"/usr/include/R" -DNDEBUG -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng15 -I/usr/include/uuid -I/usr/include/libdrm   -I../inst/include/ -I"/usr/lib64/R/library/Rcpp/include" -I/usr/local/include -fvisibility=hidden -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -c gdtools.cpp -o gdtools.o
g++ -m64 -std=gnu++11 -I"/usr/include/R" -DNDEBUG -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng15 -I/usr/include/uuid -I/usr/include/libdrm   -I../inst/include/ -I"/usr/lib64/R/library/Rcpp/include" -I/usr/local/include -fvisibility=hidden -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -c raster_to_base64.cpp -o raster_to_base64.o
g++ -m64 -std=gnu++11 -I"/usr/include/R" -DNDEBUG -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng15 -I/usr/include/uuid -I/usr/include/libdrm   -I../inst/include/ -I"/usr/lib64/R/library/Rcpp/include" -I/usr/local/include -fvisibility=hidden -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -c versions.cpp -o versions.o
g++ -m64 -std=gnu++11 -shared -L/usr/lib64/R/lib -Wl,-z,relro -o gdtools.so CairoContext.o RcppExports.o font_metrics.o gdtools.o raster_to_base64.o versions.o -lcairo -lfreetype -L/usr/lib64/R/lib -lR
installing to /usr/lib64/R/library/00LOCK-gdtools/00new/gdtools/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
  converting help for package ‘gdtools’
    finding HTML links ... done
    font_family_exists                      html
    fontconfig_reinit                       html
    glyphs_match                            html
    m_str_extents                           html
    match_family                            html
    raster_str                              html
    raster_write                            html
    set_dummy_conf                          html
    str_extents                             html
    str_metrics                             html
    sys_fonts                               html
    version_cairo                           html
Rd warning: /tmp/Rtmp54K2wC/R.INSTALL59506a4f99af/gdtools/man/version_cairo.Rd:15: file link ‘packageVersion’ in package ‘utils’ does not exist and so has been treated as a topic
** building package indices
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (gdtools)
Making 'packages.html' ... done
* installing *source* package ‘sf’ ...
** package ‘sf’ successfully unpacked and MD5 sums checked
** using staged installation
configure: CC: gcc -m64 -std=gnu99
configure: CXX: g++ -m64 -std=gnu++11
checking for gdal-config... no
no
configure: error: gdal-config not found or not executable.
ERROR: configuration failed for package ‘sf’
* removing ‘/usr/lib64/R/library/sf’
* installing *source* package ‘XML’ ...
** package ‘XML’ successfully unpacked and MD5 sums checked
** using staged installation
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for sed... /usr/bin/sed
checking for pkg-config... /bin/pkg-config
checking for xml2-config... no
Cannot find xml2-config
ERROR: configuration failed for package ‘XML’
* removing ‘/usr/lib64/R/library/XML’
* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ successfully unpacked and MD5 sums checked
** using staged installation
configure: R_HOME: /usr/lib64/R
configure: CC: gcc -m64 -std=gnu99
configure: CXX: g++ -m64 -std=gnu++11
configure: C++11 support available
configure: rgdal: 1.4-7
checking for /usr/bin/svnversion... no
configure: svn revision: 845
checking for gdal-config... no
no
configure: error: gdal-config not found or not executable.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/usr/lib64/R/library/rgdal’
ERROR: dependency ‘sf’ is not available for package ‘leafem’
* removing ‘/usr/lib64/R/library/leafem’
* installing *source* package ‘svglite’ ...
** package ‘svglite’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
g++ -m64 -std=gnu++11 -I"/usr/include/R" -DNDEBUG  -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/gdtools/include" -I"/usr/lib64/R/library/BH/include" -I/usr/local/include  -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -c RcppExports.cpp -o RcppExports.o
g++ -m64 -std=gnu++11 -I"/usr/include/R" -DNDEBUG  -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/gdtools/include" -I"/usr/lib64/R/library/BH/include" -I/usr/local/include  -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -c devSVG.cpp -o devSVG.o
g++ -m64 -std=gnu++11 -shared -L/usr/lib64/R/lib -Wl,-z,relro -o svglite.so RcppExports.o devSVG.o -L/usr/lib64/R/lib -lR
installing to /usr/lib64/R/library/00LOCK-svglite/00new/svglite/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
  converting help for package ‘svglite’
    finding HTML links ... done
    editSVG                                 html
    htmlSVG                                 html
    stringSVG                               html
    svglite                                 html
    svgstring                               html
    xmlSVG                                  html
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (svglite)
Making 'packages.html' ... done
ERROR: dependency ‘rgdal’ is not available for package ‘RSAGA’
* removing ‘/usr/lib64/R/library/RSAGA’
ERROR: dependencies ‘XML’, ‘rgdal’, ‘RSAGA’ are not available for package ‘plotKML’
* removing ‘/usr/lib64/R/library/plotKML’
ERROR: dependency ‘sf’ is not available for package ‘leafpop’
* removing ‘/usr/lib64/R/library/leafpop’
ERROR: dependencies ‘leafem’, ‘leafpop’, ‘sf’ are not available for package ‘mapview’
* removing ‘/usr/lib64/R/library/mapview’

The downloaded source packages are in
        ‘/tmp/RtmpFCowzw/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning messages:
1: In install.packages(c("mapview", "plotKML", "leafpop", "rgdal"),  :
  installation of package ‘sf’ had non-zero exit status
2: In install.packages(c("mapview", "plotKML", "leafpop", "rgdal"),  :
  installation of package ‘XML’ had non-zero exit status
3: In install.packages(c("mapview", "plotKML", "leafpop", "rgdal"),  :
  installation of package ‘rgdal’ had non-zero exit status
4: In install.packages(c("mapview", "plotKML", "leafpop", "rgdal"),  :
  installation of package ‘leafem’ had non-zero exit status
5: In install.packages(c("mapview", "plotKML", "leafpop", "rgdal"),  :
  installation of package ‘RSAGA’ had non-zero exit status
6: In install.packages(c("mapview", "plotKML", "leafpop", "rgdal"),  :
  installation of package ‘plotKML’ had non-zero exit status
7: In install.packages(c("mapview", "plotKML", "leafpop", "rgdal"),  :
  installation of package ‘leafpop’ had non-zero exit status
8: In install.packages(c("mapview", "plotKML", "leafpop", "rgdal"),  :
  installation of package ‘mapview’ had non-zero exit status
>
>

I'm still stuck. Shouldn't it be easier to load packages? What am I doing wrong?

You are missing this system dependencies
GDAL (>= 2.0.1), GEOS (>= 3.4.0) and Proj.4 (>= 4.8.0).
I have never used CentOS so I don't know the exact library names for this OS but you could Google them.

I've been trying for the past couple hours and I cant find a way to get GDAL to install.

I think the packages are here:
https://centos.pkgs.org/7/springdale-computational-x86_64/gdal224-libs-2.2.4-4.sdl7.x86_64.rpm.html

The following wont work because yum doesn't recognize the repository

yum install gdal224-libs 

The sf package is a huge pain to install on CentOS/RHEL 7. It needs a newer version of GDAL (2.x) than what's available in EPEL, so you have to build it from source or find it from some other 3rd party repo. I built it from source a while back and came up with these steps: https://gist.github.com/glin/404670e96226ff90c3029b4f43c5c7c9

There's also the CentOS 7 installation guide on the sf wiki, in case you need to install any of sf's optional dependencies: https://github.com/r-spatial/sf/wiki/Installation-Guide

1 Like

Okay - I added the repo using

yum-config-manager --add-repo=http://springdale.princeton.edu/data/springdale/7/x86_64/os/Computational/

Now i'm getting a different error.

# yum install gdal224-libs
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirror.it.ubc.ca
 * epel: mirror.prgmr.com
 * extras: mirror.its.sfu.ca
 * updates: mirror.it.ubc.ca
Resolving Dependencies
--> Running transaction check
---> Package gdal224-libs.x86_64 0:2.2.4-4.sdl7 will be installed
--> Processing Dependency: libarmadillo.so.7()(64bit) for package: gdal224-libs-2.2.4-4.sdl7.x86_64
--> Processing Dependency: libspatialite.so.5()(64bit) for package: gdal224-libs-2.2.4-4.sdl7.x86_64
--> Running transaction check
---> Package gdal224-libs.x86_64 0:2.2.4-4.sdl7 will be installed
--> Processing Dependency: libarmadillo.so.7()(64bit) for package: gdal224-libs-2.2.4-4.sdl7.x86_64
---> Package libspatialite.x86_64 0:4.1.1-2.sdl7 will be installed
--> Finished Dependency Resolution
Error: Package: gdal224-libs-2.2.4-4.sdl7.x86_64 (springdale.princeton.edu_data_springdale_7_x86_64_os_Computational_)
           Requires: libarmadillo.so.7()(64bit)
           Available: armadillo-7.960.1-1.sdl7.x86_64 (springdale.princeton.edu_data_springdale_7_x86_64_os_Computational_)
               libarmadillo.so.7()(64bit)
           Installed: armadillo-8.600.1-2.el7.x86_64 (@epel)
              ~libarmadillo.so.8()(64bit)
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

Good to know I'm not the only one that has had this problem.

The software runs fine on desktop, but getting it ported over to shiny server is a b*tch.

I'm wondering if it's just going to be easier to re-write the code to use ArcGIS online or some other package to do the web mapping aspect instead of using mapview and leaflet.

I'll try running your .sh script tomorrow, thanks for the help.

I reverted to a previous snapshot, and following your .sh code allowed me to get the sf package installed. Thank you very much for saving that and posting it.

However, I still cant get mapview to install.

When I run install.packages("mapview", repos = "https://cloud.r-project.org"), i'm getting a similar error as before.

> install.packages("mapview", repos = "https://cloud.r-project.org")
Installing package into ‘/usr/lib64/R/library’
(as ‘lib’ is unspecified)
also installing the dependencies ‘gridExtra’, ‘systemfonts’, ‘viridis’, ‘leaflet.providers’, ‘gdtools’, ‘leafem’, ‘leaflet’, ‘leafpop’, ‘png’, ‘raster’, ‘satellite’, ‘sp’, ‘svglite’, ‘uuid’, ‘webshot’

trying URL 'https://cloud.r-project.org/src/contrib/gridExtra_2.3.tar.gz'
Content type 'application/x-gzip' length 1062844 bytes (1.0 MB)
==================================================
downloaded 1.0 MB

trying URL 'https://cloud.r-project.org/src/contrib/systemfonts_0.1.1.tar.gz'
Content type 'application/x-gzip' length 24379 bytes (23 KB)
==================================================
downloaded 23 KB

trying URL 'https://cloud.r-project.org/src/contrib/viridis_0.5.1.tar.gz'
Content type 'application/x-gzip' length 1906320 bytes (1.8 MB)
==================================================
downloaded 1.8 MB

trying URL 'https://cloud.r-project.org/src/contrib/leaflet.providers_1.9.0.tar.gz'
Content type 'application/x-gzip' length 30210 bytes (29 KB)
==================================================
downloaded 29 KB

trying URL 'https://cloud.r-project.org/src/contrib/gdtools_0.2.1.tar.gz'
Content type 'application/x-gzip' length 32043 bytes (31 KB)
==================================================
downloaded 31 KB

trying URL 'https://cloud.r-project.org/src/contrib/leafem_0.0.1.tar.gz'
Content type 'application/x-gzip' length 2844830 bytes (2.7 MB)
==================================================
downloaded 2.7 MB

trying URL 'https://cloud.r-project.org/src/contrib/leaflet_2.0.3.tar.gz'
Content type 'application/x-gzip' length 2039454 bytes (1.9 MB)
==================================================
downloaded 1.9 MB

trying URL 'https://cloud.r-project.org/src/contrib/leafpop_0.0.5.tar.gz'
Content type 'application/x-gzip' length 1868188 bytes (1.8 MB)
==================================================
downloaded 1.8 MB

trying URL 'https://cloud.r-project.org/src/contrib/png_0.1-7.tar.gz'
Content type 'application/x-gzip' length 24990 bytes (24 KB)
==================================================
downloaded 24 KB

trying URL 'https://cloud.r-project.org/src/contrib/raster_3.0-12.tar.gz'
Content type 'application/x-gzip' length 608634 bytes (594 KB)
==================================================
downloaded 594 KB

trying URL 'https://cloud.r-project.org/src/contrib/satellite_1.0.2.tar.gz'
Content type 'application/x-gzip' length 2002786 bytes (1.9 MB)
==================================================
downloaded 1.9 MB

trying URL 'https://cloud.r-project.org/src/contrib/sp_1.3-2.tar.gz'
Content type 'application/x-gzip' length 1132347 bytes (1.1 MB)
==================================================
downloaded 1.1 MB

trying URL 'https://cloud.r-project.org/src/contrib/svglite_1.2.3.tar.gz'
Content type 'application/x-gzip' length 43314 bytes (42 KB)
==================================================
downloaded 42 KB

trying URL 'https://cloud.r-project.org/src/contrib/uuid_0.1-2.tar.gz'
Content type 'application/x-gzip' length 46706 bytes (45 KB)
==================================================
downloaded 45 KB

trying URL 'https://cloud.r-project.org/src/contrib/webshot_0.5.2.tar.gz'
Content type 'application/x-gzip' length 157837 bytes (154 KB)
==================================================
downloaded 154 KB

trying URL 'https://cloud.r-project.org/src/contrib/mapview_2.7.0.tar.gz'
Content type 'application/x-gzip' length 2029313 bytes (1.9 MB)
==================================================
downloaded 1.9 MB
...
...
..
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (satellite)
Making 'packages.html' ... done
ERROR: dependency ‘gdtools’ is not available for package ‘svglite’
* removing ‘/usr/lib64/R/library/svglite’
* installing *source* package ‘leafem’ ...
** package ‘leafem’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
  converting help for package ‘leafem’
    finding HTML links ... done
    addFeatures                             html
    finding level-2 HTML links ... done

    addHomeButton                           html
    addImageQuery                           html
    addLogo                                 html
    addMouseCoordinates                     html
    garnishMap                              html
*** copying figures
** building package indices
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (leafem)
Making 'packages.html' ... done
ERROR: dependency ‘svglite’ is not available for package ‘leafpop’
* removing ‘/usr/lib64/R/library/leafpop’
ERROR: dependencies ‘leafpop’, ‘svglite’ are not available for package ‘mapview’
* removing ‘/usr/lib64/R/library/mapview’

The downloaded source packages are in
        ‘/tmp/RtmpfvwhZI/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning messages:
1: In install.packages("mapview", repos = "https://cloud.r-project.org") :
  installation of package ‘gdtools’ had non-zero exit status
2: In install.packages("mapview", repos = "https://cloud.r-project.org") :
  installation of package ‘svglite’ had non-zero exit status
3: In install.packages("mapview", repos = "https://cloud.r-project.org") :
  installation of package ‘leafpop’ had non-zero exit status
4: In install.packages("mapview", repos = "https://cloud.r-project.org") :
  installation of package ‘mapview’ had non-zero exit status
>
>

successfully installed mapview and leafpop using:

yum install cairo-devel

Got the server up and running. Thanks everyone =)

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