0

I am using:
Ubuntu 16.04.4 LTS
anaconda-navigator 1.7.0
RStudio 1.1.383

Within the console, I submit

> install.packages('rgdal')

and get the following:

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

* installing source package ‘rgdal’ ...
** package ‘rgdal’ successfully unpacked and MD5 sums checked configure: CC: /home/name/anaconda3/bin/x86_64-conda_cos6-linux-gnu-cc
configure: CXX: /home/name/anaconda3/bin/x86_64-conda_cos6-linux-gnu-c++
configure: rgdal: 1.2-16
checking for /usr/bin/svnversion... yes
configure: svn revision: 701
checking for gdal-config... /home/name/anaconda3/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 2.2.2
checking GDAL version >= 1.6.3... yes
checking gdal: linking with --libs only... no
checking gdal: linking with --libs and --dep-libs... no
./configure: line 1916: /home/name/anaconda3/bin/x86_64-conda_cos6-linux-gnu-c++: No such file or directory
./configure: line 1931: /home/name/anaconda3/bin/x86_64-conda_cos6-linux-gnu-c++: No such file or directory
configure: Install failure: compilation and/or linkage problems.
configure: error: GDALAllRegister not found in libgdal.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/home/name/anaconda3/lib/R/library/rgdal’
Warning in install.packages :
installation of package ‘rgdal’ had non-zero exit status

The downloaded source packages are in
‘/tmp/RtmpIDuQu3/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done

I just installed gdal and libgdal, so those should be up to date. How do I fix these errors?

3 Answers 3

3

For the record I have the same problem and was because conda.

I did: conda deactivate and then install.packages("rgdal") and that works fine. I previously installed the packages mentioned by user50025.

A discussion with a similar problem with units could be find here: https://github.com/r-quantities/units/issues/223 Everything look like the problem is due to conda who 'is shadowing the system libraries'.

1

The same problem happened on me and that was solved with the following commands:

sudo apt update
sudo apt install gdal-bin libgdal-dev libproj-dev

Then try:

install.package("rgdal")
1
  • Just to confirm: did you have the same problem using RStudio via Anaconda? The problem for me was rooted in how Anaconda was handling things. I had no problems once I installed RStudio outside Anaconda, and since I'm not using RStudio inside Anaconda, I cannot test your solution.
    – D. Ror.
    Jun 25, 2018 at 18:55
0

I found the answer over on Dean Attali's blog on setting up an Rstudio server on Ubuntu.

https://deanattali.com/2015/05/09/setup-rstudio-shiny-server-digital-ocean/

I used the following commands. 

sudo apt-get -y install r-base-dev

sudo apt-get -y install libcurl4-gnutls-dev libxml2-dev libssl-dev

install.packages('rgdal')
2
  • I'm not sure how this addresses using RStudio via Anaconda.
    – D. Ror.
    Oct 17, 2018 at 4:55
  • With the issues rgdal gives everyone in R this is one way to install it. Feel free to ask to move the comment anywhere else, but rgdal is an issue with R lately.
    – gmach
    Oct 19, 2018 at 1:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .