1

I have a new pc that I have installed ubuntu 20.04 on. I have added R4.0.0 and RStudio 1.2.5042. I need Rgdal and have tried installing it in a variety of ways - directly from CRAN within RStudio, from R in a terminal, and from github. They all fail with similar error messages. Attempting to install sf has a similar failure. It's message is from checking GDAL: checking whether PROJ is available for running: the sf message is free(): invalid pointer ./configure line 3594:102773 Aborted (core dumped) ./gdal_proj. It appears there is a problem with the gdal installation. gdalinfo --version returns GDAL 3.1.0 and after some usage options. FAILURE: no datasource specified; free(): invalid pointer.

JerryN
  • 2,356
  • 1
  • 15
  • 49

2 Answers2

4

I installed libspatialite-dev and libgeotiff-dev, and that fixed it. Credit: https://www.mail-archive.com/gdal-dev@lists.osgeo.org/msg36151.html

Odysseas
  • 41
  • 4
  • Thanks! This worked for me when I ran into a similar error message installing the sf R package. Specifically, I was trying to update to latest spatial package versions via ubuntu-unstable repository and only updated libgdal-dev, libgeos-dev, and libproj-dev. After updating these packages too, sf succesfully installed. – paleo13 Sep 20 '22 at 01:51
0

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

JerryN
  • 2,356
  • 1
  • 15
  • 49