sdk
sdk copied to clipboard
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?
- [X] 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]
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).
Hello folks, please check https://github.com/dotnet/core/issues/7699 for more details about this.
Tried the steps but to no avail. Ubuntu 22.04
$ dn --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
Same here
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```
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'
Same issue here. Ubuntu 22.04.
$ 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
apt purge
with a reinstall does not fix the issue.
Edit: I am using the dotnet-sdk-6.0
package, version 6.0.400-1
, from the official Microsoft Debian repository:
$ cat /etc/apt/sources.list.d/microsoft-prod.list
deb [arch=amd64,arm64,armhf] https://packages.microsoft.com/ubuntu/22.04/prod jammy main
It was working fine until I updated yesterday. I think I was on 6.0.300 before.
I updated the document to make it clear when you are intended to use of the "scenarios".
https://github.com/dotnet/core/issues/7699
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.
For sure. I'm glad the instructions helped.
install the SDK without an extra sources
Indeed. This is the plan going forward.
Why is there this sudden change of installation steps? Is this going to be the one used moving forward?
I'm seeing this too
I have a fix !
-
Run
sudo apt remove --purge --autoremove *dotnet*
-
create or modify
/etc/apt/preferences
and add (you'll needsudo
)Package: *net* Pin: origin packages.microsoft.com Pin-Priority: 1001
Run
man apt_preferences
for more info about this config. -
Run
sudo apt install dotnet-sdk-6.0
-
Enjoy !
Output of cat /etc/*release
:
DISTRIB_ID=LinuxMint
DISTRIB_RELEASE=21
DISTRIB_CODENAME=vanessa
DISTRIB_DESCRIPTION="Linux Mint 21 Vanessa"
NAME="Linux Mint"
VERSION="21 (Vanessa)"
ID=linuxmint
ID_LIKE="ubuntu debian"
PRETTY_NAME="Linux Mint 21"
VERSION_ID="21"
HOME_URL="https://www.linuxmint.com/"
SUPPORT_URL="https://forums.linuxmint.com/"
BUG_REPORT_URL="http://linuxmint-troubleshooting-guide.readthedocs.io/en/latest/"
PRIVACY_POLICY_URL="https://www.linuxmint.com/"
VERSION_CODENAME=vanessa
UBUNTU_CODENAME=jammy
@olfek Great, this fix solved my issue. Thanks!
@pietervdheijden Did you need to quote the whole post? A reaction would have been enough :P
My bad... I updated the comment!
@olfek great! It works for me! Thanx!!!
Thanks @olfek. This works for me as well. :-)
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.
This 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.
Fix worked for me on the second attempt. Rider also broke for me.
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.
.NET SDKs installed:
7.0.101 [/usr/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 7.0.1 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 7.0.1 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
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/dotnet
to /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 & run
.NET SDKs installed:
6.0.404 [/usr/share/dotnet/sdk]
7.0.101 [/usr/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.11 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.1 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.11 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.1 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
can anybody pls tell me how to ''add'' something to /etc/preferences ???
There is more detail here: https://github.com/dotnet/core/issues/7699
can anybody pls tell me how to ''add'' something to /etc/preferences ???
cd /etc
ls
-> if preferences
(not preferences.d
) is available skip next step
sudo touch preferences
sudo gedit preferences
paste fix and save
Don't use /etc/apt/preferences. Create a new file in /etc/apt/preferences.d instead!
sudo nano /etc/apt/preferences.d/dotnet
With content:
Package: dotnet*
Pin: origin packages.microsoft.com
Pin-Priority: 1001
and
sudo nano /etc/apt/preferences.d/aspnet
With content:
Package: aspnet*
Pin: origin packages.microsoft.com
Pin-Priority: 1001
EDIT: Or more easy with heredoc:
sudo sh -c "cat > /etc/apt/preferences.d/dotnet <<'EOF'
Package: dotnet*
Pin: origin packages.microsoft.com
Pin-Priority: 1001
EOF"
sudo sh -c "cat > /etc/apt/preferences.d/aspnet <<'EOF'
Package: aspnet*
Pin: origin packages.microsoft.com
Pin-Priority: 1001
EOF"
I have a fix !
Run
sudo apt remove --purge --autoremove *dotnet*
create or modify
/etc/apt/preferences
and add (you'll needsudo
)Package: *net* Pin: origin packages.microsoft.com Pin-Priority: 1001
Run
man apt_preferences
for more info about this config.Run
sudo apt install dotnet-sdk-6.0
Enjoy !
Output of
cat /etc/*release
:DISTRIB_ID=LinuxMint DISTRIB_RELEASE=21 DISTRIB_CODENAME=vanessa DISTRIB_DESCRIPTION="Linux Mint 21 Vanessa" NAME="Linux Mint" VERSION="21 (Vanessa)" ID=linuxmint ID_LIKE="ubuntu debian" PRETTY_NAME="Linux Mint 21" VERSION_ID="21" HOME_URL="https://www.linuxmint.com/" SUPPORT_URL="https://forums.linuxmint.com/" BUG_REPORT_URL="http://linuxmint-troubleshooting-guide.readthedocs.io/en/latest/" PRIVACY_POLICY_URL="https://www.linuxmint.com/" VERSION_CODENAME=vanessa UBUNTU_CODENAME=jamm
@olfek tip of the hat for you sir, it worked 🎩👌
Why don't you just fix this?
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
the best solution for this problem and others that Ubuntu has with versions is to use ASDF which has support for dotnet among others.