Install Freesurfer on Ubuntu - BRAIN-TO/xnat_utilities GitHub Wiki
(Last update: 2023.08.04)
Source: https://surfer.nmr.mgh.harvard.edu/fswiki//FS7_linux
https://surfer.nmr.mgh.harvard.edu/fswiki/BuildRequirements
-
cd
to the location where you want to download freesurfer. - Download applicable deb package from Freesurfer official site. Get license through Freesurfer registration link.
sudo dpkg -i freesurfer_<version>_amd64.deb
- If needed, install the required dependencies then repeat step 3. For ubuntu 20.04, you may need
sudo apt-get -y install git wget tcsh xxd build-essential gfortran
sudo apt-get -y install libblas-dev liblapack-dev zlib1g-dev
sudo apt-get -y install libxmu-dev libxmu-headers libxi-dev libxt-dev libx11-dev libglu1-mesa-dev
sudo apt-get -y install gcc-4.8 g++-4.8 gfortran-4.8
- After the command finishes, locate the path to your freesurfer. In this example, we will use
/usr/local/freesurfer/7.4.1/
. Move the license.txt file into this directory. export FREESURFER_HOME=/usr/local/freesurfer/7.4.1/
source $FREESURFER_HOME/SetUpFreeSurfer.sh
- Test your installation with
freesurfer
. If you see the documentation, freesurfer is installed successfully. - To use freesurfer without repeating step 6 and 7 every time you open a terminal, add the commands into $HOME/.bashrc. For example:
# FREESURFER Setup
FREESURFER_HOME=/usr/local/freesurfer/7.4.1
source $FREESURFER_HOME/SetUpFreeSurfer.sh