Installed .NET 6.0 SDKs not showing with dotnet --info or dotnet --list-sdks and commands depeding on SDK fail (Linux/Ubuntu)
See original GitHub issueIs there an existing issue for this?
- I have searched the existing issues
Describe the bug
[Ubuntu] After upgrade to latest dotnet sdk stopped working. Clean reinstall of latest version doesn’t help.
dotnet-sdk-6.0/jammy,now 6.0.400-1 amd64 [installed]
dotnet --info output:
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
dotnet tools list
* You intended to execute a .NET application:
The application 'tools' does not exist.
* You intended to execute a .NET SDK command:
No .NET SDKs were found.
Download a .NET SDK:
https://aka.ms/dotnet-download
Learn about SDK resolution:
https://aka.ms/dotnet/sdk-not-found
Expected Behavior
dotnet SDK expected to be working after install or upgrade
Steps To Reproduce
Installed according to instruction for the ubuntu 22.04: https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu#2204
Exceptions (if any)
No response
.NET Version
The command could not be loaded, possibly because: * You intended to execute a .NET application: The application ‘–version’ does not exist. * You intended to execute a .NET SDK command: No .NET SDKs were found. Download a .NET SDK: https://aka.ms/dotnet-download Learn about SDK resolution: https://aka.ms/dotnet/sdk-not-found
Anything else?
dotnet-sdk-6.0/jammy,now 6.0.400-1 amd64 [installed]
Issue Analytics
- State:
- Created a year ago
- Reactions:38
- Comments:29 (5 by maintainers)
Top GitHub Comments
I have a fix !
Run
sudo apt remove --purge --autoremove *dotnet*
create or modify
/etc/apt/preferences
and add (you’ll needsudo
)Run
man apt_preferences
for more info about this config.Run
sudo apt install dotnet-sdk-6.0
Enjoy !
Output of
cat /etc/*release
:Don’t use /etc/apt/preferences. Create a new file in /etc/apt/preferences.d instead!
With content:
and
With content:
EDIT: Or more easy with heredoc: