如何从macOS Sierra卸载dotnet核心

时间:2017-05-20 18:36:59

标签: .net-core macos-sierra

我曾尝试安装dotnet核心,但它没有用。所以,我想卸载它并开始刷新。如何从macOS Sierra(10.12.3)卸载dotnet核心。

您可以在下面找到系统上现有的dotnet核心信息

/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

2 个答案:

答案 0 :(得分:12)

https://github.com/dotnet/cli/blob/master/scripts/obtain/uninstall/dotnet-uninstall-pkgs.sh下载dotnet-uninstall-pkgs.sh并运行它。

./dotnet-uninstall-pkgs.sh

然后,您可以从https://www.microsoft.com/net/core#macos重新安装dotnet core sdk。

确保按照安装最新版OpenSSL的步骤1进行操作,这是安装dotnet core sdk的先决条件。

brew update
brew install openssl
mkdir -p /usr/local/lib
ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/
ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/

然后你可以重新安装dotnet core sdk pkg,它应该可以工作。

https://github.com/dotnet/core/blob/master/cli/known-issues.md#uninstallingreinstalling-the-pkg-on-os-x还有关于卸载dotnet core sdk pkg的更多信息,但我已设法卸载旧版本并使用dotnet-uninstall-pkgs.sh脚本重新安装更新版本的dotnet core sdk。

答案 1 :(得分:0)

您也可以使用dotnet-core-uninstall工具,该工具可让您选择要删除的特定SDK或运行时版本。 github docs

如果在安装.Net 5 SDK的预览版后遇到构建Xamarin.Mac的问题,您可能希望删除Mono using such script和Visual Studio like this并尝试从头开始重新安装

祝你好运