TencentOS Server 4 基于 RHEL 8,使用 dnf:
添加 Microsoft 仓库
sudo rpm -Uvh https://packages.microsoft.com/config/centos/8/packages-microsoft-prod.rpm
安装运行时
sudo dnf install -y aspnetcore-runtime-8.0
验证
dotnet –list-runtimes
如果上面的源不可用,可以用脚本安装:
下载安装脚本
curl -sSL https://dot.net/v1/dotnet-install.sh -o dotnet-install.sh
chmod +x dotnet-install.sh
安装到 /usr/share/dotnet(全局)
sudo ./dotnet-install.sh –channel 8.0 –runtime aspnetcore –install-dir /usr/share/dotnet
创建软链接
sudo ln -sf /usr/share/dotnet/dotnet /usr/bin/dotnet
验证
dotnet –list-runtimes