我试过了
sudo apt-get update
sudo apt-get install r-base-dev
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install libxml2-dev
但 R 一直向我显示这些消息:
1: In install.packages("tidyverse"):
installation of package 'openssl' had non-zero exit
installation of package 'httr' had non-zero exti
installation of package 'rvest' had non-zero exit
installation of package 'tidyverse' had non-zero exit
我怎么解决这个问题?
答案1
最简单的方法是添加 CRAN2deb4ubuntu PPA。请参阅https://cran.r-project.org/bin/linux/ubuntu/了解详情。然后您可以使用
sudo apt install r-cran-tidyverse
另一种方法是查看安装失败的原因并进行修复。例如,openssl 失败可能是因为您尚未安装 OpenSSL。您可以使用
sudo apt-get install -y libssl-dev
您可能还需要安装其他依赖项。