无法在运行R的ubuntu上获取最新版本的GDAL [英] Trouble getting latest version of GDAL on ubuntu running R
问题描述
我的Ubuntu计算机具有最新的GDAL(2.2.1,发布于2017/06/23).但是R抱怨我的gdalversion< 2.0
My Ubuntu machine has latest GDAL (2.2.1, released 2017/06/23). But R complains that I have gdalversion <2.0
配置:CC:gcc -std = gnu99 配置:CXX:g ++ 正在检查gdal-config .../usr/bin/gdal-config 正在检查gdal-config可用性...是 配置:GDAL:1.11.3 检查GDAL版本> = 2.0.0 ...否 配置:错误:sf与低于2.0.0的GDAL版本不兼容
configure: CC: gcc -std=gnu99 configure: CXX: g++ checking for gdal-config... /usr/bin/gdal-config checking gdal-config usability... yes configure: GDAL: 1.11.3 checking GDAL version >= 2.0.0... no configure: error: sf is not compatible with GDAL versions below 2.0.0
我如何指导R访问Ubuntu上已安装的GDAL(2.2.1版)?
How can i direct R to access GDAL (2.2.1 version) already installed on Ubuntu?
推荐答案
您可能需要卸载gdal的所有痕迹,然后从ubuntugis-unstable源中重新安装它.以下内容帮助我解决了类似的问题:
You may need to uninstall all traces of gdal then re-install it from the ubuntugis-unstable source. The following helped me solve a similar problem:
sudo apt remove libgdal-dev
sudo apt remove libproj-dev
sudo apt remove gdal-bin
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
确保执行此行时出现版本> = 2.0
Make sure a version >= 2.0 appears when you execute this line
sudo apt-cache policy libgdal-dev
如果是,请运行
sudo apt update
sudo apt install libgdal-dev
然后我可以在Ubuntu 14.04("Trusty Tahr")的R 3.4.2中成功执行:
I could then successfully execute in R 3.4.2 in Ubuntu 14.04 ("Trusty Tahr"):
install.packages('rgdal')
这篇关于无法在运行R的ubuntu上获取最新版本的GDAL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!