3

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

Emad
  • 279
  • 5
  • 22
  • 1
    Have you tried installing `RcppArmadillo` via `install.packages("RcppArmadillo")`? – Roman Luštrik Apr 29 '16 at 10:18
  • @RomanLuštrik ..In install.packages("RcppArmadillo") : installation of package ‘RcppArmadillo’ had non-zero exit status – Emad Apr 29 '16 at 11:14
  • Maybe relevant post: http://stackoverflow.com/questions/25721884 – zx8754 Apr 29 '16 at 11:21
  • @zx8754 i tried every single answer in that post . – Emad Apr 29 '16 at 12:28
  • Your error message simply state that something went wrong. It is absolutely impossible to know *what* went wrong, if you don't give more information. There must be other error messages that you get before the two that you posted. Add them to your post. – Stibu Apr 29 '16 at 13:44
  • @Stibu i edited my post can you please check it out. – Emad Apr 29 '16 at 14:09
  • @Emad Can you add the output of `sessionInfo()` to your question? – nrussell Apr 29 '16 at 14:46
  • @nrussell added it ,, thank you for coming – Emad Apr 29 '16 at 14:50
  • What happens when you evaluate `rgb(0, 0, 0)`? – Stibu Apr 29 '16 at 15:15
  • @Stibu `> rgb(0, 0, 0) [1] "#000000" ` – Emad Apr 29 '16 at 15:16
  • What were the error messages generated from the failed RcppArmadillo installation specifically (I'm assuming the `could not find function "rgb"` errors were generated from a different package)? – nrussell Apr 29 '16 at 15:22
  • Also, what does `g++ --version` return from your terminal? – nrussell Apr 29 '16 at 15:24
  • @nrussell the installation of the packages `RcppArmadillo ,forecast,Rcpp ` are generating the same error messages – Emad Apr 29 '16 at 15:26
  • @nrussell the output of `g++ --version` is `g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16) ` – Emad Apr 29 '16 at 15:27
  • It may have to do with the fact that CentOS 6 has a fairly old toolchain, as discussed in [this issue](https://github.com/RcppCore/RcppArmadillo/issues/85). You could try installing an older version of RcppArmadillo [from here](https://cran.r-project.org/src/contrib/Archive/RcppArmadillo/), maybe something in the 0.4.500 range. I don't have a CentOS 6 machine available so I'm not sure what the latest compatible version is for that OS. – nrussell Apr 29 '16 at 15:29
  • @nrussell i tried to install defferent older versions with the command `install.packages("http://cran.r-project.org/src/contrib/Archive/RcppArmadillo/RcppArmadillo_0.2.4.tar.gz", repos=NULL)` but still not working – Emad Apr 29 '16 at 15:45
  • 1
    @nrussell first you were right i needed an old version of forecast and all it's dependencies ,, but i couldn't install them because of the script i was runing at the runtime of R ( as we did it in the previous question ) so i deleted them and everything goes fine ,,,, – Emad Apr 29 '16 at 17:18

2 Answers2

0

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.

-2

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

Leopold Joy
  • 4,524
  • 4
  • 28
  • 37
user3411123
  • 115
  • 2