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)
Blairg23
  • 11,334
  • 6
  • 72
  • 72
  • I've been having this problem a lot lately... with most of the packages, installing `devtools` and then doing the install from github, e.g. `devtools::install_github("tidyverse/lubridate")` works. – mysteRious May 30 '18 at 00:53
  • That's a circular argument. OP says "help me I cannot install from source" and you say "here install from source". Does not help him overcome build-dependencies. – Dirk Eddelbuettel May 30 '18 at 00:58

2 Answers2

3

Your original problem is that stringi was built against a distro package version of libicu which changed. As this distribution package does not know you have lubridate in /usr/local it changes and breaks things.

There are a number of ways to fix this. The easiest (and narrowest) is to make sure you have libicu-dev installed. You could then reinstall (ie: rebuild stringi) after which lubridate will load.

For the rest you are just going somewhat wild throwing everything that is moveable up against the wall. You need to take a moment to realize that you can either install all these as binaries (ie from the Michael Rutter PPAs at launchpad), or from source. Your call. I have an older answer explaining the difference here (as well as in other follow-ups here) and we help on the r-sig-debian list too.

But in short: read this README at CRAN (esp first few paragraphs) and consider the PPAs.

Dirk Eddelbuettel
  • 360,940
  • 56
  • 644
  • 725
  • Interesting... this was how I originally had installed R (through PPAs) which wasn't working, thus the attempt to install through distro. Let me try it again after another purge and see if I can get it working correctly. – Blairg23 May 30 '18 at 05:07
  • Now I remember why I couldn't use PPA: `Get:10 http://security.ubuntu.com/ubuntu bionic-security InRelease [83.2 kB] Err:11 https://cran.rstudio.com/bin/linux/ubuntu bionic/ Release 404 Not Found [IP: 52.84.243.137 443] Reading package lists... Done E: The repository 'https://cran.rstudio.com/bin/linux/ubuntu bionic/ Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.` – Blairg23 May 30 '18 at 05:11
  • I can't seem to find a CRAN mirror / PPA that supports Bionic, except the Michael Rutter PPA (`sudo add-apt-repository ppa:marutter/rrutter`), but I'm still getting errors when attempting to install R or the libraries... – Blairg23 May 30 '18 at 06:26
  • There are two: one for R 3.5 itself (https://launchpad.net/~marutter/+archive/ubuntu/rrutter3.5) and then one with packages (https://launchpad.net/~marutter/+archive/ubuntu/c2d4u). See Michael's blog for more (http://rubuntu.netlify.com/). – Dirk Eddelbuettel May 30 '18 at 10:31
1

After trying the following (purging and reinstalling R between each step):

  1. apt purge r-base
  2. Added/removed several different PPAs before realizing none of them supported Bionic Beaver. Result: Release not found.
  3. Found Michael Rutter's PPA and attempted to use that. Result: same error message from above ('CURL_OPENSSL_3' not found).
  4. Attempting several solutions to this SO article. Result: same error message from above ('CURL_OPENSSL_3' not found).
  5. Read this article and performed the following in R:

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

And everything worked as intended.

Blairg23
  • 11,334
  • 6
  • 72
  • 72