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?