Home > Back-end >  CentOS .NET Core 6.0 installs wrong runtime version
CentOS .NET Core 6.0 installs wrong runtime version

Time:11-24

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

CodePudding user response:

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:

  • Related