> install.packages("rgdal")
- installing source package ‘rgdal’ ... configure: error: gdal-config not found or not executable.
The packages libgdal-dev and libproj-dev are required:
sudo apt-get install gdal-bin proj-bin libgdal-dev libproj-dev
hello,
I am new to ubuntu and my version is popOs 19.10.
and I am also new to github.
Sadly I get this erreor after trying to install rdgal in RStudio:
configure: error: gdal-config not found or not executable.
ERROR: configuration failed for package ‘rgdal’
and the sudo commant presented before doesn't work for me.
has anyone more wisdom and knowledge and can help me please
thank you
If you have docker you could try to leapfrog installing the system libraries altogether with this oneliner docker run -d --name geospatial -p 8787:8787 -v /home/me:/home/rstudio -e PASSWORD=rocker rocker/geospatial:3.6.3 && sleep 5 && firefox http://localhost:8787
which gets everything needed in an isolated environment which includes all dependencies needed.
If the command you used didn't work, and you don't want to "cheat" by using a container, the error messages you have might lead you in the right direction (try searching on the error message at SO or in another search engine). When I do dpkg -l | grep gdal
I have libgdal-dev listed, which I believe gave gdal-config
(I'm not on popOS but on an earlier Ubuntu base). The command apt-file search gdal-config
seems to agree that it should come in libgdal-dev
(but I'm on Ubuntu 18 base).
Thanks! It worked for me
Just bumping this in case @statgeek or anyone else managed to solve the problem when there's no sudo access?
Try this SO page https://askubuntu.com/questions/193695/installing-packages-into-local-directory it helped me.
Many thanks. It worked
Muito obrigado pela dica
Many thanks, that fixed it!
Hi, I used
> install.packages("rgdal", repos="https://cloud.r-project.org/")
worked like a charm
Didier
P.S.
the normal install gave (I had also tried another CRAN repo):
in download.file(url, destfile, method, mode = "wb", ...) :
download from 'https://pbil.univ-lyon1.fr/CRAN/bin/macosx/contrib/4.1/rgdal_1.5-28.tgz' failed
In addition: Warning messages:
1: In download.file(url, destfile, method, mode = "wb", ...) :
downloaded length 19824640 != reported length 91041577
2: In download.file(url, destfile, method, mode = "wb", ...) :
URL 'https://pbil.univ-lyon1.fr/CRAN/bin/macosx/contrib/4.1/rgdal_1.5-28.tgz': Timeout of 60 seconds was reached
Warning in download.packages(pkgs, destdir = tmpd, available = available, :
download of package ‘rgdal’ failed
Thanks :)
Hello
I couldn't install RGDAL. Please help.
install.packages("rgdal", type = "source")
Installing package into ‘C:/Users/Hossein/AppData/Local/R/win-library/4.3’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘rgdal’ is not available for this version of R
A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
Yes, by now you need to use older R versions in order to use rgdal. Or use alternatives.
See here https://r-spatial.org/r/2022/04/12/evolution.html
Ended up here when installing dependencies for using "rgdal", "sp" and "raster" on up-to-date Linux on 20.04 package base without spatial libs installed on the system.
For me,
libmysqlclient-dev default-libmysqlclient-dev gdal-bin proj-bin libgdal-dev libproj-dev
were system libraries required on freshly installed Linux Mint 20.04 with R v 4.0.3 when installing from source R packages raster v 3.4-5 (2020-11-14), rgdal v 1.5-18 (2020-10-13) and sp v 1.4-4 (2020-10-07) from CRAN.This OS setup doesn't seem to need or require use of ubuntugis PPA, which anyways doesn't have 20.04 focal packages. On https://rgdal.r-forge.r-project.org/index.html some docs mention that "it is important that 'GDAL' < 3 be matched with 'PROJ' < 6. From 'rgdal' 1.5-8, installed with to 'GDAL' >=3, 'PROJ' >=6 and 'sp' >= 1.4, coordinate reference systems use 'WKT2_2019' strings, not 'PROJ' strings. 'Windows' and 'macOS' binaries (including 'GDAL', 'PROJ' and their dependencies) are provided on 'CRAN'. "
The system libraries versions seem to play with that combination:
R codes now show some new warnings, possibly due to now need to use "'WKT2_2019' strings, not 'PROJ' strings". Examples of how such warnings can look:
I think one has to migrate old code that is using PROJ strings to use 'WKT2_2019' strings instead to get rid of the warnings while non-migrated code still seems to work (?).