Skip to content

ln -s /usr/local.... command not working

Problem

When running ln -s /usr/local/share/dotnet/dotnet /usr/local/bin, some users receive an error message or find that the command does not work as expected, often due to permission issues or existing conflicting files.

Error Example

Solution

To resolve this issue, use the following command, which includes sudo to grant temporary system (root) privileges:

Terminal window
sudo ln -s /usr/local/share/dotnet/dotnet /usr/local/bin

The sudo command is used here to give necessary permissions.

  1. Enter Your Password: After running the command above, you will be prompted to enter your password. Type it in and press Enter.

  2. If You Encounter a Permission Denied Error:

    If you receive a “zsh: permission denied: dotnet” error, it’s likely due to an existing file conflict in the /usr/local/bin directory.

  3. Delete the Existing Dotnet File:

    Open Finder and navigate to the “/usr/local/bin” folder:

    • Click “Go” at the top of the screen.
    • Select “Go to Folder…” and enter /usr/local/bin as the folder path.
    • In the /usr/local/bin folder, locate and delete any existing dotnet file.
  4. Re-run the Command:

    Open a new Terminal window and re-enter the command:

    Terminal window
    sudo ln -s /usr/local/share/dotnet/dotnet /usr/local/bin

Following these steps should successfully create the symbolic link, allowing you to use the dotnet command from any terminal session.