2

After upgrade to latest dotnet, sdk stopped working. I try to reinstall the latest version but doesn't help.

$ dotnet --info

global.json file:
  Not found

Host:
  Version:      6.0.8
  Architecture: x64
  Commit:       55fb7ef977

.NET SDKs installed:
  No SDKs were found.

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.8 [/usr/lib/dotnet/dotnet6-6.0.108/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.8 [/usr/lib/dotnet/dotnet6-6.0.108/shared/Microsoft.NETCore.App]

Download .NET:
  https://aka.ms/dotnet-download

Learn about .NET Runtimes and SDKs:
  https://aka.ms/dotnet/runtimes-sdk-info

2 Answers2

2

There's a workaround on github issue #27129

  1. Remove currently installed packages:
    sudo apt remove dotnet* aspnetcore* -y
    
  2. Add a preference file in /etc/apt/preferences:
    sudo touch /etc/apt/preferences &&
    sudo echo "Package: *" | sudo tee -a /etc/apt/preferences &&
    sudo echo "Pin: origin \"packages.microsoft.com\"" | sudo tee -a /etc/apt/preferences &&
    sudo echo Pin-Priority: 1001 | sudo tee -a /etc/apt/preferences
    
  3. Install .NET 6 SDK again:
    sudo apt update && sudo apt install -y dotnet-sdk-6.0
    
windperson
  • 21
  • 1
  • 3
0

The following solved the problem for me:

sudo apt dist-upgrade
salihcenap
  • 1,927
  • 22
  • 25