Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

OK, this question may sound too basic, but this doesn't mean I'm not still a bit confused :

  • I'm running OS X 10.6.8 (shouldn't make much difference though, the issue is more like *nix-specific)
  • I had installed (with a setup package) an app (D for Xcode) which obviously spread its binaries throughout the system
  • Then, I tried deleting the main binary from where it was supposed to be (/Library/Compilers/dmd2/osx/bin/dmd) and installed it (actually I'm talking about the D compiler, but shouldn't really matter) as usual on /usr/bin

Now, here's the issue :

  • If I try to execute the app like /usr/bin/dmd, it works fine
  • If I try to run it just with dmd (it's in /usr/bin, which is in turn belongs to the $PATH, right?), it tries to launch it from the previous location and I'm getting errors...

    dmd: failed to launch executable at /Library/Compilers/dmd2/osx/bin/dmd.drkiMac

Any ideas how this could be fixed, so that when typing dmd it looks at the correct location?

share|improve this question
You probably shouldn't have deleted the binary but properly uninstalled the app—but what is your path now? echo $PATH will list it. There might be a leftover setting in your shell profile or /etc/paths.d – slhck Feb 7 '13 at 7:46
@slhck First, there was no 'proper' un-installation method, and even so it couldn't open the binary (which was there) in the first place. Well, my $PATH is /opt/local/bin:/opt/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr‌​/bin/engines:/usr/X11/bin:/opt/local/bin:/opt/local/sbin which doesn't look that helpful. Now, as for /etc/paths.d, I don't think there is anything helpful in there as well (don't actually think this location is of much use to OS X, anyway) – Dr.Kameleon Feb 7 '13 at 7:50
If it's not there it shouldn't reference the old directory. Have you tried restarting your shell in between? (In fact, /etc/paths.d is used for many system wide installers for its simplicity. Things like /etc/profile aren't even touched.) – slhck Feb 7 '13 at 8:03
@slhck Geez! Just restarted the Terminal, and it works fine; feel kinda stupid... lol. Thanks a lot buddy! :-) – Dr.Kameleon Feb 7 '13 at 8:05
up vote 1 down vote accepted

Whenever you make changes to your $PATH you need to reload your shell's configuration. The easiest way to do that would be to simply restart your terminal application.

Otherwise your shell will still look for the binaries in their old place.

share|improve this answer
Quite a great catch. Will keep than in mind! Thanks, mate! ;-) – Dr.Kameleon Feb 7 '13 at 8:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.