# Overwriting root.systemrc settings in a snapd install

**URL:** <https://root-forum.cern.ch/t/overwriting-root-systemrc-settings-in-a-snapd-install/57999>\
**Category:** ROOT\
**Created:** [January 29, 2024, 7:17pm UTC](https://root-forum.cern.ch/t/overwriting-root-systemrc-settings-in-a-snapd-install/57999 "2024-01-29T19:17:59Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![StephenAdler](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/stephenadler/32/35568_2.png) [@StephenAdler](https://root-forum.cern.ch/u/StephenAdler)\
**Post date:** [January 29, 2024, 7:17pm UTC](https://root-forum.cern.ch/t/overwriting-root-systemrc-settings-in-a-snapd-install/57999/1 "2024-01-29T19:17:59Z")

</div>

* * *

_ROOT Version:_ 6.30/02  
_Platform:_ Ubuntu 11.4.0-lubuntul-22.04  
_Compiler:_ Not Provided

* * *

I’ve install root-Framework on ubuntu which is a snap installation. The system.rootrc file is located in /snap/root-framework/current/usr/local/etc/ which is a read only file system. When I use root on Fedora, an rpm based linux system, system.rootrc is installed in /usr/share/root/etc or something like that but more importantly, it’s a read-write file system so I can edit system.rootrc. What’s the way to modify the values in system.rootrc, for example Unix.\*.Root.MacroPath so I can add to the directory search for my macros without editing system.rootrc?

Thanks.

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [January 29, 2024, 7:54pm UTC](https://root-forum.cern.ch/t/overwriting-root-systemrc-settings-in-a-snapd-install/57999/2 "2024-01-29T19:54:29Z")

</div>

Create a `.rootrc` file in your `${HOME}` directory

---

<div class="post-metadata">

**Author:** ![StephenAdler](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/stephenadler/32/35568_2.png) [@StephenAdler](https://root-forum.cern.ch/u/StephenAdler)\
**Post date:** [January 31, 2024, 2:19pm UTC](https://root-forum.cern.ch/t/overwriting-root-systemrc-settings-in-a-snapd-install/57999/3 "2024-01-31T14:19:23Z")

</div>

I created the .rootrc in my home directory but it doesn’t seem to be working. Is there a way to find out if root on startup is picking up the .rootrc file?

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [January 31, 2024, 2:25pm UTC](https://root-forum.cern.ch/t/overwriting-root-systemrc-settings-in-a-snapd-install/57999/4 "2024-01-31T14:25:46Z")

</div>

You can start root and ask to print a value, for example `X11.UseXft`:

```auto
root [0] gEnv->GetValue("X11.UseXft",1)
(int) 1
root [1] .q

```

then modify this value in your `${HOME}/.rootrc` (set it to `no`):

```auto
X11.UseXft: no

```

and try again:

```auto
root [0] gEnv->GetValue("X11.UseXft",1)
(int) 0
root [1] .q

```

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [January 31, 2024, 2:43pm UTC](https://root-forum.cern.ch/t/overwriting-root-systemrc-settings-in-a-snapd-install/57999/5 "2024-01-31T14:43:59Z")

</div>

And you can also print the value of `Unix.*.Root.MacroPath`:

```auto
root [1] gEnv->GetValue("Unix.*.Root.MacroPath","")
(const char *) ".:C:\root-dev\build\x64\debug/macros:/whatever"
root [2]

```

---

<div class="post-metadata">

**Author:** ![StephenAdler](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/stephenadler/32/35568_2.png) [@StephenAdler](https://root-forum.cern.ch/u/StephenAdler)\
**Post date:** [January 31, 2024, 2:49pm UTC](https://root-forum.cern.ch/t/overwriting-root-systemrc-settings-in-a-snapd-install/57999/6 "2024-01-31T14:49:53Z")

</div>

> [@bellenot](#):
>
> `gEnv->GetValue("Unix.*.Root.MacroPath","")`

```auto
tsadler@nci-02219888-vx:~$ pwd
/home/sadler
sadler@nci-02219888-vx:~$ more .rootrc

# Author: Fons Rademakers 22/09/95

# ROOT Environment settings are handled via the class TEnv. To see
# which values are active do: gEnv->Print().

# Path used by dynamic loader to find shared libraries.
# This path will be appended to the (DY)LD_LIBRARY_PATH on Unix
# and to PATH on Windows.
# Paths are different for Unix and Windows. The example shows the defaults
# for all ROOT applications for either Unix or Windows.
#Unix.*.Root.DynamicPath: .:$(ROOTSYS)/lib
#WinNT.*.Root.DynamicPath: .;$(ROOTSYS)/bin

# Path used to find macros.
# Paths are different for Unix and Windows. The example shows the defaults
# for all ROOT applications for either Unix or Windows.
#Unix.*.Root.MacroPath: .:$(ROOTSYS)/macros
#WinNT.*.Root.MacroPath: .;$(ROOTSYS)/macros
Unix.*.Root.MacroPath: .:$(ROOTSYS)/macros:$(HOME)/develspace/uDoseCal/Trun
k/uDoseCTools:$(HOME)/develspace/uDoseCal/Trunk/Macros:$(HOME)/develspace/TelaTo
ols/Trunk

sadler@nci-02219888-vx:~$ root
   ------------------------------------------------------------------
  | Welcome to ROOT 6.30/02 https://root.cern |
  | (c) 1995-2023, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for linuxx8664gcc on Nov 28 2023, 21:57:24 |
  | From tags/v6-30-02@ |
  | With c++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 |
  | Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q' |
   ------------------------------------------------------------------

Error in <TRint::ProcessLine>: macro libTelaTools.so not found in path .:/snap/root-framework/928/usr/local/macros
Error in <TRint::ProcessLine>: macro libEnergyCalib.so not found in path .:/snap/root-framework/928/usr/local/macros
Error in <TRint::ProcessLine>: macro MacroUtil.C not found in path .:/snap/root-framework/928/usr/local/macros
root [0] gEnv->GetValue("Unix.*.Root.MacroPath","")
(const char *) ""
root [1] 
ype or paste code here

```

---

<div class="post-metadata">

**Author:** ![StephenAdler](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/stephenadler/32/35568_2.png) [@StephenAdler](https://root-forum.cern.ch/u/StephenAdler)\
**Post date:** [January 31, 2024, 2:51pm UTC](https://root-forum.cern.ch/t/overwriting-root-systemrc-settings-in-a-snapd-install/57999/7 "2024-01-31T14:51:35Z")

</div>

I can confirm that the root distribution I installed on RHEL 8 works. In that I can copy system.rootrc to my home directory as .rootrc and I can customize the root environment. But it does not seem to work on ubuntu. ☹

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [January 31, 2024, 2:58pm UTC](https://root-forum.cern.ch/t/overwriting-root-systemrc-settings-in-a-snapd-install/57999/8 "2024-01-31T14:58:27Z")

</div>

That’s weird. Maybe someone having experience on Ubuntu could help here. Maybe @vpadulan ?

---

<div class="post-metadata">

**Author:** ![StephenAdler](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/stephenadler/32/35568_2.png) [@StephenAdler](https://root-forum.cern.ch/u/StephenAdler)\
**Post date:** [January 31, 2024, 3:14pm UTC](https://root-forum.cern.ch/t/overwriting-root-systemrc-settings-in-a-snapd-install/57999/9 "2024-01-31T15:14:56Z")

</div>

I installed root using the “apt install root-Framework” command. I’m going to install the prebuilt ubuntu binaries and see how that goes.

---

<div class="post-metadata">

**Author:** ![StephenAdler](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/stephenadler/32/35568_2.png) [@StephenAdler](https://root-forum.cern.ch/u/StephenAdler)\
**Post date:** [January 31, 2024, 3:33pm UTC](https://root-forum.cern.ch/t/overwriting-root-systemrc-settings-in-a-snapd-install/57999/10 "2024-01-31T15:33:28Z")

</div>

I’d like to report that the ubuntu pre-built binaries for root 6.31/01

```auto
type or paste ------------------------------------------------------------------
  | Welcome to ROOT 6.31/01 https://root.cern |
  | (c) 1995-2024, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for linuxx8664gcc on Jan 31 2024, 02:31:37 |
  | From remotes/origin/master@v6-31-01-878-g0afffc6fc9 |
  | With c++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 |
  | Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q' |
   ------------------------------------------------------------------

```

works fine, in that this version properly picks up the .rootrc in my home directory. I’ve removed the snap installed root-Framework package and I’m now using the pre-built binaries…

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [January 31, 2024, 3:35pm UTC](https://root-forum.cern.ch/t/overwriting-root-systemrc-settings-in-a-snapd-install/57999/11 "2024-01-31T15:35:49Z")

</div>

OK, thanks for the information. And sorry, but I have no experience with snap…

---

<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:** [February 3, 2024, 7:50pm UTC](https://root-forum.cern.ch/t/overwriting-root-systemrc-settings-in-a-snapd-install/57999/12 "2024-02-03T19:50:29Z")

</div>

Hey,

Sorry for the long delay. The equivilent for `$HOME/.rootrc` for the snap would be `$HOME/snap/root-framework/current/.rootrc`, this is because the Snap sandboxing prevents hidden files in the top level of `$HOME` to prevent access to `.config`, .`ssh`, etc; as well as to allow having multiple differing configs if people have multiple versions of the snap installed.

---

<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:** [February 17, 2024, 7:51pm UTC](https://root-forum.cern.ch/t/overwriting-root-systemrc-settings-in-a-snapd-install/57999/13 "2024-02-17T19:51:07Z")

</div>

Closed on February 17, 2024, 7:51pm UTC

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