CMakeのインストールを修正するには?

CMakeのインストールを修正するには?

Ubuntu 20を実行しているリモートコンピュータにCMake 3.16をインストールしました。

ただし、コマンドラインでは使用できません。

user_name@192:~$ sudo apt install cmake
[sudo] password for user_name:
Reading package lists... Done
Building dependency tree
Reading state information... Done
cmake is already the newest version (3.16.3-1ubuntu1.20.04.1).
The following packages were automatically installed and are no longer required:
  linux-headers-5.15.0-75-generic linux-hwe-5.15-headers-5.15.0-75 linux-image-5.15.0-75-generic linux-modules-5.15.0-75-generic linux-modules-extra-5.15.0-75-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
user_name@192:~$ cd CUDA_lab
user_name@192:~/CUDA_lab$ cd cuda_lab/
user_name@192:~/CUDA_lab/cuda_lab$ ls
CMakeLists.txt  googletest-master  include  main.cpp  src  test
user_name@192:~/CUDA_lab/cuda_lab$ cmake
CMake Error: Could not find CMAKE_ROOT !!!
CMake has most likely not been installed correctly.
Modules directory not found in
/usr/local/share/cmake-3.16
Usage

  cmake [options] <path-to-source>
  cmake [options] <path-to-existing-build>
  cmake [options] -S <path-to-source> -B <path-to-build>

Specify a source directory to (re-)generate a build system for it in the
current working directory.  Specify an existing build directory to
re-generate its build system.

Run 'cmake --help' for more information.

user_name@192:~/CUDA_lab/cuda_lab$

このエラーをどのように解決できますか?

注:数ヶ月前は働いていました。今何が起こっているのかわかりません。

ベストアンサー1

2つの競合するバージョンがインストールされていますcmake。手動でインストールしたバージョンを削除し、/usr/localパッケージのバージョンを維持します。バラよりhttps://discourse.cmake.org/t/could-not-find-cmake-root/216/28

おすすめ記事