如何在Ubuntu 20.4上安装dotnet core?

我正在尝试使用此命令在服务器上安装Dotnet core。

wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb


sudo apt-get update
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install dotnet-sdk-3.1

但是“ dotnet --version”的输出是

It was not possible to find any installed .NET Core SDKs

当我转到项目的根目录并使用“ sudo dotnet build -c Release”时 输出是

      It was not possible to find any installed .NET Core SDKs
  Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:https://aka.ms/dotnet-download

有人有主意吗?

评论