在 r studio 中安装 tidyverse 时 xml2 配置失败

jav*_*ved 2 r tidyverse

系统: ubuntu 18.04\nRstudio 版本 3.4.4

\n\n

每当我尝试安装 tidyverse 时都会出现此错误,如何将包含 lib-curl 的目录添加到包配置搜索路径?

\n\n
 installing source package \xe2\x80\x98curl\xe2\x80\x99 ...\n package \xe2\x80\x98curl\xe2\x80\x99 successfully unpacked and MD5 sums checked\nPackage libcurl was not found in the pkg-config search path.\nPerhaps you should add the directory containing `libcurl.pc'\nto the PKG_CONFIG_PATH environment variable\n\nNo package 'libcurl' found\nPackage libcurl was not found in the pkg-config search path.\nPerhaps you should add the directory containing `libcurl.pc'\nto the PKG_CONFIG_PATH environment variable\nNo package 'libcurl' found\nUsing PKG_CFLAGS=\nUsing PKG_LIBS=-lcurl\n.\n.\n.\n.\nERROR: configuration failed for package \xe2\x80\x98xml2\xe2\x80\x99\n\nremoving \xe2\x80\x98/home/javed/R/x86_64-pc-linux-gnu-library/3.4/xml2\xe2\x80\x99\n\nWarning in install.packages :\n\n  installation of package \xe2\x80\x98xml2\xe2\x80\x99 had non-zero exit status\n\n\nERROR: dependencies \xe2\x80\x98curl\xe2\x80\x99, \xe2\x80\x98openssl\xe2\x80\x99 are not available for package \xe2\x80\x98httr\xe2\x80\x99\n* removing \xe2\x80\x98/home/javed/R/x86_64-pc-linux-gnu-library/3.4/httr\xe2\x80\x99\n\nWarning in install.packages :\n  installation of package \xe2\x80\x98httr\xe2\x80\x99 had non-zero exit status\n\nERROR: dependencies \xe2\x80\x98xml2\xe2\x80\x99, \xe2\x80\x98httr\xe2\x80\x99 are not available for package \xe2\x80\x98rvest\xe2\x80\x99\n* removing \xe2\x80\x98/home/javed/R/x86_64-pc-linux-gnu-library/3.4/rvest\xe2\x80\x99\n\nWarning in install.packages :\n  installation of package \xe2\x80\x98rvest\xe2\x80\x99 had non-zero exit status\n\nERROR: dependencies \xe2\x80\x98httr\xe2\x80\x99, \xe2\x80\x98rvest\xe2\x80\x99, \xe2\x80\x98xml2\xe2\x80\x99 are not available for package \xe2\x80\x98tidyverse\xe2\x80\x99\n\n* removing \xe2\x80\x98/home/javed/R/x86_64-pc-linux-gnu-library/3.4/tidyverse\xe2\x80\x99\n\nWarning in install.packages :\n  installation of package \xe2\x80\x98tidyverse\xe2\x80\x99 had non-zero exit status\n
Run Code Online (Sandbox Code Playgroud)\n

Nab*_*eel 9

在安装 R 包之前安装这些缺少的依赖项:

sudo apt install libcurl4-openssl-dev libssl-dev libxml2-dev
Run Code Online (Sandbox Code Playgroud)

来源:https://blog.zenggyu.com/en/post/2018-01-29/installing-rr-packages-eg-tidyverse-and-rstudio-on-ubuntu-linux/