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

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

Related

R devtools unable to install - Ubuntu 20.04 - package or namespace load failed for ‘pkgload’

I am pretty desperate to install.packages("devtools").
However it allways fails with this error
Error: .onLoad failed in loadNamespace() for 'pkgload', details:
call: readRDS(nsInfoFilePath)
error: error reading from connection
Execution halted
ERROR: lazy loading failed for package ‘devtools’
* removing ‘/home/bjoern/R/x86_64-pc-linux-gnu-library/3.6/devtools’
Things I tried to fix this:
Add the dependencies = T argument
Following a suggestion by hadley wickham on github -> update rlang package
Try to run install.packages("pkgload") resulting in nearly exactly the same error (see below)
Completely removing R and reinstalling it
Additionally installing package following packages:
r-base-dev
r-cran-devtools
r-recommended
Updated all packages update.packages(ask = FALSE, checkBuilt = TRUE)
Error of install.packages("pkgload")
Error: package or namespace load failed for ‘pkgload’:
.onLoad failed in loadNamespace() for 'pkgload', details:
call: readRDS(nsInfoFilePath)
error: error reading from connection
Error: loading failed
Execution halted
ERROR: loading failed
I digged even deeper to the pkgload (which at least I hope is the only reason for the problem). I will check if manually (re)installing all imports and suggests from the CRAN page of pkgload does solve it.
Imports: desc, methods, pkgbuild, rlang, rprojroot, rstudioapi,
utils, withr Suggests: bitops, covr, Rcpp, testthat
My sessionInfo() output:
R version 3.6.3 (2020-02-29)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=de_DE.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=de_DE.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=de_DE.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=de_DE.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.6.3 tools_3.6.3
I still refuse to belief that it is impossibe to install devtools on ubuntu20
However at this point I take any straw
Solution Edit:
In short what fixed the issue for me was installing testthat package before. Thanks to comment by rui-barradas
install.packages("testthat")
install.packages("pkgload")
install.packages("devtools")
I am also on Ubuntu 20.04 but running R 4.0.0.
When trying to install a package, if it depends on another that was installed prior to R 4.0.0 I get an error message and the installation fails. This happens even if I set dependencies = TRUE in the call to install.packages.
Example: The command was
install.packages('pkgload')
I omit the first output lines, saying that the file was downloaded. Then, the relevant part.
installing source package ‘pkgload’ ...
** package ‘rcmdcheck’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** byte-compile and prepare package for lazy loading Error: package ‘testthat’ was installed before R 4.0.0: please re-install it
Execution halted ERROR: lazy loading failed for package ‘pkgload’
removing ‘/usr/local/lib/R/site-library/pkgload’
restoring previous ‘/usr/local/lib/R/site-library/pkgload’ Warning in install.packages : installation of package ‘pkgload’ had
non-zero exit status The downloaded source packages are in
‘/tmp/RtmpVxpbs0/downloaded_packages’
Correct way.
The right way of installing package pkgload was to run the sequence
install.packages('testthat')
install.packages('pkgload')
and the problem was solved.
Note that with other packages, it already happened to see this be a recursive issue. Imagine that package testthat depended (which it does not) on another package installed prior to R 4.0.0.
Annoying but solvable.
sessionInfo()
#R version 4.0.0 (2020-04-24)
#Platform: x86_64-pc-linux-gnu (64-bit)
#Running under: Ubuntu 20.04 LTS
#
#Matrix products: default
#BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
#LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0
#
#locale:
# [1] LC_CTYPE=pt_PT.UTF-8 LC_NUMERIC=C
#[3] LC_TIME=pt_PT.UTF-8 LC_COLLATE=pt_PT.UTF-8
# [5] LC_MONETARY=pt_PT.UTF-8 LC_MESSAGES=pt_PT.UTF-8
# [7] LC_PAPER=pt_PT.UTF-8 LC_NAME=C
# [9] LC_ADDRESS=C LC_TELEPHONE=C
#[11] LC_MEASUREMENT=pt_PT.UTF-8 LC_IDENTIFICATION=C
#
#attached base packages:
#[1] stats graphics grDevices utils datasets
#[6] methods base
#
#other attached packages:
#[1] rvest_0.3.5 xml2_1.3.2 data.table_1.12.8
#
#loaded via a namespace (and not attached):
I had the same problems, and the solution was, at least in my case, Ubuntu 20.04.1 LTS (Focal Fossa) + R 4.0.2:
First (from terminal), install:
Step 1: sudo apt-get update -y
Step 2: sudo apt-get install -y libxml2-dev
Then from RStudio (setRepositories first, and choose 8 repositories) and install both packages:
Install xml2 package
install devtools
And works 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"

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

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”)

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