Kevin Mangal
Kevin Mangal

Reputation: 259

Why is bash failing to create a symbolic link in /usr/local/bin?

Attempting to create a symbolic link for the subl command so that I can open flies in Sublime Test 3 from the terminal. However, it fails to find the /usr/local/bin directory, even though it is in my path.

 $ ln -s /D/ProgramsD/SublimeText3/subl /usr/local/bin/subl
 ln: failed to create symbolic link '/usr/local/bin/subl': No such file or directory

Upvotes: 10

Views: 24367

Answers (1)

janos
janos

Reputation: 124656

ln: failed to create symbolic link '/usr/local/bin/subl': No such file or directory

This error can happen when one of the parent directories of /usr/local/bin/subl don't exist.

Create them with:

mkdir -p /usr/local/bin

However, it fails to find the /usr/local/bin directory, even though it is in my path.

As the output of ls -ld /usr/local/bin reveals, indeed there is no such directory. The fact that the directory is on your PATH is irrelevant, because being on the PATH doesn't imply that a directory actually exists. In your example it doesn't exist, you need to create it.

Upvotes: 16

Related Questions