# Source root installed from snap

**URL:** <https://root-forum.cern.ch/t/source-root-installed-from-snap/51025>\
**Category:** Newbie\
**Created:** [July 30, 2022, 9:19am UTC](https://root-forum.cern.ch/t/source-root-installed-from-snap/51025 "2022-07-30T09:19:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shailesh](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/50afbb/32.png) [@Shailesh](https://root-forum.cern.ch/u/Shailesh)\
**Post date:** [July 30, 2022, 9:19am UTC](https://root-forum.cern.ch/t/source-root-installed-from-snap/51025/1 "2022-07-30T09:19:19Z")

</div>

Hello All,

I am using root in Ubuntu OS. It was pre-installed by someone using snap. So, I can’t seem to find the version info there.

I need to source it because I need it to install some other packages where ROOT is required. They can’t find root as the bashrc file doesn’t contain path of thisroot.sh.

I tried to search thisroot.sh and added that path in the bashrc file. That didn’t work either. Is there some other way to source root installed via snap?

Thank You

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [August 1, 2022, 8:41am UTC](https://root-forum.cern.ch/t/source-root-installed-from-snap/51025/2 "2022-08-01T08:41:02Z")

</div>

Using `find` on `thisroot.sh` does not tell you where `thisroot.sh` is ?

---

<div class="post-metadata">

**Author:** ![Shailesh](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/50afbb/32.png) [@Shailesh](https://root-forum.cern.ch/u/Shailesh)\
**Post date:** [August 1, 2022, 10:05am UTC](https://root-forum.cern.ch/t/source-root-installed-from-snap/51025/3 "2022-08-01T10:05:40Z")

</div>

I tried locating thisroot.sh using locate. I added that address (/snap/…) in the .bashrc file. But still, I got the same problem. I also tried using source thisroot.sh in that location, but that doesn’t add the source /snap/…/thisroot.sh line in the .bashrc file either.

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [August 1, 2022, 10:48am UTC](https://root-forum.cern.ch/t/source-root-installed-from-snap/51025/4 "2022-08-01T10:48:17Z")

</div>

You should `source` it. Once done you should have the `$ROOTSYS` defined.  
Try to check if it is the case with:

```auto
echo $ROOTSYS

```

---

<div class="post-metadata">

**Author:** ![James-Carroll](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/james-carroll/32/27108_2.png) [@James-Carroll](https://root-forum.cern.ch/u/James-Carroll)\
**Post date:** [August 1, 2022, 10:49am UTC](https://root-forum.cern.ch/t/source-root-installed-from-snap/51025/5 "2022-08-01T10:49:50Z")

</div>

Hello,

The ROOT Snap isn’t ideal for linking to arbitary external packages, since it runs in a container, it’s impossible to guarantee ABI compatibility with anything other than the contents shipped directly inside its own container. This is why there’s no `thisRoot.sh` for it, because the constraints of the design make it impractical to be used in this manner.

I’m curious which package you’re trying to link against? It’s possible it might make sense to include in the upstream snap itself, might make sense as another snap, or might possibly work if built and run in the container itself (but while you can give it a go using this, it’s not something usually advertised because it has its own caveats).

E.G, you can run cmake inside the snap with `root-framework.cmake /path/to/build/dir`, or work with gcc more directly with `root-framework.gcc`. Binaries produced this way can be run with `root-framework.run executableName`, and will run inside the container itself. The caveats are the snap won’t have source built in for common packages you might need (e.g, QT), and you’d likely desire to prevent updates to future releases, or you might find that you have to repeat building in this manner overtime.

But ultimately, it’s probably easiest if you downloaded and used [pre-built binary packages](https://root.cern/install/#download-a-pre-compiled-binary-distribution), [Conda](https://root.cern/install/#conda), etc, which work much more traditionally. (You could even have multiple of these existing together and swap between them, if that makes sense for you!). The pre-compiled binary packages would have `thisRoot.sh` as you expect and hopefully be a drop in solution for you.
