3

I've tried to install the current version of R (3.4.2) from CRAN on a new computer running a fresh install of Debian Stretch, and it doesn't fully work. For example,

root@machine:/home/myname# aptitude install r-cran-arm
The following NEW packages will be installed:
  libnlopt0{a} littler{a} r-cran-abind{ab} r-cran-arm{b} r-cran-coda{ab} 
  r-cran-littler{a} r-cran-lme4{ab} r-cran-minqa{a} r-cran-nloptr{a} 
  r-cran-pkgkitten{ab} r-cran-rcpp{ab} r-cran-rcppeigen{ab} 
0 packages upgraded, 12 newly installed, 0 to remove and 0 not upgraded.
Need to get 8,429 kB of archives. After unpacking 22.1 MB will be used.
The following packages have unmet dependencies:
 r-cran-coda : Depends: r-api-3 which is a virtual package, provided by:
                        - r-base-core (3.3.3-1), but 3.4.2-1~stretchcran.0 is installed

 r-cran-rcppeigen : Depends: r-api-3 which is a virtual package, provided by:
                             - r-base-core (3.3.3-1), but 3.4.2-1~stretchcran.0 is installed

 r-cran-abind : Depends: r-api-3 which is a virtual package, provided by:
                         - r-base-core (3.3.3-1), but 3.4.2-1~stretchcran.0 is installed

 r-cran-lme4 : Depends: r-api-3 which is a virtual package, provided by:
                        - r-base-core (3.3.3-1), but 3.4.2-1~stretchcran.0 is installed

 r-cran-rcpp : Depends: r-api-3 which is a virtual package, provided by:
                        - r-base-core (3.3.3-1), but 3.4.2-1~stretchcran.0 is installed

 r-cran-arm : Depends: r-api-3 which is a virtual package, provided by:
                       - r-base-core (3.3.3-1), but 3.4.2-1~stretchcran.0 is installed

 r-cran-pkgkitten : Depends: r-api-3 which is a virtual package, provided by:
                             - r-base-core (3.3.3-1), but 3.4.2-1~stretchcran.0 is installed

The following actions will resolve these dependencies:

     Keep the following packages at their current version:
1)     r-cran-abind [Not Installed]                       
2)     r-cran-arm [Not Installed]                         
3)     r-cran-coda [Not Installed]                        
4)     r-cran-lme4 [Not Installed]                        
5)     r-cran-minqa [Not Installed]                       
6)     r-cran-pkgkitten [Not Installed]                   
7)     r-cran-rcpp [Not Installed]                        
8)     r-cran-rcppeigen [Not Installed] 

I've tried to follow the instructions at https://cran.r-project.org/bin/linux/debian/. I've set the pertinent part of /etc/apt/sources.list as

## R https://cran.r-project.org/ 
## deb https://cran.cnr.berkeley.edu/bin/linux/debian stretch-cran34/
deb http://cran.wustl.edu/bin/linux/debian stretch-cran34/

(I tried the berkeley site first and then switched to see if that was my problem.

I've imported Johanne's Ranke's key.

r-base and r-base-dev are installed.

I think r-api-3 is the key, but I don't understand what to do to get around it, even after reading the thread on bugs.debian.org.

Is there a straightforward process one can use to fix this? If necessary, I can aptitude purge everything from r-cran-... and start over, but it would be nicer if I can fix things from where they are.

UPDATE IN RESPONSE TO JOHANNES' SUGGESTION:

I tried some things yesterday, and they didn't work. For example, I tried install.packages(rstanarm) and got, among other things:

/usr/lib/R/etc/Makeconf:168: recipe for target 'lang__grammars__expression_grammar_inst.o' failed

make: *** [lang__grammars__expression_grammar_inst.o] Error 1 ERROR: compilation failed for package ‘rstan’ * removing ‘/usr/local/lib/R/site-library/rstan’ ERROR: dependencies ‘PKI’, ‘RCurl’ are not available for package ‘rsconnect’ * removing ‘/usr/local/lib/R/site-library/rsconnect’ ERROR: dependency ‘igraph’ is not available for package ‘threejs’ * removing ‘/usr/local/lib/R/site-library/threejs’ ERROR: dependencies ‘rsconnect’, ‘rstan’, ‘threejs’ are not available for package ‘shinystan’ * removing ‘/usr/local/lib/R/site-library/shinystan’ ERROR: dependencies ‘rstan’, ‘shinystan’ are not available for package ‘rstanarm’ * removing ‘/usr/local/lib/R/site-library/rstanarm’

The downloaded source packages are in ‘/tmp/RtmpYtjSD9/downloaded_packages’ Warning messages: 1: In install.packages("rstanarm") : installation of package ‘PKI’ had non-zero exit status 2: In install.packages("rstanarm") : installation of package ‘RCurl’ had non-zero exit status 3: In install.packages("rstanarm") : installation of package ‘igraph’ had non-zero exit status 4: In install.packages("rstanarm") : installation of package ‘rstan’ had non-zero exit status 5: In install.packages("rstanarm") : installation of package ‘rsconnect’ had non-zero exit status 6: In install.packages("rstanarm") : installation of package ‘threejs’ had non-zero exit status 7: In install.packages("rstanarm") : installation of package ‘shinystan’ had non-zero exit status 8: In install.packages("rstanarm") : installation of package ‘rstanarm’ had non-zero exit status

I'm guessing that could be because I've now got a mix of packages.

Unless you say otherwise and when I get time, I'm inclined to use aptitude delete to get rid of all the R packages, leave sources.list pointing to the Debian backport, and then use install.packages() and update.packages() to build up my system on top of the backported (3.4.2?) base R. Does that sound safe and likely effective?

  • R 3.4.2 is already in Debian Buster: packages.debian.org/buster/r-base-core – Ipor Sircer Nov 4 '17 at 22:29
  • Unfortunately, I'm not ready to move to Buster. My recollection is that these instructions in the past always got one to the latest version of R and its packages, thanks to the work of Dirk Eddelbuetel and others. I'd like to replicate that experience on Stretch. – Bill Nov 5 '17 at 17:09
1

The package r-cran-arm is not among the packages that are being backported on CRAN. Furthermore, the version of r-cran-arm available in stretch is not compatible with the backport of R 3.4.2 because it depends on r-api-3 while R 3.4.2 on CRAN provides r-api-3.4.

You can either install the arm package from within R, or do the backports of r-cran-arm and the other packages mentioned in your log locally on your machine. I'll be happy to assist if you would like to go the second route.

  • Johannes, thanks. So the backported R that I installed should work okay, as long as I use the backported packages via aptitude and the non-backported packages via install.packages()? That leads me to two questions: How do I force aptitude to ignore r-cran-* packages that come from Stretch instead of backports? If I tried to install something like r-cran-arm and got the Stretch version, is the solution as simple as aptitude delete r-cran-arm followed by entering R and typing install.packages("r-cran-arm")? – Bill Nov 21 '17 at 13:39
  • If my understanding of the process is correct in my previous comment, that sounds quicker and easier than doing backports locally, right? Or am I missing something? – Bill Nov 21 '17 at 13:40
  • Yes, I agree to all your thoughts. I think having aptitude totally ignore r-cran-* packages from stretch is not straightforward. I think in the situation we're in I would just recommend to install via install.packages(), or maybe if you prefer to work from outside R, the neat little littler scripts that Dirk provides with littler. – Johannes Ranke Nov 21 '17 at 16:27
  • Thanks; I'll try it. And for anyone seeing this later, I know I can't install Debian packages with install.packages(). :-) – Bill Nov 22 '17 at 13:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.