# Could not find CMAKE\_ROOT

**URL:** https://discourse.cmake.org/t/could-not-find-cmake-root/216
**Category:** Usage
**Created:** [November 15, 2019, 10:09pm UTC](https://discourse.cmake.org/t/could-not-find-cmake-root/216 "2019-11-15T22:09:22Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![PeterX](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/p/8491ac/32.png) [@PeterX](https://discourse.cmake.org/u/PeterX)
#### Post date: [November 15, 2019, 10:09pm UTC](https://discourse.cmake.org/t/could-not-find-cmake-root/216/1 "2019-11-15T22:09:22Z")

</div>

When I envoke cmake I get this error:

```
CMake Error: Could not find CMAKE_ROOT !!!
CMake has most likely not been installed correctly.

```

I use cmake version 3.10.2 on Xubuntu 18.04 64bit.

What can I do?

Greetings  
Peter

---

<div class="post-metadata">

### Author: ![kyle.edwards](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/k/65b543/32.png) [@kyle.edwards](https://discourse.cmake.org/u/kyle.edwards)
#### Post date: [November 15, 2019, 10:13pm UTC](https://discourse.cmake.org/t/could-not-find-cmake-root/216/2 "2019-11-15T22:13:03Z")

</div>

It sounds like you’ve moved the `cmake` executable out of its installation tree. It needs to be kept in the same directory structure as `ctest`, `cpack`, `ccmake`, `cmake-gui`, and its `Modules` and `Templates` directory.

Is this the case?

---

<div class="post-metadata">

### Author: ![PeterX](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/p/8491ac/32.png) [@PeterX](https://discourse.cmake.org/u/PeterX)
#### Post date: [November 15, 2019, 10:17pm UTC](https://discourse.cmake.org/t/could-not-find-cmake-root/216/3 "2019-11-15T22:17:54Z")

</div>

No. But I have cmake both in /bin and in /usr/bin. This is probably a wrong thing.  
I had just installed cmake 3.16.something and **cmake --version** tells me it is still cmake 3.10.something. I think I messed up the installation somehow.  
Any chance to correct this?

Greetings  
Peter

---

<div class="post-metadata">

### Author: ![kyle.edwards](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/k/65b543/32.png) [@kyle.edwards](https://discourse.cmake.org/u/kyle.edwards)
#### Post date: [November 15, 2019, 10:18pm UTC](https://discourse.cmake.org/t/could-not-find-cmake-root/216/4 "2019-11-15T22:18:21Z")

</div>

Please type the output of the following:

```auto
which cmake

```

---

<div class="post-metadata">

### Author: ![PeterX](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/p/8491ac/32.png) [@PeterX](https://discourse.cmake.org/u/PeterX)
#### Post date: [November 15, 2019, 10:19pm UTC](https://discourse.cmake.org/t/could-not-find-cmake-root/216/5 "2019-11-15T22:19:13Z")

</div>

> [@kyle.edwards](#):
>
> which cmake

The output is:  
`/usr/local/bin/cmake`

---

<div class="post-metadata">

### Author: ![kyle.edwards](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/k/65b543/32.png) [@kyle.edwards](https://discourse.cmake.org/u/kyle.edwards)
#### Post date: [November 15, 2019, 10:20pm UTC](https://discourse.cmake.org/t/could-not-find-cmake-root/216/6 "2019-11-15T22:20:13Z")

</div>

What installation method did you use to install 3.10 and 3.16?

---

<div class="post-metadata">

### Author: ![PeterX](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/p/8491ac/32.png) [@PeterX](https://discourse.cmake.org/u/PeterX)
#### Post date: [November 15, 2019, 10:24pm UTC](https://discourse.cmake.org/t/could-not-find-cmake-root/216/7 "2019-11-15T22:24:49Z")

</div>

3.10 was already installed on OS installation or unnotieced as a dependency (via APT).  
3.16 was downloaded form [https://cmake.org/download/](https://cmake.org/download/) and I followed the instructons there (If I remember correctly: ./bootstrap && make && sudo make install)

---

<div class="post-metadata">

### Author: ![kyle.edwards](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/k/65b543/32.png) [@kyle.edwards](https://discourse.cmake.org/u/kyle.edwards)
#### Post date: [November 15, 2019, 10:26pm UTC](https://discourse.cmake.org/t/could-not-find-cmake-root/216/8 "2019-11-15T22:26:13Z")

</div>

Please post the output of the following:

```auto
ls /usr/local/share/cmake-3.16/Modules/CMake.cmake

```

---

<div class="post-metadata">

### Author: ![PeterX](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/p/8491ac/32.png) [@PeterX](https://discourse.cmake.org/u/PeterX)
#### Post date: [November 15, 2019, 10:27pm UTC](https://discourse.cmake.org/t/could-not-find-cmake-root/216/9 "2019-11-15T22:27:06Z")

</div>

> [@kyle.edwards](#):
>
> ls /usr/local/share/cmake-3.16/Modules/CMake.cmake

The output is:  
`/usr/local/share/cmake-3.16/Modules/CMake.cmake`

---

<div class="post-metadata">

### Author: ![kyle.edwards](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/k/65b543/32.png) [@kyle.edwards](https://discourse.cmake.org/u/kyle.edwards)
#### Post date: [November 15, 2019, 10:27pm UTC](https://discourse.cmake.org/t/could-not-find-cmake-root/216/10 "2019-11-15T22:27:44Z")

</div>

```auto
ls /usr/share/cmake-3.10/Modules/CMake.cmake

```

---

<div class="post-metadata">

### Author: ![PeterX](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/p/8491ac/32.png) [@PeterX](https://discourse.cmake.org/u/PeterX)
#### Post date: [November 15, 2019, 10:28pm UTC](https://discourse.cmake.org/t/could-not-find-cmake-root/216/11 "2019-11-15T22:28:31Z")

</div>

The output is:  
`/usr/share/cmake-3.10/Modules/CMake.cmake`

---

<div class="post-metadata">

### Author: ![kyle.edwards](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/k/65b543/32.png) [@kyle.edwards](https://discourse.cmake.org/u/kyle.edwards)
#### Post date: [November 15, 2019, 10:29pm UTC](https://discourse.cmake.org/t/could-not-find-cmake-root/216/12 "2019-11-15T22:29:38Z")

</div>

Hmmm. So both installations appear to be valid.

How did you get CMake into `/bin`? Did you manually copy it in there? `/bin/cmake` may be the one that’s causing issues.

---

<div class="post-metadata">

### Author: ![PeterX](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/p/8491ac/32.png) [@PeterX](https://discourse.cmake.org/u/PeterX)
#### Post date: [November 15, 2019, 10:30pm UTC](https://discourse.cmake.org/t/could-not-find-cmake-root/216/13 "2019-11-15T22:30:54Z")

</div>

Yes I copied it there by hand. ☹

---

<div class="post-metadata">

### Author: ![kyle.edwards](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/k/65b543/32.png) [@kyle.edwards](https://discourse.cmake.org/u/kyle.edwards)
#### Post date: [November 15, 2019, 10:32pm UTC](https://discourse.cmake.org/t/could-not-find-cmake-root/216/14 "2019-11-15T22:32:04Z")

</div>

Please delete `/bin/cmake`. There’s no reason for it to live in `/bin`, and it’s failing because it can’t find its module files (it’s looking in `/share/cmake-3.10/Modules`, which obviously doesn’t exist.)

---

<div class="post-metadata">

### Author: ![kyle.edwards](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/k/65b543/32.png) [@kyle.edwards](https://discourse.cmake.org/u/kyle.edwards)
#### Post date: [November 15, 2019, 10:33pm UTC](https://discourse.cmake.org/t/could-not-find-cmake-root/216/15 "2019-11-15T22:33:11Z")

</div>

Also, we have our own [APT repository](https://apt.kitware.com/) which always hosts the latest CMake builds for Ubuntu. We even publish the release candidates as an optional add-on. This would probably be easier than managing the installation yourself 🙂

---

<div class="post-metadata">

### Author: ![PeterX](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/p/8491ac/32.png) [@PeterX](https://discourse.cmake.org/u/PeterX)
#### Post date: [November 15, 2019, 10:34pm UTC](https://discourse.cmake.org/t/could-not-find-cmake-root/216/16 "2019-11-15T22:34:22Z")

</div>

Yes that would certainly be easier. I will go there.  
I deleted /bin/cmake. Any other program to delete? maybe /bin/ctest and whatelse?

Greetings  
Peter

---

<div class="post-metadata">

### Author: ![kyle.edwards](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/k/65b543/32.png) [@kyle.edwards](https://discourse.cmake.org/u/kyle.edwards)
#### Post date: [November 15, 2019, 10:35pm UTC](https://discourse.cmake.org/t/could-not-find-cmake-root/216/17 "2019-11-15T22:35:00Z")

</div>

- `/bin/cmake`
- `/bin/ctest`
- `/bin/cpack`
- `/bin/ccmake`
- `/bin/cmake-gui`

---

<div class="post-metadata">

### Author: ![PeterX](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/p/8491ac/32.png) [@PeterX](https://discourse.cmake.org/u/PeterX)
#### Post date: [November 15, 2019, 10:38pm UTC](https://discourse.cmake.org/t/could-not-find-cmake-root/216/18 "2019-11-15T22:38:52Z")

</div>

Ander deleting those files I took the APT package and now it works fine with 3.16 without error.  
Is it possible to mark this thread as “Solved”?

---

<div class="post-metadata">

### Author: ![kyle.edwards](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/k/65b543/32.png) [@kyle.edwards](https://discourse.cmake.org/u/kyle.edwards)
#### Post date: [November 15, 2019, 10:39pm UTC](https://discourse.cmake.org/t/could-not-find-cmake-root/216/19 "2019-11-15T22:39:14Z")

</div>

Yes, I will do so.

---

<div class="post-metadata">

### Author: ![kyle.edwards](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/k/65b543/32.png) [@kyle.edwards](https://discourse.cmake.org/u/kyle.edwards)
#### Post date: [November 15, 2019, 10:40pm UTC](https://discourse.cmake.org/t/could-not-find-cmake-root/216/20 "2019-11-15T22:40:46Z")

</div>

Also, you may want to remove the CMake installation from `/usr/local` - it may be shadowing the “correct” one in `/usr`.

[Next page](https://discourse.cmake.org/t/could-not-find-cmake-root/216.md?page=2)
