2

I apt-get removed default CMake and build CMake from source and installed the new version into /usr/local . But the cmake comannd does not works.

I've tried following commands:

$ source ~/.bashrc
$ sudo ldconfig
$ which cmake
/usr/local/bin/cmake
$ /usr/local/bin/cmake --version
cmake version 3.18.4
$ cmake --version
-bash: /usr/bin/cmake: No such file or directory

I can create a soft link /usr/bin/cmake to /usr/local/bin/cmake , but I'm curious about why the cmake command obstinately point to the former?

Additional Information:

$ dpkg -l | grep cmake
rc  cmake-data  3.10.2-1ubuntu2.18.04.1  all  CMake data files (modules, templates and documentation)

$ apt-cache policy cmake cmake: Installed: (none) Candidate: 3.10.2-1ubuntu2.18.04.1 Version table: 3.10.2-1ubuntu2.18.04.1 500 500 http://[INTRANET]/ubuntu bionic-updates/main amd64 Packages 3.10.2-1ubuntu2 500 500 http://[INTRANET]/ubuntu bionic/main amd64 Packages

which [INTRANET] is a private source of a company.

Devymex
  • 231

1 Answers1

0

you should run

hash -r

your terminal just hashed the old command and is giving a problem, this will reset the hashes

akshaj
  • 1