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

  1. cd to the location where you want to download freesurfer.
  2. Download applicable deb package from Freesurfer official site. Get license through Freesurfer registration link.
  3. sudo dpkg -i freesurfer_<version>_amd64.deb
  4. 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
  1. 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.
  2. export FREESURFER_HOME=/usr/local/freesurfer/7.4.1/
  3. source $FREESURFER_HOME/SetUpFreeSurfer.sh
  4. Test your installation with freesurfer. If you see the documentation, freesurfer is installed successfully.
  5. 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
⚠️ **GitHub.com Fallback** ⚠️