R packages: RCurl and curl packages install failure on Linux - r

I hope you can help with this issue I have come across whilst installing RCurl and curl packages for R.
Rd warning: /tmp/RtmpOBkvFC/R.INSTALLd07e6c06faf4/RCurl/man/url.exists.Rd:5: missing file link ‘file.exists’
** building package indices
** testing if installed package can be loaded
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/home/majaidi/R/x86_64-redhat-linux-gnu-library/3.1/RCurl/libs/RCurl.so':
/lib64/libgssapi_krb5.so.2: symbol krb5int_buf_len, version krb5support_0_MIT not defined in file libkrb5support.so.0 with link time reference
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/majaidi/R/x86_64-redhat-linux-gnu-library/3.1/RCurl’
The downloaded source packages are in
‘/tmp/RtmpX6poG4/downloaded_packages’
Warning message:
In install.packages(pkgs = pkgs, lib = lib, repos = repos, ...) :
installation of package ‘RCurl’ had non-zero exit status`

That looks like that you have different versions of libcurl.
One approch could be the following one (for your console):
wget https://cran.r-project.org/src/contrib/curl_0.9.7.tar.gz
R CMD INSTALL curl_0.9.7.tar.gz --no-test-load
ldd /home/majaidi/R/x86_64-redhat-linux-gnu-library/3.1/curl/libs/curl.so
Then you can use ldd libcurl.so to find all dependencies and shared libraries to this.
Perhaps you can find some errors and/or you have to create a new LD_LIBRARY_PATH.
Good Luck!
J_F

Related

problem installing nloptr 2.0.0 on debian 9 with R 4.2.0 and cmake 3.23.1

on my machine debian 9 (stretch), i have installed R4.2.0 from source.
i have problem to install nloptr 2.0.0 using syntax:
if (!require("nloptr", quietly = TRUE)) BiocManager::install("nloptr")
the error i get is:
/opt/R/4.2.0/lib/R/etc/Makeconf:177: recipe for target 'test-C-API.o' failed
make: *** [test-C-API.o] Error 1
ERROR: compilation failed for package ‘nloptr’
* removing ‘/home/ezop/R/x86_64-pc-linux-gnu-library/4.2/nloptr’
The downloaded source packages are in
‘/tmp/Rtmpqk35gk/downloaded_packages’
Warning message:
In install.packages(...) :
installation of package ‘nloptr’ had non-zero exit status
I have tried, also, to install it by copying compiled binaries i have found online, but then i have this error:
> library(nloptr)
Error: package or namespace load failed for ‘nloptr’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/home/ezop/R/x86_64-pc-linux-gnu-library/4.2/nloptr/libs/nloptr.so':
/home/ezop/R/x86_64-pc-linux-gnu-library/4.2/nloptr/libs/nloptr.so: invalid ELF header
I have checked the header and machine info, but i dont know what to do next:
base) root#kanta:/home/ezop/R/x86_64-pc-linux-gnu-library/4.2# file /home/ezop/R/x86_64-pc-linux-gnu-library/4.2/nloptr/libs/nloptr.so
/home/ezop/R/x86_64-pc-linux-gnu-library/4.2/nloptr/libs/nloptr.so: Mach-O 64-bit x86_64 dynamically linked shared library, flags:<NOUNDEFS|DYLDLINK|TWOLEVEL|WEAK_DEFINES|BINDS_TO_WEAK|NO_REEXPORTED_DYLIBS|HAS_TLV_DESCRIPTORS>
(base) root#kanta:/home/ezop/R/x86_64-pc-linux-gnu-library/4.2# uname -a
Linux kanta 4.9.0-18-amd64 #1 SMP Debian 4.9.303-1 (2022-03-07) x86_64 GNU/Linux
I was having the same problem a few minutes ago. I tried installing cmake and gfortran but with little success. I noticed, when I was trying install.packages("nloptr") for the last time, this error message: There are binary versions available but the source versions are later. Do you want to install from sources the package which needs compilation?.
Jenny Bryan explains here that a simple "No" would do.
I hope this is useful for you too.

Trouble Installing qdap package into R

I want to install "qdap" package to run a text mining project. I tried installing the package in many different ways:
1. intsall.packages("qdap")
2. Downloading the file locally then installing
3. Using devtools
library(devtools)
install_github("trinker/qdapDictionaries")
install_github("trinker/qdapRegex")
install_github("trinker/qdapTools")
install_github("trinker/qdap")
I always had the same problem. It seems to be related to rJava package. I tried to install rJava but I wasn't successful.
I'm more of a data analyst than a developer so I don't have much experience with development (using terminal commands or fixing java on my mac).
I'd really like to use this "qdap" package. Could you please help me figure out in a simple manner?
Here's the error message after I install the package:
The downloaded source packages are in
‘/private/var/folders/hk/r0tjy0t57n79lvkh2_fc7snm0000gn/T/RtmpsSJ6Mg/downloaded_packages’
✓ checking for file ‘/private/var/folders/hk/r0tjy0t57n79lvkh2_fc7snm0000gn/T/RtmpsSJ6Mg/remotes42b1730aa4f/trinker-qdap-7f390f7/DESCRIPTION’ (437ms)
─ preparing ‘qdap’: (1.1s)
✓ checking DESCRIPTION meta-information ...
─ checking for LF line-endings in source and make files and shell scripts (1.3s)
─ checking for empty or unneeded directories
Removed empty directory ‘qdap/tools’
─ looking to see if a ‘data/datalist’ file should be added
─ building ‘qdap_2.4.2.tar.gz’
* installing *source* package ‘qdap’ ...
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
Unable to find any JVMs matching version "(null)".
No Java runtime present, try --request to install.
Warning in system("/usr/libexec/java_home", intern = TRUE) :
running command '/usr/libexec/java_home' had status 1
Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.5/Resources/library/rJava/libs/rJava.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.5/Resources/library/rJava/libs/rJava.so, 6): Library not loaded: /Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home/lib/server/libjvm.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/3.5/Resources/library/rJava/libs/rJava.so
Reason: image not found
ERROR: lazy loading failed for package ‘qdap’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/qdap’
Error: Failed to install 'qdap' from GitHub:
(converted from warning) installation of package ‘/var/folders/hk/r0tjy0t57n79lvkh2_fc7snm0000gn/T//RtmpsSJ6Mg/file42b3e031f25/qdap_2.4.2.tar.gz’ had non-zero exit status
Maybe the key is in the following
Unable to find any JVMs matching version "(null)".
No Java runtime present, try --request to install.
and
Warning in system("/usr/libexec/java_home", intern = TRUE) :
running command '/usr/libexec/java_home' had status 1
Are you sure you have installed a JVM? And if yes, the correct one? Because it seems to not find it.
You can download JVM from here.
I hope this helps!

Why does installed "igraph" package return "libicui18n.so.58: cannot open shared object file"after loading?

I was trying to install the package igraph in R using the command install.packages("igraph"). After the installation, during testing phase it showed the following error:
testing if installed package can be loaded Error: package or namespace
load failed for ‘igraph’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object
'/home/midhun/R/x86_64-redhat-linux-gnu-library/3.5/igraph/libs/igraph.so':
libicui18n.so.58: cannot open shared object file: No such file or
directory Error: loading failed Execution halted ERROR: loading
failed
removing ‘/home/midhun/R/x86_64-redhat-linux-gnu-library/3.5/igraph’
The downloaded source packages are in
‘/tmp/RtmpLVDism/downloaded_packages’ Warning message: In
install.packages("igraph") : installation of package ‘igraph’ had
non-zero exit status
Why this is happening? What could be a solution?
The library igraph requires library files such as:
libicui18n.so.58, libicuuc.so.58, libgfortran, etc.
These were either not installed in the proper library folder or were existing as previous versions. For example, in my case, libicuuc.so.58 was required to be installed in usr/lib64. Make sure that dependencies are installed correctly to solve such problems.

Errors during installation of R dependencies after new R installation on Ubuntu 18.04

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:
Install R: apt install r-base
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)
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.
After trying the following (purging and reinstalling R between each step):
apt purge r-base
Added/removed several different PPAs before realizing none of them supported Bionic Beaver. Result: Release not found.
Found Michael Rutter's PPA and attempted to use that. Result: same error message from above ('CURL_OPENSSL_3' not found).
Attempting several solutions to this SO article. Result: same error message from above ('CURL_OPENSSL_3' not found).
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.

Rgdal package installation on Amazon Linux AMI

I've installed geos, proj-4.8.0 and gdal-1.9.2, yet, after installing the R package rgeos, rgdal fails to install.
Here is a look at my home directory:
. . . and the error I get running install.packages("rgdal", type="source"):
** building package indices
** installing vignettes
** testing if installed package can be loaded
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/mainstorage/michaeld/R/x86_64-redhat-linux-gnu-library/3.1/rgdal/libs/rgdal.so':
libgdal.so.1: cannot open shared object file: No such file or directory
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/mainstorage/michaeld/R/x86_64-redhat-linux-gnu-library/3.1/rgdal’
The downloaded source packages are in
‘/tmp/Rtmpt51iFG/downloaded_packages’
Warning message:
In install.packages("rgdal", type = "source") :
installation of package ‘rgdal’ had non-zero exit status
I infer that this error has something to do with a dependent library. . . but that is all I gather.
I should mention that running sudo yum install libgdal1 libgdal1-dev libgeos libgeos-dev as suggested here yields the following:
No package libgdal1 available.
No package libgdal1-dev available.
Package geos-3.4.2-1.3.amzn1.x86_64 already installed and latest version
No package libgeos-dev available.
So, perhaps the better question is how do I install these dev packages?
Thanks for any direction.
You probably need to update the dynamic library cache, using ldconfig as superuser.
Alternatively, rather than building the packages from source, you can enable the Extra Packages for Enterprise Linux (EPEL) repository.

Resources