Why does bash say No such file or directory when the file is on the path
So I uninstalled cmake, and reinstalled it with an updated version, and the path is correct, and the file is there, but whenever I try to run cmake, bash echoes -bash: /usr/bin/cmake: No such file or directory
pi@raspberrypi /usr/local/bin $ dir
cmake cpack ctest indiecity
pi@raspberrypi /usr/local/bin $ export | grep PATH
declare -x PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games"
You need to type hash -r
to rebuild the shell's command hash table.
It still "remembers" having found cmake
in /usr/bin
,
so it just goes there, rather than searching through the search path again.
Or you could start a new shell. Or logout and login again, or reboot.