Installing the dotnet 7 SDK on Ubuntu Jammy seems to only install the runtime.
See original GitHub issueDescribe the bug
On Ubuntu 22.04 LTS, dotnet build stopped working after the latest package updates.
I removed the SDK and when reinstalling it, it seems to install the runtime and not the SDK, is it possible a package is mistagged?
Edit: it does install it, but in the wrong location (or missing an environment var).
To Reproduce
Have a ubuntu 22.04 (Jammy Jellyfish), without dotnet installed (in my case, after sudo apt remove 'dotnet*' 'aspnet*' 'netstandard*'
).
(I’ve never installed dotnet 6 on here, in case that matters).
Then attempt to install the latest dotnet 7 SDK
wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
&& dpkg -i packages-microsoft-prod.deb
&& rm packages-microsoft-prod.deb
&& apt update
&& apt install -y dotnet-sdk-7.0
Then run dotnet --info
and see that No SKDs were found (but there is a runtime).
Exceptions (if any)
Before attempting to remove and reinstall the SDK, when running dotnet build
I got an error that went something like “You must install or update .NET to run this application.”.
Further technical details
Running dotnet --info
gives:
Host:
Version: 7.0.5
Architecture: x64
Commit: 8042d61b17
.NET SDKs installed:
No SDKs were found.
.NET runtimes installed:
Microsoft.AspNetCore.App 7.0.5 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 7.0.5 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]
Other architectures found:
None
Environment variables:
DOTNET_ROOT [/usr/lib/dotnet]
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
I’m running this from the command line (bash).
Issue Analytics
- State:
- Created 4 months ago
- Reactions:2
- Comments:28 (8 by maintainers)
Top GitHub Comments
The SDK is in the package but the search path used by dotnet is wrong.
I helped myself with this line
for f in /usr/share/dotnet/* ; do ln -s $f /usr/lib/dotnet ; done
Ah, that explains things. So if I understand it correctly this is what happened for me:
So uninstalling dotnet again, removing the ms package source and reinstalling via the ‘normal’ ubuntu source and everything works as expected. Slightly confusing as I don’t check twitter often anymore these days, but very cool that it’s available via the offical feed now!
For as far as I’m concerned this issue can be closed. Not sure if this is the same for any of the other people commenting though.
Thanks to Rich Lander and Chet Husk for looking into this.