由于 Libcurl 问题无法安装 Tidyverse

Unable To Install Tidyverse Due To Libcurl Issue

我最近升级到 R 3.5,但无法安装 'tidyverse' 包。其他软件包安装正常。每当我尝试安装 tidyverse 时,都会收到以下错误消息。

* installing *source* package ‘curl’ ...
** package ‘curl’ successfully unpacked and MD5 sums checked
Found pkg-config cflags and libs!
Using PKG_CFLAGS=-I/usr/include/x86_64-linux-gnu
Using PKG_LIBS=-lcurl
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libcurl was not found. Try installing:
 * deb: libcurl4-openssl-dev (Debian, Ubuntu, etc)
 * rpm: libcurl-devel (Fedora, CentOS, RHEL)
 * csw: libcurl_dev (Solaris)
If libcurl is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libcurl.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------
ERROR: configuration failed for package ‘curl’
* removing ‘/home/nik/anaconda3/lib/R/library/curl’
ERROR: dependency ‘curl’ is not available for package ‘httr’
* removing ‘/home/nik/anaconda3/lib/R/library/httr’
ERROR: dependency ‘httr’ is not available for package ‘rvest’
* removing ‘/home/nik/anaconda3/lib/R/library/rvest’
ERROR: dependencies ‘httr’, ‘rvest’ are not available for package ‘tidyverse’
* removing ‘/home/nik/anaconda3/lib/R/library/tidyverse’

The downloaded source packages are in
    ‘/tmp/RtmpHJ48Sk/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning messages:
1: In install.packages("tidyverse") :
  installation of package ‘curl’ had non-zero exit status
2: In install.packages("tidyverse") :
  installation of package ‘httr’ had non-zero exit status
3: In install.packages("tidyverse") :
  installation of package ‘rvest’ had non-zero exit status
4: In install.packages("tidyverse") :
  installation of package ‘tidyverse’ had non-zero exit status

我有 运行 sudo apt-get install libcurl4-openssl-dev 正如其他线程针对同一问题所建议的那样。但是,这似乎并没有解决问题(实际上libcurl已经安装了,重新安装也没有用)。

当我检查 $PATH 时,我没有看到 'pkg-config',并且 PKG_CONFIG_PATH 似乎不存在。将 /usr/bin/pkg-config 添加到路径并设置 PKG_CONFIG_PATH /home/nik/anaconda3/lib/pkgconfig/libcurl.pc 似乎也没有解决问题。在这一点上我无计可施,因为我想不出 uninstall/reinstall 的任何其他内容,也不知道为什么在我安装 libcurl 时没有将它自己添加到路径中。任何帮助都将不胜感激。

尝试将路径设置为包含 libcurl 的目录而不是 libcurl 本身,即

PKG_CONFIG_PATH=/home/nik/anaconda3/lib/pkgconfig