如何在Linux Mint上安装.NET 17

时间:2017-04-14 20:44:07

标签: c# .net linux

我遇到在Linux Mint 17上安装.NET的问题。

我已经使用了这里的步骤:

  

https://www.microsoft.com/net/core#linuxubuntu

当我运行sudo apt-get install dotnet-dev-1.0.1时,发生了以下错误:

sudo apt-get install dotnet-dev-1.0.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-dev-1.0.1 : Depends: dotnet-sharedframework-microsoft.netcore.app-1.0.4 but it is not going to be installed
                    Depends: dotnet-sharedframework-microsoft.netcore.app-1.1.1 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

我该如何解决这个问题? 在Linux中安装.NET和编译代码的正确方法是什么? 我应该使用什么IDE? 感谢。

2 个答案:

答案 0 :(得分:1)

您是否尝试添加修复标记?有时这有助于依赖性问题。

sudo apt-get -f install dotnet-dev-1.0.1

答案 1 :(得分:0)

试试这个:

sudo apt-get update    
sudo apt-get install curl libunwind8 gettext apt-transport-https

然后使用命令

注册密钥
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg

然后您需要注册Microsoft产品Feed,这取决于您的Mint 17机器,如下所示:

sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty main" > /etc/apt/sources.list.d/dotnetdev.list'    
sudo apt-get install apt-transport-https

现在你安装起来非常好,你应该拥有所有的依赖项:

sudo apt-get update    
sudo apt-get install dotnet-sdk-2.1.4

你应该好好去。