如何在CentOS上安装R 'sf'软件包?尝试安装时,最初由于gdal软件包过时而出现错误;我更新了gdal(从下面的源代码构建:http://trac.osgeo.org/gdal/wiki/BuildingOnUnix),现在出现错误:

 checking GDAL: linking with --libs only... yes
 checking GDAL: /usr/local/share/gdal/pcs.csv readable... yes
 checking GDAL: checking whether PROJ.4 is available for linking:... yes
 checking GDAL: checking whether PROJ.4 is available fur running:...
 ./gdal_proj: error while loading shared libraries: libgdal.so.20: cannot open
 shared object file: No such file or directory
  no
 configure: error: OGRCoordinateTransformation() does not return a
coord.trans:
 PROJ.4 not available?
ERROR: configuration failed for package ‘sf’
我尝试创建到libgdal.so.20的符号链接(symbolic link),但这根本不会改变错误。

最佳答案

  • /usr/local/lib添加到例如/etc/ld.so.conf.d/libgdal-x86_64.conf
  • 运行ldconfig
  • 重新启动R
  • 再试一次
  • 关于r - 在Centos上安装R 'sf'软件包— Gdal共享库错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/46181614/

    10-13 05:17