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

두 개의 충돌하는 버전이 설치되어 있습니다 cmake. 수동으로 설치한 버전을 제거 /usr/local하고 패키지 버전을 유지하세요. 바라보다https://discourse.cmake.org/t/could-not-find-cmake-root/216/28

관련 정보