Installing CERN ROOT on Debian GNU/Linux 11 (bullseye)


by Ricardo Yanez
Last updated: December 26, 2022

bullseye version (bookworm, buster, stretch, squeeze)


ROOT is not part of Debian as of the last stable version 11 (bullseye). This is a quick installation guide from source that avoids debianization.

Download the source.

Install dependencies,

sudo apt-get install dpkg-dev cmake g++ gcc binutils git python3-numpy python3-pygments python3-yaml libx11-dev libxpm-dev libxft-dev libxext-dev 
libssl-dev libpng-dev libjpeg-dev python3-dev liblzma-dev libxxhash-dev libzstd-dev libgsl-dev liblz4-dev libgif-dev libtiff-dev libxml2-dev 
libmariadbd-dev libsqlite3-dev libfftw3-dev libcfitsio-dev libxrootd-dev libxrootd-client-dev libgfal2-dev davix-dev libtbb-dev libblas-dev

Define ROOT version,

export ROOTVER=6.26.10

Create a directory, for instance root, then untar the source,

mkdir root
cd root
tar -zxvf ../root_v$ROOTVER.source.tar.gz

Create a working directory,

mkdir build
cd build

then configure, compile and install,

cmake ../root-$ROOTVER/ -DCMAKE_INSTALL_PREFIX=/usr/opt/root-$ROOTVER -Dgnuinstall=ON
make -j4
sudo make install
sudo ln -sf /usr/opt/root-$ROOTVER /usr/opt/root

The option '-j' in make means the number of jobs to run simultaneously, in this case, four. In multi-core systems this reduces the compilation time considerably.

Update the dynamic linker,

sudo ldconfig

Define the ROOT environment variables in your .bashrc,

export ROOTSYS=/usr/opt/root
export PATH=$PATH:$ROOTSYS/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ROOTSYS/lib/root

If the system has many ROOT users, it may be advantageous to define these variables system-wide in /etc/bash.bashrc instead.

Run root at the terminal-emulator.



This document was generated using AFT v5.098