'I've installed dot net core on mac, but didn't find "dotnet" command
Today I've just downloaded "dotnet-dev-osx-x64.1.0.0-preview1-002702.pkg" and installed it. After that I tried "dotnet" command in my terminal, nothing printed.
I also tried Spotlight searching, seems nothing found.
Where is this package installed at all?
Solution 1:[1]
UPDATE FOR .NET Core 6
It looks like the binary location has been changed to /usr/local/share/dotnet/x64/dotnet
but also, the link is broken, since /usr/local/bin/dotnet
exists...so I had to delete the old symlink, and replace it like below.
The "new" link would be:
ln -s /usr/local/share/dotnet/x64/dotnet /usr/local/bin/
Solution 2:[2]
I found it was installed at usr/local/share/
So added this to the end of my PATH variable
:/usr/local/share/dotnet
Solution 3:[3]
I have a similar issue, but slightly different error message:
It seems the symlink source '/usr/local/share/dotnet/dotnet' is not there.
$ brew install dotnet-sdk
==> Downloading https://download.visualstudio.microsoft.com/download/pr/8509554d-61b4-43b8-b934-ad2e679ce1
Already downloaded: /Users/devinrhode2/Library/Caches/Homebrew/downloads/2b854af3d17e907f13c66328d3144bde572daea671923126eec05783659f1b7f--dotnet-sdk-6.0.102-osx-x64.pkg
==> Installing Cask dotnet-sdk
==> Running installer for dotnet-sdk; your password may be necessary.
Package installers may write to any location; options such as `--appdir` are ignored.
Password:
installer: Package name is Microsoft .NET SDK 6.0.102 (x64)
installer: Upgrading at base path /
installer: The upgrade was successful.
==> Purging files for version 6.0.102,8509554d-61b4-43b8-b934-ad2e679ce18f,aa565a52b909b3133ef6763bb2868a4
Error: It seems the symlink source '/usr/local/share/dotnet/dotnet' is not there.
Turns out, this symlink source file really does not exist.
But, I do have a /usr/local/share/dotnet/x64
directory.
This is odd. When I run arch
in my terminal, it shows arm64
. So I'm not sure why dotnet is adding not adding the arm64
version of dotnet (/usr/local/share/dotnet/dotnet
)
https://github.com/Homebrew/homebrew-cask/issues/114509
I also had this issue opening up a zsh terminal - it just prints "zsh: killed" and vscode terminal wouldn't open. Only normal terminal or iTerm would open, and those would print "zsh: killed"
Eventually I uninstalled all homebrew packages, and ran homebrews uninstall script, to completely uninstall homebrew. I reinstalled a handful of packages: git, curl, etc. Still had zsh issue, but, I ended up doing brew install zsh
and using brew-installed zsh instead of Monterey default zsh (I just upgraded macOS, so that probably caused the zsh issue).
I also had this snippet sitting in my shell profile startup script:
export DOTNET_ROOT="/usr/local/opt/dotnet/libexec"
This was likely causing my issue.
After all this cleanup, I ran brew install dotnet-sdk
and it worked fine the first time without any warnings or errors.
Solution 4:[4]
Usage: dotnet [options] Usage: dotnet [path-to-application]
Options: -h|--help Display help. --info Display .NET information. --list-sdks Display the installed SDKs. --list-runtimes Display the installed runtimes.
path-to-application: The path to an application .dll file to execute. anasmahdi@Anass-Air ~ % dotnet --version A fatal error occurred, the folder [/usr/local/share/dotnet/host/fxr] does not contain any version-numbered child folders anasmahdi@Anass-Air ~ %
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | NovaDev |
Solution 2 | sidonaldson |
Solution 3 | Devin Rhode |
Solution 4 | Anas |