Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot install .NET Core SDK 2.1 on Fedora 32 #4655

Closed
gmarokov opened this issue May 7, 2020 · 2 comments
Closed

Cannot install .NET Core SDK 2.1 on Fedora 32 #4655

gmarokov opened this issue May 7, 2020 · 2 comments

Comments

@gmarokov
Copy link

gmarokov commented May 7, 2020

Cannot install .NET Core SDK 2.1 on Fedora 21

General

Upgrading from Fedora 31 to 32 dotnet stopped working giving the following error:

[georgi@localhost-home ~]$ dotnet --info
A fatal error occurred, the folder [/usr/lib64/dotnet/host/fxr] does not contain any version-numbered child folders

Package seems to be installed:

[georgi@localhost-home ~]$ rpm -qa | grep dotnet
dotnet-runtime-2.1-2.1.17-1.x86_64
dotnet-hostfxr-2.1-2.1.17-1.x86_64
dotnet-runtime-deps-2.1-2.1.17-1.x86_64
dotnet-sdk-2.1-2.1.805-1.x86_64
dotnet-host-3.1.3-1.fc32.x86_64

dotnet-sdk-3.1 was successfully installed and running indeed:

[georgi@localhost-home ~]$ dotnet --info
.NET Core SDK (reflecting any global.json):
 Version:   3.1.103
 Commit:    6f74c4a1dd

Runtime Environment:
 OS Name:     fedora
 OS Version:  32
 OS Platform: Linux
 RID:         fedora.32-x64
 Base Path:   /usr/lib64/dotnet/sdk/3.1.103/

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

.NET Core SDKs installed:
  3.1.103 [/usr/lib64/dotnet/sdk]

.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]

Also tried to remove package and install it again, but that didn't changed anything.

@gmarokov gmarokov changed the title Cannot install .NET Core SDK 2.1 on Fedora 21 Cannot install .NET Core SDK 2.1 on Fedora 32 May 7, 2020
@omajid
Copy link
Member

omajid commented May 7, 2020

I think I know why this happens.

Fedora 32 includes .NET Core 3.1 in the default repositories. You can dnf install dotnet-sdk-3.1 and it will work out of the box.

On Fedora 31, you had installed the .NET Core 2.1 packages, using the Microsoft repository.

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:

dotnet-runtime-2.1-2.1.17-1.x86_64
dotnet-hostfxr-2.1-2.1.17-1.x86_64
dotnet-runtime-deps-2.1-2.1.17-1.x86_64
dotnet-sdk-2.1-2.1.805-1.x86_64
dotnet-host-3.1.3-1.fc32.x86_64

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.

I think you have a couple of options on how to fix this.

  1. If you dont need .NET Core 2.1, you can simply remove the .NET Core 2.1 packages, disable the Microsoft repository and continue.

  2. If you need the .NET Core 2.1 packages, you can remove all .NET Core packages, block the packages from the Fedora repository, then install only the Microsoft packages.

    Add this line

    excludepkgs=dotnet* aspnet* netstandard*
    

    to the end of the [fedora] section in /etc/yum.repos.d/fedora.repo and at the end of the [updates] section in /etc/yum.repos.d/fedora-updates.repo. Then dnf remove '*dotnet*' and dnf install dotnet-sdk-2.1 should leave you with only Microsoft packages.

  3. You can also download and run the .NET Core 2.1 SDK from a tarball: https://dotnet.microsoft.com/download/dotnet-core/thank-you/sdk-2.1.805-linux-x64-binaries. This would leave the existing packages on the system.

  4. Most dangerous: You can download and extract the contents of the tarball into /usr/lib64/dotnet/ as suggested on Add installation instructions for Fedora 32 docs#18070 (comment).

@gmarokov
Copy link
Author

@omajid thanks for the quick reply! As I needed 2.1 for the current project went with option 2 without any problems. Many thanks again :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants