Unable to install packages on rstudio server

package-installation
rgdal
#1

Good day,

I would like to install the following packages in rstudio server:

install.packages("rgdal")
install.packages("RSAGA")
install.packages("plotKML")

However, I keep on getting the following errors

> install.packages("rgdal")
Error: unexpected symbol in:
"library(plotKML
install.packages"
> install.packages("RSAGA")
Installing package into ‘/home/gis/R/x86_64-redhat-linux-gnu-library/3.5’
(as ‘lib’ is unspecified)
also installing the dependency ‘rgdal’

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

trying URL 'https://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

* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ successfully unpacked and MD5 sums checked
configure: R_HOME: /usr/lib64/R
configure: CC: gcc -m64 -std=gnu99
configure: CXX: g++ -m64
configure: C++11 support available
configure: rgdal: 1.4-3
checking for /usr/bin/svnversion... yes
configure: svn revision: 828
checking for gdal-config... no
no
configure: error: gdal-config not found or not executable.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/home/gis/R/x86_64-redhat-linux-gnu-library/3.5/rgdal’
Warning in install.packages :
  installation of package ‘rgdal’ had non-zero exit status
ERROR: dependency ‘rgdal’ is not available for package ‘RSAGA’
* removing ‘/home/gis/R/x86_64-redhat-linux-gnu-library/3.5/RSAGA’
Warning in install.packages :
  installation of package ‘RSAGA’ had non-zero exit status

The downloaded source packages are in
	‘/tmp/RtmphHmFFw/downloaded_packages’
> install.packages("plotKML")
Installing package into ‘/home/gis/R/x86_64-redhat-linux-gnu-library/3.5’
(as ‘lib’ is unspecified)
also installing the dependencies ‘rgdal’, ‘RSAGA’

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

trying URL 'https://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 'https://cran.rstudio.com/src/contrib/plotKML_0.5-9.tar.gz'
Content type 'application/x-gzip' length 3455602 bytes (3.3 MB)
==================================================
downloaded 3.3 MB

* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ successfully unpacked and MD5 sums checked
configure: R_HOME: /usr/lib64/R
configure: CC: gcc -m64 -std=gnu99
configure: CXX: g++ -m64
configure: C++11 support available
configure: rgdal: 1.4-3
checking for /usr/bin/svnversion... yes
configure: svn revision: 828
checking for gdal-config... no
no
configure: error: gdal-config not found or not executable.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/home/gis/R/x86_64-redhat-linux-gnu-library/3.5/rgdal’
Warning in install.packages :
  installation of package ‘rgdal’ had non-zero exit status
ERROR: dependency ‘rgdal’ is not available for package ‘RSAGA’
* removing ‘/home/gis/R/x86_64-redhat-linux-gnu-library/3.5/RSAGA’
Warning in install.packages :
  installation of package ‘RSAGA’ had non-zero exit status
ERROR: dependencies ‘rgdal’, ‘RSAGA’ are not available for package ‘plotKML’
* removing ‘/home/gis/R/x86_64-redhat-linux-gnu-library/3.5/plotKML’
Warning in install.packages :
  installation of package ‘plotKML’ had non-zero exit status

The downloaded source packages are in
	‘/tmp/RtmphHmFFw/downloaded_packages’
> library(rgdal)
Error in library(rgdal) : there is no package called ‘rgdal’
> library(RSAGA)
Error in library(RSAGA) : there is no package called ‘RSAGA’
> library(plotKML)
Error in library(plotKML) : there is no package called ‘plotKML’
> install.packages("rgdal")
Installing package into ‘/home/gis/R/x86_64-redhat-linux-gnu-library/3.5’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/rgdal_1.4-3.tar.gz'
Content type 'application/x-gzip' length 1687331 bytes (1.6 MB)
==================================================
downloaded 1.6 MB

* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ successfully unpacked and MD5 sums checked
configure: R_HOME: /usr/lib64/R
configure: CC: gcc -m64 -std=gnu99
configure: CXX: g++ -m64
configure: C++11 support available
configure: rgdal: 1.4-3
checking for /usr/bin/svnversion... yes
configure: svn revision: 828
checking for gdal-config... no
no
configure: error: gdal-config not found or not executable.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/home/gis/R/x86_64-redhat-linux-gnu-library/3.5/rgdal’
Warning in install.packages :
  installation of package ‘rgdal’ had non-zero exit status

The downloaded source packages are in
	‘/tmp/RtmphHmFFw/downloaded_packages’
> install.packages("RSAGA")
Installing package into ‘/home/gis/R/x86_64-redhat-linux-gnu-library/3.5’
(as ‘lib’ is unspecified)
also installing the dependency ‘rgdal’

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

trying URL 'https://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

* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ successfully unpacked and MD5 sums checked
configure: R_HOME: /usr/lib64/R
configure: CC: gcc -m64 -std=gnu99
configure: CXX: g++ -m64
configure: C++11 support available
configure: rgdal: 1.4-3
checking for /usr/bin/svnversion... yes
configure: svn revision: 828
checking for gdal-config... no
no
configure: error: gdal-config not found or not executable.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/home/gis/R/x86_64-redhat-linux-gnu-library/3.5/rgdal’
Warning in install.packages :
  installation of package ‘rgdal’ had non-zero exit status
ERROR: dependency ‘rgdal’ is not available for package ‘RSAGA’
* removing ‘/home/gis/R/x86_64-redhat-linux-gnu-library/3.5/RSAGA’
Warning in install.packages :
  installation of package ‘RSAGA’ had non-zero exit status

The downloaded source packages are in
	‘/tmp/RtmphHmFFw/downloaded_packages’
> install.packages("plotKML")
Installing package into ‘/home/gis/R/x86_64-redhat-linux-gnu-library/3.5’
(as ‘lib’ is unspecified)
also installing the dependencies ‘rgdal’, ‘RSAGA’

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

trying URL 'https://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 'https://cran.rstudio.com/src/contrib/plotKML_0.5-9.tar.gz'
Content type 'application/x-gzip' length 3455602 bytes (3.3 MB)
==================================================
downloaded 3.3 MB

* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ successfully unpacked and MD5 sums checked
configure: R_HOME: /usr/lib64/R
configure: CC: gcc -m64 -std=gnu99
configure: CXX: g++ -m64
configure: C++11 support available
configure: rgdal: 1.4-3
checking for /usr/bin/svnversion... yes
configure: svn revision: 828
checking for gdal-config... no
no
configure: error: gdal-config not found or not executable.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/home/gis/R/x86_64-redhat-linux-gnu-library/3.5/rgdal’
Warning in install.packages :
  installation of package ‘rgdal’ had non-zero exit status
ERROR: dependency ‘rgdal’ is not available for package ‘RSAGA’
* removing ‘/home/gis/R/x86_64-redhat-linux-gnu-library/3.5/RSAGA’
Warning in install.packages :
  installation of package ‘RSAGA’ had non-zero exit status
ERROR: dependencies ‘rgdal’, ‘RSAGA’ are not available for package ‘plotKML’
* removing ‘/home/gis/R/x86_64-redhat-linux-gnu-library/3.5/plotKML’
Warning in install.packages :
  installation of package ‘plotKML’ had non-zero exit status

The downloaded source packages are in
	‘/tmp/RtmphHmFFw/downloaded_packages’

I, therefore, cannot load them:

> library(rgdal)
Error in library(rgdal) : there is no package called ‘rgdal’
> library(RSAGA)
Error in library(RSAGA) : there is no package called ‘RSAGA’
> library(plotKML)
Error in library(plotKML) : there is no package called ‘plotKML’

Any help?

Regards
Edward

0 Likes

#2

I believe this is because you are missing a requirement for rgdal, and the other packages depend on rgdal:

checking for gdal-config... no
no
configure: error: gdal-config not found or not executable.

From the SystemRequirements for rgdal:

for building from source: GDAL >= 1.11.4 and <= 2.5.0, library from https://trac.osgeo.org/gdal/wiki/DownloadSource and PROJ.4 (proj >= 4.8.0) from https://download.osgeo.org/proj/; GDAL OSX frameworks built by William Kyngesburye at http://www.kyngchaos.com/ may be used for source installs on OSX. For installation with older external dependencies, override configure checks with --configure-args="enable-deprecated=yes". Consider source installations using archived versions of rgdal contemporary with installed external dependencies, for example rgdal_0.8-7 for PROJ4 4.8.0 (March 2012).

1 Like

#3

How do I then ensure that I am not missing the requirement for RGDAL?

0 Likes

#4

Assuming you're on Linux, this should help:

0 Likes

#5

Thanks for the assistance but none of the solutions worked.

0 Likes

#6

What's your system setup? What did you try? What output did you get?

2 Likes