2017-03-23 135 views
1

我一直试图从RStudio版本1.0.44在Ubuntu 16.04上安装rgdal然后我得到了gdal-config找不到错误。我通过安装libgdal1-dev & libproj包解决了这个问题,但现在我收到以下错误消息。有人帮我解决这个问题。在Ubuntu的Rgdal安装失败16.04

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 

回答

2

我有一些问题试图安装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 

希望工程对你也是。