在linux ubuntu 20.04上安装dotnet sdk时遇到问题

时间:2020-04-24 03:29:57

标签: linux ubuntu .net-core

我有一个小问题,我最近将我的电脑更新为ubuntu 20.04,从https://docs.microsoft.com/en-us/dotnet/core/install/linux-package-manager-ubuntu-1910#troubleshoot-the-package-manager安装dotnet-sdk时遇到了问题,当我到达sudo apt-get install dotnet-sdk-3.1时,它给了我这个:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 dotnet-sdk-3.1 : Depends: dotnet-runtime-3.1 (>= 3.1.3) but it is not going to be installed
                  Depends: aspnetcore-runtime-3.1 (>= 3.1.3) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

我以前使用的是pop os 19.10,但安装dotnet sdk并不是一个问题,因此对于Linux用户来说有什么帮助吗?

1 个答案:

答案 0 :(得分:0)

在这个Github主题的结尾我找到了一个解决方案。 然后我使用了命令:

sudo apt-get install -y gpg
wget O- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o microsoft.asc.gpg

sudo mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/

wget https://packages.microsoft.com/config/ubuntu/19.10/prod.list

sudo mv prod.list /etc/apt/sources.list.d/microsoft-prod.list

sudo chown root:root /etc/apt/trusted.gpg.d/microsoft.asc.gpg

sudo chown root:root /etc/apt/sources.list.d/microsoft-prod.list

sudo apt-get install -y apt-transport-https

sudo apt-get update

sudo apt-get install dotnet-sdk-3.1

https://github.com/dotnet/docs/issues/17638

enter image description here