Missing R packages after standard afni installation in ubuntu22.04

Hi. I installed afni in Ubuntu22.04 in a Virtual Machine following the standard procedure (quick setup instructions). After completing all the steps with the suggested instructions, the system_check all reports that there are missing R packages. I don't get what went wrong and how to fix that. I put here the output of the system check.
Thanks in advance

-------------------------------- general ---------------------------------

architecture:         64bit ELF

cpu type:             x86_64

system:               Linux

release:              6.8.0-40-generic

version:              #40~22.04.3-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 30 17:30:19 UTC 2

distribution:         ubuntu 22.04 Jammy Jellyfish

number of CPUs:       4

apparent login shell: bash

shell RC file:        .bashrc (exists)



--------------------- AFNI and related program tests ---------------------

which afni           : /home/martin/abin/afni

afni version         : Precompiled binary linux_ubuntu_16_64: Aug 20 2024 

                     : AFNI_24.2.03 'Macrinus'

AFNI_version.txt     : AFNI_24.2.03, linux_ubuntu_16_64, Aug 20 2024, official

which python         : /usr/bin/python

python version       : 3.10.12

which R              : /usr/bin/R

R version            : R version 4.1.2 (x86_64-pc-linux-gnu)



instances of various programs found in PATH:

    afni    : 1   (/home/martin/abin/afni)

    R       : 1   (/usr/bin/R)

    python  : 1   (/usr/bin/python3.10)

    python2 : 0 

    python3 : 1   (/usr/bin/python3.10)



** have python3 but not python2



testing ability to start various programs...

    afni                 : success

    suma                 : success

    3dSkullStrip         : success

    3dAllineate          : success

    3dRSFC               : success

    SurfMesh             : success

    3dClustSim           : success

    uber_subject.py      : success

    3dMVM                : success



------------------------ dependent program tests -------------------------

checking for dependent programs...



which tcsh           : /usr/bin/tcsh

tcsh version         : 6.21.00

which Xvfb           : /usr/bin/Xvfb



checking for R packages...

    rPkgsInstall -pkgs ALL -check : FAILURE

        

        oo Warning: 

           These packages are not installed on the computer: afex!

        These packages are not installed on the computer: phia!

        These packages are not installed on the computer: brms!

        



R RHOME : /usr/lib/R



------------------------------ python libs -------------------------------



++ module loaded: matplotlib.pyplot

   module file : /usr/lib/python3/dist-packages/matplotlib/pyplot.py

   matplotlib version : 3.5.1



++ module loaded: flask

   module file : /usr/lib/python3/dist-packages/flask/__init__.py

   flask version : 2.0.1



++ module loaded: flask_cors

   module file : /usr/lib/python3/dist-packages/flask_cors/__init__.py

   flask_cors version : 3.0.9



-------------------------------- env vars --------------------------------

PATH                       = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/home/martin/abin



PYTHONPATH                 = 

R_LIBS                     = /home/martin/R

LD_LIBRARY_PATH            = 

DYLD_LIBRARY_PATH          = 

DYLD_FALLBACK_LIBRARY_PATH = 

CONDA_SHLVL                = 

CONDA_DEFAULT_ENV          = 

CC                         = 



----------------------------- eval dot files -----------------------------



----------- AFNI $HOME files -----------



    .afnirc                   : found

    .sumarc                   : found

    .afni/help/all_progs.COMP : found



--------- shell startup files ----------



   -- good: .tcshrc seems to contain 'source .cshrc'

   -- considered operations: path, apsearch

   

   -- note: followers should not need edits, so edit flags should be 0

      (have 1 follower(s), which can be ignored)

   

   dot file test : want 1 modifications across 3 files:

   

      file             path  flatdir  apsearch        follower

      ---------------  ----  -------  --------        --------

      .cshrc           0     0        1               0     

      .tcshrc          0     0        0               1     

      .bashrc          0     0        0               0     

   

------------------------------ data checks -------------------------------

data dir : found AFNI_data6   under $HOME (199995M Avail)

           top history: ... 2024 [rickr]: 3drefit -newid FT/SUMA/FT_SurfVol.nii

data dir : found AFNI_demos   under $HOME

           top history: ...ct 2020 [taylorp]: updated scripts under FATCAT_DEMO

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/martin/abin



------------------------------ OS specific -------------------------------

which apt-get        : /usr/bin/apt-get

apt-get version      : apt 2.4.11 (amd64)



have Ubuntu system: ubuntu 22.04 Jammy Jellyfish

have Ubuntu afni  : Precompiled binary linux_ubuntu_16_64: Aug 20 2024 



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

*  just be aware: login shell 'bash', but our code examples use 'tcsh'

*  missing R packages (see rPkgsInstall)

*  dot file test : want 1 modifications across 3 files:

Howdy-

Yeah, sometimes on things like WSL or virtual machines the R packages aren't always directly installed. I am not sure why; maybe the package manager has been adapted or something on those applications.

Anyways, can you try installing installing them with R's install function directly? So first type:

R

to enter the R environment. Then, run:

install.packages("afex")
install.packages("phia")
install.packages("brms")

?

What is the output of afni_system_check.py -check_all after that?

--pt

Hi. Thank you for the reply. I tried to execute the commands you suggested, but unfortunately R is not responding well. I report the log for the first of the packages (the other two show the same behavior).

install.packages("afex")

Installing package into ‘/home/martin/R’

(as ‘lib’ is unspecified)

Warning: dependencies ‘pbkrtest’, ‘Matrix’ are not available

also installing the dependencies ‘MatrixModels’, ‘quantreg’, ‘car’



trying URL 'https://cloud.r-project.org/src/contrib/MatrixModels_0.5-3.tar.gz'

Content type 'application/x-gzip' length 24822 bytes (24 KB)

==================================================

downloaded 24 KB



trying URL 'https://cloud.r-project.org/src/contrib/quantreg_5.98.tar.gz'

Content type 'application/x-gzip' length 1026698 bytes (1002 KB)

==================================================

downloaded 1002 KB



trying URL 'https://cloud.r-project.org/src/contrib/car_3.1-2.tar.gz'

Content type 'application/x-gzip' length 579829 bytes (566 KB)

==================================================

downloaded 566 KB



trying URL 'https://cloud.r-project.org/src/contrib/afex_1.3-1.tar.gz'

Content type 'application/x-gzip' length 3785869 bytes (3.6 MB)

==================================================

downloaded 3.6 MB



* installing *source* package ‘MatrixModels’ ...

** package ‘MatrixModels’ successfully unpacked and MD5 sums checked

** using staged installation

** R

** byte-compile and prepare package for lazy loading

Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : 

  namespace ‘Matrix’ 1.4-0 is being loaded, but >= 1.6.0 is required

Calls: <Anonymous> ... namespaceImportFrom -> asNamespace -> loadNamespace

Execution halted

ERROR: lazy loading failed for package ‘MatrixModels’

* removing ‘/home/martin/R/MatrixModels’

ERROR: dependency ‘MatrixModels’ is not available for package ‘quantreg’

* removing ‘/home/martin/R/quantreg’

ERROR: dependencies ‘pbkrtest’, ‘quantreg’ are not available for package ‘car’

* removing ‘/home/martin/R/car’

ERROR: dependencies ‘pbkrtest’, ‘car’ are not available for package ‘afex’

* removing ‘/home/martin/R/afex’



The downloaded source packages are in

	‘/tmp/RtmpnyJvzx/downloaded_packages’

Warning messages:

1: In install.packages("afex") :

  installation of package ‘MatrixModels’ had non-zero exit status

2: In install.packages("afex") :

  installation of package ‘quantreg’ had non-zero exit status

3: In install.packages("afex") :

  installation of package ‘car’ had non-zero exit status

4: In install.packages("afex") :

  installation of package ‘afex’ had non-zero exit status

Hi,
It seems like the 'Matrix' package now requires R 4.4.0 or greater.
Try updating R and running the installation again.
Thanks, Justin