Hi, Shun-
I believe that you should first remove R, because otherwise there are version conflicts. Then,
1) open the "list" file of sources for your package manager (sudo/admin password required):
sudo gedit /etc/apt/sources.list
2) Copy+paste this line to the bottom of that file (this gives your package manager a new place to look for files to install- specifically, R v3.5 on Ubuntu 18.04; for other people people doing this on different versions of ubuntu, instead of "bionic" one might have "xenial" (for Ubuntu 16.04) for example, whatever the fun Ubuntu name for your exact LTS version is):
deb [cloud.r-project.org] bionic-cran35/
You can save+close that file now.
3) Refresh the list of packages that your package manager reads-- copy+paste this:
sudo apt-get update
4) Now instruct your package manager to update its R base installation (this should get 3.5 now)-- copy+paste:
sudo apt-get install -y r-base-dev r-cran-rmpi
5) Use the AFNI command to get necessary packages, which should now include brms-- copy+paste this:
rPkgsInstall -pkgs ALL
Note, this step miiiiight take a little while, to fully build the R package.
Run the afni_system_check again, and let us know if that sorts out your R issue.
--pt