sdk: Installed .NET 6.0 SDKs not showing with dotnet --info or dotnet --list-sdks and commands depeding on SDK fail (Linux/Ubuntu)
Is 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]
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 40
- Comments: 30 (5 by maintainers)
I have a fix !
Run
sudo apt remove --purge --autoremove *dotnet*create or modify
/etc/apt/preferencesand add (you’ll needsudo)Run
man apt_preferencesfor more info about this config.Run
sudo apt install dotnet-sdk-6.0Enjoy !
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:
It’s not straightforward to fix.
For folks that don’t register the Microsoft feeds, there is no problem. It is the mixing and matching of the Ubuntu and Microsoft feeds that cause issues and require special handling.
Documented at https://learn.microsoft.com/en-us/dotnet/core/install/linux-package-mixup?pivots=os-linux-ubuntu#whats-going-on
How is this not a breaking change? A minor version update shouldn’t nuke a previously functioning installation! This breaks local dev, but it probably breaks a bunch of CI pipelines etc.
EDIT: https://github.com/dotnet/sdk/issues/27129#issuecomment-1214358108 is the correct fix at the moment.
Following the steps here: https://github.com/dotnet/core/issues/7699 will leave you with an outdated SDK and stuck with an old dependency of libunwind which can prevent other software installation / cause dependency conflicts.
Hello folks, please check https://github.com/dotnet/core/issues/7699 for more details about this.
I’ve had the same issues as well ever since I updated my .NET SDK to the latest version. I’m on Pop!_OS 22.04 (based on Ubuntu 22.04).
Why don’t you just fix this?
I updated the document to make it clear when you are intended to use of the “scenarios”.
https://github.com/dotnet/core/issues/7699
My bad… I updated the comment!
Same issue here. Ubuntu 22.04.
apt purgewith a reinstall does not fix the issue.Edit: I am using the
dotnet-sdk-6.0package, version6.0.400-1, from the official Microsoft Debian repository:It was working fine until I updated yesterday. I think I was on 6.0.300 before.
I encountered this problem after installing .net7 on ubuntu 22.04. I also needed the .net6 SDK and runtimes which were already installed, but after the .net7 installation, they did not show up.
a couple of uninstall/purge/clean/remove steps yielded the same result; thus, for a quick workaround, I basically moved .net6 related directories from
/usr/lib/dotnetto/usr/share/dotnet, which the latter path is configured to work with dotnet cli.after moving .net6 SDK and runtime folders under
/usr/share/dotnet; they started to list, and no issues with build & runThis breaks my dev env on Linux machine. Rider just suddenly not working anymore. Although I fixed it temperarily by https://github.com/dotnet/sdk/issues/27129#issuecomment-1214358108 (Thanks!) It’s a very bad issue.
Thanks, Rich! I followed the instructions in “Mixed state scenario 1” and am back up and running. It’s nice to be able to install the SDK without an extra sources entry now.
hello folks, after I had updated, the issue appeared to me too. dotnet worked but when I tried to execute with build arg or other few except --verion it showed me the error. what helped me, open link provided by baronfel, and do two steps: ‘Use .NET 6 Package via PMC’ and ‘Scenario 1: Use native Jammy packages after installing a previous .NET release from PMC’