I had the same problem, and here’s what I did to resolve it.
-
Removed all .NET packages
sudo apt remove 'dotnet*'
sudo apt remove 'aspnetcore*'
-
Deleted PMC repository from APT, by deleting the repo .list file
sudo rm /etc/apt/sources.list.d/microsoft-prod.list
-
Ran
sudo apt update
-
Installed .NET 6 SDK via
sudo apt install dotnet-sdk-6.0
This is one of the solutions provided on the Github issues page for dotnet/core, please follow the original article if the above did not work for you.
https://github.com/dotnet/core/issues/7699