Ubuntu 16.04 R Installation: configure: gdal-config not found or not executable
You have to install gdal
, proj
& geos
on your Linux system.
sudo apt-get install libgdal1-dev gdal-bin libproj-dev proj-data proj-bin libgeos-dev
To compile yourself, see this script (backup)
Edit: For Ubuntu 18.04 Bionic or Mint 19 Tara
sudo apt-get install libgdal-dev gdal-bin libproj-dev proj-data proj-bin libgeos-dev
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 replacedlibgdal1
(thoughlibgdal1-dev
is still needed). At least
I get an error to that effect when I attempted toapt-get install libgdal1
For Ubuntu 16.04 the corresponding line would besudo 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.
Unable to install ‘sf’ R package on Ubuntu 16.04 LTS
This worked for me. Using
sudo aptitude install libgdal-dev
and then
devtools::install_github("r-spatial/sf")
Trouble installing rgdal
Finally solved it.
Here is how I've done it!
OS X 10.10.5
R 3.2.3
GDAL 1.1
- Download and install the GDAL Complete Framework from here
- Tell your OS X where to find the
gdal-config
file by typing this in you shellecho 'export PATH=/Library/Frameworks/GDAL.framework/Programs:$PATH' >> ~/.bash_profile
and thensource ~/.bash_profile
- Check if your GDAL is working fine by typing in the bash
gdalinfo --version
. That should come back with something likeGDAL 1.11.3, released 2015/09/16
. - For most people, starting R and typing
install.packages("rgdal")
works (if you've done step 1-3). However, that was not the case for me. So, proceed with 5 if you're still having troubles. - Go to the GDAL website and download the
.tar
file. - In the shell, try this:
sudo R CMD INSTALL –configure-args=’–with-proj-include=/usr/local/lib’ rgdal_1.1-1.tar
. That still gave me an error:configure: error: proj_api.h not found in standard or given locations.
ERROR: configuration failed for package ‘rgdal’ - So, you again need to tell where to find that one. Try:
R CMD INSTALL rgdal_1.1-1.tar --configure-args='--with-gdal-config=/Library/Frameworks/GDAL.framework/Programs/gdal-config
--with-proj-include=/Library/Frameworks/PROJ.framework/Headers
--with-proj-lib=/Library/Frameworks/PROJ.framework/unix/lib'
That should work. Try by starting R
and type library(rgdal)
in the R console.
Note: With rgoes
I experienced similar problems. This helped me.
Try:
R CMD INSTALL rgeos_0.3-15.tar --configure-args='--with-geos-config=/Library/Frameworks/GEOS.framework/unix/bin/geos-config
--with-proj-include=/Library/Frameworks/PROJ.framework/Headers
--with-proj-lib=/Library/Frameworks/PROJ.framework/unix/lib'
For pointing to the config
file. It's here /Library/Frameworks/GEOS.framework/unix/bin/geos-config
Related Topics
Specifying the Colour Scale for Maps in Ggplot
Parsimonious Way to Add North Arrow and Scale Bar to Ggmap
Creating Shiny Reactive Variable That Indicates Which Widget Was Last Modified
Rstudio Shiny Not Able to Use Ggvis
Shiny App File Upload: How to Save the Files Uploaded on a Shiny Gui to a Particular Destination
Multiple Groups in Geom_Density() Plot
How to Set Axis Ranges in Ggplot2 When Using a Log Scale
Plot Margins in Rmarkdown/Knitr
Ggplot Inserting Space Before Degree Symbol on Axis Label
Dplyr: Mutate_At + Coalesce: Dynamic Names of Columns
Forest Plot with Table Ggplot Coding
Making Binned Scatter Plots for Two Variables in Ggplot2 in R
How to Convert List of List into a Tibble (Dataframe)
Gadm-Maps Cross-Country Comparison Graphics
Rscript Detect If R Script Is Being Called/Sourced from Another Script