Search code examples
freebsdports

launch application after install from ports (freebsd)


I just installed nano from freebsd ports, but when I tried to launch it immediately after install completed it failed (complaining command not found) but when I logged out and logged back in it worked.

I remember few years back when I first started playing with freebsd someone gave me a command to issue after install from port so that I dont have to logout and logback in. I tried searching online but dont know what to search for.


Solution

  • Some shells require that you run rehash for them to "see" new executable in path. This is the case of csh or zsh, for example. See the csh man page. Your shell under freebsd is probably a c shell derivative.

    The shell keeps in its memory an associative table, mapping command names to their full path. When your port is installed, the new command is installed, but the shell's in memory table is not updated. When you log again, the new shell recomputed this table, and the command is seen. You could use the rehash command to recompute the table without having to log out.