Debian 9, getting cmake-3.9 or above

I am running Debian 9 an need cmake v3.9 or higher.

Debian 9 has a package of cmake v3.7.

I go to the page

and download cmake-3.15.5.tar.gz source.

First i followed your instructions:

Or, an existing CMake installation can be used to build a new version:

  cmake .


  make install

It finished ok, without error report.

The call of cmake failed:

t-user@ch-dell:~/rpclib/build$ cmake …

CMake Error: Could not find CMAKE_ROOT !!!

CMake has most likely not been installed correctly.

Modules directory not found in


CMake Error: Error executing cmake::LoadCache(). Aborting.

It intermixed with the old installation of 3.7.

Then i uninstalled the v3.7 package of Debian and removed everything of cmake in the /usr/local/ directories bin, doc, share

and followed your instructions with bootstrap:



make install

Finished ok, no error report, but calling ‘cmake’:

t-user@ch-dell:~/rpclib/build$ cmake ..

bash: /usr/bin/cmake: Datei oder Verzeichnis nicht gefunden


What is he missing and how to repair it on Debian 9?


Christian Koberg

I think you should use ./cmake instead of cmake in both of your example to avoid using the one in /usr/bin The error the second time means no file or folder found. This is because by calling cmake directly your shell tried to use the one in your PATH that you have removed (a new shell or sourcing /etc/profile should remove this error).

In practice, once you have installed cmake locally you may want to update your PATH or to use the complete path to the cmake executable to use it.

I also recommend downloading the pre-built linux binaries, instead of building from scratch. The pre-built binaries should work on debain 9.