安装 之前,请运行以下命令,将 Microsoft 包签名密钥添加到受信任密钥列表,并添加 Microsoft 包存储库。 打开终端并运行以下命令:
sudo rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm
安装运行时:
sudo yum install aspnetcore-runtime-5.0 -y
在配置好后,可以通过如下命令检查:
dotnet --info
样例输出:
Host (useful for support): Version: 5.0.12 Commit: 7211aa01b3 .NET SDKs installed: No SDKs were found. .NET runtimes installed: Microsoft.AspNetCore.App 5.0.12 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 5.0.12 [/usr/share/dotnet/shared/Microsoft.NETCore.App] To install additional .NET runtimes or SDKs: https://aka.ms/dotnet-download