AFNI install issues on ubuntu22.04 with R-4.3.1

Dear AFNI oracles,

I have been trying to install AFNI on a ubuntu22.04 computer , and still have some errors I don't manage to overcome.
When I try rPkgsInstall. there are sth wrong with:
In file included from gzipdatasource.cpp:1:
gzipdatasource.h:4:10: fatal error: zlib.h: No such file or directory
4 | #include <zlib.h>
.
.
.
Warning messages (with all Pkgs depended):
In install.packages(pkgs_miss, dep = NA, repos = site) :

This is the output of afni_system_check:

-------------------------------- general ---------------------------------
architecture:         64bit ELF
cpu type:             x86_64
system:               Linux
release:              6.2.0-32-generic
version:              #32~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 18 10:40:13 UTC 2
distribution:         Ubuntu 22.04.3 LTS
number of CPUs:       20
apparent login shell: bash
shell RC file:        .bashrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni           : /home/xiaoyu/abin/afni
afni version         : Precompiled binary linux_ubuntu_16_64: Sep 15 2023 
                     : AFNI_23.2.10 'Marcus Didius Severus Julianus'
AFNI_version.txt     : AFNI_23.2.10, linux_ubuntu_16_64, Sep 15 2023, official
which python         : /home/xiaoyu/fsl/bin/python
python version       : 3.11.5
which R              : /opt/R/4.3.1/bin/R
R version            : R version 4.3.1 (2023-06-16) -- "Beagle Scouts"

instances of various programs found in PATH:
    afni    : 1   (/home/xiaoyu/abin/afni)
    R       : 2 
      /opt/R/4.3.1/bin/R
      /usr/bin/R
    python  : 2 
      /home/xiaoyu/fsl/bin/python3.11
      /usr/bin/python3.10
    python2 : 0 
    python3 : 2 
      /home/xiaoyu/fsl/bin/python3.11
      /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
which Xvfb           : /usr/bin/Xvfb

checking for R packages...
    rPkgsInstall -pkgs ALL -check : FAILURE
        
        oo Warning: 
           These packages are not installed on the computer: brms!
        

R RHOME : /opt/R/4.3.1/lib/R

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

++ module loaded: matplotlib.pyplot
   module file : /home/xiaoyu/fsl/lib/python3.11/site-packages/matplotlib/pyplot.py
   matplotlib version : 3.7.2

-------------------------------- env vars --------------------------------
PATH = /opt/R/4.3.1/bin:/home/xiaoyu/fsl/bin:/home/xiaoyu/fsl/share/fsl/bin:/usr/local/freesurfer/bin:/usr/local/freesurfer/fsfast/bin:/usr/local/freesurfer/tktools:/home/xiaoyu/fsl/bin:/home/xiaoyu/fsl/share/fsl/bin:/usr/local/freesurfer/mni/bin:/home/xiaoyu/fsl/share/fsl/bin:/home/xiaoyu/fsl/share/fsl/bin:/home/xiaoyu/.local/bin:/home/xiaoyu/download/software/build/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/xiaoyu/abin

PYTHONPATH = 
R_LIBS = /home/xiaoyu/R

LD_LIBRARY_PATH = 
DYLD_LIBRARY_PATH = 
DYLD_FALLBACK_LIBRARY_PATH = 

----------------------------- 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, flatdir, apsearch
      (not on a mac, should skip flatdir)
   
   -- 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: ...3 [rickr]: renamed GroupAna_cases scripts and output
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/xiaoyu/abin

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

have Ubuntu system: Ubuntu 22.04.3 LTS
have Ubuntu afni  : Precompiled binary linux_ubuntu_16_64: Sep 15 2023 

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

Thanks for the help!
Xiaoyu