2

System: Ubuntu 18.04

Original error that showed up that prompted me to try to reinstall R and dependencies:

Error: package or namespace load failed for 'lubridate' in dyn.load(file, DLLpath = DLLpath, ...):  unable to load shared object '/usr/local/lib/R/site-library/stringi/libs/stringi.so':   libicui18n.so.57: cannot open shared object file: No such file or directory

Steps to reproduce:

  1. Install R: apt install r-base
  2. Try to install R dependencies: install.packages(c("dplyr", "lubridate", "qcc", "forecast"), repos='http://cran.us.r-project.org')

Error that displays during installation:

/usr/local/lib/R/site-library/BH/include/boost/smart_ptr/scoped_ptr.hpp:74:31: warning: 'template<class> class std::auto_ptr' is deprecated

Error that displays after installation:

The downloaded source packages are in
    '/tmp/RtmpnulsEe/downloaded_packages'
Warning message:
In install.packages(c("dplyr", "lubridate", "qcc", "forecast", "stringi"),  :
  installation of package 'forecast' had non-zero exit status

After purging and reinstalling r-base and R dependencies, I'm seeing this...(already checked that libcurl4-openssl-dev was latest version):

Error: package or namespace load failed for 'forecast' in dyn.load(file, DLLpath = DLLpath, ...): 
unable to load shared object '/usr/local/lib/R/site-library/curl/libs/curl.so':
/usr/lib/x86_64-linux-gnu/libcurl.so.4: version `CURL_OPENSSL_3' not found (required by /usr/local/lib/R/site-library/curl/libs/curl.so)

Update: Apparently it's something in the forecast library, because I reproduced that error like this:

$ R
> library(forecast)
Error: package or namespace load failed for 'forecast' in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/usr/local/lib/R/site-library/curl/libs/curl.so':
  /usr/lib/x86_64-linux-gnu/libcurl.so.4: version `CURL_OPENSSL_3' not found (required by /usr/local/lib/R/site-library/curl/libs/curl.so)
4

2 回答 2

3

您最初的问题是它stringi是针对已更改的发行包版本构建的。libicu由于此分发包不知道您lubridate在 /usr/local 中,因此它会更改并破坏内容。

有很多方法可以解决这个问题。最简单(也是最窄的)是确保您已libicu-dev安装。然后您可以重新安装(即:rebuild stringi),然后lubridate加载。

其余的你只是有点疯狂地将所有可移动的东西扔到墙上。您需要花一点时间来意识到您可以所有这些安装为二进制文件(即来自启动板上的 Michael Rutter PPA),也可以从源代码安装。你的来电。我有一个较旧的答案来解释这里的区别(以及这里的其他后续行动),我们也在r-sig-debian列表中提供帮助。

但简而言之:阅读CRAN 的自述文件(尤其是前几段)并考虑 PPA。

于 2018-05-30T01:05:39.237 回答
1

尝试以下操作后(在每个步骤之间清除并重新安装 R):

  1. apt purge r-base
  2. 添加/删除了几个不同的 PPA,然后才意识到它们都不支持 Bionic Beaver。结果:Release not found
  3. 找到 Michael Rutter 的 PPA 并尝试使用它。结果:与上面相同的错误消息 ( 'CURL_OPENSSL_3' not found)。
  4. 尝试对此SO 文章的几种解决方案。结果:与上面相同的错误消息 ( 'CURL_OPENSSL_3' not found)。
  5. 阅读本文并在 R 中执行以下操作:

    > remove.packages("curl")
    > install.packages("curl")
    > install.packages(c("dplyr", "lubridate", "qcc", "forecast", "stringi", "curl"), repos='http://cran.us.r-project.org')
    

一切都按预期工作。

于 2018-05-30T07:44:30.473 回答