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
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?


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:

| improve this answer | |
  • 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 '18 at 18:55

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


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

| improve this answer | |
  • I'm not sure how this addresses using RStudio via Anaconda. – D. Ror. Oct 17 '18 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 '18 at 1:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.