简体   繁体   English

如何在 CentOS 6.8 安装 sf R 的包或 GDAL

[英]How install sf R's package or GDAL at CentOS 6.8

I'm trying to install sf package on R in a server CentOS 6.8, by line command, with:我正在尝试通过行命令在服务器 CentOS 6.8 中的 R 上安装 sf 包,其中:

install.packages('sf', dependencies = TRUE)

And I got this error message:我收到了这个错误信息:

> install.packages('sf')
Installing package into ‘/usr/lib64/R/library’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/sf_0.7-1.tar.gz'
Content type 'application/x-gzip' length 8330564 bytes (7.9 MB)
==================================================
downloaded 7.9 MB

* installing *source* package ‘sf’ ...
** package ‘sf’ successfully unpacked and MD5 sums checked
configure: CC: gcc -m64 -std=gnu99
configure: CXX: g++ -m64 -std=gnu++0x
checking for gdal-config... /usr/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 1.7.3
checking GDAL version >= 2.0.0... no
configure: error: sf is not compatible with GDAL versions below 2.0.0
ERROR: configuration failed for package ‘sf’
* removing ‘/usr/lib64/R/library/sf’

The downloaded source packages are in
        ‘/tmp/RtmpKDXg4S/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("sf") :
  installation of package ‘sf’ had non-zero exit status

Looks like that I need to upgrade the GDAL to 2.0.0 or later, but I don't know how to do this.看起来我需要将 GDAL 升级到 2.0.0 或更高版本,但我不知道该怎么做。 I'm looking for instalation (or even upgrade) by command line on CentOS and got nothing.我正在 CentOS 上通过命令行寻找安装(甚至升级),但一无所获。

Any help will be apreciated.任何帮助将不胜感激。

Tks Tks

For those who landed on this page hoping to find instructions for installing "sf" on RHEL 7.5: 对于那些希望找到在RHEL 7.5上安装“ sf”的说明的用户:

wget http://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/u/udunits2-2.2.20-2.el7.x86_64.rpm
wget http://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/u/udunits2-devel-2.2.20-2.el7.x86_64.rpm
yum install udunits2-devel-2.2.20-2.el7.x86_64.rpm
yum install udunits2-2.2.20-2.el7.x86_64.rpm

wget http://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/g/geos-3.4.2-2.el7.x86_64.rpm
wget http://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/g/geos-devel-3.4.2-2.el7.x86_64.rpm
yum install geos-*

wget http://download.osgeo.org/gdal/2.4.1/gdal-2.4.1.tar.gz
tar -zxvf gdal-2.4.1.tar.gz
cd gdal-2.4.1; 
./configure; make -j4; make install
echo "/usr/local/lib" /etc/ld.so.conf.d/libgdal-x86_64.conf
ldconfig
cp -p /usr/local/lib/libgdal.so.20* /usr/lib64/

cd ../
wget http://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/p/proj-4.8.0-4.el7.x86_64.rpm
wget http://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/p/proj-devel-4.8.0-4.el7.x86_64.rpm
yum install proj-4.8.0-4.el7.x86_64.rpm proj-devel-4.8.0-4.el7.x86_64.rpm

Some lines might be redundant however this has worked for me. 有些行可能是多余的,但这对我有用。

You need the latest GDAL version.您需要最新的 GDAL 版本。 The package documentation suggest using docker https:\/\/r-spatial.github.io\/sf\/<\/a>包文档建议使用 docker https:\/\/r-spatial.github.io\/sf\/<\/a>

"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM