I went to the following official Microsoft link to install .NET Core 6.x (SDK & runtime) and they would not work.
Basically, it tells you to :
wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
Then to install SDK you are supposed to run:
sudo apt-get update && sudo apt-get install -y dotnet-sdk-6.0
Then to install runtime it says to run:
sudo apt-get update && sudo apt-get install -y aspnetcore-runtime-6.0
But when I ran all of that, I got a weird thing where the runtime was "half installed".
I could run $ dotnet --list-sdks
and it wouldn't report any SDK.
Also, I couldn't run the simple command $ dotnet --version
It would state that no SDKs were installed and the command couldn't run. Very confusing.
I also got an error like:
Unable to locate package dotnet-sdk-6.0
Microsoft says to choose the following link to resolve that: APT troubleshooting section.
Tried Snap I also tried installing the snap. Again, dotnet runtime still didn't work properly. I tried various removing and rebooting and many options but could never get the SDK installed properly.