Skip to content

Instantly share code, notes, and snippets.

@justinyoo
Last active Nov 20, 2021
Embed
What would you like to do?
Removing .NET SDKs from MacOS Manually
sdkVersion="6.0.100"
sudo rm -rf /usr/local/share/dotnet/sdk/$sdkVersion
sudo rm -rf /usr/local/share/dotnet/sdk-manifests/$sdkVersion
runtimeVersion="6.0.0"
sudo rm -rf /usr/local/share/dotnet/host/fxr/$runtimeVersion
sudo rm -rf /usr/local/share/dotnet/packs/Microsoft.AspNetCore.App.Ref/$runtimeVersion
sudo rm -rf /usr/local/share/dotnet/packs/Microsoft.NETCore.App.Host.osx-x64/$runtimeVersion
sudo rm -rf /usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/$runtimeVersion
sudo rm -rf /usr/local/share/dotnet/packs/NETStandard.Library.Ref/$runtimeVersion
sudo rm -rf /usr/local/share/dotnet/shared/Microsoft.AspNetCore.All/$runtimeVersion
sudo rm -rf /usr/local/share/dotnet/shared/Microsoft.AspNetCore.App/$runtimeVersion
sudo rm -rf /usr/local/share/dotnet/shared/Microsoft.NETCore.App/$runtimeVersion
sudo rm -rf /usr/local/share/dotnet/templates/$runtimeVersion
$sdkVersion="6.0.100"
$runtimeVersion="6.0.0"
$sdkPaths = Get-ChildItem -Path /usr/local/share/dotnet/ -Include $sdkVersion -Directory -Recurse
$runtimePaths = Get-ChildItem -Path /usr/local/share/dotnet/ -Include $runtimeVersion -Directory -Recurse
$sdkPaths | ForEach-Object {
sudo rm -rf $_.FullName
}
$runtimePaths | ForEach-Object {
sudo rm -rf $_.FullName
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment