Search code examples
rpackageubuntu-16.04rgdalr-sf

Unable to install ‘sf’ R package on Ubuntu 16.04 LTS


I'm not able to install sf R package on Ubuntu 16.04 LTS. I tried

install.packages("sf")

as well as

devtools::install_github("r-spatial/sf")

after running

sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
sudo apt-get install libudunits2-dev libgdal-dev libgeos-dev libproj-dev 

Getting the following error message:

configure: error: gdal-config not found or not executable.

ERROR: configuration failed for package ‘sf’

Wonder what is the way to install sf?


Solution

  • This worked for me. Using

    sudo aptitude install libgdal-dev
    

    and then

    devtools::install_github("r-spatial/sf")