New version R 3.6.1 installation issue

When I installed R on Linux, Ubuntu 18.04 according to the process shown on the AFNI website,
1.1.4. Linux, Ubuntu 18.04 — AFNI, SUMA and FATCAT: v23.1.06. The process is attached.

But I installed the lastest version of R, 3.6.1, when I started:

rPkgsInstall -pkgs ALL

Some errors and warning appeared; they said
installation of package ‘ps’ had non-zero exit status
installation of package ‘sf’ had non-zero exit status
installation of package ‘processx’ had non-zero exit status
installation of package ‘spdep’ had non-zero exit status :
installation of package ‘rstan’ had non-zero exit status
installation of package ‘brms’ had non-zero exit status

And R installation failed.

After a lot of searching on line about the solution, no solution shown on this message board resolved the problem I run into, since the R versions are different from theirs, like 3.5,3.4.

But this link gave us the hint.

It said we can solve this new version issue by using following command in R programming.

Sys.setenv(R_INSTALL_STAGED = FALSE)

And we found the explanation about the above command in RDocumentation about the Staged Installation in the Install issue, shown as below.

Staged Installation
The default way to install source packages changed in R 3.6.0, so packages are first installed to a temporary location and then (if successful) moved to the destination library directory. Some older packages were written in ways that assume direct installation to the destination library.

Staged installation can currently be overridden by having a line StagedInstall: no in the package’s DESCRIPTION file, via flag --no-staged-install or by setting environment variable R_INSTALL_STAGED to a false value (e.g.false or no)

After we override the stage installation, then installed the unsuccessful packages,like brms shingstan, rstan, ps…
Then R 3.6.1 installed successfully.

Hope it will help with your problem.

Best,
GL

Hi, GL-

Thanks very much for the heads-up on this issue, and particular for providing a solution.

We haven’t run into this previously from R 3.6.0 on WSL or on any other OS; however, it will be good to know. We’ll do some testing here and see if this is a more general issue with R 3.6.1; though, when setting up my Ubuntu Linux 16.04 laptop, I didn’t run into that error (and it was for R 3.6.1).

In the stackoverflow comment you posted, there was a specific error message about not having permission to copy files over, something like:


mv: cannot move '/home/mark/R/x86_64-pc-linux-gnu-library/3.6/00LOCK-Biobase/00new/Biobase' to '/home/mark/R/x86_64-pc-linux-gnu-library/3.6/Biobase': Permission denied
ERROR:   moving to final location failed

… presumably part of the “staging” operation. I am curious-- did you get a similar message? And if so, what are the permissions on your ~/R/x86_64-pc-linux-gnu-library/3.* directory? Did you by any chance use “sudo” when installing R packages?

Thanks,
pt

Hello,

I just wanted to add that i got the same error message (see below) trying to install afni on ubuntu (on windows via virtual box; see below for system details). The workaround: Sys.setenv(R_INSTALL_STAGED=FALSE) did not work for me, but maybe I was doing something wrong.

Here is what i did from within the terminal:
R (to open R)
R_INSTALL_STAGED=FALSE
Sys.getenv (“R_INSTALL_STAGED”) (to check variable state)
=False (confirming var is false)
q ()
save = y

R (re open R)
Sys.getenv (“R_INSTALL_STAGED”) (to check variable state)
Sys.getenv (“R_INSTALL_STAGED”) (to check variable state)
=“” (var state not saved)

Next, I tried disabling staged install from inside R and manually downloading packages:
install.packages(“units”,dependencies=TRUE)

This gave me the same error message as before.

Any assistance would be much appreciated!

Here are the results from original R package install error:


g++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
/usr/lib/R/etc/Makeconf:176: recipe for target 'stan/lang/grammars/term_grammar_inst.o' failed
make: *** [stan/lang/grammars/term_grammar_inst.o] Error 4
ERROR: compilation failed for package ‘rstan’
* removing ‘/home/wtm0004/R/rstan’
ERROR: dependency ‘units’ is not available for package ‘sf’
* removing ‘/home/wtm0004/R/sf’
ERROR: dependency ‘rstan’ is not available for package ‘shinystan’
* removing ‘/home/wtm0004/R/shinystan’
ERROR: dependency ‘sf’ is not available for package ‘spdep’
* removing ‘/home/wtm0004/R/spdep’
ERROR: dependencies ‘rstan’, ‘shinystan’ are not available for package ‘brms’
* removing ‘/home/wtm0004/R/brms’

The downloaded source packages are in
        ‘/tmp/RtmpPpocAd/downloaded_packages’

++ Note:  @ 01:10:52
        This package has been installed on the computer: brms

Warning messages:
1: In install.packages(pkgs_miss, dep = TRUE, repos = site) :
  installation of package ‘units’ had non-zero exit status
2: In install.packages(pkgs_miss, dep = TRUE, repos = site) :
  installation of package ‘rstan’ had non-zero exit status
3: In install.packages(pkgs_miss, dep = TRUE, repos = site) :
  installation of package ‘sf’ had non-zero exit status
4: In install.packages(pkgs_miss, dep = TRUE, repos = site) :
  installation of package ‘shinystan’ had non-zero exit status
5: In install.packages(pkgs_miss, dep = TRUE, repos = site) :
  installation of package ‘spdep’ had non-zero exit status
6: In install.packages(pkgs_miss, dep = TRUE, repos = site) :
  installation of package ‘brms’ had non-zero exit status

 
here is my system info and results from afni_system_check.py -check_all

wtm0004@Linux-VM:~$ afni_system_check.py -check_all
-------------------------------- general ---------------------------------
architecture: 64bit
system: Linux
release: 5.0.0-25-generic
version: #26~18.04.1-Ubuntu SMP Thu Aug 1 13:51:02 UTC 2019
distribution: Ubuntu 18.04 bionic
number of CPUs: 1
apparent login shell: bash
shell RC file: .bashrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni : /home/wtm0004/abin/afni
afni version : Precompiled binary linux_ubuntu_16_64: Aug 19 2019
: AFNI_19.2.14 ‘Claudius’
AFNI_version.txt : AFNI_19.2.14, linux_ubuntu_16_64, Aug 19 2019
which python : /usr/bin/python
python version : 2.7.15+
which R : /usr/bin/R
R version : R version 3.6.1 (2019-07-05) – “Action of the Toes”
which tcsh : /usr/bin/tcsh

instances of various programs found in PATH:
afni : 1 (/home/wtm0004/abin/afni)
R : 1 (/usr/bin/R)
python : 1 (/usr/bin/python2.7)
python2 : 1 (/usr/bin/python2.7)
python3 : 1 (/usr/bin/python3.6)

testing ability to start various programs…
afni : success
suma : success
3dSkullStrip : success
uber_subject.py : success
3dAllineate : success
3dRSFC : success
SurfMesh : success
3dClustSim : success

checking for R packages…
rPkgsInstall -pkgs ALL -check : FAILURE

    oo Warning: 
       These packages are not installed on the computer: brms!

checking for $HOME files…
.afnirc : found
.sumarc : found
.afni/help/all_progs.COMP : found

------------------------------ python libs -------------------------------
++ module loaded: PyQt4
module file : /usr/lib/python2.7/dist-packages/PyQt4/init.pyc

** failed to load module matplotlib.pyplot
– matplotlib.pyplot is not required, but is desirable

-------------------------------- env vars --------------------------------
PATH = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/wtm0004/abin:/home/wtm0004/abin

PYTHONPATH =
R_LIBS = /home/wtm0004/R

LD_LIBRARY_PATH =
DYLD_LIBRARY_PATH =
DYLD_FALLBACK_LIBRARY_PATH =

------------------------------ data checks -------------------------------
data dir : found AFNI_data6 under $HOME
top history: …2019 [ptaylor]: updated FT_analysis/results.QC_FT.05
data dir : found AFNI_demos under $HOME
top history: 29 Apr 2019 [rickr]: AFNI_pamenc command newline
data dir : found suma_demo under $HOME
top history: …s_New/data/Build_tmp on Mon Mar 4 11:56:45 EST 2013
data dir : found afni_handouts under $HOME
atlas : found TT_N27+tlrc under /home/wtm0004/abin

------------------------------ OS specific -------------------------------
which apt-get : /usr/bin/apt-get
apt-get version : apt 1.6.11 (amd64)

have Ubuntu system: Ubuntu 18.04 bionic
have Ubuntu afni : Precompiled binary linux_ubuntu_16_64: Aug 19 2019

========================= summary, please fix: =========================

  • login shell ‘bash’, trusting user to translate code examples from ‘tcsh’
  • missing R packages (see rPkgsInstall)