Trouble Getting Latest Version of Gdal on Ubuntu Running R

Installing rgdal - backdate rgdal version versus update gdal version, and how?

What finally worked for me was trying to install an earlier version (v1.2-20) of rgdal that was compatible with gdal 1.11.3.

I was able to identify the correct version of rgdal using the documentation page here:
https://www.rdocumentation.org/packages/rgdal/versions/1.2-20

Then I used the devtools package to install the correct version:

require(devtools)
install_version("rgdal", version="1.2-20")

This page has helpful information on installation of earlier versions of R packages:
https://support.rstudio.com/hc/en-us/articles/219949047-Installing-older-versions-of-packages

I attempted installing more recent versions of gdal both from source and with my package manager but continued to get various errors when I got to the step of trying to install rgdal.

What I don't know is why I kept getting errors when trying to work with gdal upgrades.

Error: gdal-config not found while installing R dependent packages whereas gdal is installed

You need the -dev package with headers and shared library links for development besides the normal package for deployment. Two different use cases as far as the distro is concerned.

On my distribution:

edd@max:/tmp$ dpkg -l | grep gdal | cut -c-72
ii libgdal1-1.7.0 1.7.3-6ubuntu3
ii libgdal1-dev 1.7.3-6ubuntu3
edd@max:/tmp$

and R CMD INSTALL rgdal_0.7-8.tar.gz works just fine as you would expect from a CRAN package given all the build-time checks at CRAN.

Update late 2016: As @JoshO'Brien points out in the comment

Minor update: Here in 2016, running Ubuntu 14.04.2, libgdal1h seems to
have replaced libgdal1(though libgdal1-dev is still needed). At least
I get an error to that effect when I attempted to apt-get install libgdal1

For Ubuntu 16.04 the corresponding line would be

sudo apt-get install libgdal1i

Such renaming of upstream libraries is common; something such as apt-cache search libgdal can help locate the current package names. The important key though is that the "abstract" development package libgdal-dev is all that is needed to build as it pulls the "concrete" current run-time package (here: libgdal1i) in via a dependency.

rgdal installed in Ubuntu 18.04 LTS, but R 3.5 not recognized it

The solution was to uninstall QGIS, and install GDAL first and re-install QGIS after.

Finally, the rGDAL was possible to be installed in R.

r Rgdal install fails on ubuntu 20.04 with error double red or corruption (!prev)

Following the directions at this link solved the rgdal problem. Now have a different, non-gdal error with sf so need to research that.

sf R package is not compatible with GDAL versions below 2.0.0 after installing gdal 2.3 from conda

Errors are caused by non-conda package installations. From a clean environment, the sf package can be installed directly from conda:

conda create -n rsf -c conda-forge r-sf
source activate rsf

Or from a clean environment:

conda install -c conda-forge r-sf


Related Topics



Leave a reply



Submit