Fail to install R packages

When I carried out this step during the installation process, there was an error message displayed as follows:

Warning messages:
1: In install.packages(pkgs_miss, dep = NA, repos = site) :
installation of package ‘MatrixModels’ had non-zero exit status
2: In install.packages(pkgs_miss, dep = NA, repos = site) :
installation of package ‘Brobdingnag’ had non-zero exit status
3: In install.packages(pkgs_miss, dep = NA, repos = site) :
installation of package ‘quantreg’ had non-zero exit status
4: In install.packages(pkgs_miss, dep = NA, repos = site) :
installation of package ‘car’ had non-zero exit status
5: In install.packages(pkgs_miss, dep = NA, repos = site) :
installation of package ‘bridgesampling’ had non-zero exit status
6: In install.packages(pkgs_miss, dep = NA, repos = site) :
installation of package ‘phia’ had non-zero exit status
7: In install.packages(pkgs_miss, dep = NA, repos = site) :
installation of package ‘afex’ had non-zero exit status
8: In install.packages(pkgs_miss, dep = NA, repos = site) :
installation of package ‘brms’ had non-zero exit status

How can we solve this problem?

Hi Chloe,

To be sure, what is the system check output?

afni_system_check.py -check_all

Thanks,

-rick

Hi, rick, here is the output:

========================= 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:

Hi-

Can you please post the full output of afni_system_check.py -check_all? That has useful information like package version numbers, operating system type, etc.

For posting here, it will also help to put the output within a block of triple backquotes (one set above the top of the code, and one set below), to be formatted like code. Or, you can paste the code output here, and then highlight it and click on the </> "preformatted code" button above the text field here.

thanks,
pt

Hi, pt, thanks for reply, here is the output:

-------------------------------- general ---------------------------------
architecture:         64bit ELF
cpu type:             x86_64
system:               Linux
release:              6.8.0-52-generic
version:              #53~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Jan 15 19:18:46 UTC 2
distribution:         ubuntu 22.04 Jammy Jellyfish
number of CPUs:       4
user:                 liubingyu
apparent login shell: bash
shell RC file:        .bashrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni           : /home/liubingyu/abin/afni
afni version         : Precompiled binary linux_ubuntu_16_64: Feb 24 2025 
                     : AFNI_25.0.07 'Severus Alexander'
AFNI_version.txt     : AFNI_25.0.07, linux_ubuntu_16_64, Feb 24 2025, 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/liubingyu/abin/afni)
    R       : 1   (/usr/bin/R)
    python  : 1   (/usr/bin/python3.10)
    python2 : 0 
    python3 : 1   (/usr/bin/python3.10)

testing ability to start various programs...
    afni                 : success
    suma                 : success
    3dSkullStrip         : success
    3dAllineate          : success
    3dRSFC               : success
    SurfMesh             : success
    3dClustSim           : success
    build_afni.py        : success
    uber_subject.py      : success
    3dMVM                : success
    rPkgsInstall         : 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/liubingyu/abin

PYTHONPATH                 = 
R_LIBS                     = /home/liubingyu/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
           top history: 22 Jan 2025 [rickr]: add AV2_aud_AM2.txt
data dir : found AFNI_demos   under $HOME
           top history: ...aylorp]: remove gzip from FATCAT_DEMO/Do_1[34]*.tcsh
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/liubingyu/abin

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

which git            : /usr/bin/git
git version          : git version 2.34.1
which gcc            : /usr/bin/gcc
gcc version          : gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0

have Ubuntu system: ubuntu 22.04 Jammy Jellyfish
have Ubuntu afni  : Precompiled binary linux_ubuntu_16_64: Feb 24 2025 

=========================  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:

Hi, Chloe-

This is a known issue with Ubuntu 22.04 ("Jammy Jellyfish", which is referenced in the names below), where the default R version installed is 4.1.2, which you have. However, the R package "Matrix" (and then some dependencies) now require R version 4.4 or higher. We are working to address this in our install instructions. For now, you can update your R, like following the instructions here, which I summarize below.

Overview and note: I note that the location where R packages are installed is set here by $R_LIBS, which on your OS is specifically: /home/liubingyu/R. We will both empty out this directory (to avoid any version conflicts later), and remove R, and then add information to your package manager to be able to get a more modern (but still official) R version, and then re-install both R and its packages; the packages will go back into that same $R_LIBS directory. Doing this requires that you have the sudo or admin password for your system.

Each of the commands below should be copy+pasted, to avoid typos.

  1. First, we remove your old R and any packages installed in your $R_LIBS directory; in the latter case, we just move your existing $R_LIBS directory to a backup location and create a new one in its place, to fill below:

    sudo apt-get remove -y r-base r-base-core r-base-dev
    mv /home/liubingyu/R /home/liubingyu/R_old_backup
    mkdir /home/liubingyu/R
    
  2. Next, run this to be able to get more modern R installed with your package manager (this adds the location of the official R-cran repository for your Ubuntu version to the package lists):

    sudo echo "" >> /etc/apt/sources.list
    sudo echo "deb https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/" >> /etc/apt/sources.list
    sudo echo "" >> /etc/apt/sources.list
    
  3. Run this so that the Ubuntu package manager updates itself by reading that text file, to know about the new source:

    sudo apt-get update
    
  4. Install R again, by copy+pasting:

    sudo apt-get install -y r-base r-base-dev
    
  5. Run the AFNI program to install necessary libraries again:

    rPkgsInstall -pkgs ALL
    

Please let us know how that goes. If all has gone well, you can now remove the backup directory:

/home/liubingyu/R_old_backup

--pt

Thanks pt!
I tried to run the commands you provided, but there was an error in the second step. I searched for a solution and modified the code using the tee command as follows:

sudo tee -a /etc/apt/sources.list <<EOF
deb https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/
EOF

Then, an error occurred when I executed the update operation in the third step.

Hit:2 http://security.ubuntu.com/ubuntu jammy-security InRelease                                
Hit:1 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy InRelease                                                                      
Hit:3 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-updates InRelease                                                              
Hit:4 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-backports InRelease                      
Get:5 https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/ InRelease [3,632 B]
Err:5 https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/ InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 51716619E084DAB9
Reading package lists... Done
W: GPG error: https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/ InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 51716619E084DAB9
E: The repository 'https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/ InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: Target Packages (Packages) is configured multiple times in /etc/apt/sources.list:52 and /etc/apt/sources.list:57
W: Target Translations (en_US) is configured multiple times in /etc/apt/sources.list:52 and /etc/apt/sources.list:57
W: Target Translations (en) is configured multiple times in /etc/apt/sources.list:52 and /etc/apt/sources.list:57
W: Target Translations (en_US.UTF-8) is configured multiple times in /etc/apt/sources.list:52 and /etc/apt/sources.list:57
W: Target Translations (zh_CN) is configured multiple times in /etc/apt/sources.list:52 and /etc/apt/sources.list:57
W: Target Packages (Packages) is configured multiple times in /etc/apt/sources.list:52 and /etc/apt/sources.list:59
W: Target Translations (en_US) is configured multiple times in /etc/apt/sources.list:52 and /etc/apt/sources.list:59
W: Target Translations (en) is configured multiple times in /etc/apt/sources.list:52 and /etc/apt/sources.list:59
W: Target Translations (en_US.UTF-8) is configured multiple times in /etc/apt/sources.list:52 and /etc/apt/sources.list:59
W: Target Translations (zh_CN) is configured multiple times in /etc/apt/sources.list:52 and /etc/apt/sources.list:59

Then I use sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 51716619E084DAB9 to add the key, and continue with step 4 & 5, then I got some warnings:

Warning messages:
1: In install.packages(pkgs_miss, dep = NA, repos = site) :
  installation of package ‘reformulas’ had non-zero exit status
2: In install.packages(pkgs_miss, dep = NA, repos = site) :
  installation of package ‘future.apply’ had non-zero exit status
3: In install.packages(pkgs_miss, dep = NA, repos = site) :
  installation of package ‘lme4’ had non-zero exit status
4: In install.packages(pkgs_miss, dep = NA, repos = site) :
  installation of package ‘gamm4’ had non-zero exit status
5: In install.packages(pkgs_miss, dep = NA, repos = site) :
  installation of package ‘lmerTest’ had non-zero exit status
6: In install.packages(pkgs_miss, dep = NA, repos = site) :
  installation of package ‘rstan’ had non-zero exit status
7: In install.packages(pkgs_miss, dep = NA, repos = site) :
  installation of package ‘pbkrtest’ had non-zero exit status
8: In install.packages(pkgs_miss, dep = NA, repos = site) :
  installation of package ‘car’ had non-zero exit status
9: In install.packages(pkgs_miss, dep = NA, repos = site) :
  installation of package ‘afex’ had non-zero exit status
10: In install.packages(pkgs_miss, dep = NA, repos = site) :
  installation of package ‘phia’ had non-zero exit status

When I run afni_system_check.py -check_all, here is the output:

-------------------------------- general ---------------------------------
architecture:         64bit ELF
cpu type:             x86_64
system:               Linux
release:              6.8.0-52-generic
version:              #53~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Jan 15 19:18:46 UTC 2
distribution:         ubuntu 22.04 Jammy Jellyfish
number of CPUs:       4
user:                 liubingyu
apparent login shell: bash
shell RC file:        .bashrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni           : /home/liubingyu/abin/afni
afni version         : Precompiled binary linux_ubuntu_16_64: Feb 24 2025 
                     : AFNI_25.0.07 'Severus Alexander'
AFNI_version.txt     : AFNI_25.0.07, linux_ubuntu_16_64, Feb 24 2025, official
which python         : /usr/bin/python
python version       : 3.10.12
which R              : /usr/bin/R
R version            : R version 4.4.3 (x86_64-pc-linux-gnu)

instances of various programs found in PATH:
    afni    : 1   (/home/liubingyu/abin/afni)
    R       : 1   (/usr/bin/R)
    python  : 1   (/usr/bin/python3.10)
    python2 : 0 
    python3 : 1   (/usr/bin/python3.10)

testing ability to start various programs...
    afni                 : success
    suma                 : success
    3dSkullStrip         : success
    3dAllineate          : success
    3dRSFC               : success
    SurfMesh             : success
    3dClustSim           : success
    build_afni.py        : success
    uber_subject.py      : success
    3dMVM                : success
    rPkgsInstall         : 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: lme4!
        These packages are not installed on the computer: lmerTest!
        These packages are not installed on the computer: gamm4!
        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/liubingyu/abin:/home/liubingyu/abin

PYTHONPATH                 = 
R_LIBS                     = /home/liubingyu/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 (29560M Avail)
           top history: 22 Jan 2025 [rickr]: add AV2_aud_AM2.txt
data dir : found AFNI_demos   under $HOME
           top history: ...aylorp]: remove gzip from FATCAT_DEMO/Do_1[34]*.tcsh
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/liubingyu/abin

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

which git            : /usr/bin/git
git version          : git version 2.34.1
which gcc            : /usr/bin/gcc
gcc version          : gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0

have Ubuntu system: ubuntu 22.04 Jammy Jellyfish
have Ubuntu afni  : Precompiled binary linux_ubuntu_16_64: Feb 24 2025 

=========================  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:

Hi, Chloe-

Thanks for those pointers.

Re. Step 2: I wonder if that failed because the sudo .. from the first line required a password, and so having additional commands in that code block weren't interpreted correctly. I would have thought the terminal would have a long enough lockout time for the password that it would accept it immediately. You solution of doing the file entry in a single step gets around that potential issue, which is great.

Re. Step 3: I didn't know a separate public key would be needed---thanks for sorting that out, too.

At that point, you should be able to have the R version that is needed---I see it is v4.4.3, which is fine for the Matrix package. I'm surprised that several packages are not installed. Can you please try this:

  • From this post, I wonder if we also have to add libgsl-dev to the OS:

     sudo apt-get install libgsl-dev
    
  • Then try the package installer script again

    rPkgsInstall -pkgs ALL
    

If that doesn't work, then please try starting R and running the installs like this:

install.packages("Matrix", dependencies = TRUE)
install.packages("reformulas", dependencies = TRUE)
install.packages("lme4", dependencies = TRUE)
install.packages("afex", dependencies = TRUE)
install.packages("rstan", dependencies = TRUE)
install.packages("phia", dependencies = TRUE)

--pt

Hi, PT
I've tried sudo apt-get install libgsl-dev and the packages seems to be installed:

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

++ Note:  @ 19:37:32
   	This package has been installed on the computer: afex
	This package has been installed on the computer: phia
	This package has been installed on the computer: lme4
	This package has been installed on the computer: lmerTest
	This package has been installed on the computer: gamm4
	This package has been installed on the computer: brms

But the output of afni_system_check.py -check_all is the same as before with missing R packages:

-------------------------------- general ---------------------------------
architecture:         64bit ELF
cpu type:             x86_64
system:               Linux
release:              6.8.0-52-generic
version:              #53~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Jan 15 19:18:46 UTC 2
distribution:         ubuntu 22.04 Jammy Jellyfish
number of CPUs:       4
user:                 liubingyu
apparent login shell: bash
shell RC file:        .bashrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni           : /home/liubingyu/abin/afni
afni version         : Precompiled binary linux_ubuntu_16_64: Feb 24 2025 
                     : AFNI_25.0.07 'Severus Alexander'
AFNI_version.txt     : AFNI_25.0.07, linux_ubuntu_16_64, Feb 24 2025, official
which python         : /usr/bin/python
python version       : 3.10.12
which R              : /usr/bin/R
R version            : R version 4.4.3 (x86_64-pc-linux-gnu)

instances of various programs found in PATH:
    afni    : 1   (/home/liubingyu/abin/afni)
    R       : 1   (/usr/bin/R)
    python  : 1   (/usr/bin/python3.10)
    python2 : 0 
    python3 : 1   (/usr/bin/python3.10)

testing ability to start various programs...
    afni                 : success
    suma                 : success
    3dSkullStrip         : success
    3dAllineate          : success
    3dRSFC               : success
    SurfMesh             : success
    3dClustSim           : success
    build_afni.py        : success
    uber_subject.py      : success
    3dMVM                : success
    rPkgsInstall         : 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: phia!
        

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/liubingyu/abin:/home/liubingyu/abin

PYTHONPATH                 = 
R_LIBS                     = /home/liubingyu/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 (29560M Avail)
           top history: 22 Jan 2025 [rickr]: add AV2_aud_AM2.txt
data dir : found AFNI_demos   under $HOME
           top history: ...aylorp]: remove gzip from FATCAT_DEMO/Do_1[34]*.tcsh
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/liubingyu/abin

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

which git            : /usr/bin/git
git version          : git version 2.34.1
which gcc            : /usr/bin/gcc
gcc version          : gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0

have Ubuntu system: ubuntu 22.04 Jammy Jellyfish
have Ubuntu afni  : Precompiled binary linux_ubuntu_16_64: Feb 24 2025 

=========================  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:

Well, getting closer---just one left!---but sorry for this continued hassle.

And just to check, if you start R and run this:

install.packages("phia", dependencies = TRUE)

...what is the terminal output?

thanks,
pt

Here is the output:

Installing package into ‘/home/liubingyu/R’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/phia_0.3-1.tar.gz'
Content type 'application/x-gzip' length 545361 bytes (532 KB)
==================================================
downloaded 532 KB

* installing *source* package ‘phia’ ...
** package ‘phia’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (phia)

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

OK, cool---does that mean it is installed successfully? What is the output of:

afni_system_check.py -check_all

?

thanks,
pt

The output is:

-------------------------------- general ---------------------------------
architecture:         64bit ELF
cpu type:             x86_64
system:               Linux
release:              6.8.0-52-generic
version:              #53~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Jan 15 19:18:46 UTC 2
distribution:         ubuntu 22.04 Jammy Jellyfish
number of CPUs:       4
user:                 liubingyu
apparent login shell: bash
shell RC file:        .bashrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni           : /home/liubingyu/abin/afni
afni version         : Precompiled binary linux_ubuntu_16_64: Feb 24 2025 
                     : AFNI_25.0.07 'Severus Alexander'
AFNI_version.txt     : AFNI_25.0.07, linux_ubuntu_16_64, Feb 24 2025, official
which python         : /usr/bin/python
python version       : 3.10.12
which R              : /usr/bin/R
R version            : R version 4.4.3 (x86_64-pc-linux-gnu)

instances of various programs found in PATH:
    afni    : 1   (/home/liubingyu/abin/afni)
    R       : 1   (/usr/bin/R)
    python  : 1   (/usr/bin/python3.10)
    python2 : 0 
    python3 : 1   (/usr/bin/python3.10)

testing ability to start various programs...
    afni                 : success
    suma                 : success
    3dSkullStrip         : success
    3dAllineate          : success
    3dRSFC               : success
    SurfMesh             : success
    3dClustSim           : success
    build_afni.py        : success
    uber_subject.py      : success
    3dMVM                : success
    rPkgsInstall         : 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 : success

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/liubingyu/abin:/home/liubingyu/abin

PYTHONPATH                 = 
R_LIBS                     = /home/liubingyu/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 (29560M Avail)
           top history: 22 Jan 2025 [rickr]: add AV2_aud_AM2.txt
data dir : found AFNI_demos   under $HOME
           top history: ...aylorp]: remove gzip from FATCAT_DEMO/Do_1[34]*.tcsh
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/liubingyu/abin

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

which git            : /usr/bin/git
git version          : git version 2.34.1
which gcc            : /usr/bin/gcc
gcc version          : gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0

have Ubuntu system: ubuntu 22.04 Jammy Jellyfish
have Ubuntu afni  : Precompiled binary linux_ubuntu_16_64: Feb 24 2025 

=========================  summary, please fix:  =========================
*  just be aware: login shell 'bash', but our code examples use 'tcsh'
*  dot file test : want 1 modifications across 3 files:

It seems that everything is okay now? I've opend AFNI successfully!

Thanks a million, pt! You've been a huge help.

Great, glad that is sorted. Thanks for sticking with it, and the suggestions about the package management updates.

Happy processing!

--pt