Sdk: Fedora 32: No SDKs were found

Created on 2 May 2020  路  5Comments  路  Source: dotnet/sdk

Hello! I followed the instructions here: https://docs.microsoft.com/en-us/dotnet/core/install/linux-package-manager-fedora32

For installing dotnet core SDK and runtime using the Fedora package manager, using the commands:

sudo dnf install dotnet-sdk-3.1
sudo dnf install aspnetcore-runtime-3.1
sudo dnf install dotnet-runtime-3.1

Note that the 2nd and 3rd command above did nothing, because the first command for the sdk installed everything.

After successfully installing, I can see that I have all the packages:

$ sudo dnf list installed 'dotnet*'
Installed Packages
dotnet-apphost-pack-3.1.x86_64                              3.1.3-1.fc32                             @updates                    
dotnet-host.x86_64                                          3.1.3-1.fc32                             @updates                    
dotnet-hostfxr-3.1.x86_64                                   3.1.3-1.fc32                             @updates                    
dotnet-runtime-3.1.x86_64                                   3.1.3-1.fc32                             @updates                    
dotnet-sdk-3.1.x86_64                                       3.1.201-1                                @packages-microsoft-com-prod
dotnet-targeting-pack-3.1.x86_64                            3.1.3-1.fc32                             @updates                    

The problem is, however, that no SDK's are detected

$ dotnet --info
  It was not possible to find any installed .NET Core SDKs
  Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
      https://aka.ms/dotnet-download

Host (useful for support):
  Version: 3.1.3
  Commit:  4a9f85e9f8

.NET Core SDKs installed:
  No SDKs were found.

.NET Core runtimes installed:
  Microsoft.AspNetCore.App 3.1.3 [/usr/lib64/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.3 [/usr/lib64/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download

System info

$ cat /etc/*release
Fedora release 32 (Thirty Two)
NAME=Fedora
VERSION="32 (Workstation Edition)"
ID=fedora
VERSION_ID=32
VERSION_CODENAME=""
PLATFORM_ID="platform:f32"
PRETTY_NAME="Fedora 32 (Workstation Edition)"
ANSI_COLOR="0;34"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:32"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f32/system-administrators-guide/"
SUPPORT_URL="https://fedoraproject.org/wiki/Communicating_and_getting_help"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=32
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=32
PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy"
VARIANT="Workstation Edition"
VARIANT_ID=workstation
Fedora release 32 (Thirty Two)
Fedora release 32 (Thirty Two)

If I check my path for my non-root user, the only dotnet related entry is /home/wes/.dotnet/tools.

I've tried uninstalling and reinstalling this half a dozen times and I can't get it to recognize or detect the SDK. What can I do to get this working?

Most helpful comment

I resolved this issue by running: sudo dnf remove dotnet-sdk-3.1

And then following most of the instructions here: https://stackoverflow.com/a/59201350

sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/bin/dotnet
sudo rm -rf /etc/yum.repos.d/microsoft-prod.repo
sudo dnf clean all
sudo dnf upgrade
sudo init 6 #reboots the machine

Then sudo dnf install dotnet-sdk-3.1

I did not use the wget or rpm commands suggested in the stackoverflow post, as they aren't necessary in Fedora 32 because dotnet appears to be included in the OS repos now.

The commentary on that post suggests that the sudo dnf clean all might have been the thing that solves the problem.

All 5 comments

I resolved this issue by running: sudo dnf remove dotnet-sdk-3.1

And then following most of the instructions here: https://stackoverflow.com/a/59201350

sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/bin/dotnet
sudo rm -rf /etc/yum.repos.d/microsoft-prod.repo
sudo dnf clean all
sudo dnf upgrade
sudo init 6 #reboots the machine

Then sudo dnf install dotnet-sdk-3.1

I did not use the wget or rpm commands suggested in the stackoverflow post, as they aren't necessary in Fedora 32 because dotnet appears to be included in the OS repos now.

The commentary on that post suggests that the sudo dnf clean all might have been the thing that solves the problem.

I've tried to follow the above solution and this is my issue:

https://ask.fedoraproject.org/t/package-libreoffice-core-1-6-4-6-2-2-fc32-x86-64-does-not-verify-payload-sha256-digest-bad/9158

I think this should be re-opened and solved in a safer and better way... or otherwise IMHO this is a clearer explanation/fix for the problem, namely

When you upgraded, all the .NET Core packages were upgraded. Now you have a mix of packages. the packages with .fc32 are from the Fedora repository. The packages without that are from the Microsoft repository:
...
The dotnet-host package, is from the Fedora repository. It is installed at /usr/lib64/dotnet. The other packages are installed at /usr/share/dotnet. Those two installations are, unfortunately, not compatible with each other.

Anyway after the abobe upgrade and reboot, I had to uninstall the dotnet-host package and directly, from scratch, go with sudo dnf install dotnet-sdk-3.1

I ended up downloading the x64 binary distribution from here: https://dotnet.microsoft.com/download/dotnet-core/3.1, unpacking it to /opt, and adding the /opt/dotnet-sdk-xxx folder to the path. Using dnf did not work for me.

So this happened to me after I enabled the microsoft-prod repo in order to install the mssql-tools package.
Solution in my case was:

  • dnf remove the existing dotnet-sdk-3.1 package,

    • Set the repo priorities in yum.repos.d so that fedora was higher priority than microsoft-prod-repo *

    • dnf install the dotnet-sdk-3.1 package

I suspect the reason the microsoft repo is normally preferred to the fedora one is that the version of the package will be newer.

* https://dnf.readthedocs.io/en/latest/conf_ref.html

@gavincampbell good idea with the priorities as well. The packages in it get installed because Microsoft provides feature versions that are not "source-built" and have a higher version number.

I'll re-iterate the solution with bold text if someone else looks this up again.

Correct Solution

We package dotnet directly in Fedora proper, if you add an extra Microsoft repo providing them as well, you will have conflicts.

  • Remove all Microsoft provided packages
  • Remove Microsoft provided repositories (or set fedora repositories to a higher priority than the Microsoft one if you need it for other packages.)
  • dnf install dotnet-sdk-x.y (where x.y is the desired version - 3.1 or higher.)
Was this page helpful?
0 / 5 - 0 ratings