R XML ERROR: 'configure' exists but is not executable centos 7 - r

I've been having quite a time installing XML on a shiny server. It is currently installed, but I can't quite install it on a separate user, shiny or using sudo.
* installing *source* package ‘XML’ ...
** package ‘XML’ successfully unpacked and MD5 sums checked
ERROR: 'configure' exists but is not executable -- see the 'R Installation
and Administration Manual'
* removing ‘/home/dalgleishjl/R/x86_64-redhat-linux-gnu-library/3.5/XML’
* restoring previous ‘/home/dalgleishjl/R/x86_64-redhat-linux-gnu-
library/3.5/XML’
The downloaded source packages are in
‘/tmp/RtmpMK29rO/downloaded_packages’
Warning message:
In install.packages("XML") :
installation of package ‘XML’ had non-zero exit status
attempting it with sudo R has the following result:
trying URL 'https://cloud.r-project.org/src/contrib/XML_3.98-1.11.tar.gz'
Content type 'application/x-gzip' length 1599533 bytes (1.5 MB)
==================================================
downloaded 1.5 MB
* installing *source* package ‘XML’ ...
** package ‘XML’ successfully unpacked and MD5 sums checked
ERROR: 'configure' exists but is not executable -- see the 'R Installation
and Administration Manual'
* removing ‘/usr/lib64/R/library/XML’
The downloaded source packages are in
‘/tmp/RtmpJCIVd4/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("XML") :
installation of package ‘XML’ had non-zero exit status
I've tried it on the user shiny (sudo -u shiny R):
trying URL 'https://cloud.r-project.org/src/contrib/XML_3.98-1.11.tar.gz'
Content type 'application/x-gzip' length 1599533 bytes (1.5 MB)
==================================================
downloaded 1.5 MB
Error in setwd(od) : cannot change working directory
Error in setwd(startdir) : cannot change working directory
Execution halted
The downloaded source packages are in
‘/tmp/Rtmpa7IPyB/downloaded_packages’
Warning message:
In install.packages("XML") :
installation of package ‘XML’ had non-zero exit status
> sessionInfo()
R version 3.5.0 (2018-04-23)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)
Matrix products: default
BLAS/LAPACK: /usr/lib64/R/lib/libRblas.so
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.5.0 tools_3.5.0
I've also installed the most recent version of libxml2-devel and libxml2
(using sudo yum install libxml2-devel and sudo yum install libxml2).

It's actually fairly straightforward. Using sudo R to start R, do the following:
dir.create("/home/username/tmp/")
Sys.setenv(TMPDIR="/home/username/tmp/")
install.packages(“XML”)

Related

R - New libraries fail to install even though dependencies are there

I have a rather interesting problem that I cannot find the answer to. I am using a RStudio Server (v. 1.4.1717), and R version 4.1.0 is installed. I try to use Projects with renv and so far it had been quite okay, even though I had problems with occasional library installations.
However, right now I keep getting this error:
Error: package ‘xxx’ required by ‘yyy’ could not be found
I have tried couple of things. I tried changing .libPaths() to a new location, have a fresh installation of each library, but it didn't solve my issue. I also tried doing this inside and outside a project (so, also renv active and disabled) but I keep getting same problem. Just to give an example:
>BiocManager::install("MatrixGenerics", lib = "/media/erkin/lib")
getOption("repos")' replaces Bioconductor standard repositories, see '?repositories' for details
replacement repositories:
CRAN: https://packagemanager.rstudio.com/all/__linux__/focal/latest
Bioconductor version 3.14 (BiocManager 1.30.18), R 4.1.0 (2021-05-18)
Installing package(s) 'MatrixGenerics'
trying URL 'https://bioconductor.org/packages/3.14/bioc/src/contrib/MatrixGenerics_1.6.0.tar.gz'
Content type 'application/x-gzip' length 28270 bytes (27 KB)
==================================================
downloaded 27 KB
* installing *source* package ‘MatrixGenerics’ ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Error: package ‘matrixStats’ required by ‘MatrixGenerics’ could not be found
Execution halted
ERROR: lazy loading failed for package ‘MatrixGenerics’
* removing ‘/media/erkin/lib/MatrixGenerics’
The downloaded source packages are in
‘/tmp/RtmpgabWCB/downloaded_packages’
Warning message:
In install.packages(...) :
installation of package ‘MatrixGenerics’ had non-zero exit status
I have matrixStats installed, and I can call it. If I check sessionInfo():
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.2 LTS
Matrix products: default
BLAS/LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.8.so
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=C LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] matrixStats_0.62.0 BiocGenerics_0.40.0
loaded via a namespace (and not attached):
[1] BiocManager_1.30.18 compiler_4.1.0 tools_4.1.0
This is not the only package this happens with. Many of the other packages I tried to install (e.g. S4Vectors installation cannot find BiocGenerics, BiocStyle installation says no package called BiocManager) just keeps failing.
I am probably missing something, does anybody have an idea why I my R fails to find the installed packages to install new packages?
I solved the issue by removing .Rprofile.
If you have an .Rprofile file and you set the library there, using renv "confuses" the main library path. I think it ends up checking the path .Rprofile shows, even though all the other commands (.libPaths(), find.package()) show renv library path. Removing the .Rprofile removed all the issues for me.

installation of package ‘ggplot2’ had non-zero exit status

I am trying to install ggplot2, which I had previously had installed however, I keep on getting an error message saying
ggplot2 had non-zero exit status.
I have updated R, unistalled and reinstalled it.
I have also done "install.packaged("ggplot2", dependencies = TRUE), that did not work, I have tried to install each dependency independently, which did not work.
I have tried to update some of the dependencies, especially rlang, however, the version nevers changes, so again had no success...
This is the error message
>install.packages("ggplot2", dependencies = TRUE)
Installing package into ‘C:/Users/Liah Brown/Documents/R/win-library/3.3’
(as ‘lib’ is unspecified)
also installing the dependency ‘rlang’
There are binary versions available but the source versions are
later:
binary source needs_compilation
rlang 0.2.0 0.3.1 TRUE
ggplot2 2.2.1 3.1.0 FALSE
Binaries will be installed
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/rlang_0.2.0.zip'
Content type 'application/zip' length 754726 bytes (737 KB)
downloaded 737 KB
package ‘rlang’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\Liah Brown\AppData\Local\Temp\Rtmpao258F\downloaded_packages
installing the source package ‘ggplot2’
trying URL 'https://cran.rstudio.com/src/contrib/ggplot2_3.1.0.tar.gz'
Content type 'application/x-gzip' length 2863109 bytes (2.7 MB)
downloaded 2.7 MB
* installing *source* package 'ggplot2' ...
** package 'ggplot2' successfully unpacked and MD5 sums checked
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
namespace 'rlang' 0.2.0 is being loaded, but >= 0.2.1 is required
ERROR: lazy loading failed for package 'ggplot2'
* removing 'C:/Users/Liah Brown/Documents/R/win-library/3.3/ggplot2'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-33~1.2/bin/x64/R" CMD INSTALL -l "C:\Users\Liah Brown\Documents\R\win-library\3.3" C:\Users\LIAHBR~1\AppData\Local\Temp\Rtmpao258F/downloaded_packages/ggplot2_3.1.0.tar.gz' had status 1
Warning in install.packages :
installation of package ‘ggplot2’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\Liah Brown\AppData\Local\Temp\Rtmpao258F\downloaded_packages’
My session info is...
R version 3.3.2 (2016-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
locale:
[1] LC_COLLATE=English_United Kingdom.1252
[2] LC_CTYPE=English_United Kingdom.1252
[3] LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United Kingdom.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] plyr_1.8.4
loaded via a namespace (and not attached):
[1] tools_3.3.2 yaml_2.1.18 Rcpp_0.12.16
And this is my .libPaths()
[1] "C:/Users/Liah Brown/Documents/R/win-library/3.3"
[2] "C:/Program Files/R/R-3.3.2/library"

Installation of package ‘forecast’ had non-zero exit status

With R version 3.2.3 (2015-12-10) on centOS I am trying to install.packages('forecast')
I get this:
install.packages('forecast')
Installing package into ‘/usr/lib64/R/library’
(as ‘lib’ is unspecified)
also installing the dependency ‘RcppArmadillo’
trying URL 'http://mirrors.ebi.ac.uk/CRAN/src/contrib/RcppArmadillo_0.6.700.3.0.tar.gz'
Content type 'application/x-gzip' length 1002967 bytes (979 KB)
downloaded 979 KB
trying URL 'http://mirrors.ebi.ac.uk/CRAN/src/contrib/forecast_7.1.tar.gz'
Content type 'application/x-gzip' length 196896 bytes (192 KB)
downloaded 192 KB
Error in plota.theme(col.border = rgb(68, 68, 68, maxColorValue = 255), :
could not find function "rgb"
Calls: source ... eval -> eval -> plota.theme.green.orange -> plota.theme
Execution halted
Error in plota.theme(col.border = rgb(68, 68, 68, maxColorValue = 255), :
could not find function "rgb"
Calls: source ... eval -> eval -> plota.theme.green.orange -> plota.theme
Execution halted
The downloaded source packages are in
‘/tmp/Rtmp0jOTCu/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning messages:
1: In install.packages("forecast") :
installation of package ‘RcppArmadillo’ had non-zero exit status
2: In install.packages("forecast") :
installation of package ‘forecast’ had non-zero exit status
I tried every solution to fix this like install package from source indicate the dependency = TRUE, etc., but nothing works.
sessionInfo() give this output
R version 3.2.3 (2015-12-10)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: CentOS release 6.7 (Final)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
On UBUNTU 18.04 I got the following
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)
I installed the package libcurl14-openssl-dev using synaptic, that solved the problem.
Install devtools. Most of the time the problem in installing R packages is that these tools are not there. Once this is installed, the zero exit error goes away.
install.packages('devtools')
https://www.digitalocean.com/community/tutorials/how-to-install-r-packages-using-devtools-on-ubuntu-16-04

Error installing R (3.1.0) package caret on Ubuntu 14.04.1 LTS

Trying to install package "caret" on R 3.1.0 (Ubuntu 14.04.01 LTS) and running into a build error.
> install.packages('caret')
[...]
* installing *source* package ‘BradleyTerry2’ ...
** package ‘BradleyTerry2’ successfully unpacked and MD5 sums checked
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
Error : object ‘brglm’ is not exported by 'namespace:brglm'
ERROR: lazy loading failed for package ‘BradleyTerry2’
* removing ‘/home/br00t/R/x86_64-pc-linux-gnu-library/3.1/BradleyTerry2’
Warning in install.packages :
installation of package ‘BradleyTerry2’ had non-zero exit status
ERROR: dependency ‘BradleyTerry2’ is not available for package ‘caret’
* removing ‘/home/br00t/R/x86_64-pc-linux-gnu-library/3.1/caret’
Warning in install.packages :
installation of package ‘caret’ had non-zero exit status
The downloaded source packages are in
‘/tmp/Rtmp7pWmvr/downloaded_packages’
> sessionInfo()
R version 3.1.0 (2014-04-10)
Platform: x86_64-pc-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=en_CA.UTF-8 LC_NUMERIC=C LC_TIME=en_CA.UTF-8 LC_COLLATE=en_CA.UTF-8
[5] LC_MONETARY=en_CA.UTF-8 LC_MESSAGES=en_CA.UTF-8 LC_PAPER=en_CA.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_CA.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] sp_1.0-16
loaded via a namespace (and not attached):
[1] grid_3.1.0 lattice_0.20-29 tools_3.1.0
Wasn't able to find anything helpful on the interwebs. Not sure if this is an issue with the BradleyTerry2 package or brglm... help?
Thanks,
br00t
If you are running a version of the brglm package greater than 0.5-9, uninstall and install brglm package version 0.5-9
I was able to get over the issue too by installing the dependencies. You may want to select your answer as the right one.

Zoo package compilation error

I'm running RStudio Server and am unable to install the zoo package. The error message I get is as follows:
Installing package(s) into ‘/home/tsajid/R/library’
(as ‘lib’ is unspecified)
trying URL 'http://mirrors.nics.utk.edu/cran/src/contrib/zoo_1.7-9.tar.gz'
Content type 'application/x-gzip' length 807084 bytes (788 Kb)
opened URL
==================================================
downloaded 788 Kb
** installing source package ‘zoo’ ...
** package ‘zoo’ successfully unpacked and MD5 sums checked
** libs
sh: make: command not found
ERROR: compilation failed for package ‘zoo’
** removing ‘/home/tsajid/R/library/zoo’
Warning in install.packages :
installation of package ‘zoo’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpsKlJWz/downloaded_packages’
I tried installing the package archive file but I get an identical error message.
Session info:
R version 2.15.1 (2012-06-22)
Platform: x86_64-redhat-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=C LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] svMisc_0.9-65
loaded via a namespace (and not attached):
[1] tools_2.15.1
It states it pretty clearly:
sh: make: command not found
So please do install the Red Hat equivalent of the Debian / Ubuntu command
sudo apt-get install r-base-dev
which via its dependence on build-essential also installs make, gcc etc pp

Resources