Run the uninstall script:
winget install Microsoft.DotNet.SDK.8 Open a new Command Prompt or PowerShell: install net 8
sudo /usr/local/share/dotnet/dotnet-uninstall-pkgs.sh Run the uninstall script: winget install Microsoft