在ubuntu 16.04上,Rgdal安装失败

提问

我一直试图在ubuntu 16.04上从RStudio版本1.0.44安装rgdal然后我得到了gdal-config not found错误.我通过安装libgdal1-dev& amp来解决这个问题. libproj包但现在我收到以下错误.有人帮我解决这个问题.

Error in dyn.load(file, DLLpath = DLLpath, ...) : 
unable to load shared object '/home/hetch/R/x86_64-pc-linux-gnu-library/3.3/rgdal/libs/rgdal.so':
/usr/lib/x86_64-linux-gnu/libgeos_c.so.1: undefined symbol:_ZN4geos4geom18IntersectionMatrixC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE 
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/hetch/R/x86_64-pc-linux-gnu-library/3.3/rgdal’
Warning in install.packages :
installation of package ‘rgdal’ had non-zero exit status

最佳答案

我有一些问题试图安装rgdal包但最后我成功了.
我的问题是gdal>需要2.0,默认情况下它不附带ubuntu 16.04,因此需要额外的软件包.

我最终安装了以下软件包:

sudo add-apt-repository -y ppa:ubuntugis/ubuntugis-unstable
sudo apt update
sudo apt install gdal-bin python-gdal python3-gdal libgdal1-dev

另外,r>也需要3.3,所以我最终更新了ubuntu的默认r-base安装,如下所示:

sudo add-apt-repository 'deb https://cran.rediris.es/bin/linux/ubuntu xenial/'
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
sudo apt update

希望它也适合你.