How get rid of -bash: /usr/{package}: No such file or directory

Solution 1:

Bash hashes the entries in the PATH to avoid unnecessary expensive lookups. Due to this, sometimes outdated entries may remain in the hash. You can clear a specific hash entry using:

hash -d sl

Or clear the entire hash table:

hash -r

Reference:

  • How do I clear Bash's cache of paths to executables?