我有RVersion3.4.2,试图安装ggplot2,在RStudio中运行install.packages("ggplot2", dependencies = TRUE)。它最终告诉我,它是以非零退出状态退出的,错误很难读懂,因为消息太长了,但是我看到,在这个过程中,Matrix是一个依赖关系,它也没有安装,所以我尝试直接安装它,下面是我在错误消息中看到的:
/usr/bin/ld: cannot find -llapack
/usr/bin/ld: cannot find -lblas
/usr/bin/ld: cannot find -lgfortran
collect2: error: ld returned 1 exit status
/usr/share/R/share/make/shlib.mk:6: recipe for target 'Matrix.so' failed
make: *** [Matrix.so] Error 1
ERROR: compilation failed for package ‘Matrix’
* removing ‘/usr/local/lib/R/site-library/Matrix’我不清楚什么是ld,以及我是否需要研究这个问题来解决这个问题。看起来,这可能与Matrix.so有关。
发布于 2018-07-19 08:56:08
您需要为R包安装这些构建依赖项:
sudo apt-get install r-base-dev然后将R包安装到您的主文件夹(即~/R/x86_64-pc-linux-gnu-library)。您不需要以根用户身份运行RStudio。
https://askubuntu.com/questions/1057455
复制相似问题