3

These are 2 commands I ran trying to install .net core 6.0 on CentOS 8 Stream:

sudo dnf install dotnet-runtime-6.0
Last metadata expiration check: 0:12:04 ago on Tue 23 Nov 2021 17:38:47 UTC.

. . .

Installed:
  dotnet-host-6.0.0-0.6.28be3e9a006d90d8c6e87d4353b77882829df718.el8.x86_64                                                                                
  dotnet-hostfxr-6.0-6.0.0-0.6.28be3e9a006d90d8c6e87d4353b77882829df718.el8.x86_64                                                                         
  dotnet-runtime-6.0-6.0.0-0.6.28be3e9a006d90d8c6e87d4353b77882829df718.el8.x86_64                                                                         
  lttng-ust-2.8.1-11.el8.x86_64                                                                                                                            
  userspace-rcu-0.10.1-4.el8.x86_64                                                                                                                        

Complete!

[/usr/local/bin]$  dotnet --list-runtimes
Microsoft.NETCore.App 6.0.0-rc.2.21470.23 [/usr/lib64/dotnet/shared/Microsoft.NETCore.App]

Install says it installed 6.0.0-0.6 but the actual version is 6.0.0-rc.2.21470.23 and my app is failing with error:

It was not possible to find any compatible framework version
The framework 'Microsoft.NETCore.App', version '6.0.0' (x64) was not found.
  - The following frameworks were found:
      6.0.0-rc.2.21470.23 at [/usr/lib64/dotnet/shared/Microsoft.NETCore.App]

Can it be fixed without manual .net install ?

SOLUTION (worked)

  1. add repo to the OS: sudo rpm -Uvh https://packages.microsoft.com/config/centos/8/packages-microsoft-prod.rpm

  2. change it priority to preceed the OS: echo 'priority=50' | sudo tee -a /etc/yum.repos.d/microsoft-prod.repo

  3. install sudo dnf install dotnet-runtime-6.0

  4. reboot the machine

1 Answer 1

2

CentOS 8 Stream seems to have an out-of-date version of .NET 6.

That the version is old is kind of my fault; I need to update the package in CentOS Stream 8 (which really copies what's in RHEL 8.6 and that's the one I will fix).

The version showed by dotnet --info is correct.

The RPM package versioning is a workaround in that CentOS (and RHEL and Fedora until recently) don't have a way of reflecting pre-release versions of an upstream that is about to a release 6.0. We are forced to use a version "6.0" and Release with "0.X" to say "this is a pre-release of 6.0". I could have called it "6.0-0.6.rc2", but this build isn't even exact "6.0 RC2", it was a pre-RC2 snaphost (commit 28be3e9a006d90d8c6e87d4353b77882829df718 from dotnet/installer repository).

If you urgently need .NET 6, here are some options to consider:

5
  • yeah I just found out a minute ago that on CentOS 8 - the .net reinstall to 6.0 works fine, but not on CentOS 8 Stream. It is fairly pressing - how long its going to take to update the repository? (I am going to try solution 3 for now :) ) Nov 23, 2021 at 18:58
  • 1
    Updating would probably be a matter of days, if not weeks.
    – omajid
    Nov 23, 2021 at 19:04
  • solution 3 worked (after a reboot). thank you Nov 23, 2021 at 19:45
  • Wait... I thought MS wrote that they do not support .Net 6 on Cent OS 8?
    – John C
    Dec 30, 2021 at 1:58
  • CentOS Stream 8 - which is really the "next version of RHEL 8" (as opposed to CentOS 8, which is really the "current verisn of RHEL 8") - is not going EOL. Red Hat definitely intends to produce .NET 6 packages for RHEL 8, and those should show up in CentOS Stream 8.
    – omajid
    Dec 30, 2021 at 2:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.