How can I uninstall dotnet core from macOS Sierra

99封情书 提交于 2020-12-01 09:17:19

问题


I have tried to install dotnet core, but it does not worked. So, I would like to uninstall it and start refresh. How can I uninstall dotnet core from macOS Sierra(10.12.3).

you can find below, existing dotnet core info on the system

/usr/local/share/dotnet/sdk$ ls -la
total 0
drwxr-xr-x    4 root  wheel   136 May 20 18:28 .
drwxr-xr-x   10 root  wheel   340 May 20 20:44 ..
drwxr-xr-x  142 root  wheel  4828 May 20 20:44 1.0.4
drwxr-xr-x  121 root  wheel  4114 May  9 23:04 2.0.0-preview1-005977


/usr/local/share/dotnet/sdk$ sudo find / -name dotnet
find: /dev/fd/sdk: No such file or directory
find: /dev/fd/sdk: No such file or directory
/private/etc/paths.d/dotnet
/Users/melihtt/.dotnet/NuGetFallbackFolder/microsoft.codeanalysis.analyzers/1.1.0/analyzers/dotnet
/Users/melihtt/.dotnet/optimizationdata/2.0.0-preview1-005977/osx.10.12-x64/dotnet
/usr/local/share/dotnet
/usr/local/share/dotnet/dotnet
/usr/local/share/dotnet/shared/Microsoft.NETCore.App/1.0.5/dotnet
/usr/local/share/dotnet/shared/Microsoft.NETCore.App/1.1.2/dotnet

回答1:


To uninstall dotnet core from macOS:

  1. download dotnet-uninstall-pkgs.sh from https://github.com/dotnet/cli/blob/master/scripts/obtain/uninstall/dotnet-uninstall-pkgs.sh
  2. make dotnet-uninstall-pkgs.sh executable
  3. execute dotnet-uninstall-pkgs.sh as root (requires superuser privileges to run).
curl -O https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/uninstall/dotnet-uninstall-pkgs.sh
chmod u+x dotnet-uninstall-pkgs.sh
sudo ./dotnet-uninstall-pkgs.sh



回答2:


You might as well use dotnet-core-uninstall tool which allow you to select a specific SDK or runtime version to remove. github docs

If you are experiencing issues with building Xamarin.Mac after installing preview version of .Net 5 SDK you might like to remove Mono using such script and Visual Studio like this and try to reinstall from scratch

good luck



来源:https://stackoverflow.com/questions/44089518/how-can-i-uninstall-dotnet-core-from-macos-sierra

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!