ubuntu 17.10上的rgdal安装错误

时间:2018-03-22 14:09:52

标签: r linux ubuntu ubuntu-17.10

我正在尝试在R上安装rgdal库,但我遇到了一些困难。也许我是一个天真的错误或纯新手:P。我正在跑步:

经销商ID:Ubuntu;描述:Ubuntu 17.10;发布:17.10;代号:巧妙的

R版本3.4.2(2017-09-28) - “短暂的夏天”; 版权所有(C)2017 R统计计算基金会; 平台:x86_64-pc-linux-gnu(64位)

当我尝试 install.packages('rgdal')时,出现以下错误:

Installing package into ‘/home/jonathan/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/rgdal_1.2-18.tar.gz'
Content type 'application/x-gzip' length 1650578 bytes (1.6 MB)
==================================================
downloaded 1.6 MB

* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ successfully unpacked and MD5 sums checked
configure: CC: gcc -std=gnu99
configure: CXX: g++
configure: rgdal: 1.2-18
checking for /usr/bin/svnversion... no
configure: svn revision: 718
checking for gdal-config... no
no
configure: error: gdal-config not found or not executable.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/home/jonathan/R/x86_64-pc-linux-gnu-library/3.4/rgdal’
Warning in install.packages :
  installation of package ‘rgdal’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/Rtmpt88o8k/downloaded_packages’

我尝试了thisthis,但没有人提供帮助。 感谢您的支持。

1 个答案:

答案 0 :(得分:3)

  

错误:找不到gdal-config

是否安装了gdal? ....

解决方案:sudo apt install libgdal-dev:提供/ usr / bin / gdal-config