# How do I actually install ROOT?

**URL:** <https://root-forum.cern.ch/t/how-do-i-actually-install-root/40014>\
**Category:** ROOT\
**Tags:** installation\
**Created:** [June 21, 2020, 3:35am UTC](https://root-forum.cern.ch/t/how-do-i-actually-install-root/40014 "2020-06-21T03:35:52Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![KAM](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/kam/32/37110_2.png) [@KAM](https://root-forum.cern.ch/u/KAM)\
**Post date:** [June 21, 2020, 3:35am UTC](https://root-forum.cern.ch/t/how-do-i-actually-install-root/40014/1 "2020-06-21T03:35:53Z")

</div>

* * *

_Please read [tips for efficient and successful posting](https://root-forum.cern.ch/t/tips-for-efficient-and-successful-posting/28292) and [posting code](https://root-forum.cern.ch/t/posting-code-read-this-first/28293)_

_ROOT Version:_ Not Provided  
_Platform:_ Ubuntu 20.04  
_Compiler:_ Not Provided

* * *

My apologies for such a basic question, but how do I actually install ROOT? I’m on Ubuntu 20.04 (the latest release), and I’ve spent the better of 4 days trying to install ROOT. I’ve followed various tutorials online, several guides, and the ROOT documentation. All are slightly different, and none have worked for me. I’ve encountered far too many errors to list here, at various steps of the process. I’ve done a clean install of Ubuntu twice. I’ve spent too much time playing around with this. Can someone tell me how to actually install ROOT for my system? Thanks so much in advance!

---

<div class="post-metadata">

**Author:** ![dastudillo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/dastudillo/32/17280_2.png) [@dastudillo](https://root-forum.cern.ch/u/dastudillo)\
**Post date:** [June 21, 2020, 4:50am UTC](https://root-forum.cern.ch/t/how-do-i-actually-install-root/40014/2 "2020-06-21T04:50:10Z")

</div>

I start by installing the package “build-essential”:

```auto
sudo apt install build-essential

```

Then go here:  
[https://root.cern/build-prerequisites#ubuntu](https://root.cern/build-prerequisites#ubuntu)  
and install the “required” prerequisites they list (to be safe, even if you won’t be compiling root, as I show here). You can install them one by one or use the “sudo” command they provide (below the list) for the “Required packages”; some will have been installed already with build-essential, so you may want to go one by one (also get the optional packages if you want, but not really needed, unless you know you need them).

Then go here:  
[https://root.cern/downloading-root](https://root.cern/downloading-root)  
and click on the latest Pro release. As of today, it takes you to v. 6.20/04  
[https://root.cern/content/release-62004](https://root.cern/content/release-62004)  
From there, download the binary package for your Ubuntu and gcc versions. There’s no Ubuntu 20.04 yet but the one for “Ubuntu 19 gcc9.2” works (root\_v6.20.04.Linux-ubuntu19-x86\_64-gcc9.2.tar.gz).  
Extract everything inside, to any folder, e.g.

```auto
tar xzvf root_v6.20.04.Linux-ubuntu19-x86_64-gcc9.2.tar.gz /home/myusername

```

which creates a folder called “root” (you can rename it, e.g. to “root62004”). Then add this line at the end of your /home/myusername/.bashrc file:

```auto
source /home/myusername/root62004/bin/thisroot.sh

```

save it and close the terminal. Of course, change “myusername” and “root62004” in the paths above to whatever is your case. Now every time you open a terminal just type “root” and it should run.

---

<div class="post-metadata">

**Author:** ![eguiraud](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/eguiraud/32/32217_2.png) [@eguiraud](https://root-forum.cern.ch/u/eguiraud)\
**Post date:** [June 21, 2020, 8:09am UTC](https://root-forum.cern.ch/t/how-do-i-actually-install-root/40014/3 "2020-06-21T08:09:29Z")

</div>

Hi,  
the easiest way is probably to install ROOT in a conda environment. From the terminal:

```bash
# first install conda (instructions at https://docs.conda.io/en/latest/miniconda.html#linux-installers)
$ wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
$ bash Miniconda3-latest-Linux-x86_64.sh # and just follow the instructions on the terminal
# then install ROOT
$ conda create -c conda-forge --name <my-environment> root
$ conda activate <my-environment>

```

Whenever you want to have ROOT available in a terminal, you have to first give the command `conda activate <my-environment>`.

The second easiest way, in my opinion, is what @dastudillo described. To summarize the essential steps, that they described nicely in detail above:

1. install [all prerequisites for your platform](https://root.cern/build-prerequisites#ubuntu)
2. download and unpack a [pre-compiled binary](https://root.cern/content/release-62004) (no need to compile anything, but make sure you download a “Binary distribution” and not the “Source distribution”)
3. Whenever you want to have ROOT available in a terminal, you have to first give the command `source path/to/unpacked/root/bin/thisroot.sh`

Note that we currently do not have pre-compiled binaries for Ubuntu 20.04. I _think_ the ones for Ubuntu 19 should just work.

_Very soon_ we will have an even simpler method (download a root.deb package and `apt install root.deb`). Stay tuned 😄

Cheers,  
Enrico

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [June 21, 2020, 12:21pm UTC](https://root-forum.cern.ch/t/how-do-i-actually-install-root/40014/4 "2020-06-21T12:21:15Z")

</div>

You can easily get [the list of available binary releases for e.g. “Ubuntu 20”](https://root.cern/download/?C=M;O=A;P=*%5BuU%5D%5BbB%5D%5BuU%5D%5BnN%5D%5BtT%5D%5BuU%5D*20*):

`curl -s -l "https://root.cern/download/?C=M;O=A" | grep -i "ubuntu*20" | sed -e '{s/.*\(root.*gz\).*/\1/}'`

BTW. Immediately after:

> [@eguiraud](#):
>
> download a root.deb package and `apt install root.deb`

do not forget to execute: [`sudo apt-get purge root*`](https://root-forum.cern.ch/t/missing-canvas/17664/17)

---

<div class="post-metadata">

**Author:** ![Khang\_Pham](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/khang_pham/32/19369_2.png) [@Khang\_Pham](https://root-forum.cern.ch/u/Khang_Pham)\
**Post date:** [June 21, 2020, 1:30pm UTC](https://root-forum.cern.ch/t/how-do-i-actually-install-root/40014/5 "2020-06-21T13:30:27Z")

</div>

Just want to add onto what others have posted. Here’s the whole process that I went through to install root onto Ubuntu 20.04.  
First, download the prerequisite from [https://root.cern.ch/build-prerequisites#ubuntu](https://root.cern.ch/build-prerequisites#ubuntu) for ubuntu. The two lines of code you will need are:

1. sudo apt-get install git dpkg-dev cmake g++ gcc binutils libx11-dev libxpm-dev libxft-dev libxext-dev
2. sudo apt-get install gfortran libssl-dev libpcre3-dev xlibmesa-glu-dev libglew1.5-dev libftgl-dev libmysqlclient-dev libfftw3-dev libcfitsio-dev graphviz-dev libavahi-compat-libdnssd-dev libldap2-dev python-dev libxml2-dev libkrb5-dev libgsl0-dev libqt4-dev  
You may encounter some problems with the libqt4-dev since ubuntu 20.04 doesn’t carry qt4 anymore. However, if you need it (I think Geant4 uses it), then replace libqt4-dev with qt5-default

Once that’s done, you can then start with installing root. Go to [https://root.cern.ch/content/release-62004](https://root.cern.ch/content/release-62004) and download the source file (root\_v6.20.04.source.tar.gz). Next, use the following commands to install it, starting from the $HOME directory:

1. cd $HOME
2. mkdir Cern\_Root
3. cp Downloads/root\_v6.20.04.source.tar.gz Cern\_Root/
4. cd Cern\_Root
5. tar -zxvf root\_v6.20.04.source.tar.gz  
You should now have a new directory inside of Cern\_Root called root-6.20.04
6. cd root-6.20.04
7. mkdir root-build
8. mkdir root-install
9. cd root-build
10. cmake …
11. cmake -Dall=on .
12. cmake -DCMAKE\_INSTALL\_PREFIX=~/Cern\_Root/root-6.20.04/root-install .
13. make -jN (where N is the number of cores your machine has, the more core you provide, the quicker this step will be)
14. make install
15. cd …/root-install/bin
16. . thisroot.sh
17. root

At this point, you should be able to start using root. However, if you want to be able to run root anywhere (at this moment, if you close the terminal, start a new one, it will not recognize the command root), you need to add some stuff onto your bash like follow:

1. Open a new terminal
2. cd $HOME
3. gedit .bashrc
4. go to the bottom and add the following:

#For Cern ROOT

export ROOTSYS=$HOME/Cern\_Root/root-6.20.04/root-install/

export PATH=$PATH:$ROOTSYS/bin

export LD\_LIBRARY\_PATH=$LD\_LIBRARY\_PATH:$ROOTSYS/lib

When you’re done, save and close it. Open a new terminal, then type in the command “root” to see if it works. Hope this helps!

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [June 21, 2020, 1:59pm UTC](https://root-forum.cern.ch/t/how-do-i-actually-install-root/40014/6 "2020-06-21T13:59:54Z")

</div>

Try (in case of problems, inspect the three created “`*.out.txt`” files):

```bash
# ... assuming you are using a bash like shell ...
# cd /wherever/you/want/to/build/it
VERSION=6.20.06 # which ROOT version should be downloaded and built
rm -rf root-${VERSION} root-build root-install # cleanup
wget -c https://root.cern/download/root_v${VERSION}.source.tar.gz
tar -zxf root_v${VERSION}.source.tar.gz
mkdir root-build
cd root-build
cmake -DCMAKE_INSTALL_PREFIX=${PWD}/../root-install -Dall=ON ../root-${VERSION} 2>&1 | tee -a cmake.out.txt
nice make -j `nproc` 2>&1 | tee -a make.out.txt
nice make install 2>&1 | tee -a make.intall.out.txt

```

BTW. Do not modify ROOT related environment variables manually. Always use:

`source /full/path/to/your/root/bin/thisroot.sh # setup your ROOT`

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [July 5, 2020, 2:14pm UTC](https://root-forum.cern.ch/t/how-do-i-actually-install-root/40014/7 "2020-07-05T14:14:28Z")

</div>

Closed on July 5, 2020, 2:14pm UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

**Author:** ![amadio](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/amadio/32/12562_2.png) [@amadio](https://root-forum.cern.ch/u/amadio)\
**Post date:** [July 10, 2020, 11:57am UTC](https://root-forum.cern.ch/t/how-do-i-actually-install-root/40014/8 "2020-07-10T11:57:57Z")

</div>

I’ve created some unofficial DEB packages for Ubuntu and Debian to make it easier for users to install.

You can install it like shown below and no setup is required to use ROOT after that.

```auto
$ wget https://cern.ch/amadio/root/root_6.22.00_ubuntu20_amd64.deb
$ sudo apt install ./root_6.22.00_ubuntu20_amd64.deb

```

If you later want to uninstall:

```auto
$ sudo apt remove root && sudo apt autoremove

```

Cheers,
