# Feature request - make uninstall

**URL:** <https://root-forum.cern.ch/t/feature-request-make-uninstall/32663>\
**Category:** Evolution Proposals, Apps & Ideas\
**Tags:** cmake\
**Created:** [February 9, 2019, 9:53am UTC](https://root-forum.cern.ch/t/feature-request-make-uninstall/32663 "2019-02-09T09:53:01Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Reik](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/reik/32/17302_2.png) [@Reik](https://root-forum.cern.ch/u/Reik)\
**Post date:** [February 9, 2019, 9:53am UTC](https://root-forum.cern.ch/t/feature-request-make-uninstall/32663/1 "2019-02-09T09:53:01Z")

</div>

Was the possibility of creating a make uninstall script to complement cmake’s make install which would delete all the files listed in install\_manifest.txt ever considered? If so, is there any inherent reason why the idea was discarded?

One of the problems could be the removal of files that were installed independently of ROOT. I wonder if there is a way to check if a file was already present and prevent ROOT from writing that file(and thereby prevent it being recorded in the install\_manifest.txt)…

Motivation - Existing installations of ROOT seem to conflict with newer builds of ROOT.  
I faced an issue recently which was solved by removing the installed ROOT files manually - [Build failure with cxx14 and root7 enabled](https://root-forum.cern.ch/t/build-failure-with-cxx14-and-root7-enabled/32565/12)  
Also, I faced an issue where I installed a build with pyroot\_experimental enabled. Then I installed a build with pyroot\_experimental disabled. I sourced the thisroot.sh in my /usr/local/ (where ROOT is installed by default for a system wide installation) and pyroot\_experimental features were enabled. (Ofcourse this issue could be worked around with sourcing the thisroot.sh in my build directory)

---

<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:** [February 9, 2019, 12:40pm UTC](https://root-forum.cern.ch/t/feature-request-make-uninstall/32663/2 "2019-02-09T12:40:09Z")

</div>

> [@Missing Canvas](https://root-forum.cern.ch/t/missing-canvas/17664/17):
>
> Honestly speaking, sooner or later, you will learn by hard that the policy of using a “system-provided” ROOT version (e.g. in “/usr/[bin|lib]” or “/usr/local/[bin|lib]”) is a dead end. You will learn that you need something like three different versions of ROOT - just because something that works with a particular ROOT version is not working with another ones, or because some piece of your additional, experiment / analysis specific, software explicitly requires a particular ROOT version. The s…

---

<div class="post-metadata">

**Author:** ![pamputt](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pamputt/32/12526_2.png) [@pamputt](https://root-forum.cern.ch/u/pamputt)\
**Post date:** [February 9, 2019, 12:47pm UTC](https://root-forum.cern.ch/t/feature-request-make-uninstall/32663/3 "2019-02-09T12:47:38Z")

</div>

I support this feature. From what I understand cmake does not allow natively to do “make uninstall” but for this sure, such feature would be really useful. I think you should open a [JIRA ticket](https://sft.its.cern.ch/jira/projects/ROOT/summary) to track this feature request.

---

<div class="post-metadata">

**Author:** ![Reik](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/reik/32/17302_2.png) [@Reik](https://root-forum.cern.ch/u/Reik)\
**Post date:** [February 9, 2019, 5:39pm UTC](https://root-forum.cern.ch/t/feature-request-make-uninstall/32663/5 "2019-02-09T17:39:04Z")

</div>

Related pull request - [https://github.com/root-project/root/pull/3405](https://github.com/root-project/root/pull/3405)

---

<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:** [February 12, 2019, 9:32am UTC](https://root-forum.cern.ch/t/feature-request-make-uninstall/32663/6 "2019-02-12T09:32:18Z")

</div>

As discussed in the pull request, I think that adding `make uninstall` is not a good idea. If you install a custom ROOT compiled by hand, just install into a custom directory like `/opt/root-6.16` or similar, which you can just remove later to uninstall. With `make uninstall` it’s too easy to break things by changing configuration between calls to `make install` / `make uninstall` which will leave you with a half-uninstalled ROOT, or worse, with important files removed from the system that were installed by other means. It’s already possible to “uninstall” with `xargs rm < install_manifest.txt` from the build directory in any case if you really need it. The issue you described, however, is due to sourcing more than one `thisroot.sh` in the same shell, which will mess up the environment. Just start with a fresh shell and source only one `thisroot.sh` file, or put `$ROOTSYS/bin` in `$PATH` and `$ROOTSYS/lib` in `$PYTHONPATH` only, without sourcing `thisroot.sh`.

---

<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:** [February 12, 2019, 9:38am UTC](https://root-forum.cern.ch/t/feature-request-make-uninstall/32663/7 "2019-02-12T09:38:06Z")

</div>

@Wile_E_Coyote I think that what you say in your linked post is no longer true. It’s perfectly possible now to use, for example, Fedora, and use ROOT that you get with `yum install root`. It’s usually the latest version or close to latest, and incompatibilities are not such a big issue anymore. You may only need to install a separate version of ROOT 5 if your own scripts do not work with ROOT 6, but that’s only 1 custom version of ROOT 5.34. Also, in Gentoo Linux I made it possible to install ROOT 6.12, 6.14, 6.16, and master, all along side each other and “system-provided”. For example, you can try it out by running (not sourcing) `/cvmfs/sft.cern.ch/lcg/contrib/gentoo/linux/x86_64/startprefix` from any Linux distribution and then run `root-6.12`, `root-6.16`, etc, as they will be in `$PATH` already.

---

<div class="post-metadata">

**Author:** ![pamputt](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pamputt/32/12526_2.png) [@pamputt](https://root-forum.cern.ch/u/pamputt)\
**Post date:** [February 12, 2019, 9:53am UTC](https://root-forum.cern.ch/t/feature-request-make-uninstall/32663/8 "2019-02-12T09:53:43Z")

</div>

If we installed ROOT in /opt/root, there is indeed no interest to use “make install”. The advantage of “make uninstall” is clear when we did not specify any install prefix and then ROOT has been installed in /usr/local.  
If it breaks something on Mac OS, maybe some “workaround” exists (I do not know this OS) but on Linux, I am not aware of such issues.  
If we compiled ROOT and installed it in /usr/local, what is the solution to properly uninstall it in order to avoid version mix?

---

<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:** [February 12, 2019, 10:00am UTC](https://root-forum.cern.ch/t/feature-request-make-uninstall/32663/9 "2019-02-12T10:00:09Z")

</div>

Sourcing more than one `thisroot.sh` in the same shell, MUST NOT mess up the environment. This script IS EXPECTED to clean any environment variables which reference the “previous” version and then add appropriate entries for the “new” version.

---

<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:** [February 12, 2019, 10:11am UTC](https://root-forum.cern.ch/t/feature-request-make-uninstall/32663/10 "2019-02-12T10:11:18Z")

</div>

> [@pamputt](#):
>
> If we compiled ROOT and installed it in /usr/local, what is the solution to properly uninstall it in order to avoid version mix?

If you installed more than one compiled ROOT into `/usr/local` they will have partially overwritten each other’s files. There’s not much that can be done in that case to restore a consistent installation. You can, however, use `xargs rm < install_manifest.txt`, as suggested in CMake’s own FAQ, which is equivalent to the `make uninstall` target that the pull request creates, but requires no changes to ROOT.

---

<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:** [February 12, 2019, 10:15am UTC](https://root-forum.cern.ch/t/feature-request-make-uninstall/32663/11 "2019-02-12T10:15:06Z")

</div>

I believe that is indeed what happens (@amadio correct me if I’m wrong) . I never had problems sourcing more than one `thisroot.sh` in the same shell.

Building ROOT with an active `thisroot.sh`, however, can be tricky.

---

<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:** [February 12, 2019, 10:20am UTC](https://root-forum.cern.ch/t/feature-request-make-uninstall/32663/12 "2019-02-12T10:20:45Z")

</div>

> [@eguiraud](#):
>
> Building ROOT with an active `thisroot.sh` , however, can be tricky.

In my [“old post”](https://root-forum.cern.ch/t/missing-canvas/17664/17), I explicitly warn against it.

---

<div class="post-metadata">

**Author:** ![Reik](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/reik/32/17302_2.png) [@Reik](https://root-forum.cern.ch/u/Reik)\
**Post date:** [February 12, 2019, 10:23am UTC](https://root-forum.cern.ch/t/feature-request-make-uninstall/32663/13 "2019-02-12T10:23:11Z")

</div>

> [@eguiraud](#):
>
> Building ROOT with an active `thisroot.sh` , however, can be tricky.

This was one of my main motivations for proposing the make uninstall feature, so that the user is able to set up a clean system before building ROOT again.

---

<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:** [February 12, 2019, 10:28am UTC](https://root-forum.cern.ch/t/feature-request-make-uninstall/32663/14 "2019-02-12T10:28:33Z")

</div>

> [@Reik](#):
>
> This was one of my main motivations for proposing the make uninstall feature, so that the user is able to set up a clean system before building ROOT again.

The ultimate solution is [to install all needed versions of ROOT, but each version in a different “version specific” ROOTSYS subdirectory](https://root-forum.cern.ch/t/missing-canvas/17664/17).

See also:

> [@Sourcing root for all users](https://root-forum.cern.ch/t/sourcing-root-for-all-users/25885):
>
> So, the common approach for sourcing ROOT seems to be just including source /path/to/root/bin/thisroot.sh in your ~/.bashrc I was thinking that in order for it to work for all users, you could do the same in /etc/bash.bashrc (but that doesn’t seem to work). And that for it to work also when accessing the computer via SSH, you could do the same in /etc/environment. Neither of these options, however, seem to work for me, and I’m at my wits’ end. How have/would you solve this? I want to set t…

---

<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:** [February 12, 2019, 10:30am UTC](https://root-forum.cern.ch/t/feature-request-make-uninstall/32663/15 "2019-02-12T10:30:26Z")

</div>

> [@Wile\_E\_Coyote](#):
>
> Sourcing more than one `thisroot.sh` in the same shell, MUST NOT mess up the environment. This script IS EXPECTED to clean any environment variables which reference the “previous” version and then add appropriate entries for the “new” version.

That’s just not possible if you install ROOT into `/usr/local` or another path that is there by default. For example, you cannot tell the loader to stop looking for libraries into directories that are listed in `/etc/ld.so.conf`, regardless of what `LD_LIBRARY_PATH` is set to. Same for `CMAKE_PREFIX_PATH` default paths. In any case, the script also does not account for the fact that `@libdir@` may not be `$ROOTSYS/lib`, but `$ROOTSYS/lib64` when removing paths, which will leave the old directory in place, etc (although this _is_ indeed a problem with the script itself). In my opinion the scripts `thisroot.*` should not be installed with ROOT at all, as they are only a workaround to let people use ROOT from the build directory, which I think is a _very bad idea_. If you install ROOT with `make install`, `thisroot.*` should not be used. I never use these scripts myself and never had the sort of problems described above with mixed up environments.

---

<div class="post-metadata">

**Author:** ![Reik](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/reik/32/17302_2.png) [@Reik](https://root-forum.cern.ch/u/Reik)\
**Post date:** [February 12, 2019, 10:35am UTC](https://root-forum.cern.ch/t/feature-request-make-uninstall/32663/16 "2019-02-12T10:35:22Z")

</div>

> [@Wile\_E\_Coyote](#):
>
> The ultimate solution is [to install all needed versions of ROOT, each version in a different “version specific” ROOTSYS subdirectory](https://root-forum.cern.ch/t/missing-canvas/17664/17).

Absolutely, but what if the user already has a system wide installation of ROOT?  
(Ofcourse as @amadio pointed out, `xargs rm < install_manifest.txt` does the same thing as make uninstall)

---

<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:** [February 12, 2019, 10:46am UTC](https://root-forum.cern.ch/t/feature-request-make-uninstall/32663/17 "2019-02-12T10:46:17Z")

</div>

> [@Reik](#):
>
> Absolutely, but what if the user already has a system wide installation of ROOT?

Is it not explicitly mentioned in the very first and the very last sentences of my [“old post”](https://root-forum.cern.ch/t/missing-canvas/17664/17) (and also in some sentences inside which explicitly say “purge”)?

---

<div class="post-metadata">

**Author:** ![Reik](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/reik/32/17302_2.png) [@Reik](https://root-forum.cern.ch/u/Reik)\
**Post date:** [February 12, 2019, 10:48am UTC](https://root-forum.cern.ch/t/feature-request-make-uninstall/32663/18 "2019-02-12T10:48:08Z")

</div>

My apologies, I misread.
