1.1.2. Linux, Ubuntu 26.04¶
These setup instructions are for Ubuntu Linux version 26.04 (Resolute Raccoon).
Things to note before starting¶
Each step involves either copy+pasting a command or clicking on a download link.
Copy and paste: In most terminals, use
Ctrl+Shift+candCtrl+Shift+v. (In WSL terminals, one might first enable this functionality: rightclick on the panel’s taskbar, select “Properties” and put a checkmark by this option.)Admin privileges: can you run
sudo lsand enter the correct password? If you can’t, ask an administrator to do the steps that start with sudo, and you can do the rest.Terminal type: To see your terminal shell type (
bash,zsh,tcsh, etc.), run this command:echo $0
Installation check: Run the system check in the “Evaluate” stage. Try any recommendations in its “Please Fix” section.
Getting help: if you run into any problems, please just ask a clear question on the AFNI Message Board.
To open a text file, use any text editor you like, and/or you can type
gedit FILENAME, such as either:gedit ~/.bashrc gedit ~/.bashrc &
Quick setup¶
This is the quick form of AFNI setup for Ubuntu 26.04. It includes downloading the Bootcamp data and running the system check (don’t forget to do that!).
Download the command scripts.
Copy+paste:
cd curl -O https://raw.githubusercontent.com/afni/afni/master/src/other_builds/OS_notes.linux_ubuntu_26_64_a_admin.txt curl -O https://raw.githubusercontent.com/afni/afni/master/src/other_builds/OS_notes.linux_ubuntu_26_64_b_user.tcsh curl -O https://raw.githubusercontent.com/afni/afni/master/src/other_builds/OS_notes.linux_ubuntu_26_64_c_nice.tcsh
Feel free to read any of these, for educational purposes.Run command scripts.
Check your shell (
echo $0), and use the appropriate set of commands below. Running the commands this way creates a text file,o.ubuntu*.txt, which can be sent to an AFNI guru for troubleshooting, if necessary.For bash users:
Copy+paste the following (requires
sudowith password):sudo bash OS_notes.linux_ubuntu_26_64_a_admin.txt 2>&1 | tee o.ubuntu_26_a.txt
Copy+paste the following (no
sudo):tcsh OS_notes.linux_ubuntu_26_64_b_user.tcsh 2>&1 | tee o.ubuntu_26_b.txt
(optional, but useful) To niceify your terminal, copy+paste the following (no
sudo):tcsh OS_notes.linux_ubuntu_26_64_c_nice.tcsh 2>&1 | tee o.ubuntu_26_c.txt
For tcsh or csh users:
Copy+paste the following (requires
sudowith password):sudo bash OS_notes.linux_ubuntu_26_64_a_admin.txt |& tee o.ubuntu_26_a.txt
Copy+paste the following (no
sudo):tcsh OS_notes.linux_ubuntu_26_64_b_user.tcsh |& tee o.ubuntu_26_b.txt
(optional, but useful) To niceify your terminal, copy+paste the following (no
sudo):tcsh OS_notes.linux_ubuntu_26_64_c_nice.tcsh |& tee o.ubuntu_26_c.txt
Install Bootcamp demo data¶
The AFNI Bootcamp involves hands-on learning with processing and looking at data. The packages installed here include the data, handouts and useful “cheat sheets” of commands. The full download size is several GB, and you should leave at least 10 GB free on your computer after downloading+unpacking the data, to be able to run various examples.
Copy+paste (to download+unpack Bootcamp data to your home directory; note that this will overwrite any pre-existing Bootcamp directories):
cd install_bootcamp_data.tcsh -do_install yes
If you want to remove the compressed packages that were downloaded, you can also delete theafni_boot_packages/directory.- !Pro tip!: Bring a computer mouse to use at the Bootcamp. It is muuuuch easier to follow the demos that way.
Read+practice the handy Unix documentation/tutorial. This will give you a quick lesson/refresher on using basic Linux shell commands (e.g.,
ls,cd,less, etc.). It will greatly enhance your bootcamp experience– we promise!
Evaluate setup/system (important!)¶
Open a new terminal, and copy+paste:
afni_system_check.py -check_all
- Read the “Please Fix” section at the end. If there are no suggestions, then rejoice! Otherwise, try the suggestion(s) there.
Open up the AFNI and SUMA GUIs, juuuust to make sure all is well:
afni suma
Report any crashes or problems!
If stuck, then …
try searching online with the error message, and/or ask on the Message Board
send the system check to an AFNI guru for advice—copy+paste:
afni_system_check.py -check_all > out.ASC.txt
... and email the file “out.ASC.txt”.
How to keep up-to-date (remember!)¶
To update your AFNI sometime, copy+paste:
@update.afni.binaries -d
That’s it!!
Purpose: This will automatically download the correct, latest AFNI version to your computer, replacing your old binaries. It will also update the
apearchhelp information. Update often!To check your AFNI version, copy+paste:
afni -ver
Purpose: Report this useful info whenever asking a question on the Message Board!
Note
The record of all changes (new options, new programs, bug fixes, et al.) in AFNI programs is maintained for all to see in the online AFNI History.
A note on setting up Python/using Conda (opt)¶
For this OS, you should not need to do anything further to set up your Python.
AFNI has a small number Python requirements, like Numpy, Matplotlib, flask and flask_cors.
You can use any method to install+manage Python and its dependencies. In fact, your OS might have all the Python+modules needed to run AFNI already. Check this by running:
afni_system_check.py -check_all
... and check for any notes in the “Please fix” section at the end. If there are none about Python, then you are all set!
But if you still need to install some Python modules, you might consider using Miniconda. It is a convenient, cross-platform way to setup Python (and other packages) and manage environments. If you want to use it or learn more, check out this tutorial for both quick and detailed instructions. We have tutorial notes here for both installing Miniconda and using it to get the necessary Python libraries for AFNI.