0

i'm currently testing the install target (which installs into /usr/local/bin) of some software (that is also installed via my package manager into /usr/bin), and noticed that bash doesn't find the right version.

installing

$ echo $PATH
/home/user/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
$ which pd
/usr/bin/pd
$ command -v pd
/usr/bin/pd
$ pd -version
[version installed into /usr/bin/]
$ sudo make install
[...installs 'pd' into /usr/local/bin...]
$ which pd
/usr/local/bin/pd
$ command -v pd
/usr/bin/pd
$ pd -version
[version installed into /usr/bin/]
$

as you can see, of the two executables named pd, the one in /usr/bin seems to take precedence, even though the $PATH says otherwise.

starting a new shell finds seems to refresh the paths:

$ bash
$ which pd
/usr/local/bin/pd
$ command -v pd
/usr/local/bin/pd
$ pd -version
[version installed into /usr/local/bin/]

uninstalling

the reverse is true if I remove the program:

$ which pd
/usr/local/bin/pd
$ command -v pd
/usr/local/bin/pd
$ sudo make uninstall
[...removes 'pd' from /usr/local/bin...]
$ which pd
/usr/bin/pd
$ command -v pd
/usr/local/bin/pd
$ pd -version
bash: /usr/local/bin/pd: No such file or directory

$ bash
$ pd -version
[version installed into /usr/bin/]

so ??

i guess this is due to some path-caching within bash. is there a way to force-refresh that cache?

umläute
  • 6,300
  • 1
  • 24
  • 48

0 Answers0