Centos 8 (RHEL8)安装dotnet5

HUC-WFX 1年前 ⋅ 13851 阅读

1、运行环境

[root@Anolis ~]# lsb_release -a 
LSB Version:	:core-4.1-amd64:core-4.1-noarch
Distributor ID:	AnolisOS
Description:	Anolis OS release 8.2
Release:	8.2
Codename:	n/a

2、 安装准备 这部分最重要的是在安装 .NET 之前,运行以下命令,将 Microsoft 包签名密钥添加到受信任密钥列表,并添加 Microsoft 包存储库。如果之前安装过.NET Core3.1 ,那么这个步骤可以省略,直接进行2.2步骤即可。

sudo rpm -Uvh https://packages.microsoft.com/config/centos/8/packages-microsoft-prod.rpm

3、 安装方法 安装SDK

sudo yum install dotnet-sdk-5.0

4、 验证

[root@Anolis ~]# dotnet --info
.NET SDK (反映任何 global.json):
 Version:   5.0.203
 Commit:    383637d63f

运行时环境:

OS Name:     anolis
 OS Version:  8.2
 OS Platform: Linux
 RID:         linux-x64
 Base Path:   /usr/share/dotnet/sdk/5.0.203/

Host (useful for support):
  Version: 5.0.6
  Commit:  478b2f8c0e

.NET SDKs installed:
  5.0.203 [/usr/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 5.0.6 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 5.0.6 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

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