我在寻找解决办法来避免重复的情况,但是没有找到。
我想要在 Ubuntu 16.04 LTS 上为 R 安装 'rgdal' 包。如果我在 R-studio 中编写以下代码:
install.packages("rgdal", type = "source")
出现以下错误;
Installing package into ‘/home/kocesat/R/x86_64-pc-linux-gnu-library/3.2’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘rgdal’ is not available (for R version 3.2.3)
然后我尝试按照以下方式安装 libgdal1-dev 和 libproj-dev:
$ sudo apt-get install libgdal1-dev libproj-dev
它成功安装了dev文件。然后我尝试使用相同的命令在R-studio中再次安装"rgdal",但仍然无法安装成功。
接着,我安装了homebrew并尝试使用以下命令获取gdal:
~$ brew install gdal
它返回了
Error: undefined method `rebuild' for
#<BottleSpecification:0x000000015ddc60>
Please report this bug:
https://github.com/Linuxbrew/linuxbrew/blob/master/share/doc/homebrew
/Troubleshooting.md#troubleshooting
/home/kocesat/.linuxbrew/Library/Taps/homebrew/homebrew-core/Formula
/jpeg.rb:9:in `block in <class:Jpeg>'
/home/kocesat/.linuxbrew/Library/Homebrew/software_spec.rb:91:in
`instance_eval'
/home/kocesat/.linuxbrew/Library/Homebrew/software_spec.rb:91:in `bottle'
/home/kocesat/.linuxbrew/Library/Homebrew/formula.rb:1729:in `bottle'
/home/kocesat/.linuxbrew/Library/Taps/homebrew/homebrew-core/Formula
/jpeg.rb:7:in `<class:Jpeg>'
/home/kocesat/.linuxbrew/Library/Taps/homebrew/homebrew-core/Formula
/jpeg.rb:1:in `load_formula'
/home/kocesat/.linuxbrew/Library/Homebrew/formulary.rb:21:in `module_eval'
/home/kocesat/.linuxbrew/Library/Homebrew/formulary.rb:21:in
`load_formula'
/home/kocesat/.linuxbrew/Library/Homebrew/formulary.rb:34:in
`load_formula_from_path'
/home/kocesat/.linuxbrew/Library/Homebrew/formulary.rb:83:in `load_file'
/home/kocesat/.linuxbrew/Library/Homebrew/formulary.rb:74:in `klass'
/home/kocesat/.linuxbrew/Library/Homebrew/formulary.rb:70:in `get_formula'
/home/kocesat/.linuxbrew/Library/Homebrew/formulary.rb:207:in `factory'
/home/kocesat/.linuxbrew/Library/Homebrew/dependency.rb:32:in `to_formula'
/home/kocesat/.linuxbrew/Library/Homebrew/dependency.rb:93:in `block in
expand'
/home/kocesat/.linuxbrew/Library/Homebrew/dependencies.rb:9:in `each'
/home/kocesat/.linuxbrew/Library/Homebrew/dependencies.rb:9:in `each'
/home/kocesat/.linuxbrew/Library/Homebrew/dependency.rb:80:in `expand'
/home/kocesat/.linuxbrew/Library/Homebrew/formula.rb:1223:in
`recursive_dependencies'
/home/kocesat/.linuxbrew/Library/Homebrew/requirement.rb:196:in `expand'
/home/kocesat/.linuxbrew/Library/Homebrew/formula.rb:1229:in `recursive_requirements'
/home/kocesat/.linuxbrew/Library/Homebrew/formula_installer.rb:313:in `expand_requirements'
/home/kocesat/.linuxbrew/Library/Homebrew/formula_installer.rb:263:in `compute_dependencies'
/home/kocesat/.linuxbrew/Library/Homebrew/formula_installer.rb:130:in `verify_deps_exist'
/home/kocesat/.linuxbrew/Library/Homebrew/formula_installer.rb:123:in `prelude'
/home/kocesat/.linuxbrew/Library/Homebrew/cmd/install.rb:231:in `install_formula'
/home/kocesat/.linuxbrew/Library/Homebrew/cmd/install.rb:93:in `block in install'
/home/kocesat/.linuxbrew/Library/Homebrew/cmd/install.rb:93:in `each'
/home/kocesat/.linuxbrew/Library/Homebrew/cmd/install.rb:93:in `install'
/home/kocesat/.linuxbrew/Library/brew.rb:84:in `<main>'
现在,我应该做什么?非常感谢您的任何建议。
apt
而不是linuxbrew http://www.sarasafavi.com/installing-gdalogr-on-ubuntu.html 此外,你的R版本有点旧了。你可能需要考虑更新它,因为最新的CRAN版本依赖于R > 3.3.0
。https://cran.r-project.org/web/packages/rgdal/index.html - amatsuo_net